Note
This Bricklet is currently in the prototype stage and the software/hardware as well as the documentation is in an incomplete state.
This is the description of the Shell API bindings for the ARINC429 Bricklet. General information and technical specifications for the ARINC429 Bricklet are summarized in its hardware description.
An installation guide for the Shell API bindings is part of their general description.
Possible exit codes for all tinkerforge
commands are:
argparse
module is missingThe common options of the call
and dispatch
commands are documented
here. The specific command structure is shown below.
call
arinc429-bricklet
[<option>..] <uid> <function> [<argument>..]¶Parameters: |
|
---|
The call
command is used to call a function of the ARINC429 Bricklet. It can take several
options:
--help
shows help for the specific call
command and exits--list-functions
shows a list of known functions of the ARINC429 Bricklet and exitsdispatch
arinc429-bricklet
[<option>..] <uid> <callback>¶Parameters: |
|
---|
The dispatch
command is used to dispatch a callback of the ARINC429 Bricklet. It can
take several options:
--help
shows help for the specific dispatch
command and exits--list-callbacks
shows a list of known callbacks of the ARINC429 Bricklet and exitsarinc429-bricklet
<uid> <function>
[<option>..] [<argument>..]¶Parameters: |
|
---|
The <function>
to be called can take different options depending of its
kind. All functions can take the following options:
--help
shows help for the specific function and exitsGetter functions can take the following options:
--execute <command>
shell command line to execute for each incoming
response (see section about output formatting
for details)Setter functions can take the following options:
--expect-response
requests response and waits for itThe --expect-response
option for setter functions allows to detect
timeouts and other error conditions calls of setters as well. The device will
then send a response for this purpose. If this option is not given for a
setter function then no response is sent and errors are silently ignored,
because they cannot be detected.
arinc429-bricklet
<uid> <callback>
[<option>..]¶Parameters: |
|
---|
The <callback>
to be dispatched can take several options:
--help
shows help for the specific callback and exits--execute <command>
shell command line to execute for each incoming
response (see section about output formatting
for details)arinc429-bricklet
<uid> get-capabilities
¶Output: |
|
---|
Gets the capabilities of the ARINC429 Bricklet as of the currently loaded firmware:
arinc429-bricklet
<uid> set-channel-configuration
<channel> <parity> <speed>¶Parameters: |
|
---|---|
Output: |
|
Sets the data transmission properties of the selected channel:
When parity set to 'parity_auto', frames received with a parity error will be counted in the lost frames counter but discarded otherwise.
The following symbols are available for this function:
For <channel>:
For <parity>:
For <speed>:
arinc429-bricklet
<uid> get-channel-configuration
<channel>¶Parameters: |
|
---|---|
Output: |
|
Gets the data transmission properties of the selected channel. The channel parameter and the data returned use the same constants
as the set-channel-configuration
, despite that the all-channels constants CHANNEL_TX and CHANNEL_RX can not be used.
The following symbols are available for this function:
For <channel>:
For parity:
For speed:
arinc429-bricklet
<uid> set-channel-mode
<channel> <mode>¶Parameters: |
|
---|---|
Output: |
|
Sets the operating mode of the selected channel(s):
The following symbols are available for this function:
For <channel>:
For <mode>:
arinc429-bricklet
<uid> get-channel-mode
<channel>¶Parameters: |
|
---|---|
Output: |
|
Gets the operating mode of the selected channel. The channel parameter and the data returned use the same constants as the
set-channel-configuration
, despite that the all-channels constants CHANNEL_TX and CHANNEL_RX can not be used.
The following symbols are available for this function:
For <channel>:
For mode:
arinc429-bricklet
<uid> clear-all-rx-filters
<channel>¶Parameters: |
|
---|---|
Output: |
|
Clears all receive filters on the selected RX channel(s). The RX channels will only process those Arinc429 frames that pass the input filtering stage. With this command, all filters are cleared, thus all incoming Arinc429 frames will be blocked from further processing.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> clear-rx-filter
<channel> <label> <sdi>¶Parameters: |
|
---|---|
Output: |
|
Clears a specific receive filter on the selected RX channel(s). The RX channels will only process those Arinc429 frames that pass the input filtering stage. With this command, an Arinc429 frame matching the given parameters will be blocked by the filter.
The function either returns 'True' if the filter was cleared or 'False' if a respective filter was not set.
The following symbols are available for this function:
For <channel>:
For <sdi>:
arinc429-bricklet
<uid> set-rx-standard-filters
<channel>¶Parameters: |
|
---|---|
Output: |
|
Sets a receive filter for each label value (0-255 / 0o000-0o377) with the SDI bits set for data. Any previously existing filters will be overwritten.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> set-rx-filter
<channel> <label> <sdi>¶Parameters: |
|
---|---|
Output: |
|
Sets a specific receive filter on the selected channel(s):
The function either returns 'True' if the filter was set or 'False' if a respective filter could not be created e.g. because the given combination
of label and SDI collides with an already existing filter, or because all available filters are used up (see the get-capabilities
function).
The following symbols are available for this function:
For <channel>:
For <sdi>:
arinc429-bricklet
<uid> get-rx-filter
<channel> <label> <sdi>¶Parameters: |
|
---|---|
Output: |
|
Queries if a filter for the given combination of label and SDI is set up or not:
The function will return 'True' if the queried filter filter exists, else 'False'.
The following symbols are available for this function:
For <channel>:
For <sdi>:
arinc429-bricklet
<uid> read-frame
<channel> <label> <sdi>¶Parameters: |
|
---|---|
Output: |
|
Executes a direct read of an Arinc429 frame, i.e. without using the callback mechanism. In order to be able to do a direct read of a frame with a certain label and SDI combination, a respective receive filter needs to be set up beforehand.
The function return the following data:
set-rx-callback-configuration
will be returned.The following symbols are available for this function:
For <channel>:
For <sdi>:
arinc429-bricklet
<uid> write-frame-direct
<channel> <frame>¶Parameters: |
|
---|---|
Output: |
|
Immediately transmits an Arinc429 frame, given that the channel is in either ACTIVE or RUN mode. If the channel is in RUN mode and frames are sent as per programmed schedule, using this function will inject additional frames into the transmission, independent of the scheduler's activities.
The frame needs to be passed as a 32 bit integer. Opposite to the line transmission format, in the API functions the label code is mirrored such that the label code can be directly written 1:1 into the lower 8 bits. Beware that the label codes are usually given in octal notation, so make sure to use the correct notation (i.e. 0o377). If 'parity_auto' is set for the channel, the parity bit will be set (adjusted) automatically.
Between the API and the actual Arinc429 line output, there is a 32 entry deep FIFO. If frames are written via the API and/or in combination with a running TX scheduler, the FIFO may become overfilled and subsequently frames will get lost. Such frame losses will be indicated in the statistics data sent with the heartbeat callback.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> write-frame-scheduled
<channel> <frame-index> <frame>¶Parameters: |
|
---|---|
Output: |
|
Sets or updates an Arinc429 frame that is to be transmitted via the scheduler using the scheduler job types 'Single' or 'Cyclic'.
The frame needs to be passed as a 32 bit integer. Opposite to the line transmission format, in the API functions the label code is mirrored such that the label code can be directly written 1:1 into the lower 8 bits. Beware that the label codes are usually given in octal notation, so make sure to use the correct notation (i.e. 0o377). If 'parity_auto' is set for the channel, the parity bit will be set (adjusted) automatically.
If the frame is used by a 'single transmit' scheduler job entry, setting or updating the frame with this function arms the frame for its next transmission.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> clear-schedule-entries
<channel> <job-index-first> <job-index-last>¶Parameters: |
|
---|---|
Output: |
|
Clears a range of transmit scheduler job table entries:
To clear a single entry, set 'First' and 'Last' to the one index of the one entry to be cleared. Clearing scheduler entries actually means they are set to the job command 'Skip'.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> set-schedule-entry
<channel> <job-index> <job> <frame-index> <dwell-time>¶Parameters: |
|
---|---|
Output: |
|
Sets an entry in the transmit scheduler job table:
get-capabilities
function for the total number of job indexes available. In firmware 2.4.0 it is 1000.write-frame-scheduled
.When the scheduler is set to 'run' mode via the set-channel-mode
, it continuously loops through the job table and executes
the assigned tasks. It starts with the job stored at job index 0.
The scheduler can execute the following activity types (jobs):
write-frame-scheduled
, then the process repeats.The value assigned to the 'Frame Index' parameter varies with the activity type (job):
write-frame-scheduled
of the frame to transmit. Valid range: 0-255The set-schedule-entry
can be called while the TX scheduler is running, i.e. the channel mode is set to 'RUN'.
Any change will take immediate effect once the scheduler passes along and executes the changed job entry.
Every time the scheduler is started, it will begin with the job stored at job index 0.
At the end of the programmed schedule there should be a 'Jump' command back to index 0 to avoid the scheduler wasting time in processing all the remaining 'Skip' commands.
Two or more TX schedules can be pre-programmed and then selected for execution by placing - and changing as desired - a 'Jump' at index 0 that then branches to the
sequence of commands destined to be executed. This can be arranged in arbitrary ways, e.g. to create schedules with fixed and variable parts, just by using the 'Jump'
command alike a track switch in railway.
When the dwell time of a transmit command is set to zero, the respective Arinc429 frames will be transmitted back-to-back on the physical link. Beware that there is a FIFO between the scheduler and the actual physical transmitter that is limited to 32 frames. So after latest 32 frames enqueued with zero dwell time, the scheduler needs to be commanded to do some dwelling. How much dwelling is required can be computed by the number of back-to-back frames and the speed setting: in high speed mode each frame takes 0.36 ms, in low speed mode 2.88 ms. If a certain sequence of frames is to be transmitted multiple times in a schedule, this sequence just needs to be put once into the scheduler table with a 'Return' command at its end. This way, this sequence can be called from multiple placed (job indexes) throughout the main schedule using the 'Jump' command. Please note that this kind of calling a subroutine can not be nested, i.e. there is no return index stack, the 'Return' command always branches to the job index following the index of the last 'Jump' command encountered. In case a dwell time > 0 is set with the 'Jump' command, this dwell time will actually be executed on encountering the 'Return' command, thus as a dwell time to be done after the execution of the subsequence that was jumped to before.
The 'Callback' command can be used to notify the application program via a callback when the scheduler passes at the respective job index. This can be used for pure reporting / surveillance purpose, or as a means to set up a self-clocked system in which the called application program's function in return does some modification of the programmed sequence or alike. The scheduler can also be programmed to stop itself via the 'Stop' command, e.g. to run a pre-programmed, accurately timed single-shot sequence of frame transmissions. Placing a' Callback' command right before the 'Stop' command will inform the application program via a callback when the sequence is done. When using several 'Callback' commands in a schedule, each of them can be uniquely identified in the receiving application program by assigning a different 'userdata' value to each callback command.
With the aid of the 'Retrans' commands, a frame transmission schedule can be set up whose frame timing is defined by the schedule, but whose frame's payload is taken from the frames received via the RX1 or RX2 channel. This opens possibilities to create an autonomously operating time base corrector or re-scheduling machinery, to zip the frames from two A429 buses onto one common bus, to create inline filers to remove certain frames (by their label & SDI code), to insert frames into a stream, to exchange the payload of certain frames on-the-fly, and much more.
The following symbols are available for this function:
For <channel>:
For <job>:
arinc429-bricklet
<uid> get-schedule-entry
<channel> <job-index>¶Parameters: |
|
---|---|
Output: |
|
Gets the definition of a transmit scheduler job table entry, refer to the set-schedule-entry
.
The following symbols are available for this function:
For <channel>:
For job:
arinc429-bricklet
<uid> restart
¶Output: |
|
---|
Reverts the whole bricklet into its power-up default state.
arinc429-bricklet
<uid> set-frame-mode
<channel> <frame-index> <mode>¶Parameters: |
|
---|---|
Output: |
|
Stops / resumes the transmission of a specific frame or trigger another single-transmit. This function only works on frames that are sent via the TX scheduler jobs 'single' and 'cyclic'.
The following symbols are available for this function:
For <channel>:
For <mode>:
arinc429-bricklet
<uid> get-spitfp-error-count
¶Output: |
|
---|
Returns the error count for the communication between Brick and Bricklet.
The errors are divided into
The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.
arinc429-bricklet
<uid> set-status-led-config
<config>¶Parameters: |
|
---|---|
Output: |
|
Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets.
You can also turn the LED permanently on/off or show a heartbeat.
If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
The following symbols are available for this function:
For <config>:
arinc429-bricklet
<uid> get-status-led-config
¶Output: |
|
---|
Returns the configuration as set by set-status-led-config
The following symbols are available for this function:
For config:
arinc429-bricklet
<uid> get-chip-temperature
¶Output: |
|
---|
Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!
The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.
arinc429-bricklet
<uid> reset
¶Output: |
|
---|
Calling this function will reset the Bricklet. All configurations will be lost.
After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!
arinc429-bricklet
<uid> get-identity
¶Output: |
|
---|
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.
The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an Isolator Bricklet is always at position 'z'.
The device identifier numbers can be found here.
arinc429-bricklet
<uid> set-heartbeat-callback-configuration
<channel> <enabled> <value-has-to-change> <period>¶Parameters: |
|
---|---|
Output: |
|
Sets the bricklet heartbeat callback function which reports the statistics counters for processed frames and lost frames.
The period is the period with which the heartbeat-message
callback is triggered periodically. A value of 0 turns the callback off.
When 'Value Has To Change' is enabled, the heartbeat will only be sent if there is a change in the statistics numbers.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> get-heartbeat-callback-configuration
<channel>¶Parameters: |
|
---|---|
Output: |
|
Gets the current configuration of the bricklet heartbeat callback, see set-heartbeat-callback-configuration
.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> set-rx-callback-configuration
<channel> <enabled> <value-has-to-change> <timeout>¶Parameters: |
|
---|---|
Output: |
|
Sets the configuration of the Arinc429 frame reception callback:
Despite on frame reception, a callback is also generated if a frame encounters a timeout, i.e. if it is not periodically received again before the set timeout period has expired. In order to have callbacks being generated at all, respective receive filters need to be set up.
The following symbols are available for this function:
For <channel>:
arinc429-bricklet
<uid> get-rx-callback-configuration
<channel>¶Parameters: |
|
---|---|
Output: |
|
Gets the configuration of the frame reception callback, see the set-rx-callback-configuration
.
The following symbols are available for this function:
For <channel>:
Callbacks can be used to receive time critical or recurring data from the device:
tinkerforge dispatch arinc429-bricklet <uid> example
The available callbacks are described below.
Note
Using callbacks for recurring events is always preferred compared to using getters. It will use less USB bandwidth and the latency will be a lot better, since there is no round trip time.
arinc429-bricklet
<uid> heartbeat-message
¶Output: |
|
---|
This callback is triggered periodically according to the configuration set by
set-heartbeat-callback-configuration
. It reports the statistics counters
for processed frames and lost frames for all TX and RX channels.
The following symbols are available for this function:
For channel:
For status:
arinc429-bricklet
<uid> frame-message
¶Output: |
|
---|
This callback is triggered according to the configuration set by set-rx-callback-configuration
.
set-rx-callback-configuration
will be returned.The following symbols are available for this function:
For channel:
For status:
arinc429-bricklet
<uid> scheduler-message
¶Output: |
|
---|
This callback is triggered by the 'Callback' job in the transmit schedule.
The following symbols are available for this function:
For channel:
For status:
Internal functions are used for maintenance tasks such as flashing a new firmware of changing the UID of a Bricklet. These task should be performed using Brick Viewer instead of using the internal functions directly.
arinc429-bricklet
<uid> set-bootloader-mode
<mode>¶Parameters: |
|
---|---|
Output: |
|
Sets the bootloader mode and returns the status after the requested mode change was instigated.
You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier and CRC are present and correct.
This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.
The following symbols are available for this function:
For <mode>:
For status:
arinc429-bricklet
<uid> get-bootloader-mode
¶Output: |
|
---|
Returns the current bootloader mode, see set-bootloader-mode
.
The following symbols are available for this function:
For mode:
arinc429-bricklet
<uid> set-write-firmware-pointer
<pointer>¶Parameters: |
|
---|---|
Output: |
|
Sets the firmware pointer for write-firmware
. The pointer has
to be increased by chunks of size 64. The data is written to flash
every 4 chunks (which equals to one page of size 256).
This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.
arinc429-bricklet
<uid> write-firmware
<data>¶Parameters: |
|
---|---|
Output: |
|
Writes 64 Bytes of firmware at the position as written by
set-write-firmware-pointer
before. The firmware is written
to flash every 4 chunks.
You can only write firmware in bootloader mode.
This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.
arinc429-bricklet
<uid> write-uid
<uid>¶Parameters: |
|
---|---|
Output: |
|
Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first.
We recommend that you use Brick Viewer to change the UID.
arinc429-bricklet
<uid> read-uid
¶Output: |
|
---|
Returns the current UID as an integer. Encode as Base58 to get the usual string version.