Allow LR1121 single RF path (#2998)
[ExpressLRS.git] / src / include / hardware.h
blob83b0d1ec81368a4905f8ee6afa3daa522c60702d
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_values_count,
55 HARDWARE_power_values2,
56 HARDWARE_power_values_dual,
57 HARDWARE_power_values_dual_count,
59 // Input
60 HARDWARE_joystick,
61 HARDWARE_joystick_values,
63 HARDWARE_five_way1,
64 HARDWARE_five_way2,
65 HARDWARE_five_way3,
67 HARDWARE_button,
68 HARDWARE_button_led_index,
69 HARDWARE_button2,
70 HARDWARE_button2_led_index,
72 // Lighting
73 HARDWARE_led,
74 HARDWARE_led_blue,
75 HARDWARE_led_blue_invert,
76 HARDWARE_led_green,
77 HARDWARE_led_green_invert,
78 HARDWARE_led_green_red,
79 HARDWARE_led_red,
80 HARDWARE_led_red_invert,
81 HARDWARE_led_red_green,
82 HARDWARE_led_rgb,
83 // GPIO_PIN_LED_WS2812_FAST // stm32
84 HARDWARE_led_rgb_isgrb,
85 HARDWARE_ledidx_rgb_status,
86 HARDWARE_ledidx_rgb_status_count,
87 HARDWARE_ledidx_rgb_vtx,
88 HARDWARE_ledidx_rgb_vtx_count,
89 HARDWARE_ledidx_rgb_boot,
90 HARDWARE_ledidx_rgb_boot_count,
92 // OLED/TFT
93 HARDWARE_screen_cs, // SPI
94 HARDWARE_screen_dc, // SPI
95 HARDWARE_screen_mosi, // SPI
96 HARDWARE_screen_rst, // SPI & I2c (optional)
97 HARDWARE_screen_sck, // clock for SPI & I2C
98 HARDWARE_screen_sda, // I2C data
100 // screen_type == 0 is no screen
101 HARDWARE_screen_type,
102 HARDWARE_screen_reversed,
103 HARDWARE_screen_bl,
105 // Backpack
106 HARDWARE_use_backpack,
107 HARDWARE_debug_backpack_baud,
108 HARDWARE_debug_backpack_rx,
109 HARDWARE_debug_backpack_tx,
110 HARDWARE_backpack_boot,
111 HARDWARE_backpack_en,
112 HARDWARE_passthrough_baud,
114 // I2C & Misc devices
115 HARDWARE_i2c_scl,
116 HARDWARE_i2c_sda,
117 HARDWARE_misc_gsensor_int,
118 HARDWARE_misc_buzzer, // stm32 only
119 HARDWARE_misc_fan_en,
120 HARDWARE_misc_fan_pwm,
121 HARDWARE_misc_fan_tacho,
122 HARDWARE_misc_fan_speeds,
123 HARDWARE_misc_fan_speeds_count,
124 HARDWARE_gsensor_stk8xxx,
125 HARDWARE_thermal_lm75a,
127 // PWM
128 HARDWARE_pwm_outputs,
129 HARDWARE_pwm_outputs_count,
131 // VBAT
132 HARDWARE_vbat,
133 HARDWARE_vbat_offset,
134 HARDWARE_vbat_scale,
135 HARDWARE_vbat_atten,
137 // VTX
138 HARDWARE_vtx_amp_pwm,
139 HARDWARE_vtx_amp_vpd,
140 HARDWARE_vtx_amp_vref,
141 HARDWARE_vtx_nss,
142 HARDWARE_vtx_miso,
143 HARDWARE_vtx_mosi,
144 HARDWARE_vtx_sck,
145 HARDWARE_vtx_amp_vpd_25mW,
146 HARDWARE_vtx_amp_vpd_100mW,
147 HARDWARE_vtx_amp_pwm_25mW,
148 HARDWARE_vtx_amp_pwm_100mW,
150 HARDWARE_LAST
151 } nameType;
153 bool hardware_init();
154 const int hardware_pin(nameType name);
155 const bool hardware_flag(nameType name);
156 const int hardware_int(nameType name);
157 const float hardware_float(nameType name);
158 const int16_t* hardware_i16_array(nameType name);
159 const uint16_t* hardware_u16_array(nameType name);