Allow choosing the RF Band on LR1121 modules (#3078)
[ExpressLRS.git] / src / include / target / Unified_ESP32_TX.h
blob08b1c8d0a20e6f7943ded83c3d00b52603d5ee3a
1 // Serial
2 #define GPIO_PIN_RCSIGNAL_RX hardware_pin(HARDWARE_serial_rx)
3 #define GPIO_PIN_RCSIGNAL_TX hardware_pin(HARDWARE_serial_tx)
5 // Radio
6 #define GPIO_PIN_BUSY hardware_pin(HARDWARE_radio_busy)
7 #define GPIO_PIN_BUSY_2 hardware_pin(HARDWARE_radio_busy_2)
8 #define GPIO_PIN_DIO0 hardware_pin(HARDWARE_radio_dio0)
9 #define GPIO_PIN_DIO0_2 hardware_pin(HARDWARE_radio_dio0_2)
10 #define GPIO_PIN_DIO1 hardware_pin(HARDWARE_radio_dio1)
11 #define GPIO_PIN_DIO1_2 hardware_pin(HARDWARE_radio_dio1_2)
12 #define GPIO_PIN_MISO hardware_pin(HARDWARE_radio_miso)
13 #define GPIO_PIN_MOSI hardware_pin(HARDWARE_radio_mosi)
14 #define GPIO_PIN_NSS hardware_pin(HARDWARE_radio_nss)
15 #define GPIO_PIN_NSS_2 hardware_pin(HARDWARE_radio_nss_2)
16 #define GPIO_PIN_RST hardware_pin(HARDWARE_radio_rst)
17 #define GPIO_PIN_RST_2 hardware_pin(HARDWARE_radio_rst_2)
18 #define GPIO_PIN_SCK hardware_pin(HARDWARE_radio_sck)
19 #define OPT_USE_HARDWARE_DCDC hardware_flag(HARDWARE_radio_dcdc)
20 #define OPT_USE_SX1276_RFO_HF hardware_flag(HARDWARE_radio_rfo_hf)
21 #define LR1121_RFSW_CTRL hardware_u16_array(HARDWARE_radio_rfsw_ctrl)
22 #define LR1121_RFSW_CTRL_COUNT hardware_int(HARDWARE_radio_rfsw_ctrl_count)
24 // Radio Antenna
25 #define GPIO_PIN_ANT_CTRL hardware_pin(HARDWARE_ant_ctrl)
26 #define GPIO_PIN_ANT_CTRL_COMPL hardware_pin(HARDWARE_ant_ctrl_compl)
28 // Radio power
29 #define GPIO_PIN_PA_ENABLE hardware_pin(HARDWARE_power_enable)
30 #define GPIO_PIN_RFamp_APC2 hardware_pin(HARDWARE_power_apc2)
31 #define GPIO_PIN_RX_ENABLE hardware_pin(HARDWARE_power_rxen)
32 #define GPIO_PIN_TX_ENABLE hardware_pin(HARDWARE_power_txen)
33 #define GPIO_PIN_RX_ENABLE_2 hardware_pin(HARDWARE_power_rxen_2)
34 #define GPIO_PIN_TX_ENABLE_2 hardware_pin(HARDWARE_power_txen_2)
35 #define LBT_RSSI_THRESHOLD_OFFSET_DB hardware_int(HARDWARE_power_lna_gain)
36 #define MinPower (PowerLevels_e)hardware_int(HARDWARE_power_min)
37 #define MaxPower (PowerLevels_e)hardware_int(HARDWARE_power_max)
38 #define DefaultPower (PowerLevels_e)hardware_int(HARDWARE_power_default)
40 #define GPIO_PIN_PA_PDET hardware_pin(HARDWARE_power_pdet)
41 #define SKY85321_PDET_INTERCEPT hardware_float(HARDWARE_power_pdet_intercept)
42 #define SKY85321_PDET_SLOPE hardware_float(HARDWARE_power_pdet_slope)
44 // default value 0 means direct!
45 #define POWER_OUTPUT_DACWRITE (hardware_int(HARDWARE_power_control)==3)
46 #define POWER_OUTPUT_VALUES hardware_i16_array(HARDWARE_power_values)
47 #define POWER_OUTPUT_VALUES_COUNT hardware_int(HARDWARE_power_values_count)
48 #define POWER_OUTPUT_VALUES2 hardware_i16_array(HARDWARE_power_values2)
49 #define POWER_OUTPUT_VALUES_DUAL hardware_i16_array(HARDWARE_power_values_dual)
50 #define POWER_OUTPUT_VALUES_DUAL_COUNT hardware_int(HARDWARE_power_values_dual_count)
52 // Input
53 #define GPIO_PIN_JOYSTICK hardware_pin(HARDWARE_joystick)
54 #define JOY_ADC_VALUES hardware_u16_array(HARDWARE_joystick_values)
56 #define GPIO_PIN_FIVE_WAY_INPUT1 hardware_pin(HARDWARE_five_way1)
57 #define GPIO_PIN_FIVE_WAY_INPUT2 hardware_pin(HARDWARE_five_way2)
58 #define GPIO_PIN_FIVE_WAY_INPUT3 hardware_pin(HARDWARE_five_way3)
60 #define GPIO_PIN_BUTTON hardware_pin(HARDWARE_button)
61 #define USER_BUTTON_LED hardware_pin(HARDWARE_button_led_index)
62 #define GPIO_PIN_BUTTON2 hardware_pin(HARDWARE_button2)
63 #define USER_BUTTON2_LED hardware_pin(HARDWARE_button2_led_index)
65 // Lighting
66 #define GPIO_PIN_LED_BLUE hardware_pin(HARDWARE_led_blue)
67 #define GPIO_LED_BLUE_INVERTED hardware_pin(HARDWARE_led_blue_invert)
68 #define GPIO_PIN_LED_GREEN hardware_pin(HARDWARE_led_green)
69 #define GPIO_LED_GREEN_INVERTED hardware_flag(HARDWARE_led_green_invert)
70 #define GPIO_PIN_LED_RED (hardware_pin(HARDWARE_led_red) == UNDEF_PIN ? hardware_pin(HARDWARE_led) : hardware_pin(HARDWARE_led_red))
71 #define GPIO_LED_RED_INVERTED hardware_pin(HARDWARE_led_red_invert)
73 #define GPIO_PIN_LED_WS2812 hardware_pin(HARDWARE_led_rgb)
74 #define OPT_WS2812_IS_GRB hardware_flag(HARDWARE_led_rgb_isgrb)
75 #define WS2812_STATUS_LEDS hardware_i16_array(HARDWARE_ledidx_rgb_status)
76 #define WS2812_STATUS_LEDS_COUNT hardware_int(HARDWARE_ledidx_rgb_status_count)
77 #define WS2812_VTX_STATUS_LEDS hardware_i16_array(HARDWARE_ledidx_rgb_vtx)
78 #define WS2812_VTX_STATUS_LEDS_COUNT hardware_int(HARDWARE_ledidx_rgb_vtx_count)
79 #define WS2812_BOOT_LEDS hardware_i16_array(HARDWARE_ledidx_rgb_boot)
80 #define WS2812_BOOT_LEDS_COUNT hardware_int(HARDWARE_ledidx_rgb_boot_count)
82 // OLED/TFT
83 #define OPT_HAS_SCREEN (hardware_int(HARDWARE_screen_type) > 0)
84 #define OPT_HAS_OLED_I2C (hardware_int(HARDWARE_screen_type)==1)
85 #define OPT_HAS_OLED_SPI (hardware_int(HARDWARE_screen_type)==2)
86 #define OPT_HAS_OLED_SPI_SMALL (hardware_int(HARDWARE_screen_type)==3)
87 #define OPT_HAS_TFT_SCREEN (hardware_int(HARDWARE_screen_type)==4)
89 #define GPIO_PIN_SCREEN_CS hardware_pin(HARDWARE_screen_cs) // SPI
90 #define GPIO_PIN_SCREEN_DC hardware_pin(HARDWARE_screen_dc) // SPI
91 #define GPIO_PIN_SCREEN_MOSI hardware_pin(HARDWARE_screen_mosi) // SPI
92 #define GPIO_PIN_SCREEN_RST hardware_pin(HARDWARE_screen_rst) // SPI & I2c (optional)
93 #define GPIO_PIN_SCREEN_SCK hardware_pin(HARDWARE_screen_sck) // clock for SPI & I2C
94 #define GPIO_PIN_SCREEN_SDA hardware_pin(HARDWARE_screen_sda) // I2C data
95 #define GPIO_PIN_SCREEN_BL hardware_pin(HARDWARE_screen_bl) // Backlight
96 #define OPT_SCREEN_REVERSED hardware_flag(HARDWARE_screen_reversed)
98 // Backpack
99 #define OPT_USE_TX_BACKPACK hardware_flag(HARDWARE_use_backpack)
100 #define BACKPACK_LOGGING_BAUD hardware_int(HARDWARE_debug_backpack_baud)
101 #define GPIO_PIN_DEBUG_RX hardware_pin(HARDWARE_debug_backpack_rx)
102 #define GPIO_PIN_DEBUG_TX hardware_pin(HARDWARE_debug_backpack_tx)
103 #define GPIO_PIN_BACKPACK_BOOT hardware_pin(HARDWARE_backpack_boot)
104 #define GPIO_PIN_BACKPACK_EN hardware_pin(HARDWARE_backpack_en)
105 #define PASSTHROUGH_BAUD hardware_int(HARDWARE_passthrough_baud)
107 // I2C
108 #define GPIO_PIN_SCL hardware_pin(HARDWARE_i2c_scl)
109 #define GPIO_PIN_SDA hardware_pin(HARDWARE_i2c_sda)
111 // Misc sensors & things
112 #define GPIO_PIN_FAN_EN hardware_pin(HARDWARE_misc_fan_en)
113 #define GPIO_PIN_FAN_PWM hardware_pin(HARDWARE_misc_fan_pwm)
114 #define GPIO_PIN_FAN_TACHO hardware_pin(HARDWARE_misc_fan_tacho)
115 #define GPIO_PIN_FAN_SPEEDS hardware_u16_array(HARDWARE_misc_fan_speeds)
116 #define GPIO_PIN_FAN_SPEEDS_COUNT hardware_int(HARDWARE_misc_fan_speeds_count)
118 #define OPT_HAS_GSENSOR_STK8xxx hardware_flag(HARDWARE_gsensor_stk8xxx)
119 #define OPT_HAS_GSENSOR OPT_HAS_GSENSOR_STK8xxx // If any of the sensors are present
120 #define GPIO_PIN_GSENSOR_INT hardware_pin(HARDWARE_misc_gsensor_int)
122 #define OPT_HAS_THERMAL_LM75A hardware_flag(HARDWARE_thermal_lm75a)
123 #define OPT_HAS_THERMAL OPT_HAS_THERMAL_LM75A // If any of the sensors are present
125 #define OPT_HAS_VTX_SPI false
126 #define GPIO_PIN_SPI_VTX_NSS UNDEF_PIN