Functions for CAN driver. More...
Functions for CAN driver.
| can_status_en can_init | ( | can_instance_en | id | ) |
Initialize a CAN instance and reset its software context.
| id | CAN controller identifier. |
| can_status_en can_configure | ( | can_instance_en | id, |
| const can_config_t * | config ) |
Configure driver-owned resources and controller runtime state.
| id | CAN controller identifier. |
| config | Optional runtime configuration, or NULL to reuse current defaults. |
| can_status_en can_deinit | ( | can_instance_en | id | ) |
Deinitialize a CAN instance and release driver-owned resources.
| id | CAN controller identifier. |
| can_status_en can_enable | ( | can_instance_en | id | ) |
Enable CAN controller operation.
| id | CAN controller identifier. |
| can_status_en can_disable | ( | can_instance_en | id | ) |
Disable CAN controller operation.
| id | CAN controller identifier. |
| can_status_en can_tx | ( | can_instance_en | id, |
| bool | high_priority, | ||
| const can_tx_frame_t * | frame, | ||
| const can_tx_schedule_time_t * | time, | ||
| can_tx_handler_t | callback, | ||
| void * | callback_param ) |
Queue a CAN or CAN FD frame for transmission.
| id | CAN controller identifier. |
| high_priority | true to use the high-priority TX FIFO, false to use the low-priority TX FIFO. |
| frame | Pointer to transmit frame descriptor. |
| time | Optional scheduled transmit timestamp, or NULL for immediate transmission. |
| callback | Optional completion callback. |
| callback_param | Application callback context. |
| can_status_en can_rx_subscribe | ( | can_instance_en | id, |
| const can_rx_filter_t * | filter, | ||
| can_rx_handler_t | callback, | ||
| void * | callback_param, | ||
| int * | subid ) |
Install an RX filter and subscribe a callback for matching frames.
| id | CAN controller identifier. |
| filter | Pointer to the RX filter definition. |
| callback | Callback invoked for matching received frames. |
| callback_param | Application callback context. |
| subid | Output subscription identifier on success. |
| can_status_en can_rx_unsubscribe | ( | can_instance_en | id, |
| int | sub_id ) |
Remove a previously installed RX subscription.
| id | CAN controller identifier. |
| sub_id | Subscription identifier returned by can_rx_subscribe. |
| can_status_en can_set_speed | ( | can_instance_en | id, |
| int | cl, | ||
| int | fd, | ||
| int | cl_sample, | ||
| int | fd_sample ) |
Update Classical CAN/CAN FD bitrates and sample points.
| id | CAN controller identifier. |
| cl | Classical CAN bitrate in bits per second. |
| fd | CAN FD bitrate in bits per second. |
| cl_sample | Classical CAN sample point percentage. |
| fd_sample | CAN FD sample point percentage. |
| can_status_en can_set_timestamp_sample_handler | ( | can_instance_en | id, |
| can_timestamp_handler_t | callback, | ||
| void * | callback_param ) |
Register a callback for sampled timestamp capture events.
| id | CAN controller identifier. |
| callback | Timestamp callback function. |
| callback_param | Application callback context. |
| can_status_en can_get_timestamp | ( | can_instance_en | id, |
| uint32_t * | ts_l, | ||
| uint32_t * | ts_h, | ||
| uint32_t * | ts_res_ns ) |
Read the current timestamp counter and its resolution.
| id | CAN controller identifier. |
| ts_l | Optional output pointer for the lower 32 bits of timestamp. |
| ts_h | Optional output pointer for the upper 32 bits of timestamp. |
| ts_res_ns | Optional output pointer for the timestamp resolution in nanoseconds. |
| can_status_en can_set_driver_buffer | ( | can_instance_en | id, |
| void * | buffer, | ||
| size_t | size ) |
Provide an externally allocated driver buffer block.
| id | CAN controller identifier. |
| buffer | Base address of a 32-byte aligned can_data_t storage block. The memory must be accessible by the CAN hardware and compatible with the platform cache-maintenance policy. |
| size | Size of the supplied storage block in bytes. |
| can_status_en can_enable_interrupt | ( | can_instance_en | id, |
| uint32_t | mask ) |
Enable selected hardware interrupt sources.
| id | CAN controller identifier. |
| mask | Interrupt mask composed from can_interrupt_en values. |
| can_status_en can_enable_all_interrupts | ( | can_instance_en | id | ) |
Enable all hardware interrupt sources.
| id | CAN controller identifier. |
| can_status_en can_disable_interrupt | ( | can_instance_en | id, |
| uint32_t | mask ) |
Disable selected hardware interrupt sources.
| id | CAN controller identifier. |
| mask | Interrupt mask composed from can_interrupt_en values. |
| can_status_en can_disable_all_interrupts | ( | can_instance_en | id | ) |
Disable all hardware interrupt sources.
| id | CAN controller identifier. |
| can_status_en can_clear_interrupt | ( | can_instance_en | id, |
| uint32_t | mask ) |
Clear selected pending hardware interrupt sources.
| id | CAN controller identifier. |
| mask | Interrupt mask composed from can_interrupt_en values. |
| can_status_en can_clear_all_interrupts | ( | can_instance_en | id | ) |
Clear all pending hardware interrupt sources.
| id | CAN controller identifier. |