Loading...
Searching...
No Matches
candev_linux.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 OTA keys S.A.
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
14
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#if defined(__linux__) /* SocketCAN is supported only on Linux */ || defined(DOXYGEN)
28
29# include <stdbool.h>
30
31# include "can/device.h"
32# include "can/candev.h"
33# include "mutex.h"
34
38# define CAN_MAX_SIZE_INTERFACE_NAME (5)
39
47
49# define HAVE_CAN_CONF_T
50
51# if !defined(CANDEV_LINUX_MAX_FILTERS_RX) || defined(DOXYGEN)
53# define CANDEV_LINUX_MAX_FILTERS_RX (16)
54# endif
55
56# if !defined(CANDEV_LINUX_DEFAULT_BITRATE) || defined(DOXYGEN)
58# define CANDEV_LINUX_DEFAULT_BITRATE (500000)
59# endif
60
61# if !defined(CANDEV_LINUX_DEFAULT_SPT) || defined(DOXYGEN)
63# define CANDEV_LINUX_DEFAULT_SPT (875)
64# endif
65
76
78# define HAVE_CAN_T
79
84
85#endif /* defined(__linux__) */
86
87#ifdef __cplusplus
88}
89#endif
90
Definitions for low-level CAN driver interface.
struct can can_t
Low level device structure for ESP32 CAN (extension of candev_t)
#define CAN_MAX_SIZE_INTERFACE_NAME
Maximum size of an interface name.
struct candev_conf can_conf_t
Linux candev configuration.
#define CANDEV_LINUX_MAX_FILTERS_RX
Max number of rx filters which can be set.
struct candev candev_t
Forward declaration for candev struct.
Definition candev.h:59
Mutex for thread synchronization.
ESP CAN device configuration.
Definition can_esp.h:84
Controller Area Network filter.
Definition can.h:128
Linux candev configuration.
char interface_name[CAN_MAX_SIZE_INTERFACE_NAME+1]
local interface name
The candev_linux struct.
const can_conf_t * conf
device configuration
int sock
local socket id
candev_t candev
candev base structure
struct can_filter filters[CANDEV_LINUX_MAX_FILTERS_RX]
filter list
Definitions of CAN device interface.
#define CAN_DLL_NUMOF
Maximum number of interfaces which can be registered on DLL.
Definition device.h:48