RZV Flexible Software Package Documentation
Release v3.0.0
|
|
Functions | |
fsp_err_t | R_CANFD_Open (can_ctrl_t *const p_api_ctrl, can_cfg_t const *const p_cfg) |
fsp_err_t | R_CANFD_Close (can_ctrl_t *const p_api_ctrl) |
fsp_err_t | R_CANFD_Write (can_ctrl_t *const p_api_ctrl, uint32_t const buffer, can_frame_t *const p_frame) |
fsp_err_t | R_CANFD_Read (can_ctrl_t *const p_api_ctrl, uint32_t const buffer, can_frame_t *const p_frame) |
fsp_err_t | R_CANFD_ModeTransition (can_ctrl_t *const p_api_ctrl, can_operation_mode_t operation_mode, can_test_mode_t test_mode) |
fsp_err_t | R_CANFD_InfoGet (can_ctrl_t *const p_api_ctrl, can_info_t *const p_info) |
fsp_err_t | R_CANFD_CallbackSet (can_ctrl_t *const p_api_ctrl, void(*p_callback)(can_callback_args_t *), void const *const p_context, can_callback_args_t *const p_callback_memory) |
Driver for the CANFD peripheral on RZ MPUs. This module implements the CAN Interface.
The CANFD module can be used to communicate over CAN networks, optionally using Flexible Data (CAN-FD) to accelerate the data phase. A variety of message filtering and buffer options are available.
RZ/V2L | RZ/V2H | |
---|---|---|
Channels | 2 | 6 |
Max nominal bitrate | 1 Mbps | 1 Mbps |
Max data bitrate | 4 Mbps | 8 Mbps |
Filter rules | 128 | 256 |
TX message buffers | 16/ch | 32/ch |
RX message buffers | 32 | 96 |
RX FIFOs | 8 | 8 |
RX Buffer RAM | 4864 bytes | 14,592 bytes |
Standards | ISO | ISO |
RZ/V2L | RZ/V2H | |
---|---|---|
Max 64-byte storage | 64 messages | 192 messages |
Max 8-byte storage | 243 messages | 729 messages |
Configuration | Options | Default | Description |
---|---|---|---|
Global Error Interrupt > Callback Channel | MCU Specific Options | Specify which channel callback should be called to handle global errors. When starting the driver this channel must be opened first. | |
Global Error Interrupt > Priority | Value must be an integer between 0 and 255 | 12 | This interrupt is fired for each of the error sources selected below. |
Global Error Interrupt > Sources | MCU Specific Options | Select which errors should trigger an interrupt. | |
Reception > FIFOs > FIFO 0 > Enable |
| Enabled | Enable or disable RX FIFO 0. |
Reception > FIFOs > FIFO 0 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 0. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 0 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 0. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 0 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 0. | |
Reception > FIFOs > FIFO 0 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 0. | |
Reception > FIFOs > FIFO 1 > Enable |
| Disabled | Enable or disable RX FIFO 1. |
Reception > FIFOs > FIFO 1 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 1. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 1 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 1. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 1 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 1. | |
Reception > FIFOs > FIFO 1 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 1. | |
Reception > FIFOs > FIFO 2 > Enable |
| Disabled | Enable or disable RX FIFO 2. |
Reception > FIFOs > FIFO 2 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 2. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 2 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 2. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 2 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 2. | |
Reception > FIFOs > FIFO 2 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 2. | |
Reception > FIFOs > FIFO 3 > Enable |
| Disabled | Enable or disable RX FIFO 3. |
Reception > FIFOs > FIFO 3 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 3. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 3 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 3. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 3 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 3. | |
Reception > FIFOs > FIFO 3 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 3. | |
Reception > FIFOs > FIFO 4 > Enable |
| Disabled | Enable or disable RX FIFO 4. |
Reception > FIFOs > FIFO 4 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 4. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 4 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 4. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 4 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 4. | |
Reception > FIFOs > FIFO 4 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 4. | |
Reception > FIFOs > FIFO 5 > Enable |
| Disabled | Enable or disable RX FIFO 5. |
Reception > FIFOs > FIFO 5 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 5. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 5 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 5. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 5 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 5. | |
Reception > FIFOs > FIFO 5 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 5. | |
Reception > FIFOs > FIFO 6 > Enable |
| Disabled | Enable or disable RX FIFO 6. |
Reception > FIFOs > FIFO 6 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 6. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 6 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 6. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 6 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 6. | |
Reception > FIFOs > FIFO 6 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 6. | |
Reception > FIFOs > FIFO 7 > Enable |
| Disabled | Enable or disable RX FIFO 7. |
Reception > FIFOs > FIFO 7 > Interrupt Mode | MCU Specific Options | Set the interrupt mode for RX FIFO 7. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below. | |
Reception > FIFOs > FIFO 7 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for RX FIFO 7. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Reception > FIFOs > FIFO 7 > Payload Size | MCU Specific Options | Select the message payload size for RX FIFO 7. | |
Reception > FIFOs > FIFO 7 > Depth | MCU Specific Options | Select the number of stages for RX FIFO 7. | |
Reception > FIFOs > Interrupt Priority | Value must be an integer between 0 and 255 | 12 | This priority level will apply to all FIFO interrupts globally. |
Reception > Message Buffers > Number of Buffers | Manual Entry | 0 | Number of message buffers available for reception. As there is no interrupt for message buffer reception it is recommended to use RX FIFOs instead. Set this value to 0 to disable RX Message Buffers. |
Reception > Message Buffers > Payload Size | MCU Specific Options | Payload size for all RX Message Buffers. | |
Reception > Acceptance Filtering > Channel 0 Rule Count | Value must be a non-negative integer | 64 | Number of acceptance filter list rules dedicated to Channel 0. |
Reception > Acceptance Filtering > Channel 1 Rule Count | Value must be a non-negative integer | 64 | Number of acceptance filter list rules dedicated to Channel 1. |
Reception > Acceptance Filtering > Channel 2 Rule Count | Value must be a non-negative integer | 0 | Number of acceptance filter list rules dedicated to Channel 2. |
Reception > Acceptance Filtering > Channel 3 Rule Count | Value must be a non-negative integer | 0 | Number of acceptance filter list rules dedicated to Channel 3. |
Reception > Acceptance Filtering > Channel 4 Rule Count | Value must be a non-negative integer | 0 | Number of acceptance filter list rules dedicated to Channel 4. |
Reception > Acceptance Filtering > Channel 5 Rule Count | Value must be a non-negative integer | 0 | Number of acceptance filter list rules dedicated to Channel 5. |
Flexible Data (FD) > Protocol Exceptions | MCU Specific Options | Select whether to enter the protocol exception handling state when a RES bit is sampled recessive as defined in ISO 11898-1. | |
Flexible Data (FD) > Payload Overflow | MCU Specific Options | Configure whether received messages larger than the destination buffer should be truncated or rejected. | |
Common FIFOs > FIFO 0 > Enable |
| Disabled | Enable or disable Common FIFO 0. |
Common FIFOs > FIFO 0 > Mode |
| Receive | Select the operation mode for Common FIFO 0. |
Common FIFOs > FIFO 0 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 0. |
Common FIFOs > FIFO 0 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 0. |
Common FIFOs > FIFO 0 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 0. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 0 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 0. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 0 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 0. | |
Common FIFOs > FIFO 0 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 0. | |
Common FIFOs > FIFO 0 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 0. | |
Common FIFOs > FIFO 0 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 0 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 0 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 0. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 0 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 0. |
Common FIFOs > FIFO 1 > Enable |
| Disabled | Enable or disable Common FIFO 1. |
Common FIFOs > FIFO 1 > Mode |
| Receive | Select the operation mode for Common FIFO 1. |
Common FIFOs > FIFO 1 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 1. |
Common FIFOs > FIFO 1 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 1. |
Common FIFOs > FIFO 1 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 1. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 1 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 1. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 1 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 1. | |
Common FIFOs > FIFO 1 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 1. | |
Common FIFOs > FIFO 1 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 1. | |
Common FIFOs > FIFO 1 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 1 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 1 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 1. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 1 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 1. |
Common FIFOs > FIFO 2 > Enable |
| Disabled | Enable or disable Common FIFO 2. |
Common FIFOs > FIFO 2 > Mode |
| Receive | Select the operation mode for Common FIFO 2. |
Common FIFOs > FIFO 2 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 2. |
Common FIFOs > FIFO 2 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 2. |
Common FIFOs > FIFO 2 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 2. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 2 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 2. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 2 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 2. | |
Common FIFOs > FIFO 2 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 2. | |
Common FIFOs > FIFO 2 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 2. | |
Common FIFOs > FIFO 2 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 2 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 2 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 2. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 2 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 2. |
Common FIFOs > FIFO 3 > Enable |
| Disabled | Enable or disable Common FIFO 3. |
Common FIFOs > FIFO 3 > Mode |
| Receive | Select the operation mode for Common FIFO 3. |
Common FIFOs > FIFO 3 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 3. |
Common FIFOs > FIFO 3 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 3. |
Common FIFOs > FIFO 3 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 3. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 3 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 3. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 3 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 3. | |
Common FIFOs > FIFO 3 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 3. | |
Common FIFOs > FIFO 3 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 3. | |
Common FIFOs > FIFO 3 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 3 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 3 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 3. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 3 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 3. |
Common FIFOs > FIFO 4 > Enable |
| Disabled | Enable or disable Common FIFO 4. |
Common FIFOs > FIFO 4 > Mode |
| Receive | Select the operation mode for Common FIFO 4. |
Common FIFOs > FIFO 4 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 4. |
Common FIFOs > FIFO 4 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 4. |
Common FIFOs > FIFO 4 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 4. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 4 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 4. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 4 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 4. | |
Common FIFOs > FIFO 4 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 4. | |
Common FIFOs > FIFO 4 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 4. | |
Common FIFOs > FIFO 4 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 4 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 4 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 4. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 4 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 4. |
Common FIFOs > FIFO 5 > Enable |
| Disabled | Enable or disable Common FIFO 5. |
Common FIFOs > FIFO 5 > Mode |
| Receive | Select the operation mode for Common FIFO 5. |
Common FIFOs > FIFO 5 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 5. |
Common FIFOs > FIFO 5 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 5. |
Common FIFOs > FIFO 5 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 5. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 5 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 5. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 5 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 5. | |
Common FIFOs > FIFO 5 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 5. | |
Common FIFOs > FIFO 5 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 5. | |
Common FIFOs > FIFO 5 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 5 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 5 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 5. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 5 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 5. |
Common FIFOs > FIFO 6 > Enable |
| Disabled | Enable or disable Common FIFO 6. |
Common FIFOs > FIFO 6 > Mode |
| Receive | Select the operation mode for Common FIFO 6. |
Common FIFOs > FIFO 6 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 6. |
Common FIFOs > FIFO 6 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 6. |
Common FIFOs > FIFO 6 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 6. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 6 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 6. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 6 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 6. | |
Common FIFOs > FIFO 6 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 6. | |
Common FIFOs > FIFO 6 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 6. | |
Common FIFOs > FIFO 6 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 6 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 6 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 6. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 6 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 6. |
Common FIFOs > FIFO 7 > Enable |
| Disabled | Enable or disable Common FIFO 7. |
Common FIFOs > FIFO 7 > Mode |
| Receive | Select the operation mode for Common FIFO 7. |
Common FIFOs > FIFO 7 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 7. |
Common FIFOs > FIFO 7 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 7. |
Common FIFOs > FIFO 7 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 7. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 7 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 7. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 7 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 7. | |
Common FIFOs > FIFO 7 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 7. | |
Common FIFOs > FIFO 7 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 7. | |
Common FIFOs > FIFO 7 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 7 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 7 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 7. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 7 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 7. |
Common FIFOs > FIFO 8 > Enable |
| Disabled | Enable or disable Common FIFO 8. |
Common FIFOs > FIFO 8 > Mode |
| Receive | Select the operation mode for Common FIFO 8. |
Common FIFOs > FIFO 8 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 8. |
Common FIFOs > FIFO 8 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 8. |
Common FIFOs > FIFO 8 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 8. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 8 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 8. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 8 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 8. | |
Common FIFOs > FIFO 8 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 8. | |
Common FIFOs > FIFO 8 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 8. | |
Common FIFOs > FIFO 8 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 8 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 8 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 8. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 8 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 8. |
Common FIFOs > FIFO 9 > Enable |
| Disabled | Enable or disable Common FIFO 9. |
Common FIFOs > FIFO 9 > Mode |
| Receive | Select the operation mode for Common FIFO 9. |
Common FIFOs > FIFO 9 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 9. |
Common FIFOs > FIFO 9 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 9. |
Common FIFOs > FIFO 9 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 9. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 9 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 9. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 9 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 9. | |
Common FIFOs > FIFO 9 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 9. | |
Common FIFOs > FIFO 9 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 9. | |
Common FIFOs > FIFO 9 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 9 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 9 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 9. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 9 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 9. |
Common FIFOs > FIFO 10 > Enable |
| Disabled | Enable or disable Common FIFO 10. |
Common FIFOs > FIFO 10 > Mode |
| Receive | Select the operation mode for Common FIFO 10. |
Common FIFOs > FIFO 10 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 10. |
Common FIFOs > FIFO 10 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 10. |
Common FIFOs > FIFO 10 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 10. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 10 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 10. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 10 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 10. | |
Common FIFOs > FIFO 10 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 10. | |
Common FIFOs > FIFO 10 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 10. | |
Common FIFOs > FIFO 10 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 10 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 10 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 10. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 10 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 10. |
Common FIFOs > FIFO 11 > Enable |
| Disabled | Enable or disable Common FIFO 11. |
Common FIFOs > FIFO 11 > Mode |
| Receive | Select the operation mode for Common FIFO 11. |
Common FIFOs > FIFO 11 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 11. |
Common FIFOs > FIFO 11 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 11. |
Common FIFOs > FIFO 11 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 11. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 11 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 11. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 11 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 11. | |
Common FIFOs > FIFO 11 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 11. | |
Common FIFOs > FIFO 11 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 11. | |
Common FIFOs > FIFO 11 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 11 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 11 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 11. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 11 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 11. |
Common FIFOs > FIFO 12 > Enable |
| Disabled | Enable or disable Common FIFO 12. |
Common FIFOs > FIFO 12 > Mode |
| Receive | Select the operation mode for Common FIFO 12. |
Common FIFOs > FIFO 12 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 12. |
Common FIFOs > FIFO 12 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 12. |
Common FIFOs > FIFO 12 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 12. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 12 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 12. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 12 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 12. | |
Common FIFOs > FIFO 12 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 12. | |
Common FIFOs > FIFO 12 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 12. | |
Common FIFOs > FIFO 12 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 12 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 12 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 12. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 12 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 12. |
Common FIFOs > FIFO 13 > Enable |
| Disabled | Enable or disable Common FIFO 13. |
Common FIFOs > FIFO 13 > Mode |
| Receive | Select the operation mode for Common FIFO 13. |
Common FIFOs > FIFO 13 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 13. |
Common FIFOs > FIFO 13 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 13. |
Common FIFOs > FIFO 13 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 13. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 13 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 13. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 13 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 13. | |
Common FIFOs > FIFO 13 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 13. | |
Common FIFOs > FIFO 13 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 13. | |
Common FIFOs > FIFO 13 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 13 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 13 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 13. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 13 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 13. |
Common FIFOs > FIFO 14 > Enable |
| Disabled | Enable or disable Common FIFO 14. |
Common FIFOs > FIFO 14 > Mode |
| Receive | Select the operation mode for Common FIFO 14. |
Common FIFOs > FIFO 14 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 14. |
Common FIFOs > FIFO 14 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 14. |
Common FIFOs > FIFO 14 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 14. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 14 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 14. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 14 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 14. | |
Common FIFOs > FIFO 14 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 14. | |
Common FIFOs > FIFO 14 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 14. | |
Common FIFOs > FIFO 14 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 14 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 14 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 14. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 14 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 14. |
Common FIFOs > FIFO 15 > Enable |
| Disabled | Enable or disable Common FIFO 15. |
Common FIFOs > FIFO 15 > Mode |
| Receive | Select the operation mode for Common FIFO 15. |
Common FIFOs > FIFO 15 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 15. |
Common FIFOs > FIFO 15 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 15. |
Common FIFOs > FIFO 15 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 15. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 15 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 15. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 15 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 15. | |
Common FIFOs > FIFO 15 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 15. | |
Common FIFOs > FIFO 15 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 15. | |
Common FIFOs > FIFO 15 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 15 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 15 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 15. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 15 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 15. |
Common FIFOs > FIFO 16 > Enable |
| Disabled | Enable or disable Common FIFO 16. |
Common FIFOs > FIFO 16 > Mode |
| Receive | Select the operation mode for Common FIFO 16. |
Common FIFOs > FIFO 16 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 16. |
Common FIFOs > FIFO 16 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 16. |
Common FIFOs > FIFO 16 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 16. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 16 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 16. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 16 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 16. | |
Common FIFOs > FIFO 16 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 16. | |
Common FIFOs > FIFO 16 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 16. | |
Common FIFOs > FIFO 16 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 16 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 16 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 16. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 16 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 16. |
Common FIFOs > FIFO 17 > Enable |
| Disabled | Enable or disable Common FIFO 17. |
Common FIFOs > FIFO 17 > Mode |
| Receive | Select the operation mode for Common FIFO 17. |
Common FIFOs > FIFO 17 > RX Interrupt Enable |
| Disabled | Enable to allow interrupts on message receiption for Common FIFO 17. |
Common FIFOs > FIFO 17 > TX Interrupt Enable |
| Disabled | Enable to allow interrupts on message transmission for Common FIFO 17. |
Common FIFOs > FIFO 17 > Interrupt Mode |
| Threshold | Set the interrupt mode for Common FIFO 17. Threshold mode will only fire an interrupt each time an incoming message crosses the threshold value set below or when all messages have been transmitted. |
Common FIFOs > FIFO 17 > Interrupt Threshold | MCU Specific Options | Set the interrupt threshold value for Common FIFO 17. This setting is only applicable when the Interrupt Mode is set to 'At Threshold Value'. | |
Common FIFOs > FIFO 17 > Payload Size | MCU Specific Options | Select the message payload size for Common FIFO 17. | |
Common FIFOs > FIFO 17 > Depth | MCU Specific Options | Select the number of stages for Common FIFO 17. | |
Common FIFOs > FIFO 17 > TX Message Buffer | MCU Specific Options | Select the TX message buffer that participates in TX scans related to Common FIFO 17. | |
Common FIFOs > FIFO 17 > Interval TX Delay | TX delay must be an integer between 0 and 255. | 0 | Selects the delay between successive transmission for Common FIFO 17 in units of the Interval Timer Clock. |
Common FIFOs > FIFO 17 > Interval Timer |
| Reference clock | Select the source of the interval timer clock for Common FIFO 17. The reference clock can be scaled by x10 below. |
Common FIFOs > FIFO 17 > Interval Timer Reference Clock Resolution |
| x1 | Selects the timer resolution if the reference clock is selected as the timer source for Common FIFO 17. |
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Transmission Priority | MCU Specific Options | Select how messages should be prioritized for transmission. In either case, lower numbers indicate higher priority. | |
DLC Check | MCU Specific Options | When enabled received messages will be rejected if their DLC field is less than the value configured in the associated AFL rule. If 'Enabled w/truncate' is selected and a message passes the DLC check the DLC field is set to the value in the associated AFL rule and any excess data is discarded. | |
Clock Source | MCU Specific Options | Select the CANFD clock source. | |
Interval Timer Prescaler | Timer prescaler must be an integer between 0 and 65535. | 0 | FIFO interval timer prescaler, required for Interval TX Delay. |
Configuration | Options | Default | Description |
---|---|---|---|
General > Name | Name must be a valid C symbol | g_canfd0 | Module name. |
General > Channel | Value must be a non-negative integer | 0 | Specify the CAN channel to use. |
Bitrate > Automatic > Clock source frequency (Set 0 if PCLK use) | Must be a valid integer. | 0 | Input clock source frequency. |
Bitrate > Automatic > Nominal Rate (bps) | Must be a valid integer with a maximum of 1MHz. | 500000 | Specify nominal bitrate in bits per second. |
Bitrate > Automatic > Data Rate (bps) | Must be a valid integer greater than 0. | 2000000 | Specify data bitrate in bits per second. |
Bitrate > Automatic > Sample Point (%) | Must be a valid integer between 60 and 99. | 75 | Specify desired sample point. |
Bitrate > Manual > Nominal > Prescaler (divisor) | Manual Entry | 1 | Specify clock divisor for nominal bitrate. |
Bitrate > Manual > Nominal > Time Segment 1 (Tq) | Manual Entry | 29 | Select the Time Segment 1 value. Check module usage notes for how to calculate this value. |
Bitrate > Manual > Nominal > Time Segment 2 (Tq) | Manual Entry | 10 | Select the Time Segment 2 value. Check module usage notes for how to calculate this value. |
Bitrate > Manual > Nominal > Sync Jump Width (Tq) | Manual Entry | 4 | Select the Synchronization Jump Width value. Check module usage notes for how to calculate this value. |
Bitrate > Manual > Data > Prescaler (divisor) | Manual Entry | 1 | Specify clock divisor for data bitrate. |
Bitrate > Manual > Data > Time Segment 1 (Tq) | Manual Entry | 12 | Select the Time Segment 1 value. Check module usage notes for how to calculate this value. |
Bitrate > Manual > Data > Time Segment 2 (Tq) | Manual Entry | 4 | Select the Time Segment 2 value. Check module usage notes for how to calculate this value. |
Bitrate > Manual > Data > Sync Jump Width (Tq) | Manual Entry | 1 | Select the Synchronization Jump Width value. Check module usage notes for how to calculate this value. |
Bitrate > Manual > Use manual settings |
| No | Select whether or not to override automatic baudrate generation and instead use the values specified here. |
Bitrate > Delay Compensation |
| Enable | When enabled the CANFD module will automatically compensate for any transceiver or bus delay between transmitted and received bits. When manually supplying bit timing values with delay compensation enabled be sure the data prescaler is 2 or smaller for correct operation. |
Interrupts > Callback | Name must be a valid C symbol | canfd0_callback | A user callback function. If this callback function is provided, it is called from the interrupt service routine (ISR) each time any interrupt occurs. |
Interrupts > Channel Interrupt Priority Level | Value must be an integer between 0 and 255 | 12 | Channel Error/Transmit interrupt priority. |
Transmit Interrupts | MCU Specific Options | Select which TX Message Buffers should trigger an interrupt when transmission is complete. | |
Channel Error Interrupts | MCU Specific Options | Select which channel error interrupt sources to enable. | |
TX Buffer Merge Mode | MCU Specific Options | When enabled the CANFD module set Transmit buffer merge mode enable. TX MB0,3 are able to transmit payload with a length of more than 20 bytes. | |
Filter List Array | Name must be a valid C symbol | p_canfd0_afl | Acceptance Filter List (AFL) rule array symbol name. |
The CANFD peripheral uses the clocks shown in the table below as its clock sources.
RZ/V2L | RZ/V2H | |
---|---|---|
Clock Source | P0 clock/2 or External CANFD Clock*1 | CANFD_0_pclk |
*1: Externally input clock to the CAN_CLK pin
To achieve an exact bitrate the CANFD source clock or divisor may need to be adjusted to meet the criteria in the formula below:
For CANFD, the possible values for each element are as follows:
Element | Min | Max (Nominal) | Max (Data) |
---|---|---|---|
Bitrate | - | 1 Mbps | 4-8 Mbps*1 |
Time Segment 1 | 2 Tq | 128 Tq | 16-32 Tq*2 |
Time Segment 2 | 2 Tq | 32 Tq | 8-16 Tq*3 |
Sync Jump Width | 2 Tq (Nominal) / 1 Tq (Data)*2 | Time Segment 2 | Time Segment 2 |
Prescalar | 1 | 1024 | 256 |
*1: RZ/V2L supports up to 4 Mbps; RZ/V2H supports up to 8 Mbps. *2: RZ/V2L supports up to 16 Tq; RZ/V2H supports up to 32 Tq. *3: RZ/V2L supports up to 8 Tq; RZ/V2H supports up to 16 Tq.
CANFD channels each control two pins: CRX (receive) and CTX (transmit).
The CANFD driver provides three types of buffers: Transmit Message Buffers (TX MBs), Receive Message Buffers (RX MBs) and Receive FIFOs (RX FIFOs).
TX MBs are used for transmission only. Refer to the hardware manual for your device for information on which TX MBs are available.
RX MBs are for reception only and may only hold one message at a time. 32-96 total RX MBs are available and are shared across all channels.
No interrupts are provided for RX MBs. Use R_CANFD_InfoGet and R_CANFD_Read to poll and read them, respectively.
RX FIFOs provide interrupt-driven queue functionality for receiving messages and are shared across all channels. All FIFOs have the following capabilities:
Once an interrupt is fired it will continue to fire until the FIFO is emptied and all messages have been passed to user code via the callback. When using the threshold interrupt mode a FIFO can be checked for data and read between interrupts by calling R_CANFD_InfoGet and R_CANFD_Read, respectively.
The CANFD peripheral has a limited amount of buffer pool RAM available for allocating RX MBs and FIFO stages. The RZ Configuration editor will provide a warning when the limit is exceeded.
The number of bytes used by RX MBs and individual FIFOs can be calculated as follows:
To filter messages to the desired message buffer or FIFO the CANFD peripheral uses an Acceptance Filter List (AFL). Each entry in the AFL provides a rule to check a message against along with destination and other filtering information. When a message is received the CANFD peripheral internally checks against every configured AFL rule for the channel. If a match is found the message is transferred to the destination(s) specified in the rule. The default template with one entry is shown below:
For an example configuration refer to the AFL Example below.
Flexible Data is an extension of the CAN protocol allowing for messages up to 64 bytes and higher data bitrates, among other features. The CANFD driver supports the following:
To specify one or more of these options when transmitting set can_frame_t::options with combined values from canfd_frame_options_t. Received messages will automatically have this field filled, if applicable.
For convenience, the baudrate of the CAN peripheral is automatically set through the RZ Configuration editor using a best effort approach. To increase compliance and reliability two extra options are provided: Link Prescalers and Delay Compensation.
When Link Prescalers is enabled the prescalers for Nominal and Data bitrates will be kept the same, improving clock tolerance in networks using FD frames. This option somewhat limits the available options for bitrate settings, so be sure to check that the automatically generated values are acceptable.
Enabling Delay Compensation instructs the CANFD peripheral to measure TX to RX tranceiver delay and automatically adjust for it, improving the reliability of high-speed FD messages. This option may severely limit available bitrate settings depending on the source clock; it is highly recommended to check the generated values when enabled.
If the auto-generated baud settings cause deviation that is not tolerable by the application the user can override the auto-generated settings and put in manually calculated values through the RZ Configuration editor. For more details on how the bitrate is calculated refer to the Clock Configuration section above.
The Sync Jump Width option specifies the maximum number of time quanta that the sample point may be delayed by to account for differences in oscillators on the bus. It should be set to a value between 1 and the configured Time Segment 2 value depending on the maximum permissible clock error.
The CANFD peripheral provides two types of error interrupts: Channel and Global. As the names imply, each channel has its own Channel Error interrupt but there is only one Global Error interrupt. Only the configured channel will receive callbacks for Global Errors.
Error interrupt callbacks will pass either CAN_EVENT_ERR_CHANNEL or CAN_EVENT_ERR_GLOBAL in the can_callback_args_t::event field. A second field, can_callback_args_t::error, provides the actual error code as canfd_error_t. Cast to this enum to retrieve the error condition. See the callback in the Basic Example below for a demonstration.
When DLC Checking is enabled messages are checked against the destination.minimum_dlc
value of each AFL rule. If the data length of a message is less than this value the message will be rejected. When DLC checking is set to "Enabled w/truncate" in the RZ Configuration editor any data in excess of the minimum DLC setting will be truncated and the DLC value for the frame will be set to match.
When an FD message is received with a DLC larger than the destination buffer an FD Payload Overflow interrupt is thrown (if configured). When Payload Overflow is set to "Truncate" the message will still be accepted but only data up to the buffer capacity will be preserved. The DLC value is unchanged in this case; any data beyond this value in the can_frame_t::data array should not be used.
The CANFD peripheral provides three basic test modes: Listen Only, Internal Loopback and External Loopback. Use R_CANFD_ModeTransition to switch to a test mode.
On some MPUs an additional "Internal Bus" test mode is available that allows connecting both CANFD channels together on an internal bus, effectively creating an internal CAN network. See the Internal Bus example below for details.
Developers should be aware of the following limitations when using CANFD:
The below is an example Acceptance Filter List (AFL) declaration with two rules.
This is a basic example of minimal use of the CANFD module in an application.
This example demonstrates sending an FD message with bitrate switching over external loopback. The CTX and CRX pins must be connected when using external loopback, though if a CAN tranciever is onboard a 120 Ohm resistor should be connected across CANH and CANL instead.
In this example two CANFD channels are connected to the Internal Bus test mode. API error checking has been omitted for clarity.
Data Structures | |
struct | canfd_afl_entry_t |
struct | canfd_global_cfg_t |
struct | canfd_extended_cfg_t |
Enumerations | |
enum | canfd_status_t |
enum | canfd_error_t |
enum | canfd_tx_buffer_t |
enum | canfd_tx_mb_t |
enum | canfd_rx_buffer_t |
enum | canfd_rx_mb_t |
enum | canfd_rx_fifo_t |
enum | canfd_minimum_dlc_t |
enum | canfd_frame_options_t |
enum | canfd_txmb_merge_mode_t |
struct canfd_afl_entry_t |
AFL Entry (based on R_CANFD_CFDGAFL_Type in renesas.h)
struct canfd_global_cfg_t |
CANFD Global Configuration
struct canfd_extended_cfg_t |
CANFD Extended Configuration
Data Fields | ||
---|---|---|
canfd_afl_entry_t const * | p_afl | AFL rules list. |
uint64_t | txmb_txi_enable | Array of TX Message Buffer enable bits. |
uint32_t | error_interrupts | Error interrupt enable bits. |
can_bit_timing_cfg_t * | p_data_timing | FD Data Rate (when bitrate switching is used) |
uint8_t | delay_compensation | FD Transceiver Delay Compensation (enable or disable) |
canfd_global_cfg_t * | p_global_cfg | Global configuration (global error callback channel only) |
canfd_txmb_merge_mode_t | txmb_merge_mode_enable | TXMB buffer marge mode configuration. |
enum canfd_status_t |
CANFD Status
enum canfd_error_t |
CANFD Error Code
enum canfd_tx_buffer_t |
CANFD Transmit Buffer (MB + CFIFO)
enum canfd_tx_mb_t |
CANFD Transmit Message Buffer (TX MB)
enum canfd_rx_buffer_t |
CANFD Receive Buffer (MB + FIFO + CFIFO)
enum canfd_rx_mb_t |
CANFD Receive Message Buffer (RX MB)
enum canfd_rx_fifo_t |
CANFD Receive FIFO (RX FIFO)
enum canfd_minimum_dlc_t |
CANFD AFL Minimum DLC settings
CANFD TXMB Merge mode
fsp_err_t R_CANFD_Open | ( | can_ctrl_t *const | p_api_ctrl, |
can_cfg_t const *const | p_cfg | ||
) |
Open and configure the CANFD channel for operation.
Example:
FSP_SUCCESS | Channel opened successfully. |
FSP_ERR_ALREADY_OPEN | Driver already open. |
FSP_ERR_IN_USE | Channel is already in use. |
FSP_ERR_IP_CHANNEL_NOT_PRESENT | Channel does not exist on this MPU. |
FSP_ERR_ASSERTION | A required pointer was NULL. |
FSP_ERR_CAN_INIT_FAILED | The provided nominal or data bitrate is invalid. |
fsp_err_t R_CANFD_Close | ( | can_ctrl_t *const | p_api_ctrl | ) |
Close the CANFD channel.
FSP_SUCCESS | Channel closed successfully. |
FSP_ERR_NOT_OPEN | Control block not open. |
FSP_ERR_ASSERTION | Null pointer presented. |
fsp_err_t R_CANFD_Write | ( | can_ctrl_t *const | p_api_ctrl, |
uint32_t | buffer, | ||
can_frame_t *const | p_frame | ||
) |
Write data to the CANFD channel.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_NOT_OPEN | Control block not open. |
FSP_ERR_CAN_TRANSMIT_NOT_READY | Transmit in progress, cannot write data at this time. |
FSP_ERR_INVALID_ARGUMENT | Data length or buffer number invalid. |
FSP_ERR_INVALID_MODE | An FD option was set on a non-FD frame. |
FSP_ERR_ASSERTION | One or more pointer arguments is NULL. |
FSP_ERR_UNSUPPORTED | FD is not supported on this MPU. |
fsp_err_t R_CANFD_Read | ( | can_ctrl_t *const | p_api_ctrl, |
uint32_t | buffer, | ||
can_frame_t *const | p_frame | ||
) |
Read data from a CANFD Message Buffer or FIFO.
Example: snippet r_canfd_example.c R_CANFD_Read
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_NOT_OPEN | Control block not open. |
FSP_ERR_INVALID_ARGUMENT | Buffer number invalid. |
FSP_ERR_ASSERTION | p_api_ctrl or p_frame is NULL. |
FSP_ERR_BUFFER_EMPTY | Buffer or FIFO is empty. |
fsp_err_t R_CANFD_ModeTransition | ( | can_ctrl_t *const | p_api_ctrl, |
can_operation_mode_t | operation_mode, | ||
can_test_mode_t | test_mode | ||
) |
Switch to a different channel, global or test mode.
Example:
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_NOT_OPEN | Control block not open. |
FSP_ERR_ASSERTION | Null pointer presented |
FSP_ERR_INVALID_MODE | Cannot change to the requested mode from the current global mode. |
fsp_err_t R_CANFD_InfoGet | ( | can_ctrl_t *const | p_api_ctrl, |
can_info_t *const | p_info | ||
) |
Get CANFD state and status information for the channel.
FSP_SUCCESS | Operation succeeded. |
FSP_ERR_NOT_OPEN | Control block not open. |
FSP_ERR_ASSERTION | Null pointer presented |
fsp_err_t R_CANFD_CallbackSet | ( | can_ctrl_t *const | p_api_ctrl, |
void(*)(can_callback_args_t *) | p_callback, | ||
void const *const | p_context, | ||
can_callback_args_t *const | p_callback_memory | ||
) |
Updates the user callback with the option to provide memory for the callback argument structure. Implements can_api_t::callbackSet.
FSP_SUCCESS | Callback updated successfully. |
FSP_ERR_ASSERTION | A required pointer is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_NO_CALLBACK_MEMORY | p_callback is non-secure and p_callback_memory is either secure or NULL. |