Add support for setting Source and Target sysID (#2886)
[ExpressLRS.git] / src / include / hardware.h
blob80e9a313e9ffcfadf458978d62baf352d2803555
1 #include <stdint.h>
3 typedef enum {
4 // Serial
5 HARDWARE_serial_rx,
6 HARDWARE_serial_tx,
7 HARDWARE_serial1_rx,
8 HARDWARE_serial1_tx,
10 // Radio
11 HARDWARE_radio_busy,
12 HARDWARE_radio_busy_2,
13 HARDWARE_radio_dio0,
14 HARDWARE_radio_dio0_2,
15 HARDWARE_radio_dio1,
16 HARDWARE_radio_dio1_2,
17 HARDWARE_radio_dio2,
18 HARDWARE_radio_miso,
19 HARDWARE_radio_mosi,
20 HARDWARE_radio_nss,
21 HARDWARE_radio_nss_2,
22 HARDWARE_radio_rst,
23 HARDWARE_radio_rst_2,
24 HARDWARE_radio_sck,
25 HARDWARE_radio_dcdc,
26 HARDWARE_radio_rfo_hf,
27 HARDWARE_radio_rfsw_ctrl,
28 HARDWARE_radio_rfsw_ctrl_count,
30 // Radio Antenna
31 HARDWARE_ant_ctrl,
32 HARDWARE_ant_ctrl_compl,
34 // Radio power
35 HARDWARE_power_enable,
36 HARDWARE_power_apc1,
37 HARDWARE_power_apc2,
38 HARDWARE_power_rxen,
39 HARDWARE_power_txen,
40 HARDWARE_power_rxen_2,
41 HARDWARE_power_txen_2,
42 HARDWARE_power_lna_gain,
43 HARDWARE_power_min,
44 HARDWARE_power_high,
45 HARDWARE_power_max,
46 HARDWARE_power_default,
48 HARDWARE_power_pdet,
49 HARDWARE_power_pdet_intercept,
50 HARDWARE_power_pdet_slope,
52 HARDWARE_power_control,
53 HARDWARE_power_values,
54 HARDWARE_power_values2,
55 HARDWARE_power_values_dual,
57 // Input
58 HARDWARE_joystick,
59 HARDWARE_joystick_values,
61 HARDWARE_five_way1,
62 HARDWARE_five_way2,
63 HARDWARE_five_way3,
65 HARDWARE_button,
66 HARDWARE_button_led_index,
67 HARDWARE_button2,
68 HARDWARE_button2_led_index,
70 // Lighting
71 HARDWARE_led,
72 HARDWARE_led_blue,
73 HARDWARE_led_blue_invert,
74 HARDWARE_led_green,
75 HARDWARE_led_green_invert,
76 HARDWARE_led_green_red,
77 HARDWARE_led_red,
78 HARDWARE_led_red_invert,
79 HARDWARE_led_red_green,
80 HARDWARE_led_rgb,
81 // GPIO_PIN_LED_WS2812_FAST // stm32
82 HARDWARE_led_rgb_isgrb,
83 HARDWARE_ledidx_rgb_status,
84 HARDWARE_ledidx_rgb_status_count,
85 HARDWARE_ledidx_rgb_vtx,
86 HARDWARE_ledidx_rgb_vtx_count,
87 HARDWARE_ledidx_rgb_boot,
88 HARDWARE_ledidx_rgb_boot_count,
90 // OLED/TFT
91 HARDWARE_screen_cs, // SPI
92 HARDWARE_screen_dc, // SPI
93 HARDWARE_screen_mosi, // SPI
94 HARDWARE_screen_rst, // SPI & I2c (optional)
95 HARDWARE_screen_sck, // clock for SPI & I2C
96 HARDWARE_screen_sda, // I2C data
98 // screen_type == 0 is no screen
99 HARDWARE_screen_type,
100 HARDWARE_screen_reversed,
101 HARDWARE_screen_bl,
103 // Backpack
104 HARDWARE_use_backpack,
105 HARDWARE_debug_backpack_baud,
106 HARDWARE_debug_backpack_rx,
107 HARDWARE_debug_backpack_tx,
108 HARDWARE_backpack_boot,
109 HARDWARE_backpack_en,
110 HARDWARE_passthrough_baud,
112 // I2C & Misc devices
113 HARDWARE_i2c_scl,
114 HARDWARE_i2c_sda,
115 HARDWARE_misc_gsensor_int,
116 HARDWARE_misc_buzzer, // stm32 only
117 HARDWARE_misc_fan_en,
118 HARDWARE_misc_fan_pwm,
119 HARDWARE_misc_fan_tacho,
120 HARDWARE_misc_fan_speeds,
121 HARDWARE_misc_fan_speeds_count,
122 HARDWARE_gsensor_stk8xxx,
123 HARDWARE_thermal_lm75a,
125 // PWM
126 HARDWARE_pwm_outputs,
127 HARDWARE_pwm_outputs_count,
129 // VBAT
130 HARDWARE_vbat,
131 HARDWARE_vbat_offset,
132 HARDWARE_vbat_scale,
133 HARDWARE_vbat_atten,
135 // VTX
136 HARDWARE_vtx_amp_pwm,
137 HARDWARE_vtx_amp_vpd,
138 HARDWARE_vtx_amp_vref,
139 HARDWARE_vtx_nss,
140 HARDWARE_vtx_miso,
141 HARDWARE_vtx_mosi,
142 HARDWARE_vtx_sck,
143 HARDWARE_vtx_amp_vpd_25mW,
144 HARDWARE_vtx_amp_vpd_100mW,
145 HARDWARE_vtx_amp_pwm_25mW,
146 HARDWARE_vtx_amp_pwm_100mW,
148 HARDWARE_LAST
149 } nameType;
151 bool hardware_init();
152 const int hardware_pin(nameType name);
153 const bool hardware_flag(nameType name);
154 const int hardware_int(nameType name);
155 const float hardware_float(nameType name);
156 const int16_t* hardware_i16_array(nameType name);
157 const uint16_t* hardware_u16_array(nameType name);