MotoHawk Master Schedule SPI Transaction
This MotoHawk™ block attempts to schedule a transaction on the selected SPI bus. A transaction associates some data that will be transmitted with a transaction identifier.
Block ID
Master Schedule Transaction
Library
motohawk_SPI_lib
Description
This block serves two purposes. First it allows the developer to define a transaction and associate runtime data with that transaction. Secondly it schedules the data to be sent on the SPI link. A transaction encapsulates the data and associates it with an identifier (the transaction name). Events can be attached to the transactions that will allow the developer, via the Master SPI Trigger block, to associate operations with the transaction. For instance the application could attach a notification when the transaction has been sent out on the wire in order to read the slave's duplex response.
Note that the block schedules the transmission of the transaction. When it occurs is dependent upon a number of factors such as whether there are already transactions scheduled to occur and SPI timing.
A transaction includes static data that allows it to effectively queue its transmission relative to other transactions. However executing the same instance of the block again before the transaction defined by that block has completed will corrupt this data. This condition needs to be avoided. Using event driven scheduling of transactions via use of the Master SPI Trigger block represents one approach that can avoid corrupting an active transaction.
Status Description
Status Value | Status Description |
---|---|
0 | Transaction was successfully scheduled. |
1 | Transaction was not successfully scheduled. Application is not open. |
2 | Transaction was not successfully scheduled. Invalid data or zero frames of data chosen. |
Block Parameters
Parameter Field | Values | Comments/Description |
---|---|---|
Transaction Name | Unique, C-legal, single quote enclosed alpha numeric | Names the transaction. Events associated with this transaction can be acted upon via the Master SPI Trigger block and the duplex data from the slave that is associated with this transaction can be recovered with the Master SPI Read Transaction block. |
Master SPI Definition Name | Single quote enclosed alpha numeric | Name of the Master SPI Definition that identifies the SPI bus that will service the transaction. |
Max Frames to send | Numeric | Maximum number of frames that can be scheduled in one transaction. |
Frame Size | Drop-down list | Selectable frame size, either 8 bit or 16 bit. This specifies the number of bits in one frame of data. |