mikroSDK Reference Manual
drv_can.h File Reference

Go to the source code of this file.

Data Structures

struct  can_filter_config_t
 CAN filter init configuration structure. More...
 
struct  can_config_t
 CAN init configuration structure. More...
 
struct  can_t
 CAN driver context structure. More...
 
struct  can_message_t
 CAN driver message structure. More...
 
struct  can_transmit_message_struct
 CAN driver transmit message structure. More...
 
struct  can_receive_message_struct
 CAN driver receive message structure. More...
 

Enumerations

enum  can_err_t
 
enum  can_mode_t
 
enum  can_state_t
 
enum  can_frame_format_t
 
enum  can_frame_type_t
 
enum  can_filter_mode_t
 
enum  can_filter_scale_t
 
enum  can_filter_fifo_t
 
enum  can_filter_activation_t
 

Functions

void can_configure_default (can_config_t *config)
 Configure CAN Driver configuration structure. More...
 
void can_filter_configure_default (can_filter_config_t *filter_config)
 Configure CAN Driver filter configuration structure. More...
 
err_t can_open (can_t *obj, can_config_t *config)
 Open the CAN driver object. More...
 
err_t can_init (can_t *obj)
 Initialize CAN module. More...
 
err_t can_set_filter (can_t *obj, can_filter_config_t *filter_config)
 Initialize CAN module filter. More...
 
err_t can_set_frequency (can_t *obj, uint32_t frequency)
 Set CAN module frequency. More...
 
err_t can_get_frequency (can_t *obj)
 Get CAN module frequency. More...
 
err_t can_set_mode (can_t *obj, can_mode_t mode)
 Set CAN module mode. More...
 
err_t can_get_mode (can_t *obj)
 Get CAN module mode. More...
 
err_t can_transmit (can_t *obj, can_transmit_message_struct *transmit_message)
 Transmit data to the first free TX mailbox. More...
 
void can_transmission_stop (can_t *obj)
 Stop transmit operation. More...
 
err_t can_receive (can_t *obj, can_receive_message_struct *receive_message)
 Get data from the RX FIFO. More...
 
err_t can_close (can_t *obj)
 Close CAN driver object. More...
 

Enumeration Type Documentation

◆ can_err_t

enum can_err_t

Return values.

Enumerator
CAN_SUCCESS 

Success.

CAN_ERROR 

Error.

◆ can_mode_t

enum can_mode_t

CAN modes.

Enumerator
CAN_MODE_NORMAL 

Mode for normal operation.

CAN_MODE_LOOPBACK 

Mode for testing communication internally with sending TX data frames to other nodes.

CAN_MODE_DISABLE 

Mode for ignoring TX and RX data frames - ARM specific.

CAN_MODE_SILENT 

Mode for only receiving messages - ARM specific.

CAN_MODE_LOOPBACK_SILENT 

Mode for testing communication internally without sending TX data frames to other nodes.

CAN_MODE_LISTENONLY 

Mode for only receiving messages - NXP specific.

CAN_MODE_DOZE 

Mode for acknowledging system low-power mode.

CAN_MODE_STOP 

Mode for acknowledging system clock stop.

CAN_MODE_FREEZE 

Mode for ignoring TX and RX data frames - NXP specific.

CAN_MODE_LISTENALL 

Mode for receiving data frames without filter configs.

CAN_MODE_CONFIGURATION 

Mode for configuring CAN module.

◆ can_state_t

CAN states.

Enumerator
CAN_STATE_RESET 

Reset state of CAN.

CAN_STATE_READY 

Ready state of CAN.

CAN_STATE_LISTENING 

Listening state of CAN.

CAN_STATE_ERROR 

Error state of CAN.

◆ can_frame_format_t

CAN data frame formats.

Enumerator
CAN_FRAME_FORMAT_STANDARD_11BITS 

Standard format identifier.

CAN_FRAME_FORMAT_EXTENDED_29BITS 

Extended format identifier.

◆ can_frame_type_t

CAN data frame types

Enumerator
CAN_FRAME_TYPE_DATA 

Data frame.

CAN_FRAME_TYPE_RTR 

Remote frame.

◆ can_filter_mode_t

CAN filter mode.

Enumerator
CAN_FILTER_MODE_IDMASK 

Identifier mask mode.

CAN_FILTER_MODE_IDLIST 

Identifier list mode.

◆ can_filter_scale_t

CAN filter scale.

Enumerator
CAN_FILTER_SCALE_16BIT 

Two 16-bit filters.

CAN_FILTER_SCALE_32BIT 

One 32-bit filter.

◆ can_filter_fifo_t

CAN filter FIFO.

Enumerator
CAN_FILTER_FIFO0 

Filter mapped to FIFO0.

CAN_FILTER_FIFO1 

Filter mapped to FIFO1.

CAN_FILTER_FIFO2 

Filter mapped to FIFO2.

CAN_FILTER_FIFO3 

Filter mapped to FIFO3.

CAN_FILTER_FIFO4 

Filter mapped to FIFO4.

CAN_FILTER_FIFO5 

Filter mapped to FIFO5.

CAN_FILTER_FIFO6 

Filter mapped to FIFO6.

CAN_FILTER_FIFO7 

Filter mapped to FIFO7.

CAN_FILTER_FIFO8 

Filter mapped to FIFO8.

CAN_FILTER_FIFO9 

Filter mapped to FIFO9.

CAN_FILTER_FIFO10 

Filter mapped to FIFO10.

CAN_FILTER_FIFO11 

Filter mapped to FIFO11.

CAN_FILTER_FIFO12 

Filter mapped to FIFO12.

CAN_FILTER_FIFO13 

Filter mapped to FIFO13.

CAN_FILTER_FIFO14 

Filter mapped to FIFO14.

CAN_FILTER_FIFO15 

Filter mapped to FIFO15.

CAN_FILTER_FIFO16 

Filter mapped to FIFO16.

CAN_FILTER_FIFO17 

Filter mapped to FIFO17.

CAN_FILTER_FIFO18 

Filter mapped to FIFO18.

CAN_FILTER_FIFO19 

Filter mapped to FIFO19.

CAN_FILTER_FIFO20 

Filter mapped to FIFO20.

CAN_FILTER_FIFO21 

Filter mapped to FIFO21.

CAN_FILTER_FIFO22 

Filter mapped to FIFO22.

CAN_FILTER_FIFO23 

Filter mapped to FIFO23.

CAN_FILTER_FIFO24 

Filter mapped to FIFO24.

CAN_FILTER_FIFO25 

Filter mapped to FIFO25.

CAN_FILTER_FIFO26 

Filter mapped to FIFO26.

CAN_FILTER_FIFO27 

Filter mapped to FIFO27.

CAN_FILTER_FIFO28 

Filter mapped to FIFO28.

CAN_FILTER_FIFO29 

Filter mapped to FIFO29.

CAN_FILTER_FIFO30 

Filter mapped to FIFO30.

CAN_FILTER_FIFO31 

Filter mapped to FIFO31.

◆ can_filter_activation_t

CAN filter activation.

Enumerator
CAN_FILTER_DISABLE 

CAN filter disable.

CAN_FILTER_ENABLE 

CAN filter enable.