mikroSDK Reference Manual
can_config_t Struct Reference

CAN init configuration structure. More...

Data Fields

pin_name_t tx_pin
 
pin_name_t rx_pin
 
can_mode_t mode
 
uint32_t frequency
 

Detailed Description

User needs to specify values herein.

Note
Take into consideration that any value can be changed explicitly by the user.
Warning
The following example includes pins mapping. Take into consideration that different hardware might not have the same pins. Make sure to accommodate pin name based on your hardware specifics.

Example

// CAN driver configuration structure.
static can_config_t can_cfg;
// Fill structure with default values.
// Specify desired CAN TX pin.
can_cfg.tx_pin = CAN_TX;
// Specify desired CAN RX pin.
can_cfg.rx_pin = CAN_RX;

Field Documentation

◆ tx_pin

pin_name_t can_config_t::tx_pin

Tx pin.

◆ rx_pin

pin_name_t can_config_t::rx_pin

Rx pin.

◆ mode

can_mode_t can_config_t::mode

CAN mode.

◆ frequency

uint32_t can_config_t::frequency

CAN frequency.

can_configure_default
void can_configure_default(can_config_t *config)
Configure CAN Driver configuration structure.
can_config_t::rx_pin
pin_name_t rx_pin
Definition: drv_can.h:322
can_config_t
CAN init configuration structure.
Definition: drv_can.h:319
can_config_t::tx_pin
pin_name_t tx_pin
Definition: drv_can.h:321