Lines Matching +full:sample +full:- +full:point +full:- +full:data

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:
39 * Phase_Seg1 and Phase_Seg2 :Define the sampling point. The bit is sampled at the end of Phase_Seg1.
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.
47 A bit is sampled at the sampling point.
48 The sample point is between Phase_Seg1 and PhaseSeg2 and therefore is a
50 The CiA recommends setting the sample point to 87.5% of the bit.
53 sample point can be moved.
54 The sample point is moved when resynchronization is needed.
56 The timing parameters (SJW, bitrate and sampling point, or bitrate, Prop_Seg,
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
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
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
121 The following code snippets show how to send data.
124 This basic sample sends a CAN frame with standard identifier 0x123 and eight
125 bytes of data. When passing NULL as the callback, as shown in this example,
130 .. code-block:: C
136 .data = {1,2,3,4,5,6,7,8}
148 two bytes of data. The provided callback is called when the message is sent, or
153 .. code-block:: C
172 frame.data[0] = 1;
173 frame.data[1] = 2;
185 :c:func:`can_add_rx_filter`. The user data argument is passed when the filter is
188 .. code-block:: C
203 .. code-block:: C
226 .. code-block:: C
251 .. code-block:: C
258 The bitrate and sampling point is initially set at runtime. To change it from
260 function can calculate timing from a bitrate and sampling point in permille.
261 The following example sets the bitrate to 250k baud with the sampling point at
264 .. code-block:: C
272 LOG_INF("Sample-Point error: %d", ret);
295 A similar API exists for calculating and setting the timing for the data phase for CAN FD capable
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>`.