RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
RBControl_pinout.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <driver/adc.h>
4 #include <driver/gpio.h>
5 
6 namespace rb {
7 
8 enum class MotorId : uint8_t {
9  M1,
10  M2,
11  M3,
12  M4,
13  M5,
14  M6,
15  M7,
16  M8,
17 
18  MAX,
19 };
20 
21 inline MotorId operator++(MotorId& x) { return x = MotorId(static_cast<uint8_t>(x) + 1); }
22 
23 static const gpio_num_t IO0 = GPIO_NUM_0;
24 static const gpio_num_t IO2 = GPIO_NUM_2;
25 static const gpio_num_t IO12 = GPIO_NUM_12;
26 static const gpio_num_t IO4 = GPIO_NUM_4;
27 static const gpio_num_t IO5 = GPIO_NUM_5;
28 static const gpio_num_t IO13 = GPIO_NUM_13;
29 static const gpio_num_t IO14 = GPIO_NUM_14;
30 static const gpio_num_t IO15 = GPIO_NUM_15;
31 static const gpio_num_t IO16 = GPIO_NUM_16;
32 static const gpio_num_t IO17 = GPIO_NUM_17;
33 static const gpio_num_t IO18 = GPIO_NUM_18;
34 static const gpio_num_t IO19 = GPIO_NUM_19;
35 static const gpio_num_t IO21 = GPIO_NUM_21;
36 static const gpio_num_t IO25 = GPIO_NUM_25;
37 static const gpio_num_t IO26 = GPIO_NUM_26;
38 static const gpio_num_t IO27 = GPIO_NUM_27;
39 static const gpio_num_t IO32 = GPIO_NUM_32;
40 static const gpio_num_t IO33 = GPIO_NUM_33;
41 static const gpio_num_t IO34 = GPIO_NUM_34;
42 static const gpio_num_t IO35 = GPIO_NUM_35;
43 
44 static const gpio_num_t RCKMOT = IO0;
45 static const gpio_num_t SERMOT = IO2;
46 static const gpio_num_t SCKMOT = IO12;
47 
48 static const gpio_num_t ENC1A = IO21;
49 static const gpio_num_t ENC1B = IO19;
50 static const gpio_num_t ENC2A = IO18;
51 static const gpio_num_t ENC2B = IO5;
52 static const gpio_num_t ENC3A = IO17;
53 static const gpio_num_t ENC3B = IO16;
54 static const gpio_num_t ENC4A = IO15;
55 static const gpio_num_t ENC4B = IO13;
56 static const gpio_num_t ENC5A = IO4;
57 static const gpio_num_t ENC5B = IO15;
58 static const gpio_num_t ENC6A = IO27;
59 static const gpio_num_t ENC6B = IO26;
60 static const gpio_num_t ENC7A = IO25;
61 static const gpio_num_t ENC7B = IO33;
62 static const gpio_num_t ENC8A = IO32;
63 static const gpio_num_t ENC8B = IO35;
64 
65 static const gpio_num_t POWER_OFF = IO32;
66 static const gpio_num_t BATT_REF = IO34;
67 static const adc_unit_t BATT_ADC_UNIT = ADC_UNIT_1;
68 static const adc1_channel_t BATT_ADC_CHANNEL = ADC1_CHANNEL_6;
69 
70 static const gpio_num_t PIEZO_A = ENC7A;
71 static const gpio_num_t PIEZO_B = ENC7B;
72 
73 static const gpio_num_t I2C_MASTER_SDA = GPIO_NUM_23;
74 static const gpio_num_t I2C_MASTER_SCL = GPIO_NUM_22;
75 static const int I2C_ADDR_EXPANDER = 0x20 | 0x01;
76 
77 static const int EA0 = 0;
78 static const int EA1 = 1;
79 static const int EA2 = 2;
80 static const int EA3 = 3;
81 static const int EA4 = 4;
82 static const int EA5 = 5;
83 static const int EA6 = 6;
84 static const int EA7 = 7;
85 
86 static const int EB0 = 8;
87 static const int EB1 = 9;
88 static const int EB2 = 10;
89 static const int EB3 = 11;
90 static const int EB4 = 12;
91 static const int EB5 = 13;
92 static const int EB6 = 14;
93 static const int EB7 = 15;
94 
95 static const int SW1 = EB0;
96 static const int SW2 = EB1;
97 static const int SW3 = EB2;
98 static const int LED_RED = EB3;
99 static const int LED_YELLOW = EB4;
100 static const int LED_GREEN = EB5;
101 static const int LED_BLUE = EB6;
102 static const int EXPANDER_BOARD_POWER_ON = EB7; //<! keeps the board powered on
103 
104 } // namespace rb
The base namespace. Contains some logging functions, too.
Definition: half_duplex_uart.cpp:53
static const int LED_BLUE
Definition: RBControl_pinout.hpp:101
static const gpio_num_t IO26
Definition: RBControl_pinout.hpp:37
static const int EA5
Definition: RBControl_pinout.hpp:82
static const gpio_num_t I2C_MASTER_SDA
Definition: RBControl_pinout.hpp:73
static const gpio_num_t IO12
Definition: RBControl_pinout.hpp:25
static const gpio_num_t ENC1B
Definition: RBControl_pinout.hpp:49
static const int LED_RED
Definition: RBControl_pinout.hpp:98
static const int EA3
Definition: RBControl_pinout.hpp:80
static const gpio_num_t IO19
Definition: RBControl_pinout.hpp:34
static const int EB0
Definition: RBControl_pinout.hpp:86
static const gpio_num_t IO4
Definition: RBControl_pinout.hpp:26
static const gpio_num_t SERMOT
Definition: RBControl_pinout.hpp:45
static const int EB7
Definition: RBControl_pinout.hpp:93
static const int EB6
Definition: RBControl_pinout.hpp:92
static const int EB3
Definition: RBControl_pinout.hpp:89
static const gpio_num_t ENC7B
Definition: RBControl_pinout.hpp:61
static const int I2C_ADDR_EXPANDER
Definition: RBControl_pinout.hpp:75
static const gpio_num_t ENC1A
Definition: RBControl_pinout.hpp:48
static const int EA7
Definition: RBControl_pinout.hpp:84
static const int EB1
Definition: RBControl_pinout.hpp:87
static const gpio_num_t POWER_OFF
Definition: RBControl_pinout.hpp:65
static const gpio_num_t SCKMOT
Definition: RBControl_pinout.hpp:46
static const int EB2
Definition: RBControl_pinout.hpp:88
static const gpio_num_t PIEZO_A
Definition: RBControl_pinout.hpp:70
static const int EA2
Definition: RBControl_pinout.hpp:79
static const gpio_num_t IO33
Definition: RBControl_pinout.hpp:40
static const gpio_num_t ENC8B
Definition: RBControl_pinout.hpp:63
static const gpio_num_t IO14
Definition: RBControl_pinout.hpp:29
static const gpio_num_t IO5
Definition: RBControl_pinout.hpp:27
static const gpio_num_t ENC2A
Definition: RBControl_pinout.hpp:50
static const gpio_num_t ENC4A
Definition: RBControl_pinout.hpp:54
static const int SW2
Definition: RBControl_pinout.hpp:96
static const gpio_num_t ENC6B
Definition: RBControl_pinout.hpp:59
static const gpio_num_t IO0
Definition: RBControl_pinout.hpp:23
static const gpio_num_t IO27
Definition: RBControl_pinout.hpp:38
static const int SW3
Definition: RBControl_pinout.hpp:97
static const gpio_num_t IO35
Definition: RBControl_pinout.hpp:42
static const gpio_num_t IO2
Definition: RBControl_pinout.hpp:24
static const gpio_num_t PIEZO_B
Definition: RBControl_pinout.hpp:71
static const gpio_num_t ENC3A
Definition: RBControl_pinout.hpp:52
static const gpio_num_t ENC5A
Definition: RBControl_pinout.hpp:56
static const int EB5
Definition: RBControl_pinout.hpp:91
static const int SW1
Definition: RBControl_pinout.hpp:95
static const gpio_num_t ENC4B
Definition: RBControl_pinout.hpp:55
static const gpio_num_t I2C_MASTER_SCL
Definition: RBControl_pinout.hpp:74
static const gpio_num_t ENC6A
Definition: RBControl_pinout.hpp:58
static const gpio_num_t ENC3B
Definition: RBControl_pinout.hpp:53
static const gpio_num_t IO21
Definition: RBControl_pinout.hpp:35
static const gpio_num_t IO15
Definition: RBControl_pinout.hpp:30
static const int EB4
Definition: RBControl_pinout.hpp:90
static const int EXPANDER_BOARD_POWER_ON
Definition: RBControl_pinout.hpp:102
static const gpio_num_t IO16
Definition: RBControl_pinout.hpp:31
MotorId
Definition: RBControl_pinout.hpp:8
static const gpio_num_t IO13
Definition: RBControl_pinout.hpp:28
static const int LED_GREEN
Definition: RBControl_pinout.hpp:100
static const int EA1
Definition: RBControl_pinout.hpp:78
static const int EA4
Definition: RBControl_pinout.hpp:81
static const adc1_channel_t BATT_ADC_CHANNEL
Definition: RBControl_pinout.hpp:68
static const adc_unit_t BATT_ADC_UNIT
Definition: RBControl_pinout.hpp:67
static const gpio_num_t IO25
Definition: RBControl_pinout.hpp:36
static const gpio_num_t RCKMOT
Definition: RBControl_pinout.hpp:44
static const gpio_num_t IO34
Definition: RBControl_pinout.hpp:41
static const gpio_num_t ENC8A
Definition: RBControl_pinout.hpp:62
static const gpio_num_t ENC2B
Definition: RBControl_pinout.hpp:51
static const gpio_num_t ENC5B
Definition: RBControl_pinout.hpp:57
static const gpio_num_t IO17
Definition: RBControl_pinout.hpp:32
static const gpio_num_t ENC7A
Definition: RBControl_pinout.hpp:60
static const int EA0
Definition: RBControl_pinout.hpp:77
static const int EA6
Definition: RBControl_pinout.hpp:83
static const gpio_num_t BATT_REF
Definition: RBControl_pinout.hpp:66
MotorId operator++(MotorId &x)
Definition: RBControl_pinout.hpp:21
static const gpio_num_t IO32
Definition: RBControl_pinout.hpp:39
static const gpio_num_t IO18
Definition: RBControl_pinout.hpp:33
static const int LED_YELLOW
Definition: RBControl_pinout.hpp:99