Skip to content
Browse files

can: Add RX timestamp to zcan_frame

This commit introduces a timestamp for received CAN frames.
The timestamp is optional and can be activated via Kconfig.

Signed-off-by: Alexander Wachter <>
  • Loading branch information...
alexanderwachter authored and jukkar committed Jul 24, 2019
1 parent 01d11d5 commit 3febaad1d69b34f091d2f7d7cadd9d25ce24c224
Showing with 15 additions and 0 deletions.
  1. +8 −0 drivers/can/Kconfig
  2. +7 −0 include/drivers/can.h
@@ -42,6 +42,14 @@ config CAN_WORKQ_FRAMES_BUF_CNT
Number of frames in the buffer of a zcan_work.

bool "Enable receiving timestamps"
depends on CAN_STM32
This option enables a timestamp value of the CAN free running timer.
The value is incremented every bit time and starts when the controller
is initialized.

config CAN_0
bool "Enable CAN 0"
@@ -173,6 +173,13 @@ struct zcan_frame {
u8_t data[8];
u32_t data_32[2];
/** Timer value of the CAN free running timer.
* The timer is incremented every bit time and captured at the start
* of frame bit (SOF).
u16_t timestamp;
} __packed;


0 comments on commit 3febaad

Please sign in to comment.
You can’t perform that action at this time.