Functions | |
cy_en_can_status_t | Cy_CAN_Init (CAN_Type *base, const cy_stc_can_config_t *config, cy_stc_can_context_t *context) |
Initializes the CAN module. More... | |
cy_en_can_status_t | Cy_CAN_DeInit (CAN_Type *base, cy_stc_can_context_t *context) |
De-initializes the CAN module, returns registers values to default. More... | |
cy_en_can_rx_buffer_status_t | Cy_CAN_GetRxBufferStatus (CAN_Type const *base, uint32_t index) |
Gets the status of the CAN Rx buffer. More... | |
cy_en_can_status_t | Cy_CAN_GetRxBuffer (CAN_Type *base, uint8_t index, cy_stc_can_message_frame_t *rxMsg) |
Reads the received message from Rx buffer. More... | |
cy_en_can_status_t | Cy_CAN_ExtractMsgFromRxBuffer (CAN_Type *base, cy_stc_can_message_frame_t *rxMsg, const cy_stc_can_context_t *context) |
Extracts the message data in the lowest numbered Rx buffer being received. More... | |
void | Cy_CAN_IrqHandler (CAN_Type *base, const cy_stc_can_context_t *context) |
CAN (Status/Error/Rx/Tx) interrupt ISR. More... | |
cy_en_can_tx_buffer_status_t | Cy_CAN_GetTxBufferStatus (CAN_Type const *base, uint8_t index) |
Gets the status of the CAN Tx buffer. More... | |
void | Cy_CAN_SetBitrate (CAN_Type *base, const cy_stc_can_bitrate_t *bitrate) |
Sets Bit Timing and Prescaler Register parameters: -Time segment after sample point; -Time segment before sample point; -Baud Rate Prescaler; -Synchronization Jump Width. More... | |
cy_en_can_status_t | Cy_CAN_Start (CAN_Type *base) |
Sets the CAN controller into run mode. More... | |
cy_en_can_status_t | Cy_CAN_Stop (CAN_Type *base) |
Sets the CAN controller into stop mode. More... | |
cy_en_can_status_t | Cy_CAN_Transmit (CAN_Type *base, uint8_t index, const cy_stc_can_message_frame_t *frameData, bool interruptEnabled, bool singleShot, const cy_stc_can_context_t *context) |
Stores the specified frame data in the Tx buffer and begins transmitting it immediately. More... | |
cy_en_can_status_t | Cy_CAN_UpdateRxBufferConfig (CAN_Type *base, uint8_t index, const cy_stc_can_rx_buffer_config_t *config, const cy_stc_can_message_frame_t *remoteFrame) |
Updates the specified Rx buffer configuration. More... | |
__STATIC_INLINE uint32_t | Cy_CAN_GetInterruptStatus (CAN_Type const *base) |
Returns a status of CAN interrupt requests. More... | |
__STATIC_INLINE void | Cy_CAN_ClearInterrupt (CAN_Type *base, uint32_t status) |
Clears CAN interrupts by setting each bit. More... | |
__STATIC_INLINE uint32_t | Cy_CAN_GetInterruptMask (CAN_Type const *base) |
Returns an interrupt mask. More... | |
__STATIC_INLINE void | Cy_CAN_SetInterruptMask (CAN_Type *base, uint32_t interrupt) |
Configures which bits of the interrupt request register can trigger an interrupt event. More... | |
__STATIC_INLINE void | Cy_CAN_AckRxBuffer (CAN_Type *base, uint8_t index) |
Acknowledges the data reading and makes the buffer element available for a next message. More... | |
__STATIC_INLINE uint32_t | Cy_CAN_GetErrorCapture (CAN_Type *base) |
Returns the current error information. More... | |
__STATIC_INLINE void | Cy_CAN_SetTestMode (CAN_Type *base, cy_en_can_test_mode_t testMode) |
Changes the test mode setting. More... | |
__STATIC_INLINE void | Cy_CAN_SetArbiter (CAN_Type *base, cy_en_can_arbiter_t arbiter) |
Changes the Tx Buffer arbiter setting. More... | |
__STATIC_INLINE void | Cy_CAN_SetSwapEndian (CAN_Type *base, cy_en_can_endian_t endian) |
Changes the byte endianness of the data field setting. More... | |
__STATIC_INLINE void | Cy_CAN_SetBusOffAutoRestart (CAN_Type *base, cy_en_can_busoff_restart_t restart) |
Changes the bus-off auto restart setting. More... | |
cy_en_can_status_t Cy_CAN_Init | ( | CAN_Type * | base, |
const cy_stc_can_config_t * | config, | ||
cy_stc_can_context_t * | context | ||
) |
Initializes the CAN module.
*base | The pointer to a CAN instance. |
*config | The pointer to the CAN configuration structure. |
*context | The pointer to the context structure cy_stc_can_context_t allocated by the user. The structure is used during the CAN operation for internal configuration and data retention. User must not modify anything in this structure. |
cy_en_can_status_t Cy_CAN_DeInit | ( | CAN_Type * | base, |
cy_stc_can_context_t * | context | ||
) |
De-initializes the CAN module, returns registers values to default.
*base | The pointer to a CAN instance. |
*context | The pointer to the context structure cy_stc_can_context_t allocated by the user. The structure is used during the CAN operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_can_rx_buffer_status_t Cy_CAN_GetRxBufferStatus | ( | CAN_Type const * | base, |
uint32_t | index | ||
) |
Gets the status of the CAN Rx buffer.
*base | The pointer to a CAN instance. |
index | Rx Message buffer index (0-15). |
cy_en_can_status_t Cy_CAN_GetRxBuffer | ( | CAN_Type * | base, |
uint8_t | index, | ||
cy_stc_can_message_frame_t * | rxMsg | ||
) |
Reads the received message from Rx buffer.
*base | The pointer to a CAN instance. |
index | Rx Message buffer index (0-15). |
*rxMsg | The pointer to a message structure to be stored. |
cy_en_can_status_t Cy_CAN_ExtractMsgFromRxBuffer | ( | CAN_Type * | base, |
cy_stc_can_message_frame_t * | rxMsg, | ||
const cy_stc_can_context_t * | context | ||
) |
Extracts the message data in the lowest numbered Rx buffer being received.
*base | The pointer to a CAN instance. |
*rxMsg | The pointer to a message structure to be stored. |
context | The pointer to the context structure cy_stc_can_context_t allocated by the user. The structure is used during the CAN operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_CAN_IrqHandler | ( | CAN_Type * | base, |
const cy_stc_can_context_t * | context | ||
) |
CAN (Status/Error/Rx/Tx) interrupt ISR.
*base | The pointer to a CAN instance. |
*context | The pointer to the context structure cy_stc_can_context_t allocated by the user. The structure is used during the CAN operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_can_tx_buffer_status_t Cy_CAN_GetTxBufferStatus | ( | CAN_Type const * | base, |
uint8_t | index | ||
) |
Gets the status of the CAN Tx buffer.
*base | The pointer to a CAN instance. |
index | Tx Message buffer index (0-7). |
void Cy_CAN_SetBitrate | ( | CAN_Type * | base, |
const cy_stc_can_bitrate_t * | bitrate | ||
) |
Sets Bit Timing and Prescaler Register parameters: -Time segment after sample point; -Time segment before sample point; -Baud Rate Prescaler; -Synchronization Jump Width.
*base | The pointer to a CAN instance. |
*bitrate | cy_stc_can_bitrate_t |
cy_en_can_status_t Cy_CAN_Start | ( | CAN_Type * | base | ) |
Sets the CAN controller into run mode.
If the Test Mode has been set beforehand by Cy_CAN_SetTestMode, the controller will start operating in that mode.
*base | The pointer to a CAN instance. |
cy_en_can_status_t Cy_CAN_Stop | ( | CAN_Type * | base | ) |
Sets the CAN controller into stop mode.
*base | The pointer to a CAN instance. |
cy_en_can_status_t Cy_CAN_Transmit | ( | CAN_Type * | base, |
uint8_t | index, | ||
const cy_stc_can_message_frame_t * | frameData, | ||
bool | interruptEnabled, | ||
bool | singleShot, | ||
const cy_stc_can_context_t * | context | ||
) |
Stores the specified frame data in the Tx buffer and begins transmitting it immediately.
And returns without waiting for transmission to complete.
*base | The pointer to a CAN instance. |
index | Tx Message buffer index (0-15). |
*frameData | The pointer to the frame data to be transmitted. |
interruptEnabled | Specifies whether to interrupt when the message is transmitted successfully. |
singleShot | Specifies whether to perform single shot transmission. In this case, even if the transmission fails, there will be no automatic retry. |
*context | The pointer to the context structure cy_stc_can_context_t allocated by the user. The structure is used during the CAN operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_can_status_t Cy_CAN_UpdateRxBufferConfig | ( | CAN_Type * | base, |
uint8_t | index, | ||
const cy_stc_can_rx_buffer_config_t * | config, | ||
const cy_stc_can_message_frame_t * | remoteFrame | ||
) |
Updates the specified Rx buffer configuration.
*base | The pointer to a CAN instance. |
index | Rx Message buffer index (0-31). |
*config | The pointer to the configuration data. |
*remoteFrame | The pointer to the remote frame data. Sets to NULL if not used. |
__STATIC_INLINE uint32_t Cy_CAN_GetInterruptStatus | ( | CAN_Type const * | base | ) |
Returns a status of CAN interrupt requests.
*base | The pointer to a CAN instance. |
__STATIC_INLINE void Cy_CAN_ClearInterrupt | ( | CAN_Type * | base, |
uint32_t | status | ||
) |
Clears CAN interrupts by setting each bit.
*base | The pointer to a CAN instance. |
status | The bitmask of statuses to clear. Valid masks can be found in RX Interrupt masks, TX Interrupt masks, Error Interrupt masks. |
__STATIC_INLINE uint32_t Cy_CAN_GetInterruptMask | ( | CAN_Type const * | base | ) |
Returns an interrupt mask.
*base | The pointer to a CAN instance. |
__STATIC_INLINE void Cy_CAN_SetInterruptMask | ( | CAN_Type * | base, |
uint32_t | interrupt | ||
) |
Configures which bits of the interrupt request register can trigger an interrupt event.
*base | The pointer to a CAN instance. |
interrupt | The bit field determines which status changes can cause an interrupt. Valid masks can be found in RX Interrupt masks, TX Interrupt masks, Error Interrupt masks, Global Interrupt masks. |
__STATIC_INLINE void Cy_CAN_AckRxBuffer | ( | CAN_Type * | base, |
uint8_t | index | ||
) |
Acknowledges the data reading and makes the buffer element available for a next message.
*base | The pointer to a CAN instance. |
index | Rx Message buffer index (0-15). |
__STATIC_INLINE uint32_t Cy_CAN_GetErrorCapture | ( | CAN_Type * | base | ) |
Returns the current error information.
*base | The pointer to a CAN instance. |
__STATIC_INLINE void Cy_CAN_SetTestMode | ( | CAN_Type * | base, |
cy_en_can_test_mode_t | testMode | ||
) |
Changes the test mode setting.
*base | The pointer to a CAN instance. |
testMode | cy_en_can_test_mode_t |
__STATIC_INLINE void Cy_CAN_SetArbiter | ( | CAN_Type * | base, |
cy_en_can_arbiter_t | arbiter | ||
) |
Changes the Tx Buffer arbiter setting.
*base | The pointer to a CAN instance. |
arbiter | cy_en_can_arbiter_t |
__STATIC_INLINE void Cy_CAN_SetSwapEndian | ( | CAN_Type * | base, |
cy_en_can_endian_t | endian | ||
) |
Changes the byte endianness of the data field setting.
*base | The pointer to a CAN instance. |
endian | cy_en_can_endian_t |
__STATIC_INLINE void Cy_CAN_SetBusOffAutoRestart | ( | CAN_Type * | base, |
cy_en_can_busoff_restart_t | restart | ||
) |
Changes the bus-off auto restart setting.
*base | The pointer to a CAN instance. |
restart | cy_en_can_busoff_restart_t |