CAN interface for the AFBR-S50 Reference Board CAN application.
More...
|
void | CAN_Init (void) |
| Initializes the CAN API module.
|
|
void | CAN_Deinit (void) |
| Deinitializes the CAN module.
|
|
static void | CAN_AwaitIdle (void) |
|
static void | CAN_Write (can_frame_t *const tx_frame) |
|
void | CAN_Transmit1D (argus_results_t const *res) |
| Prints measurement results via CAN bus.
|
|
void | CAN_HandleCommand (void) |
| Handles incoming CAN commands by invoking the corresponding methods.
|
|
void | can_callback (can_callback_args_t *p_args) |
| CAN callback as defined in the "hal_data" module generated by the Renesas FSP Configuration.
|
|
CAN interface for the AFBR-S50 Reference Board CAN application.
A simple CAN interface to demonstrate the basic usage of the CAN bus that comes with the AFBR-S50 Reference Board.
◆ CAN_FRAME_TRANSMIT_DATA_BYTES
#define CAN_FRAME_TRANSMIT_DATA_BYTES (8U) |
Data length for TX frames.
◆ CAN_MAILBOX_ID_TRANSMIT
#define CAN_MAILBOX_ID_TRANSMIT CAN_MAILBOX_ID_0 |
◆ argus_can_frame_id_t
CAN Data Frame ID definition.
Enumerator |
---|
CAN_FRAME_ID_START | Remote Frame ID for starting measurements
|
CAN_FRAME_ID_STOP | Remote Frame ID for stopping measurements
|
CAN_FRAME_ID_1D | 1D Data Frame ID
|
◆ CAN_AwaitIdle()
static void CAN_AwaitIdle |
( |
void |
| ) |
|
|
static |
◆ can_callback()
void can_callback |
( |
can_callback_args_t * |
p_args | ) |
|
CAN callback as defined in the "hal_data" module generated by the Renesas FSP Configuration.
- Parameters
-
p_args | The callback arguments provided by HAL. |
◆ CAN_Deinit()
Deinitializes the CAN module.
◆ CAN_HandleCommand()
void CAN_HandleCommand |
( |
void |
| ) |
|
Handles incoming CAN commands by invoking the corresponding methods.
Checks the incomming data queue and handles/invokes commands accordingly.
Note that this function must be called from thread level (not from interrupt service routines) in order to be executed correctly.
◆ CAN_Init()
Initializes the CAN API module.
◆ CAN_Transmit1D()
Prints measurement results via CAN bus.
Prints 1D measurement data via CAN-bus as data frame with ID 28.
The following values are included in the CAN data frame payload:
- 0..2: 1D Range [mm] (24bit, unsigned, MSB first)
- 3..4: 1D Amplitude [LSB] (16-bit, unsigned, MSB first)
- 5: Signal Quality [%] (8-bit, 0%-100% )
- 6-7: Status (16-bit, signed, MSB first, see #status_t for details)
.
- Parameters
-
res | A pointer to the latest measurement results structure. |
◆ CAN_Write()
static void CAN_Write |
( |
can_frame_t *const |
tx_frame | ) |
|
|
static |
◆ can_rx_remote_id
volatile uint32_t can_rx_remote_id = 0 |
|
static |
CAN remote frame if received but not handled.
◆ is_can_tx_busy
volatile bool is_can_tx_busy = false |
|
static |
CAN transmission busy status.