CAT2 Peripheral Driver Library

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...
 

Detailed Description

Function Documentation

◆ Cy_CAN_Init()

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.

Note
The function enables the "Message was received" and "Message was sent" interrupt events only. Other interrupts can be configured with the Cy_CAN_SetInterruptMask() function.
Parameters
*baseThe pointer to a CAN instance.
*configThe pointer to the CAN configuration structure.
*contextThe 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.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: Initialize the CAN block with predefined settings to:
- Receive the frames with ID = 0x10 into Rx buffer #0;
- Receive the frames with ID = 0x20 - 0x2F into Rx buffer #1;
- Receive the frames with ID = 0x10010 into Rx buffer #2;
- Receive the frames with ID = 0x10020 - 0x1002F into Rx buffer #3;
*/
#define MESSAGE_ID0 (0x00000010UL)
#define MESSAGE_ID1 (0x00000020UL)
#define MESSAGE_ID1_MASK (0x0000002FUL)
#define MESSAGE_ID2 (0x00010010UL)
#define MESSAGE_ID3 (0x00010020UL)
#define MESSAGE_ID3_MASK (0x0001002FUL)
cy_stc_can_context_t context; /* This is a shared context structure, it is unique for each channel.
* It must be global
*/
const cy_stc_can_bitrate_t bitrateConfig =
{
/* .prescaler */ 10u - 1u,
/* .timeSegment1 */ 5u - 1u,
/* .timeSegment2 */ 2u - 1u,
/* .syncJumpWidth */ 2u - 1u,
/* .samplingMode */ CY_CAN_SAMPLING_MODE_1,
/* .edgeMode */ CY_CAN_EDGE_R_TO_D
};
const cy_stc_can_rx_buffer_config_t rxbConfig[4] =
{
{
/* .acceptanceMask */ {
/* .id */ 0u, /* No mask bits. Receive only the Code ID */
/* .idType */ CY_CAN_IDE_STANDARD_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .acceptanceCode */ {
/* .id */ MESSAGE_ID0,
/* .idType */ CY_CAN_IDE_STANDARD_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .linked */ false,
/* .interruptEnabled */ true,
/* .autoReplyRtr */ false,
/* .enable */ true
},
{
/* .acceptanceMask */ {
/* .id */ MESSAGE_ID1_MASK,
/* .idType */ CY_CAN_IDE_STANDARD_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .acceptanceCode */ {
/* .id */ MESSAGE_ID1,
/* .idType */ CY_CAN_IDE_STANDARD_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .linked */ false,
/* .interruptEnabled */ true,
/* .autoReplyRtr */ false,
/* .enable */ true
},
{
/* .acceptanceMask */ {
/* .id */ 0u, /* No mask bits. Receive only the Code ID */
/* .idType */ CY_CAN_IDE_EXTENDED_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .acceptanceCode */ {
/* .id */ MESSAGE_ID2,
/* .idType */ CY_CAN_IDE_EXTENDED_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 1u
},
/* .linked */ false,
/* .interruptEnabled */ true,
/* .autoReplyRtr */ false,
/* .enable */ true
},
{
/* .acceptanceMask */ {
/* .id */ MESSAGE_ID3_MASK,
/* .idType */ CY_CAN_IDE_EXTENDED_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .acceptanceCode */ {
/* .id */ MESSAGE_ID3,
/* .idType */ CY_CAN_IDE_EXTENDED_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 1u
},
/* .linked */ false,
/* .interruptEnabled */ true,
/* .autoReplyRtr */ false,
/* .enable */ true
}
};
const cy_stc_can_config_t canConfig =
{
/* .txCallback */ NULL,
/* .rxCallback */ NULL,
/* .errorCallback */ NULL,
/* .arbiter */ CY_CAN_FIXED_PRIORITY,
/* .swapEndian */ CY_CAN_LITTLE_ENDIAN,
/* .busOffRestart */ CY_CAN_MANUAL,
/* .bitrate */ &bitrateConfig,
/* .rxBuffer */ &(rxbConfig[0]),
/* .numOfRxBuffers */ 4
};
if (CY_CAN_SUCCESS != Cy_CAN_Init (CAN, &canConfig, &context))
{
/* Insert error handling */
}
Note
After initialization CAN started with CY_CAN_TEST_MODE_DISABLE

◆ Cy_CAN_DeInit()

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.

Parameters
*baseThe pointer to a CAN instance.
*contextThe 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.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: The CAN block is initialized/working and then no longer used or needs to be reset. */
cy_stc_can_context_t context; /* This is a shared context structure, it is unique for each channel.
* It must be global
*/
if (CY_CAN_SUCCESS != Cy_CAN_DeInit (CAN, &context))
{
/* Insert error handling */
}

◆ Cy_CAN_GetRxBufferStatus()

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.

Parameters
*baseThe pointer to a CAN instance.
indexRx Message buffer index (0-15).
Returns
cy_en_can_rx_buffer_status_t
Function Usage
/* Scenario: Checks if the buffer has new data. */
uint8_t index = 0u; /* Rx buffer index (max 15u) */
{
/* Reads the received data */
if (CY_CAN_SUCCESS == Cy_CAN_GetRxBuffer(CAN, index, &rxMsg))
{
/* Clears the New data flag of the Rx buffer */
Cy_CAN_AckRxBuffer(CAN, index);
}
}

◆ Cy_CAN_GetRxBuffer()

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.

Note
Remember to clear the MSG_AV_RTRSENT bit of CAN_CAN_RXn_CONTROL after the Rx buffer is read.
Parameters
*baseThe pointer to a CAN instance.
indexRx Message buffer index (0-15).
*rxMsgThe pointer to a message structure to be stored.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: Reads one Rx buffer element. */
uint8_t index = 0u; /* Rx buffer index (max 15u) */
if (CY_CAN_SUCCESS == Cy_CAN_GetRxBuffer(CAN, index, &rxMsg))
{
/* Clears the New data flag of the Rx buffer */
Cy_CAN_AckRxBuffer(CAN, index);
}
else
{
/* Insert error handling */
}

◆ Cy_CAN_ExtractMsgFromRxBuffer()

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.

Parameters
*baseThe pointer to a CAN instance.
*rxMsgThe pointer to a message structure to be stored.
contextThe 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.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: Reads one Rx buffer element. */
if (CY_CAN_SUCCESS != Cy_CAN_ExtractMsgFromRxBuffer(CAN, &rxMsg, &context))
{
/* Insert error handling */
}

◆ Cy_CAN_IrqHandler()

void Cy_CAN_IrqHandler ( CAN_Type *  base,
const cy_stc_can_context_t context 
)

CAN (Status/Error/Rx/Tx) interrupt ISR.

Parameters
*baseThe pointer to a CAN instance.
*contextThe 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_CAN_GetTxBufferStatus()

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.

Parameters
*baseThe pointer to a CAN instance.
indexTx Message buffer index (0-7).
Returns
cy_en_can_tx_buffer_status_t
Function Usage
/* Scenario: Checks if the buffer was transmitted. */
uint8_t index = 0u; /* Tx buffer index (max 7u) */
{
/* The buffer with index 0 was transmitted */
}

◆ Cy_CAN_SetBitrate()

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.

Note
Before calling the Cy_CAN_SetBitrate() function, the Cy_CAN_Stop() function must be called to stop the CAN controller.
Parameters
*baseThe pointer to a CAN instance.
*bitratecy_stc_can_bitrate_t
Function Usage
/* Scenario: Changes the Bit Timing or Prescaler Register parameters after the CAN block is initialized.
* SYSCLK:48MHz, CAN baudrate:250Kbps
*/
const cy_stc_can_bitrate_t bitrateConfig =
{
/* .prescaler */ 12u - 1u, /* can_clk = 48MHz / 12 = 4MHz
* CAN baudrate = can_clk / bit-time
* = 4MHz / 16TQ = 250Kbps
*/
/* .timeSegment1 */ 10u - 1u,
/* .timeSegment2 */ 5u - 1u,
/* .syncJumpWidth */ 2u - 1u,
/* .samplingMode */ CY_CAN_SAMPLING_MODE_1,
/* .edgeMode */ CY_CAN_EDGE_R_TO_D
};
Cy_CAN_SetBitrate(CAN, &bitrateConfig);

◆ Cy_CAN_Start()

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.

Parameters
*baseThe pointer to a CAN instance.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: The CAN block must be started. */

◆ Cy_CAN_Stop()

cy_en_can_status_t Cy_CAN_Stop ( CAN_Type *  base)

Sets the CAN controller into stop mode.

Parameters
*baseThe pointer to a CAN instance.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: CAN no longer in use, the CAN block must be switched off. */

◆ Cy_CAN_Transmit()

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.

Parameters
*baseThe pointer to a CAN instance.
indexTx Message buffer index (0-15).
*frameDataThe pointer to the frame data to be transmitted.
interruptEnabledSpecifies whether to interrupt when the message is transmitted successfully.
singleShotSpecifies whether to perform single shot transmission. In this case, even if the transmission fails, there will be no automatic retry.
*contextThe 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.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: Configure a transmit buffer for the CAN transmit operation */
uint8_t index = 0U; /* Tx buffer index (max 7u) */
bool interruptEnabled = true; /* Use interrupt when the message transmitted */
bool singleShot = false; /* Re-transmit automatically when transmission failed */
{
/* .id */ 0x00000055UL,
/* .data */ { 0x44332211, 0x88776655 },
/* .length */ 8u,
/* .rtr */ false,
/* .ide */ false
};
if (CY_CAN_SUCCESS != Cy_CAN_Transmit(CAN, index, &txMsg,
interruptEnabled, singleShot, &context))
{
/* Insert error handling */
}

◆ Cy_CAN_UpdateRxBufferConfig()

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.

Parameters
*baseThe pointer to a CAN instance.
indexRx Message buffer index (0-31).
*configThe pointer to the configuration data.
*remoteFrameThe pointer to the remote frame data. Sets to NULL if not used.
Returns
cy_en_can_status_t
Function Usage
/* Scenario: Update the Rx buffer to send remote frame
*/
#define MESSAGE_ID4 (0x00000040UL)
uint8_t index = 4u; /* Rx buffer index (max 15u) */
{
/* .acceptanceMask */ {
/* .id */ 0u, /* No mask bits. Receive only the Code ID */
/* .idType */ CY_CAN_IDE_STANDARD_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .acceptanceCode */ {
/* .id */ MESSAGE_ID4,
/* .idType */ CY_CAN_IDE_STANDARD_ID,
/* .data */ 0xFFFFu,
/* .rtr */ 0u,
/* .ide */ 0u
},
/* .linked */ false,
/* .interruptEnabled */ false,
/* .autoReplyRtr */ true,
/* .enable */ true
};
{
/* .id */ MESSAGE_ID4,
/* .data */ { 0x44332211, 0x88776655 },
/* .length */ 8u,
/* .rtr */ true,
/* .ide */ false
};
if (CY_CAN_SUCCESS != Cy_CAN_UpdateRxBufferConfig(CAN, index, &rxbConfig, &rtrMsg))
{
/* Insert error handling */
}

◆ Cy_CAN_GetInterruptStatus()

__STATIC_INLINE uint32_t Cy_CAN_GetInterruptStatus ( CAN_Type const *  base)

Returns a status of CAN interrupt requests.

Parameters
*baseThe pointer to a CAN instance.
Returns
uint32_t The bit mask of the Interrupt Status. Valid masks can be found in RX Interrupt masks, TX Interrupt masks, Error Interrupt masks.
Function Usage
/* Scenario: Checks for a new message in the Rx buffer. */
uint32_t status;
if (0 != (status & CY_CAN_RX_BUFFER_NEW_MESSAGE))
{
/* Process the received message */
}

◆ Cy_CAN_ClearInterrupt()

__STATIC_INLINE void Cy_CAN_ClearInterrupt ( CAN_Type *  base,
uint32_t  status 
)

Clears CAN interrupts by setting each bit.

Parameters
*baseThe pointer to a CAN instance.
statusThe bitmask of statuses to clear. Valid masks can be found in RX Interrupt masks, TX Interrupt masks, Error Interrupt masks.
Function Usage
/* Scenario: Clears all Rx interrupts by setting corresponding bits to 1. */
uint32_t status = CY_CAN_RX_BUFFER_NEW_MESSAGE; /* Message stored to Rx buffer */
Cy_CAN_ClearInterrupt(CAN, status);

◆ Cy_CAN_GetInterruptMask()

__STATIC_INLINE uint32_t Cy_CAN_GetInterruptMask ( CAN_Type const *  base)

Returns an interrupt mask.

Parameters
*baseThe pointer to a CAN instance.
Returns
uint32_t 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.
Function Usage
/* Scenario: Checks if the Rx buffer interrupt is enabled. */
if (0 != (Cy_CAN_GetInterruptMask(CAN) & CY_CAN_RX_BUFFER_NEW_MESSAGE))
{
/* The Rx buffer interrupt is enabled */
}

◆ Cy_CAN_SetInterruptMask()

__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.

Parameters
*baseThe pointer to a CAN instance.
interruptThe 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.
Function Usage
/* Scenario: Enables the interrupts from the Rx buffer. */
uint32_t status = CY_CAN_RX_BUFFER_NEW_MESSAGE; /* Message stored to Rx buffer */

◆ Cy_CAN_AckRxBuffer()

__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.

Parameters
*baseThe pointer to a CAN instance.
indexRx Message buffer index (0-15).
Function Usage
/* Scenario: Reads one Rx buffer element. */
uint8_t index = 0u; /* Rx buffer index (max 15u) */
if (CY_CAN_SUCCESS == Cy_CAN_GetRxBuffer(CAN, index, &rxMsg))
{
/* Clears the New data flag of the Rx buffer */
Cy_CAN_AckRxBuffer(CAN, index);
}
else
{
/* Insert error handling */
}

◆ Cy_CAN_GetErrorCapture()

__STATIC_INLINE uint32_t Cy_CAN_GetErrorCapture ( CAN_Type *  base)

Returns the current error information.

Parameters
*baseThe pointer to a CAN instance.
Returns
uint32_t Register value of the CAN_ECR
Function Usage
/* Scenario: Checks the ECR register for the error that occurred. */
uint32_t value;
cy_en_can_lec_t errorType;
value = Cy_CAN_GetErrorCapture(CAN);
if (0 != (value & CY_CAN_ECR_STATUS_MSK))
{
/* Handling protocol error according to errorType */
}

◆ Cy_CAN_SetTestMode()

__STATIC_INLINE void Cy_CAN_SetTestMode ( CAN_Type *  base,
cy_en_can_test_mode_t  testMode 
)

Changes the test mode setting.

Parameters
*baseThe pointer to a CAN instance.
testModecy_en_can_test_mode_t
Function Usage
/* Scenario: Configures Test mode to use the internal loopback mode. */
/* CAN should be initialized before set test mode.
* After initialization CAN already started.
* So it needed to stop, apply test mode,
* and run again with selected mode
*/

◆ Cy_CAN_SetArbiter()

__STATIC_INLINE void Cy_CAN_SetArbiter ( CAN_Type *  base,
cy_en_can_arbiter_t  arbiter 
)

Changes the Tx Buffer arbiter setting.

Parameters
*baseThe pointer to a CAN instance.
arbitercy_en_can_arbiter_t

◆ Cy_CAN_SetSwapEndian()

__STATIC_INLINE void Cy_CAN_SetSwapEndian ( CAN_Type *  base,
cy_en_can_endian_t  endian 
)

Changes the byte endianness of the data field setting.

Parameters
*baseThe pointer to a CAN instance.
endiancy_en_can_endian_t

◆ Cy_CAN_SetBusOffAutoRestart()

__STATIC_INLINE void Cy_CAN_SetBusOffAutoRestart ( CAN_Type *  base,
cy_en_can_busoff_restart_t  restart 
)

Changes the bus-off auto restart setting.

Parameters
*baseThe pointer to a CAN instance.
restartcy_en_can_busoff_restart_t