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 <alexander.wachter@student.tugraz.at>
This commit is contained in:
parent
01d11d50d3
commit
3febaad1d6
2 changed files with 15 additions and 0 deletions
|
@ -42,6 +42,14 @@ config CAN_WORKQ_FRAMES_BUF_CNT
|
||||||
help
|
help
|
||||||
Number of frames in the buffer of a zcan_work.
|
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
|
config CAN_0
|
||||||
bool "Enable CAN 0"
|
bool "Enable CAN 0"
|
||||||
help
|
help
|
||||||
|
|
|
@ -173,6 +173,13 @@ struct zcan_frame {
|
||||||
u8_t data[8];
|
u8_t data[8];
|
||||||
u32_t data_32[2];
|
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;
|
} __packed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue