CAN stack common definitions. More...

Detailed Description

CAN stack common definitions.

This module defines the common part of the CAN stack, including structures and messages.

Files

file  common.h
 Definitions of high-level CAN interface.
 

Data Structures

struct  can_opt_t
 Structure to pass a CAN option. More...
 
struct  can_rx_data
 Received data structure. More...
 
struct  can_reg_entry
 registry entry More...
 

Typedefs

typedef struct can_rx_data can_rx_data_t
 Received data structure. More...
 
typedef struct can_reg_entry can_reg_entry_t
 registry entry More...
 

Enumerations

enum  canopt_t {
  CANOPT_BITTIMING, CANOPT_RX_FILTERS, CANOPT_TEC, CANOPT_REC,
  CANOPT_LEC, CANOPT_CLOCK, CANOPT_BITTIMING_CONST, CANOPT_STATE
}
 CAN options. More...
 
enum  canopt_state_t { CANOPT_STATE_OFF, CANOPT_STATE_SLEEP, CANOPT_STATE_LISTEN_ONLY, CANOPT_STATE_ON }
 CAN state options. More...
 
enum  can_msg {
  CAN_MSG_ACK = 0x100, CAN_MSG_SEND_FRAME, CAN_MSG_ABORT_FRAME, CAN_MSG_SET,
  CAN_MSG_GET, CAN_MSG_SET_FILTER, CAN_MSG_REMOVE_FILTER, CAN_MSG_POWER_UP,
  CAN_MSG_POWER_DOWN, CAN_MSG_SET_TRX, CAN_MSG_EVENT = 0x200, CAN_MSG_WAKE_UP,
  CAN_MSG_TX_CONFIRMATION, CAN_MSG_RX_INDICATION, CAN_MSG_TX_ERROR, CAN_MSG_RX_ERROR,
  CAN_MSG_BUS_OFF, CAN_MSG_ERROR_PASSIVE, CAN_MSG_ERROR_WARNING, CAN_MSG_PM,
  CAN_MSG_ISOTP_RX_TIMEOUT = 0x400, CAN_MSG_ISOTP_TX_TIMEOUT
}
 Messages which can be sent through the CAN stack. More...
 
enum  can_reg_type_t { CAN_TYPE_DEFAULT = 0, CAN_TYPE_MBOX }
 registry entry types More...
 

Typedef Documentation

◆ can_reg_entry_t

registry entry

This structure is used through the stack to describe how to contact the upper layer and which CAN interface to use

◆ can_rx_data_t

typedef struct can_rx_data can_rx_data_t

Received data structure.

This structure is used when a layer sends received data to the upper layer

Enumeration Type Documentation

◆ can_msg

enum can_msg

Messages which can be sent through the CAN stack.

Enumerator
CAN_MSG_ACK 

acknowledgment

CAN_MSG_SEND_FRAME 

send a frame

CAN_MSG_ABORT_FRAME 

abort a frame

CAN_MSG_SET 

set an option

CAN_MSG_GET 

get an option

CAN_MSG_SET_FILTER 

set a filter

CAN_MSG_REMOVE_FILTER 

remove a filter

CAN_MSG_POWER_UP 

power up

CAN_MSG_POWER_DOWN 

power down

CAN_MSG_SET_TRX 

set a transceiver

CAN_MSG_EVENT 

driver event

CAN_MSG_WAKE_UP 

driver has been woken up by bus

CAN_MSG_TX_CONFIRMATION 

a frame has been sent

CAN_MSG_RX_INDICATION 

a frame has been received

CAN_MSG_TX_ERROR 

there was an error when transmitting

CAN_MSG_RX_ERROR 

there was an error when receiving

CAN_MSG_BUS_OFF 

bus-off detected

CAN_MSG_ERROR_PASSIVE 

driver switched in error passive

CAN_MSG_ERROR_WARNING 

driver reached error warning

CAN_MSG_PM 

power management event

CAN_MSG_ISOTP_RX_TIMEOUT 

isotp rx timeout

CAN_MSG_ISOTP_TX_TIMEOUT 

isotp tx timeout

Definition at line 82 of file common.h.

◆ can_reg_type_t

registry entry types

Enumerator
CAN_TYPE_DEFAULT 

default entry (use msg)

CAN_TYPE_MBOX 

mbox entry

Definition at line 130 of file common.h.

◆ canopt_state_t

CAN state options.

CAN state options to be used with CANOPT_STATE

Enumerator
CANOPT_STATE_OFF 

powered off

CANOPT_STATE_SLEEP 

sleep mode

CANOPT_STATE_LISTEN_ONLY 

listen only mode

CANOPT_STATE_ON 

power on, rx / tx mode

Definition at line 61 of file common.h.

◆ canopt_t

enum canopt_t

CAN options.

Enumerator
CANOPT_BITTIMING 

bit timing parameter

CANOPT_RX_FILTERS 

rx filters

CANOPT_TEC 

Transmit Error Counter.

CANOPT_REC 

Receive Error Counter.

CANOPT_LEC 

Last Error Code.

CANOPT_CLOCK 

controller main clock

CANOPT_BITTIMING_CONST 

controller bittiming parameters

CANOPT_STATE 

set controller state canopt_state_t

Definition at line 45 of file common.h.