Lines Matching +full:frame +full:- +full:delay
13 Controller Area Network is a two-wire serial bus specified by the
14 Bosch CAN Specification, Bosch CAN with Flexible Data-Rate specification and the
15 ISO 11898-1:2003 standard.
26 The bit-timing as defined in ISO 11898-1:2003 looks as following:
37 * Prop_Seg: The signal propagation delay of the bus and other delays of the transceiver and node.
41 The bit-rate is calculated from the time of a time quantum and the values
45 The bit-rate is the inverse of the length of a single bit.
57 Phase_Seg1and Phase_Seg2) are initially set from the device-tree and can be
58 changed at run-time from the timing-API.
60 CAN uses so-called identifiers to identify the frame instead of addresses to
62 This identifier can either have 11-bit width (Standard or Basic Frame) or
63 29-bit in case of an Extended Frame. The Zephyr CAN API supports both Standard
64 and Extended identifiers concurrently. A CAN frame starts with a dominant
65 Start Of Frame bit. After that, the identifiers follow. This phase is called the
83 Errors may occur during transmission. In case a node detects an erroneous frame,
84 it partially overrides the current frame with an error-frame.
85 Error-frames can either be error passive or error active, depending on the state
89 detect. The sender may resend the frame right after.
93 * Error-active
94 * Error-passive
95 * Bus-off
97 After initialization, the node is in the error-active state. In this state, the
99 Every node has a receive- and transmit-error counter.
100 If either the receive- or the transmit-error counter exceeds 127,
101 the node changes to error-passive state.
102 In this state, the node is not allowed to send error-active frames anymore.
103 If the transmit-error counter increases further to 255, the node changes to the
104 bus-off state. In this state, the node is not allowed to send any dominant bits
105 to the bus. Nodes in the bus-off state may recover after receiving 128
124 This basic sample sends a CAN frame with standard identifier 0x123 and eight
126 the send function blocks until the frame is sent and acknowledged by at least
130 .. code-block:: C
132 struct can_frame frame = {
141 ret = can_send(can_dev, &frame, K_MSEC(100), NULL, NULL);
147 This example shows how to send a frame with extended identifier 0x1234567 and
150 function to block until a transfer mailbox is assigned to the frame or an error
153 .. code-block:: C
166 struct can_frame frame = {
172 frame.data[0] = 1;
173 frame.data[1] = 2;
175 return can_send(can_dev, &frame, K_FOREVER, tx_callback, "Sender 1");
188 .. code-block:: C
190 void rx_callback_function(const struct device *dev, struct can_frame *frame, void *user_data)
192 ... do something with the frame ...
203 .. code-block:: C
226 .. code-block:: C
246 ... do something with the frame ...
251 .. code-block:: C
264 .. code-block:: C
272 LOG_INF("Sample-Point error: %d", ret);
303 SocketCAN brings the convenience of the well-known BSD Socket API to
305 implementation, where many other high-level CAN projects build on top.
312 We have two ready-to-build samples demonstrating use of the Zephyr CAN API:
313 :zephyr:code-sample:`Zephyr CAN counter sample <can-counter>` and
314 :zephyr:code-sample:`SocketCAN sample <socket-can>`.