Data structure used with MCSPI_transfer()
It indicates how many MCSPI_FrameFormat frames are sent and received from the buffers pointed to txBuf and rxBuf. The args variable is an user-definable argument which gets passed to the MCSPI_CallbackFxn when the SPI driver is in MCSPI_TRANSFER_MODE_CALLBACK.
Data Fields | |
uint32_t | channel |
uint32_t | csDisable |
uint32_t | dataSize |
uint32_t | count |
void * | txBuf |
void * | rxBuf |
void * | args |
uint32_t | status |
uint32_t MCSPI_Transaction::channel |
[IN] Channel number (chip select) to use. Valid value from 0 to (MCSPI_MAX_NUM_CHANNELS - 1)
uint32_t MCSPI_Transaction::csDisable |
[IN] TRUE/FALSE to disable CS(chip select) If it is set to TRUE, CS is de-asseted automatically at the end of the transfer. If user wants to chain more transfers under one CS pulse, user needs to set it to FALSE for each transfer and for the last transfer, user needs to set to TRUE to de-assert CS
uint32_t MCSPI_Transaction::dataSize |
[IN] MCSPI data frame size in bits - valid values: 4 bits to 32 bits
The dataSize value determines the element types of txBuf and rxBuf. If the dataSize is from 4 to 8 bits, the driver assumes the data buffers are of type uint8_t (unsigned char). If the dataSize is from 8 to 16 bits, the driver assumes the data buffers are of type uint16_t (unsigned short). If the dataSize is greater than 16 bits, the driver assumes the data buffers are uint32_t (unsigned long).
uint32_t MCSPI_Transaction::count |
[IN] Number of frames for this transaction. This should in word size length and not in bytes
void* MCSPI_Transaction::txBuf |
[IN] void * to a buffer with data to be transmitted.
If txBuf is NULL, the driver sends MCSPI frames with all data set to the default value specified by MCSPI_ChConfig.defaultTxData.
The size of the buffer should be count * MCSPI_Transaction.dataSize in bytes rounded to nearest byte boundary. For example if MCSPI_Transaction.dataSize is 12 bits, then size of buffers should be count * 2 bytes.
void* MCSPI_Transaction::rxBuf |
[IN] void * to a buffer to receive data.
If rxBuf is NULL, the driver discards all MCSPI frames received.
The size of the buffer is similar to txBuf as explained above.
void* MCSPI_Transaction::args |
[IN] Argument to be passed to the callback function
uint32_t MCSPI_Transaction::status |
[OUT] MCSPI_TransferStatus code set by MCSPI_transfer()