Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
can.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 2018 Alexander Wachter
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 */
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_CAN_H_
14#define ZEPHYR_INCLUDE_DRIVERS_CAN_H_
15
23#include <zephyr/types.h>
24#include <device.h>
25#include <string.h>
26#include <sys/util.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define CAN_EX_ID (1 << 31)
33#define CAN_MAX_STD_ID (0x7FF)
34#define CAN_STD_ID_MASK CAN_MAX_STD_ID
35#define CAN_EXT_ID_MASK (0x1FFFFFFF)
36#define CAN_MAX_DLC (8)
37#define CANFD_MAX_DLC CONFIG_CANFD_MAX_DLC
38#ifndef CONFIG_CANFD_MAX_DLC
39#define CAN_MAX_DLEN 8
40#else
41#if CONFIG_CANFD_MAX_DLC <= 8
42#define CAN_MAX_DLEN CONFIG_CANFD_MAX_DLC
43#elif CONFIG_CANFD_MAX_DLC <= 12
44#define CAN_MAX_DLEN CONFIG_CANFD_MAX_DLC + (CONFIG_CANFD_MAX_DLC - 8) * 4
45#elif CONFIG_CANFD_MAX_DLC == 13
46#define CAN_MAX_DLEN 32
47#elif CONFIG_CANFD_MAX_DLC == 14
48#define CAN_MAX_DLEN 48
49#elif CONFIG_CANFD_MAX_DLC == 15
50#define CAN_MAX_DLEN 64
51#endif
52#endif /* CONFIG_CANFD_MAX_DLC */
53
54/* CAN_TX_* are the error flags from tx_callback and send.*/
56#define CAN_TX_OK (0)
58#define CAN_TX_ERR (-2)
60#define CAN_TX_ARB_LOST (-3)
62#define CAN_TX_BUS_OFF (-4)
64#define CAN_TX_UNKNOWN (-5)
65
67#define CAN_TX_EINVAL (-22)
68
70#define CAN_NO_FREE_FILTER (-1)
71
73#define CAN_TIMEOUT (-1)
74
83#define CAN_DEFINE_MSGQ(name, size) \
84 K_MSGQ_DEFINE(name, sizeof(struct zcan_frame), size, 4)
85
91enum can_ide {
94};
95
104
110 /*Normal mode*/
112 /*Controller is not allowed to send dominant bits*/
114 /*Controller is in loopback mode (receive own messages)*/
116 /*Combination of loopback and silent*/
119
130
131/*
132 * Controller Area Network Identifier structure for Linux compatibility.
133 *
134 * The fields in this type are:
135 *
136 * bit 0-28 : CAN identifier (11/29 bit)
137 * bit 29 : error message frame flag (0 = data frame, 1 = error message)
138 * bit 30 : remote transmission request flag (1 = rtr frame)
139 * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
140 */
142
150struct can_frame {
153
156
158 uint8_t pad; /* padding */
159 uint8_t res0; /* reserved / padding */
160 uint8_t res1; /* reserved / padding */
165};
166
176};
177
206#if defined(CONFIG_CAN_RX_TIMESTAMP)
211 uint16_t timestamp;
212#else
214 uint8_t res0; /* reserved / padding */
215 uint8_t res1; /* reserved / padding */
217#endif
219 union {
222 };
223};
224
250};
251
260};
261
263#define CAN_SJW_NO_CHANGE 0
264
299};
300
308typedef void (*can_tx_callback_t)(uint32_t error_flags, void *arg);
309
318typedef void (*can_rx_callback_t)(struct zcan_frame *msg, void *arg);
319
328 struct can_bus_err_cnt err_cnt);
329
330typedef int (*can_set_timing_t)(const struct device *dev,
331 const struct can_timing *timing,
332 const struct can_timing *timing_data);
333
334typedef int (*can_set_mode_t)(const struct device *dev, enum can_mode mode);
335
336typedef int (*can_send_t)(const struct device *dev,
337 const struct zcan_frame *msg,
339 void *callback_arg);
340
341
342typedef int (*can_attach_msgq_t)(const struct device *dev,
343 struct k_msgq *msg_q,
344 const struct zcan_filter *filter);
345
346typedef int (*can_attach_isr_t)(const struct device *dev,
348 void *callback_arg,
349 const struct zcan_filter *filter);
350
351typedef void (*can_detach_t)(const struct device *dev, int filter_id);
352
353typedef int (*can_recover_t)(const struct device *dev, k_timeout_t timeout);
354
355typedef enum can_state (*can_get_state_t)(const struct device *dev,
356 struct can_bus_err_cnt *err_cnt);
357
358typedef void(*can_register_state_change_isr_t)(const struct device *dev,
360
361typedef int (*can_get_core_clock_t)(const struct device *dev, uint32_t *rate);
362
363#ifndef CONFIG_CAN_WORKQ_FRAMES_BUF_CNT
364#define CONFIG_CAN_WORKQ_FRAMES_BUF_CNT 4
365#endif
370};
371
377struct zcan_work {
382 void *cb_arg;
383};
384
385__subsystem struct can_driver_api {
391#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
393#endif
397 /* Min values for the timing registers */
399 /* Max values for the timing registers */
401#ifdef CONFIG_CAN_FD_MODE
402 /* Min values for the timing registers during the data phase */
403 struct can_timing timing_min_data;
404 /* Max values for the timing registers during the data phase */
405 struct can_timing timing_max_data;
406#endif
407};
408
419{
420 static const uint8_t dlc_table[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 12,
421 16, 20, 24, 32, 48, 64};
422
423 return dlc > 0x0F ? 64 : dlc_table[dlc];
424}
425
436static inline uint8_t can_bytes_to_dlc(uint8_t num_bytes)
437{
438 return num_bytes <= 8 ? num_bytes :
439 num_bytes <= 12 ? 9 :
440 num_bytes <= 16 ? 10 :
441 num_bytes <= 20 ? 11 :
442 num_bytes <= 24 ? 12 :
443 num_bytes <= 32 ? 13 :
444 num_bytes <= 48 ? 14 :
445 15;
446}
447
466__syscall int can_send(const struct device *dev, const struct zcan_frame *msg,
468 void *callback_arg);
469
470static inline int z_impl_can_send(const struct device *dev,
471 const struct zcan_frame *msg,
473 can_tx_callback_t callback_isr,
474 void *callback_arg)
475{
476 const struct can_driver_api *api =
477 (const struct can_driver_api *)dev->api;
478
479 return api->send(dev, msg, timeout, callback_isr, callback_arg);
480}
481
482/*
483 * Derived can APIs -- all implemented in terms of can_send()
484 */
485
502static inline int can_write(const struct device *dev, const uint8_t *data,
503 uint8_t length,
504 uint32_t id, enum can_rtr rtr, k_timeout_t timeout)
505{
506 struct zcan_frame msg;
507
508 if (length > 8) {
509 return -EINVAL;
510 }
511
512 msg.id = id;
513
514 if (id > CAN_MAX_STD_ID) {
516 } else {
518 }
519
520 msg.dlc = length;
521 msg.rtr = rtr;
522 memcpy(msg.data, data, length);
523
524 return can_send(dev, &msg, timeout, NULL, NULL);
525}
526
550int can_attach_workq(const struct device *dev, struct k_work_q *work_q,
551 struct zcan_work *work,
552 can_rx_callback_t callback, void *callback_arg,
553 const struct zcan_filter *filter);
554
574__syscall int can_attach_msgq(const struct device *dev, struct k_msgq *msg_q,
575 const struct zcan_filter *filter);
576
596static inline int can_attach_isr(const struct device *dev,
598 void *callback_arg,
599 const struct zcan_filter *filter)
600{
601 const struct can_driver_api *api =
602 (const struct can_driver_api *)dev->api;
603
604 return api->attach_isr(dev, isr, callback_arg, filter);
605}
606
618__syscall void can_detach(const struct device *dev, int filter_id);
619
620static inline void z_impl_can_detach(const struct device *dev, int filter_id)
621{
622 const struct can_driver_api *api =
623 (const struct can_driver_api *)dev->api;
624
625 return api->detach(dev, filter_id);
626}
627
639__syscall int can_get_core_clock(const struct device *dev, uint32_t *rate);
640
641static inline int z_impl_can_get_core_clock(const struct device *dev,
642 uint32_t *rate)
643{
644 const struct can_driver_api *api =
645 (const struct can_driver_api *)dev->api;
646
647 return api->get_core_clock(dev, rate);
648}
649
669int can_calc_timing(const struct device *dev, struct can_timing *res,
670 uint32_t bitrate, uint16_t sample_pnt);
671
672#ifdef CONFIG_CAN_FD_MODE
687int can_calc_timing_data(const struct device *dev, struct can_timing *res,
688 uint32_t bitrate, uint16_t sample_pnt);
689#endif
690
706int can_calc_prescaler(const struct device *dev, struct can_timing *timing,
707 uint32_t bitrate);
708
718__syscall int can_set_mode(const struct device *dev, enum can_mode mode);
719
720static inline int z_impl_can_set_mode(const struct device *dev,
721 enum can_mode mode)
722{
723 const struct can_driver_api *api =
724 (const struct can_driver_api *)dev->api;
725
726 return api->set_mode(dev, mode);
727}
728
745__syscall int can_set_timing(const struct device *dev,
746 const struct can_timing *timing,
747 const struct can_timing *timing_data);
748
749static inline int z_impl_can_set_timing(const struct device *dev,
750 const struct can_timing *timing,
751 const struct can_timing *timing_data)
752{
753 const struct can_driver_api *api =
754 (const struct can_driver_api *)dev->api;
755
756 return api->set_timing(dev, timing, timing_data);
757}
758
775static inline int can_set_bitrate(const struct device *dev,
776 uint32_t bitrate,
777 uint32_t bitrate_data)
778{
779 struct can_timing timing;
780#ifdef CONFIG_CAN_FD_MODE
781 struct can_timing timing_data;
782#endif
783 int ret;
784
785 ret = can_calc_timing(dev, &timing, bitrate, 875);
786 if (ret < 0) {
787 return -EINVAL;
788 }
789
790 timing.sjw = CAN_SJW_NO_CHANGE;
791
792#ifdef CONFIG_CAN_FD_MODE
793 ret = can_calc_timing_data(dev, &timing_data, bitrate_data, 875);
794 if (ret < 0) {
795 return -EINVAL;
796 }
797
798 timing_data.sjw = CAN_SJW_NO_CHANGE;
799
800 return can_set_timing(dev, &timing, &timing_data);
801#else
802 return can_set_timing(dev, &timing, NULL);
803#endif /* CONFIG_CAN_FD_MODE */
804}
805
816static inline int can_configure(const struct device *dev, enum can_mode mode,
817 uint32_t bitrate)
818{
819 if (bitrate > 0) {
820 int err = can_set_bitrate(dev, bitrate, 0);
821 if (err != 0) {
822 return err;
823 }
824 }
825
826 return can_set_mode(dev, mode);
827}
828
829
840__syscall enum can_state can_get_state(const struct device *dev,
841 struct can_bus_err_cnt *err_cnt);
842
843static inline
844enum can_state z_impl_can_get_state(const struct device *dev,
845 struct can_bus_err_cnt *err_cnt)
846{
847 const struct can_driver_api *api =
848 (const struct can_driver_api *)dev->api;
849
850 return api->get_state(dev, err_cnt);
851}
852
864#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
865__syscall int can_recover(const struct device *dev, k_timeout_t timeout);
866
867static inline int z_impl_can_recover(const struct device *dev,
869{
870 const struct can_driver_api *api =
871 (const struct can_driver_api *)dev->api;
872
873 return api->recover(dev, timeout);
874}
875#else
876/* This implementation prevents inking errors for auto recovery */
877static inline int z_impl_can_recover(const struct device *dev,
879{
880 return 0;
881}
882#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
883
893static inline
896{
897 const struct can_driver_api *api =
898 (const struct can_driver_api *)dev->api;
899
900 return api->register_state_change_isr(dev, isr);
901}
902
909static inline void can_copy_frame_to_zframe(const struct can_frame *frame,
910 struct zcan_frame *zframe)
911{
912 zframe->id_type = (frame->can_id & BIT(31)) >> 31;
913 zframe->rtr = (frame->can_id & BIT(30)) >> 30;
914 zframe->id = frame->can_id & BIT_MASK(29);
915 zframe->dlc = frame->can_dlc;
916 memcpy(zframe->data, frame->data, sizeof(zframe->data));
917}
918
925static inline void can_copy_zframe_to_frame(const struct zcan_frame *zframe,
926 struct can_frame *frame)
927{
928 frame->can_id = (zframe->id_type << 31) | (zframe->rtr << 30) |
929 zframe->id;
930 frame->can_dlc = zframe->dlc;
931 memcpy(frame->data, zframe->data, sizeof(frame->data));
932}
933
941static inline
942void can_copy_filter_to_zfilter(const struct can_filter *filter,
943 struct zcan_filter *zfilter)
944{
945 zfilter->id_type = (filter->can_id & BIT(31)) >> 31;
946 zfilter->rtr = (filter->can_id & BIT(30)) >> 30;
947 zfilter->id = filter->can_id & BIT_MASK(29);
948 zfilter->rtr_mask = (filter->can_mask & BIT(30)) >> 30;
949 zfilter->id_mask = filter->can_mask & BIT_MASK(29);
950}
951
959static inline
960void can_copy_zfilter_to_filter(const struct zcan_filter *zfilter,
961 struct can_filter *filter)
962{
963 filter->can_id = (zfilter->id_type << 31) |
964 (zfilter->rtr << 30) | zfilter->id;
965 filter->can_mask = (zfilter->rtr_mask << 30) |
966 (zfilter->id_type << 31) | zfilter->id_mask;
967}
968
969#ifdef __cplusplus
970}
971#endif
975#include <syscalls/can.h>
976
977#endif /* ZEPHYR_INCLUDE_DRIVERS_CAN_H_ */
ZTEST_BMEM int timeout
Definition: main.c:31
#define BIT_MASK(n)
Definition: adc.h:14
void
Definition: eswifi_shell.c:15
int can_set_mode(const struct device *dev, enum can_mode mode)
Set the controller to the given mode.
int can_attach_workq(const struct device *dev, struct k_work_q *work_q, struct zcan_work *work, can_rx_callback_t callback, void *callback_arg, const struct zcan_filter *filter)
Attach a CAN work queue to a single or group of identifiers.
int can_attach_msgq(const struct device *dev, struct k_msgq *msg_q, const struct zcan_filter *filter)
Attach a message queue to a single or group of identifiers.
int(* can_send_t)(const struct device *dev, const struct zcan_frame *msg, k_timeout_t timeout, can_tx_callback_t callback_isr, void *callback_arg)
Definition: can.h:336
#define CAN_SJW_NO_CHANGE
Definition: can.h:263
void(* can_rx_callback_t)(struct zcan_frame *msg, void *arg)
Define the application callback handler function signature for receiving.
Definition: can.h:318
int can_get_core_clock(const struct device *dev, uint32_t *rate)
Read the core clock value.
void(* can_tx_callback_t)(uint32_t error_flags, void *arg)
Define the application callback handler function signature.
Definition: can.h:308
int(* can_get_core_clock_t)(const struct device *dev, uint32_t *rate)
Definition: can.h:361
can_mode
can_mode enum Defines the mode of the can controller
Definition: can.h:109
int(* can_set_timing_t)(const struct device *dev, const struct can_timing *timing, const struct can_timing *timing_data)
Definition: can.h:330
void(* can_state_change_isr_t)(enum can_state state, struct can_bus_err_cnt err_cnt)
Defines the state change isr handler function signature.
Definition: can.h:327
int(* can_attach_isr_t)(const struct device *dev, can_rx_callback_t isr, void *callback_arg, const struct zcan_filter *filter)
Definition: can.h:346
void(* can_detach_t)(const struct device *dev, int filter_id)
Definition: can.h:351
#define CAN_MAX_STD_ID
Definition: can.h:33
int can_calc_prescaler(const struct device *dev, struct can_timing *timing, uint32_t bitrate)
Fill in the prescaler value for a given bitrate and timing.
static uint8_t can_bytes_to_dlc(uint8_t num_bytes)
Convert a number of bytes to the DLC.
Definition: can.h:436
can_rtr
can_rtr enum Define if the message is a data or remote frame
Definition: can.h:100
int(* can_recover_t)(const struct device *dev, k_timeout_t timeout)
Definition: can.h:353
enum can_state(* can_get_state_t)(const struct device *dev, struct can_bus_err_cnt *err_cnt)
Definition: can.h:355
can_ide
can_ide enum Define if the message has a standard (11bit) or extended (29bit) identifier
Definition: can.h:91
void(* can_register_state_change_isr_t)(const struct device *dev, can_state_change_isr_t isr)
Definition: can.h:358
int(* can_attach_msgq_t)(const struct device *dev, struct k_msgq *msg_q, const struct zcan_filter *filter)
Definition: can.h:342
static uint8_t can_dlc_to_bytes(uint8_t dlc)
Convert the DLC to the number of bytes.
Definition: can.h:418
enum can_state can_get_state(const struct device *dev, struct can_bus_err_cnt *err_cnt)
Get current state.
int can_send(const struct device *dev, const struct zcan_frame *msg, k_timeout_t timeout, can_tx_callback_t callback_isr, void *callback_arg)
Perform data transfer to CAN bus.
int(* can_set_mode_t)(const struct device *dev, enum can_mode mode)
Definition: can.h:334
int can_calc_timing(const struct device *dev, struct can_timing *res, uint32_t bitrate, uint16_t sample_pnt)
Calculate timing parameters from bitrate and sample point.
int can_recover(const struct device *dev, k_timeout_t timeout)
Recover from bus-off state.
can_state
can_state enum Defines the possible states of the CAN bus
Definition: can.h:124
static void can_register_state_change_isr(const struct device *dev, can_state_change_isr_t isr)
Register an ISR callback for state change interrupt.
Definition: can.h:894
static int can_configure(const struct device *dev, enum can_mode mode, uint32_t bitrate)
Configure operation of a host controller.
Definition: can.h:816
void can_detach(const struct device *dev, int filter_id)
Detach an isr or message queue from the identifier filtering.
static void can_copy_zframe_to_frame(const struct zcan_frame *zframe, struct can_frame *frame)
Converter that translates between zcan_frame and can_frame structs.
Definition: can.h:925
static int can_set_bitrate(const struct device *dev, uint32_t bitrate, uint32_t bitrate_data)
Set the bitrate of the CAN controller.
Definition: can.h:775
#define CONFIG_CAN_WORKQ_FRAMES_BUF_CNT
Definition: can.h:364
static int can_attach_isr(const struct device *dev, can_rx_callback_t isr, void *callback_arg, const struct zcan_filter *filter)
Attach an isr callback function to a single or group of identifiers.
Definition: can.h:596
static void can_copy_zfilter_to_filter(const struct zcan_filter *zfilter, struct can_filter *filter)
Converter that translates between zcan_filter and can_filter structs.
Definition: can.h:960
int can_set_timing(const struct device *dev, const struct can_timing *timing, const struct can_timing *timing_data)
Configure timing of a host controller.
uint32_t canid_t
Definition: can.h:141
static int can_write(const struct device *dev, const uint8_t *data, uint8_t length, uint32_t id, enum can_rtr rtr, k_timeout_t timeout)
Write a set amount of data to the can bus.
Definition: can.h:502
static void can_copy_frame_to_zframe(const struct can_frame *frame, struct zcan_frame *zframe)
Converter that translates between can_frame and zcan_frame structs.
Definition: can.h:909
#define CAN_MAX_DLEN
Definition: can.h:39
static void can_copy_filter_to_zfilter(const struct can_filter *filter, struct zcan_filter *zfilter)
Converter that translates between can_filter and zcan_frame_filter structs.
Definition: can.h:942
@ CAN_SILENT_MODE
Definition: can.h:113
@ CAN_LOOPBACK_MODE
Definition: can.h:115
@ CAN_NORMAL_MODE
Definition: can.h:111
@ CAN_SILENT_LOOPBACK_MODE
Definition: can.h:117
@ CAN_DATAFRAME
Definition: can.h:101
@ CAN_REMOTEREQUEST
Definition: can.h:102
@ CAN_EXTENDED_IDENTIFIER
Definition: can.h:93
@ CAN_STANDARD_IDENTIFIER
Definition: can.h:92
@ CAN_ERROR_PASSIVE
Definition: can.h:126
@ CAN_ERROR_ACTIVE
Definition: can.h:125
@ CAN_BUS_OFF
Definition: can.h:127
@ CAN_BUS_UNKNOWN
Definition: can.h:128
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
#define ceiling_fraction(numerator, divider)
Ceiling function applied to numerator / divider as a fraction.
Definition: util.h:158
#define EINVAL
Definition: errno.h:61
state
Definition: http_parser_state.h:30
static ZTEST_BMEM volatile int ret
Definition: k_float_disable.c:28
static struct k_work work[2]
Definition: main.c:16
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
void * memcpy(void *_MLIBC_RESTRICT d, const void *_MLIBC_RESTRICT s, size_t n)
can bus error count structure
Definition: can.h:257
uint8_t tx_err_cnt
Definition: can.h:258
uint8_t rx_err_cnt
Definition: can.h:259
Definition: can.h:385
can_attach_isr_t attach_isr
Definition: can.h:389
can_set_timing_t set_timing
Definition: can.h:387
can_detach_t detach
Definition: can.h:390
struct can_timing timing_max
Definition: can.h:400
can_send_t send
Definition: can.h:388
can_get_state_t get_state
Definition: can.h:394
can_recover_t recover
Definition: can.h:392
can_register_state_change_isr_t register_state_change_isr
Definition: can.h:395
can_set_mode_t set_mode
Definition: can.h:386
can_get_core_clock_t get_core_clock
Definition: can.h:396
struct can_timing timing_min
Definition: can.h:398
CAN filter that is compatible with Linux. This is mainly used by Socket CAN code.
Definition: can.h:173
canid_t can_mask
Definition: can.h:175
canid_t can_id
Definition: can.h:174
Definition: can.h:366
uint16_t tail
Definition: can.h:369
uint16_t head
Definition: can.h:368
struct zcan_frame buf[4]
Definition: can.h:367
CAN frame structure that is compatible with Linux. This is mainly used by Socket CAN code.
Definition: can.h:150
uint8_t can_dlc
Definition: can.h:155
canid_t can_id
Definition: can.h:152
uint8_t data[8]
Definition: can.h:164
canbus timings
Definition: can.h:288
uint16_t sjw
Definition: can.h:290
uint16_t phase_seg2
Definition: can.h:296
uint16_t prescaler
Definition: can.h:298
uint16_t phase_seg1
Definition: can.h:294
uint16_t prop_seg
Definition: can.h:292
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
const void * api
Definition: device.h:373
Message Queue Structure.
Definition: kernel.h:4290
Kernel timeout type.
Definition: sys_clock.h:65
A structure used to hold work until it can be processed.
Definition: kernel.h:3770
A structure used to submit work.
Definition: kernel.h:3623
CAN filter structure.
Definition: can.h:234
uint32_t res0
Definition: can.h:237
uint32_t id_mask
Definition: can.h:245
uint32_t rtr
Definition: can.h:239
uint32_t rtr_mask
Definition: can.h:248
uint32_t res1
Definition: can.h:246
uint32_t id_type
Definition: can.h:243
uint32_t id
Definition: can.h:236
uint32_t res2
Definition: can.h:249
CAN message structure.
Definition: can.h:185
uint8_t dlc
Definition: can.h:199
uint32_t id_type
Definition: can.h:197
uint32_t data_32[ceiling_fraction(8, sizeof(uint32_t))]
Definition: can.h:221
uint8_t data[8]
Definition: can.h:220
uint32_t rtr
Definition: can.h:193
uint8_t res
Definition: can.h:205
uint8_t brs
Definition: can.h:203
uint32_t fd
Definition: can.h:189
uint32_t id
Definition: can.h:187
CAN work structure.
Definition: can.h:377
void * cb_arg
Definition: can.h:382
can_rx_callback_t cb
Definition: can.h:381
struct k_work_q * work_queue
Definition: can.h:379
struct can_frame_buffer buf
Definition: can.h:380
struct k_work work_item
Definition: can.h:378
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
Misc utilities.