ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
canopen.h
Go to the documentation of this file.
1// ProtoCore v1.0.16 - Copyright (C) 2026 Douglas Quigg (dstroy0) <dquigg123@gmail.com>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4/**
5 * @file canopen.h
6 * @brief CANopen (CiA 301) application-layer message codec (PROTOCORE_ENABLE_CANOPEN).
7 *
8 * A pure, zero-heap builder + parser for the CANopen messaging set carried over classic
9 * CAN frames (see shared/can/can.h): NMT node control, SYNC, TIME, the
10 * heartbeat / boot-up (NMT error control), EMCY, PDO (process data), and expedited SDO
11 * (service data object) read / write / abort. The 11-bit CAN identifier is a 4-bit
12 * function code plus a 7-bit node id. Each builder computes the right COB-ID and each
13 * parser classifies a received frame back to its function + node.
14 *
15 * Scope: the CANopen object dictionary itself is the application's; this is the wire codec.
16 * SDO transfers cover expedited (<= 4 octets) and segmented (CiA 301 §7.2.4.3, larger objects via a
17 * toggling run of 7-octet segments); block SDO is not covered.
18 *
19 * Bridging: pair with the ESP32's TWAI peripheral (or an MCP2515 over SPI) to bridge a
20 * CANopen field bus onto Wi-Fi - expose node state / PDOs over HTTP, MQTT, or a WebSocket.
21 *
22 * @author Douglas Quigg (dstroy0)
23 * @date 2026
24 */
25
26#ifndef PROTOCORE_CANOPEN_H
27#define PROTOCORE_CANOPEN_H
28
29#include "protocore_config.h" // the entry point: protocore_types.h for the widths
30
31#if PROTOCORE_ENABLE_CANOPEN
32
33EMBED_BEGIN_DECLS
34
35// This module holds nothing between calls, so it carves no borrow and states none. An entry
36// takes one all the same, and never reads it, so every namespace in the tree is invoked the
37// same way.
38
39// Function-code COB-ID bases. The 11-bit id is (function-code | node-id); the node id is
40// 1..127 (0 = broadcast for NMT / SYNC / TIME). EMCY shares 0x080 with SYNC: SYNC is the
41// node-id == 0 case, EMCY is 0x081..0x0FF.
42#define CANOPEN_COB_NMT 0x000u ///< NMT node control (broadcast), 2 data octets
43#define CANOPEN_COB_SYNC 0x080u ///< SYNC (broadcast), 0 data octets
44#define CANOPEN_COB_EMCY 0x080u ///< EMCY base (+ node id)
45#define CANOPEN_COB_TIME 0x100u ///< TIME stamp (broadcast)
46#define CANOPEN_COB_TPDO1 0x180u ///< transmit PDO 1 base (+ node id)
47#define CANOPEN_COB_RPDO1 0x200u ///< receive PDO 1 base (+ node id)
48#define CANOPEN_COB_TPDO2 0x280u ///< transmit PDO 2 base
49#define CANOPEN_COB_RPDO2 0x300u ///< receive PDO 2 base
50#define CANOPEN_COB_TPDO3 0x380u ///< transmit PDO 3 base
51#define CANOPEN_COB_RPDO3 0x400u ///< receive PDO 3 base
52#define CANOPEN_COB_TPDO4 0x480u ///< transmit PDO 4 base
53#define CANOPEN_COB_RPDO4 0x500u ///< receive PDO 4 base
54#define CANOPEN_COB_SDO_TX 0x580u ///< SDO server -> client (response), + node id
55#define CANOPEN_COB_SDO_RX 0x600u ///< SDO client -> server (request), + node id
56#define CANOPEN_COB_HEARTBEAT 0x700u ///< NMT error control (heartbeat / boot-up), + node id
57#define CANOPEN_FUNC_MASK 0x780u ///< top 4 bits select the function code
58#define CANOPEN_NODE_MASK 0x07Fu ///< low 7 bits select the node id
59
60// NMT node-control commands (CANOPEN_COB_NMT data[0]).
61#define CANOPEN_NMT_START 0x01u ///< enter Operational
62#define CANOPEN_NMT_STOP 0x02u ///< enter Stopped
63#define CANOPEN_NMT_PRE_OP 0x80u ///< enter Pre-operational
64#define CANOPEN_NMT_RESET_NODE 0x81u ///< reset application
65#define CANOPEN_NMT_RESET_COMM 0x82u ///< reset communication
66
67// NMT states reported in a heartbeat (data[0], low 7 bits).
68#define CANOPEN_STATE_BOOTUP 0x00u
69#define CANOPEN_STATE_STOPPED 0x04u
70#define CANOPEN_STATE_OPERATIONAL 0x05u
71#define CANOPEN_STATE_PRE_OP 0x7Fu
72
73// SDO command specifier (high 3 bits of data[0]).
74#define CANOPEN_SDO_CCS_DOWNLOAD 1u ///< client download initiate (write)
75#define CANOPEN_SDO_CCS_UPLOAD 2u ///< client upload initiate (read)
76#define CANOPEN_SDO_SCS_UPLOAD 2u ///< server upload initiate response
77#define CANOPEN_SDO_SCS_DOWNLOAD 3u ///< server download initiate response (ack)
78#define CANOPEN_SDO_ABORT 4u ///< abort transfer (either direction)
79
80// A few common SDO abort codes (the field is any 32-bit value).
81#define CANOPEN_ABORT_TOGGLE 0x05030000u ///< toggle bit not alternated
82#define CANOPEN_ABORT_TIMEOUT 0x05040000u ///< SDO protocol timed out
83#define CANOPEN_ABORT_NO_OBJECT 0x06020000u ///< object does not exist
84#define CANOPEN_ABORT_NO_SUBINDEX 0x06090011u ///< sub-index does not exist
85#define CANOPEN_ABORT_GENERAL 0x08000000u ///< general error
86
87/** @brief Octets in a TIME message (CiA 301 TIME_OF_DAY: 4-octet ms + 2-octet days). */
88#define CANOPEN_TIME_LEN 6
89
90/** @brief The ms-after-midnight field is 28 bits; the top 4 bits of the U32 are reserved. */
91#define CANOPEN_TIME_MS_MASK 0x0FFFFFFFu
92
93/** @brief Octets of object data a single SDO segment carries. */
94#define CANOPEN_SDO_SEG_DATA 7
95
96/** @brief CANopen message classes (the function decoded from the COB-ID). */
97EMBED_ENUM_BYTE(CanopenType, CANOPEN_T_UNKNOWN = 0, CANOPEN_T_NMT, CANOPEN_T_SYNC, CANOPEN_T_EMCY, CANOPEN_T_TIME,
98 CANOPEN_T_TPDO, CANOPEN_T_RPDO, CANOPEN_T_SDO_TX, CANOPEN_T_SDO_RX, CANOPEN_T_HEARTBEAT, );
99
100/** @brief A classified CANopen frame (the function code + node, from protocore_canopen_parse). */
101typedef struct
102{
103 CanopenType type;
104 uint8_t node_id; ///< 1..127, or 0 for a broadcast (NMT / SYNC / TIME)
105 uint8_t pdo_num; ///< 1..4 for TPDO / RPDO, else 0
106} CanopenMsg;
107
108/** @brief A decoded SDO initiate response (from protocore_canopen_parse_sdo_response). */
109typedef struct
110{
111 uint16_t index; ///< object index echoed by the server
112 uint8_t sub; ///< sub-index echoed by the server
113 embed_bool is_abort; ///< true => the server aborted the transfer
114 uint32_t abort_code; ///< valid when is_abort
115 embed_bool is_upload; ///< true => upload (read) response; false => download (write) ack
116 embed_bool expedited; ///< true => the payload is inline in data[0..len-1]
117 uint8_t data[4]; ///< expedited upload payload
118 uint8_t len; ///< expedited payload length 0..4
119} CanopenSdoResponse;
120
121/** @brief Decoded CANopen TIME_OF_DAY (the TIME message payload, CiA 301 §7.2.6). The CANopen epoch is
122 * January 1, 1984, so @c days_since_1984 plus @c ms_since_midnight locate an absolute instant. */
123typedef struct
124{
125 uint32_t ms_since_midnight; ///< milliseconds after midnight (28-bit; 0..86'399'999)
126 uint16_t days_since_1984; ///< days since January 1, 1984
127} CanopenTime;
128
129/** @brief Segmented-upload reassembly state (accumulates segment data into a caller buffer). */
130typedef struct
131{
132 uint8_t *buf; ///< caller-provided accumulation buffer
133 size_t cap; ///< its capacity
134 size_t len; ///< octets accumulated so far
135 embed_bool expect_toggle; ///< the toggle the next segment must carry (starts false)
136 embed_bool done; ///< set once the last segment is accepted
137} CanopenSdoReasm;
138
139#include "shared/can/can.h" // CanFrame: the type a parameter points at
140
141/** @brief What build_nmt takes: out, command, node_id. */
142typedef struct
143{
144 CanFrame *out;
145 uint8_t command;
146 uint8_t node_id;
147} CanopenBuildNmtArgs;
148
149/** @brief What build_sync takes: out. */
150typedef struct
151{
152 CanFrame *out;
153} CanopenBuildSyncArgs;
154
155/** @brief What build_time takes: out, ms_since_midnight, ... */
156typedef struct
157{
158 CanFrame *out;
159 uint32_t ms_since_midnight;
160 uint16_t days_since_1984;
161} CanopenBuildTimeArgs;
162
163/** @brief What build_heartbeat takes: out, node_id, state. */
164typedef struct
165{
166 CanFrame *out;
167 uint8_t node_id;
168 uint8_t state;
169} CanopenBuildHeartbeatArgs;
170
171/** @brief What build_emcy takes: out, node_id, error_code, error_reg, ... */
172typedef struct
173{
174 CanFrame *out;
175 uint8_t node_id;
176 uint16_t error_code;
177 uint8_t error_reg;
178 const uint8_t *msef; ///< 5 bytes.
179} CanopenBuildEmcyArgs;
180
181/** @brief What build_tpdo takes: out, pdo_num, node_id, data, len. */
182typedef struct
183{
184 CanFrame *out;
185 uint8_t pdo_num;
186 uint8_t node_id;
187 const uint8_t *data;
188 uint8_t len;
189} CanopenBuildTpdoArgs;
190
191/** @brief What build_rpdo takes: out, pdo_num, node_id, data, len. */
192typedef struct
193{
194 CanFrame *out;
195 uint8_t pdo_num;
196 uint8_t node_id;
197 const uint8_t *data;
198 uint8_t len;
199} CanopenBuildRpdoArgs;
200
201/** @brief What build_sdo_read takes: out, node_id, index, sub. */
202typedef struct
203{
204 CanFrame *out;
205 uint8_t node_id;
206 uint16_t index;
207 uint8_t sub;
208} CanopenBuildSdoReadArgs;
209
210/** @brief What build_sdo_write takes: out, node_id, index, sub, data, ... */
211typedef struct
212{
213 CanFrame *out;
214 uint8_t node_id;
215 uint16_t index;
216 uint8_t sub;
217 const uint8_t *data;
218 uint8_t len;
219} CanopenBuildSdoWriteArgs;
220
221/** @brief What build_sdo_abort takes: out, node_id, index, sub, ... */
222typedef struct
223{
224 CanFrame *out;
225 uint8_t node_id;
226 uint16_t index;
227 uint8_t sub;
228 uint32_t abort_code;
229 embed_bool to_server;
230} CanopenBuildSdoAbortArgs;
231
232/** @brief What parse takes: f, out. */
233typedef struct
234{
235 const CanFrame *f;
236 CanopenMsg *out;
237} CanopenParseArgs;
238
239/** @brief What parse_emcy takes: f, node_id, error_code, error_reg, ... */
240typedef struct
241{
242 const CanFrame *f;
243 uint8_t *node_id;
244 uint16_t *error_code;
245 uint8_t *error_reg;
246 uint8_t *msef; ///< 5 bytes.
247} CanopenParseEmcyArgs;
248
249/** @brief What parse_heartbeat takes: f, node_id, state. */
250typedef struct
251{
252 const CanFrame *f;
253 uint8_t *node_id;
254 uint8_t *state;
255} CanopenParseHeartbeatArgs;
256
257/** @brief What parse_time takes: f, out. */
258typedef struct
259{
260 const CanFrame *f;
261 CanopenTime *out;
262} CanopenParseTimeArgs;
263
264/** @brief What parse_sdo_response takes: f, out. */
265typedef struct
266{
267 const CanFrame *f;
268 CanopenSdoResponse *out;
269} CanopenParseSdoResponseArgs;
270
271/** @brief What build_sdo_download_init takes: out, node_id, index, ... */
272typedef struct
273{
274 CanFrame *out;
275 uint8_t node_id;
276 uint16_t index;
277 uint8_t sub;
278 uint32_t total_size;
279} CanopenBuildSdoDownloadInitArgs;
280
281/** @brief What build_sdo_download_segment takes: out, node_id, ... */
282typedef struct
283{
284 CanFrame *out;
285 uint8_t node_id;
286 embed_bool toggle; ///< the toggle bit for this segment (0 for the first, then alternating)
287 const uint8_t *data;
288 uint8_t len;
289 embed_bool last; ///< true on the final segment
290} CanopenBuildSdoDownloadSegmentArgs;
291
292/** @brief What build_sdo_upload_segment_req takes: out, node_id, ... */
293typedef struct
294{
295 CanFrame *out;
296 uint8_t node_id;
297 embed_bool toggle;
298} CanopenBuildSdoUploadSegmentReqArgs;
299
300/** @brief What parse_sdo_segment takes: f, toggle, data, len, last. */
301typedef struct
302{
303 const CanFrame *f;
304 embed_bool *toggle;
305 uint8_t *data;
306 uint8_t *len;
307 embed_bool *last;
308} CanopenParseSdoSegmentArgs;
309
310/** @brief What sdo_reasm_init takes: r, buf, cap. */
311typedef struct
312{
313 CanopenSdoReasm *r;
314 uint8_t *buf;
315 size_t cap;
316} CanopenSdoReasmInitArgs;
317
318/** @brief What sdo_reasm_feed takes: r, data, len, toggle, last. */
319typedef struct
320{
321 CanopenSdoReasm *r;
322 const uint8_t *data;
323 uint8_t len;
324 embed_bool toggle;
325 embed_bool last;
326} CanopenSdoReasmFeedArgs;
327
328/**
329 * @brief CANopen (CiA 301) application-layer message codec (PROTOCORE_ENABLE_CANOPEN).
330 *
331 * A caller sets the members a call takes, invokes it through ::Canopen with the bytes it runs
332 * out of, and reads the outcome off the same handle.
333 *
334 * Canopen.build_nmt_args.out = ...;
335 * Canopen.build_nmt_args.command = ...;
336 * Canopen.build_nmt_args.node_id = ...;
337 * Canopen.build_nmt(work);
338 * // Canopen.ok is what the call reports
339 *
340 * @var CanopenNs::build_nmt_args what build_nmt takes: out, command, node_id
341 * @var CanopenNs::build_sync_args what build_sync takes: out
342 * @var CanopenNs::build_time_args what build_time takes: out, ms_since_midnight,
343 * @var CanopenNs::build_heartbeat_args what build_heartbeat takes: out, node_id, state
344 * @var CanopenNs::build_emcy_args what build_emcy takes: out, node_id, error_code, error_reg,
345 * @var CanopenNs::build_tpdo_args what build_tpdo takes: out, pdo_num, node_id, data, len
346 * @var CanopenNs::build_rpdo_args what build_rpdo takes: out, pdo_num, node_id, data, len
347 * @var CanopenNs::build_sdo_read_args what build_sdo_read takes: out, node_id, index, sub
348 * @var CanopenNs::build_sdo_write_args what build_sdo_write takes: out, node_id, index, sub, data,
349 * @var CanopenNs::build_sdo_abort_args what build_sdo_abort takes: out, node_id, index, sub,
350 * @var CanopenNs::parse_args what parse takes: f, out
351 * @var CanopenNs::parse_emcy_args what parse_emcy takes: f, node_id, error_code, error_reg,
352 * @var CanopenNs::parse_heartbeat_args what parse_heartbeat takes: f, node_id, state
353 * @var CanopenNs::parse_time_args what parse_time takes: f, out
354 * @var CanopenNs::parse_sdo_response_args what parse_sdo_response takes: f, out
355 * @var CanopenNs::build_sdo_download_init_args what build_sdo_download_init takes: out, node_id, index,
356 * @var CanopenNs::build_sdo_download_segment_args what build_sdo_download_segment takes: out, node_id,
357 * @var CanopenNs::build_sdo_upload_segment_req_args what build_sdo_upload_segment_req takes: out, node_id,
358 * @var CanopenNs::parse_sdo_segment_args what parse_sdo_segment takes: f, toggle, data, len, last
359 * @var CanopenNs::sdo_reasm_init_args what sdo_reasm_init takes: r, buf, cap
360 * @var CanopenNs::sdo_reasm_feed_args what sdo_reasm_feed takes: r, data, len, toggle, last
361 * @var CanopenNs::ok true iff f is an 8-octet frame whose command specifier is the ...
362 * @var CanopenNs::build_nmt NMT node-control frame. node_id 0 addresses all nodes
363 * @var CanopenNs::build_sync SYNC frame (zero-length, broadcast)
364 * @var CanopenNs::build_time TIME frame (broadcast): the TIME_OF_DAY (ms_since_midnight masked ...
365 * @var CanopenNs::build_heartbeat heartbeat / boot-up frame for node_id reporting state
366 * @var CanopenNs::build_emcy emergency (EMCY) frame: 16-bit error code (LE), error register, 5 ...
367 * @var CanopenNs::build_tpdo Transmit-PDO frame (pdo_num 1..4): up to 8 raw mapped octets
368 * @var CanopenNs::build_rpdo Receive-PDO frame (pdo_num 1..4): up to 8 raw mapped octets
369 * @var CanopenNs::build_sdo_read SDO expedited upload (read) request for object index / sub on ...
370 * @var CanopenNs::build_sdo_write SDO expedited download (write) of len (1..4) octets to index / sub
371 * @var CanopenNs::build_sdo_abort SDO abort frame. to_server true => client->server (0x600), false => ...
372 * @var CanopenNs::parse classify any frame by COB-ID into its CANopen function + node
373 * @var CanopenNs::parse_emcy decode an EMCY frame (must be a 0x080+node, 8-octet frame)
374 * @var CanopenNs::parse_heartbeat decode a heartbeat frame (0x700+node, 1 octet)
375 * @var CanopenNs::parse_time decode a TIME frame (0x100, 6 octets) into out. true iff f is the ...
376 * @var CanopenNs::parse_sdo_response decode an SDO server response (0x580+node): upload data, download ...
377 * @var CanopenNs::build_sdo_download_init build a segmented SDO download (write) initiate: names the object ...
378 * @var CanopenNs::build_sdo_download_segment build a segmented SDO download segment carrying len (1..7) octets ...
379 * @var CanopenNs::build_sdo_upload_segment_req build a segmented SDO upload segment request (client asks the ...
380 * @var CanopenNs::parse_sdo_segment decode an SDO segment frame (either direction) into its toggle, ...
381 * @var CanopenNs::sdo_reasm_init begin a segmented-upload reassembly with a caller-owned buffer
382 * @var CanopenNs::sdo_reasm_feed feed one decoded upload segment into the reassembler (append len ...
383 *
384 * @c work is bytes the CALLER holds. This module reads none of them: it carries nothing
385 * between calls, so there is no state to keep and nothing to wipe. The parameter is there so
386 * a caller drives every namespace the same way.
387 */
388typedef struct
389{
390 CanopenBuildNmtArgs build_nmt_args;
391 CanopenBuildSyncArgs build_sync_args;
392 CanopenBuildTimeArgs build_time_args;
393 CanopenBuildHeartbeatArgs build_heartbeat_args;
394 CanopenBuildEmcyArgs build_emcy_args;
395 CanopenBuildTpdoArgs build_tpdo_args;
396 CanopenBuildRpdoArgs build_rpdo_args;
397 CanopenBuildSdoReadArgs build_sdo_read_args;
398 CanopenBuildSdoWriteArgs build_sdo_write_args;
399 CanopenBuildSdoAbortArgs build_sdo_abort_args;
400 CanopenParseArgs parse_args;
401 CanopenParseEmcyArgs parse_emcy_args;
402 CanopenParseHeartbeatArgs parse_heartbeat_args;
403 CanopenParseTimeArgs parse_time_args;
404 CanopenParseSdoResponseArgs parse_sdo_response_args;
405 CanopenBuildSdoDownloadInitArgs build_sdo_download_init_args;
406 CanopenBuildSdoDownloadSegmentArgs build_sdo_download_segment_args;
407 CanopenBuildSdoUploadSegmentReqArgs build_sdo_upload_segment_req_args;
408 CanopenParseSdoSegmentArgs parse_sdo_segment_args;
409 CanopenSdoReasmInitArgs sdo_reasm_init_args;
410 CanopenSdoReasmFeedArgs sdo_reasm_feed_args;
411 embed_bool ok;
412} CanopenVars;
413
414/** @brief The operands and the outcome. */
415extern CanopenVars CanopenV;
416
417/** @brief The entries. */
418typedef struct
419{
420 void (*const build_nmt)(const uint8_t *work);
421 void (*const build_sync)(const uint8_t *work);
422 void (*const build_time)(const uint8_t *work);
423 void (*const build_heartbeat)(const uint8_t *work);
424 void (*const build_emcy)(const uint8_t *work);
425 void (*const build_tpdo)(const uint8_t *work);
426 void (*const build_rpdo)(const uint8_t *work);
427 void (*const build_sdo_read)(const uint8_t *work);
428 void (*const build_sdo_write)(const uint8_t *work);
429 void (*const build_sdo_abort)(const uint8_t *work);
430 void (*const parse)(const uint8_t *work);
431 void (*const parse_emcy)(const uint8_t *work);
432 void (*const parse_heartbeat)(const uint8_t *work);
433 void (*const parse_time)(const uint8_t *work);
434 void (*const parse_sdo_response)(const uint8_t *work);
435 void (*const build_sdo_download_init)(const uint8_t *work);
436 void (*const build_sdo_download_segment)(const uint8_t *work);
437 void (*const build_sdo_upload_segment_req)(const uint8_t *work);
438 void (*const parse_sdo_segment)(const uint8_t *work);
439 void (*const sdo_reasm_init)(const uint8_t *work);
440 void (*const sdo_reasm_feed)(const uint8_t *work);
441} CanopenNs;
442
443// What the table binds, defined once in the .c and taking one parameter each: everything
444// else an entry needs is an operand in CanopenV or a region of the borrow at a fixed offset.
445void protocore_canopen_build_nmt(const uint8_t *work);
446void protocore_canopen_build_sync(const uint8_t *work);
447void protocore_canopen_build_time(const uint8_t *work);
448void protocore_canopen_build_heartbeat(const uint8_t *work);
449void protocore_canopen_build_emcy(const uint8_t *work);
450void protocore_canopen_build_tpdo(const uint8_t *work);
451void protocore_canopen_build_rpdo(const uint8_t *work);
452void protocore_canopen_build_sdo_read(const uint8_t *work);
453void protocore_canopen_build_sdo_write(const uint8_t *work);
454void protocore_canopen_build_sdo_abort(const uint8_t *work);
455void protocore_canopen_parse(const uint8_t *work);
456void protocore_canopen_parse_emcy(const uint8_t *work);
457void protocore_canopen_parse_heartbeat(const uint8_t *work);
458void protocore_canopen_parse_time(const uint8_t *work);
459void protocore_canopen_parse_sdo_response(const uint8_t *work);
460void protocore_canopen_build_sdo_download_init(const uint8_t *work);
461void protocore_canopen_build_sdo_download_segment(const uint8_t *work);
462void protocore_canopen_build_sdo_upload_segment_req(const uint8_t *work);
463void protocore_canopen_parse_sdo_segment(const uint8_t *work);
464void protocore_canopen_sdo_reasm_init(const uint8_t *work);
465void protocore_canopen_sdo_reasm_feed(const uint8_t *work);
466
467// `static const`, initialised HERE rather than `extern` against a definition in the .c: a
468// const object whose initializer every translation unit can see is a COMPILE-TIME FACT, so
469// `Canopen.build_nmt(work)` resolves to a named function and becomes a DIRECT call. An extern table
470// leaves the call indirect and the symbol live at every level, -O2 -flto included.
471static const CanopenNs Canopen __attribute__((unused)) = {
472 .build_nmt = protocore_canopen_build_nmt,
473 .build_sync = protocore_canopen_build_sync,
474 .build_time = protocore_canopen_build_time,
475 .build_heartbeat = protocore_canopen_build_heartbeat,
476 .build_emcy = protocore_canopen_build_emcy,
477 .build_tpdo = protocore_canopen_build_tpdo,
478 .build_rpdo = protocore_canopen_build_rpdo,
479 .build_sdo_read = protocore_canopen_build_sdo_read,
480 .build_sdo_write = protocore_canopen_build_sdo_write,
481 .build_sdo_abort = protocore_canopen_build_sdo_abort,
482 .parse = protocore_canopen_parse,
483 .parse_emcy = protocore_canopen_parse_emcy,
484 .parse_heartbeat = protocore_canopen_parse_heartbeat,
485 .parse_time = protocore_canopen_parse_time,
486 .parse_sdo_response = protocore_canopen_parse_sdo_response,
487 .build_sdo_download_init = protocore_canopen_build_sdo_download_init,
488 .build_sdo_download_segment = protocore_canopen_build_sdo_download_segment,
489 .build_sdo_upload_segment_req = protocore_canopen_build_sdo_upload_segment_req,
490 .parse_sdo_segment = protocore_canopen_parse_sdo_segment,
491 .sdo_reasm_init = protocore_canopen_sdo_reasm_init,
492 .sdo_reasm_feed = protocore_canopen_sdo_reasm_feed,
493};
494
495EMBED_END_DECLS
496
497#endif // PROTOCORE_ENABLE_CANOPEN
498
499#endif // PROTOCORE_CANOPEN_H
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.
Shared CAN 2.0 frame type for the CAN-based industrial codecs (one source of truth).
Definition can.h:44