can_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef CAN_PARAMS_H
21 #define CAN_PARAMS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "can_esp.h"
28 #include "can/device.h"
29 #include "periph/can.h"
30 
31 #ifndef CAN_TX
32 
33 #define CAN_TX GPIO5
34 #endif
35 
36 #ifndef CAN_RX
37 
38 #define CAN_RX GPIO35
39 #endif
40 
41 #ifndef CAN_BITRATE
42 
43 #define CAN_BITRATE (500000)
44 #endif
45 
47 static const candev_params_t candev_params[] = {
48  {
49  .name = "esp-can",
50  },
51 };
52 
54 static const can_conf_t candev_conf[] = {
55  {
56  .bitrate = CAN_BITRATE,
57  .tx_pin = CAN_TX,
58  .rx_pin = CAN_RX,
59 #ifdef CAN_CLK_OUT
60  .clk_out_pin = CAN_CLK_OUT,
61 #endif
62 #ifdef CAN_BUS_ON_OFF
63  .bus_on_off_pin = CAN_BUS_ON_OFF,
64 #endif
65  },
66 };
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif /* CAN_PARAMS_H */
device.h
Definitions of CAN device interface.
candev_conf
Linux candev configuration.
Definition: candev_linux.h:45
can.h
Low-level CAN peripheral driver interface definitions.
candev_params::name
const char * name
candev name to set
Definition: device.h:56
CAN_TX
#define CAN_TX
Default CAN tranveiver TX pin if not defined in board configuration.
Definition: can_params.h:33
can_esp.h
can_conf_t
ESP CAN device configuration.
Definition: can_esp.h:98
CAN_RX
#define CAN_RX
Default CAN transceiver RX pin if not defined in board configuration.
Definition: can_params.h:38
CAN_BITRATE
#define CAN_BITRATE
Default CAN Bitrate.
Definition: can_params.h:43
candev_params
Parameters to initialize a candev.
Definition: device.h:55