Hi,
how can I know if spi communication(interrupt mode) is an error?
For example CAN has,
typedef void (*flexcan_error_callback_t)(uint8_t instance, flexcan_event_type_t eventType, flexcan_state_t *flexcanState);
and, has this enum,
typedef enum {
FLEXCAN_EVENT_RX_COMPLETE, /*!< A frame was received in the configured Rx MB. */ FLEXCAN_EVENT_RXFIFO_COMPLETE, /*!< A frame was received in the Rx FIFO. */ FLEXCAN_EVENT_RXFIFO_WARNING, /*!< Rx FIFO is almost full (5 frames). */ FLEXCAN_EVENT_RXFIFO_OVERFLOW, /*!< Rx FIFO is full (incoming message was lost). */ FLEXCAN_EVENT_TX_COMPLETE, /*!< A frame was sent from the configured Tx MB. */ #if FEATURE_CAN_HAS_WAKE_UP_IRQ
FLEXCAN_EVENT_WAKEUP_TIMEOUT, /*!< An wake up event occurred due to timeout. */ FLEXCAN_EVENT_WAKEUP_MATCH, /*!< An wake up event occurred due to matching. */ FLEXCAN_EVENT_SELF_WAKEUP, /*!< A self wake up event occurred. */ #endif /* FEATURE_CAN_HAS_WAKE_UP_IRQ */ #if FEATURE_CAN_HAS_DMA_ENABLE FLEXCAN_EVENT_DMA_COMPLETE, /*!< A complete transfer occurred on DMA */ FLEXCAN_EVENT_DMA_ERROR, /*!< A DMA transfer fail, because of a DMA channel error */
#endif /*
FEATURE_CAN_HAS_DMA_ENABLE */
FLEXCAN_EVENT_ERROR
} flexcan_event_type_t;
but flexio spi only has,
typedef enum {
SPI_EVENT_END_TRANSFER = 0
} spi_event_t; /* Callback for all peripherals which supports SPI features */
typedef void (*spi_callback_t)(void *driverState, spi_event_t event, void *userData);
解決済! 解決策の投稿を見る。
User can judge whether an error occurs during the transmission process according to the returen value of the API.
For your reference.
I got it I could use this return value for lpspi, but for the flexio spi, how can I write the callback function and functions parameter?
In s32DS
I cannot change it because its type is const. (I think that's why you made an error)