Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
zcan_frame Struct Reference

CAN frame structure. More...

#include <can.h>

Data Fields

uint32_t id: 29
 
uint32_t fd: 1
 
uint32_t rtr: 1
 
uint32_t id_type: 1
 
uint8_t dlc
 
uint8_t brs: 1
 
uint16_t timestamp
 
union {
   uint8_t   data [CAN_MAX_DLEN]
 
   uint32_t   data_32 [ceiling_fraction(CAN_MAX_DLEN,
       sizeof(uint32_t))]
 
}; 
 

Detailed Description

CAN frame structure.

Field Documentation

◆ 

union { ... } zcan_frame::@111

The frame payload data.

◆ brs

uint8_t zcan_frame::brs

Baud Rate Switch (BRS). Only valid for CAN-FD.

◆ data

uint8_t zcan_frame::data[CAN_MAX_DLEN]

◆ data_32

uint32_t zcan_frame::data_32[ceiling_fraction(CAN_MAX_DLEN, sizeof(uint32_t))]

◆ dlc

uint8_t zcan_frame::dlc

Data Length Code (DLC) indicating data length in bytes.

◆ fd

uint32_t zcan_frame::fd

Frame is in the CAN-FD frame format if set to true.

◆ id

uint32_t zcan_frame::id

Standard (11-bit) or extended (29-bit) CAN identifier.

◆ id_type

uint32_t zcan_frame::id_type

CAN identifier type (standard or extended). Use can_ide enum for assignment.

◆ rtr

uint32_t zcan_frame::rtr

Remote Transmission Request (RTR) flag. Use can_rtr enum for assignment.

◆ timestamp

uint16_t zcan_frame::timestamp

Captured value of the free-running timer in the CAN controller when this frame was received. The timer is incremented every bit time and captured at the start of frame bit (SOF).

Note
embed:rst:inline :kconfig:`CONFIG_CAN_RX_TIMESTAMP` 
must be selected for this field to be available.

The documentation for this struct was generated from the following file: