feat(driver_twai): support rx frame timestamp for all chips

Closes https://github.com/espressif/esp-idf/issues/4527
This commit is contained in:
wanckl
2026-01-30 15:33:03 +08:00
committed by Wan Lei
parent 68a0fc64e5
commit e4753c8019
18 changed files with 246 additions and 55 deletions
@@ -168,6 +168,13 @@ Receiving messages inside the callback:
Similarly, since the driver uses pointers for message passing, you must configure the pointer :cpp:member:`twai_frame_t::buffer` and its memory length :cpp:member:`twai_frame_t::buffer_len` before receiving.
Frame Timestamp
---------------
The TWAI driver supports creating a 64-bit timestamp for each successfully received frame, enabling this feature by configuring the :cpp:member:`twai_onchip_node_config_t::timestamp_resolution_hz` field when creating the node. The timestamp is stored in the :cpp:member:`twai_frame_t::header::timestamp` field of the received frame.
The node time inherits from the system time, i.e. the time starts from the power-on of the chip, and is not affected by the stop/restart/BUS_OFF state during the node's lifetime.
Stopping and Deleting the Node
------------------------------