diff --git a/drivers/can/Kconfig b/drivers/can/Kconfig index 7aeb91bec96..b2e9758fec8 100644 --- a/drivers/can/Kconfig +++ b/drivers/can/Kconfig @@ -42,6 +42,14 @@ config CAN_WORKQ_FRAMES_BUF_CNT help Number of frames in the buffer of a zcan_work. +config CAN_RX_TIMESTAMP + bool "Enable receiving timestamps" + depends on CAN_STM32 + help + 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" help diff --git a/include/drivers/can.h b/include/drivers/can.h index 7798a9b5e8c..7c527c20b66 100644 --- a/include/drivers/can.h +++ b/include/drivers/can.h @@ -173,6 +173,13 @@ struct zcan_frame { u8_t data[8]; u32_t data_32[2]; }; +#if defined(CONFIG_CAN_RX_TIMESTAMP) + /** 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; +#endif } __packed; /**