Allow LR1121 single RF path (#2998)
[ExpressLRS.git] / src / include / target / Unified_ESP_RX.h
blobe83bc186a8cb7e3df632db02faec60a578762671
1 #define TARGET_UNIFIED_RX
3 // DEVICE_NAME is not defined here because we get it from the SPIFFS file system
5 // // FM30
6 // TARGET_TX_FM30
7 // GPIO_PIN_ANT_CTRL
8 // GPIO_PIN_BLUETOOTH_EN
9 // GPIO_PIN_UART1RX_INVERT
10 // GPIO_PIN_UART1TX_INVERT
11 // GPIO_PIN_UART3RX_INVERT
13 // // Ghost
14 // TARGET_RX_GHOST_ATTO_V1
15 // TARGET_TX_GHOST
16 // TARGET_TX_GHOST_LITE
17 // GPIO_PIN_RF_AMP_DET // unused
19 // // Frsky/HM915
20 // GPIO_PIN_VRF1 // unused
21 // GPIO_PIN_VRF2 // unused
22 // GPIO_PIN_SWR // unused
23 // TARGET_EEPROM_400K
24 // TARGET_EEPROM_ADDR
25 // TARGET_USE_EEPROM
27 // // various (unused)
28 // GPIO_PIN_DIP1
29 // GPIO_PIN_DIP2
30 // GPIO_PIN_DIP3
31 // GPIO_PIN_DIP4
34 // ====================================
37 // Serial
38 #define GPIO_PIN_RCSIGNAL_RX hardware_pin(HARDWARE_serial_rx)
39 #define GPIO_PIN_RCSIGNAL_TX hardware_pin(HARDWARE_serial_tx)
40 #define GPIO_PIN_SERIAL1_RX hardware_pin(HARDWARE_serial1_rx)
41 #define GPIO_PIN_SERIAL1_TX hardware_pin(HARDWARE_serial1_tx)
43 // Radio
44 #define GPIO_PIN_BUSY hardware_pin(HARDWARE_radio_busy)
45 #define GPIO_PIN_BUSY_2 hardware_pin(HARDWARE_radio_busy_2)
46 #define GPIO_PIN_DIO0 hardware_pin(HARDWARE_radio_dio0)
47 #define GPIO_PIN_DIO0_2 hardware_pin(HARDWARE_radio_dio0_2)
48 #define GPIO_PIN_DIO1 hardware_pin(HARDWARE_radio_dio1)
49 #define GPIO_PIN_DIO1_2 hardware_pin(HARDWARE_radio_dio1_2)
50 #define GPIO_PIN_DIO2 hardware_pin(HARDWARE_radio_dio2)
51 #define GPIO_PIN_MISO hardware_pin(HARDWARE_radio_miso)
52 #define GPIO_PIN_MOSI hardware_pin(HARDWARE_radio_mosi)
53 #define GPIO_PIN_NSS hardware_pin(HARDWARE_radio_nss)
54 #define GPIO_PIN_NSS_2 hardware_pin(HARDWARE_radio_nss_2)
55 #define GPIO_PIN_RST hardware_pin(HARDWARE_radio_rst)
56 #define GPIO_PIN_RST_2 hardware_pin(HARDWARE_radio_rst_2)
57 #define GPIO_PIN_SCK hardware_pin(HARDWARE_radio_sck)
58 #define USE_HARDWARE_DCDC
59 #define OPT_USE_HARDWARE_DCDC hardware_flag(HARDWARE_radio_dcdc)
60 #define USE_SX1276_RFO_HF
61 #define OPT_USE_SX1276_RFO_HF hardware_flag(HARDWARE_radio_rfo_hf)
62 #define LR1121_RFSW_CTRL hardware_u16_array(HARDWARE_radio_rfsw_ctrl)
63 #define LR1121_RFSW_CTRL_COUNT hardware_int(HARDWARE_radio_rfsw_ctrl_count)
65 // Radio Antenna
66 #define GPIO_PIN_ANT_CTRL hardware_pin(HARDWARE_ant_ctrl)
67 #define GPIO_PIN_ANT_CTRL_COMPL hardware_pin(HARDWARE_ant_ctrl_compl)
69 // Radio power
70 #define GPIO_PIN_PA_ENABLE hardware_pin(HARDWARE_power_enable)
71 #define GPIO_PIN_RFamp_APC1 hardware_pin(HARDWARE_power_apc1)
72 #define GPIO_PIN_RFamp_APC2 hardware_pin(HARDWARE_power_apc2)
73 #define GPIO_PIN_RX_ENABLE hardware_pin(HARDWARE_power_rxen)
74 #define GPIO_PIN_TX_ENABLE hardware_pin(HARDWARE_power_txen)
75 #define GPIO_PIN_RX_ENABLE_2 hardware_pin(HARDWARE_power_rxen_2)
76 #define GPIO_PIN_TX_ENABLE_2 hardware_pin(HARDWARE_power_txen_2)
77 #define LBT_RSSI_THRESHOLD_OFFSET_DB hardware_int(HARDWARE_power_lna_gain)
78 #define MinPower (PowerLevels_e)hardware_int(HARDWARE_power_min)
79 #define HighPower (PowerLevels_e)hardware_int(HARDWARE_power_high)
80 #define MaxPower (PowerLevels_e)hardware_int(HARDWARE_power_max)
81 #define DefaultPower (PowerLevels_e)hardware_int(HARDWARE_power_default)
83 #define USE_SKY85321
84 #define GPIO_PIN_PA_PDET hardware_pin(HARDWARE_power_pdet)
85 #define SKY85321_PDET_INTERCEPT hardware_float(HARDWARE_power_pdet_intercept)
86 #define SKY85321_PDET_SLOPE hardware_float(HARDWARE_power_pdet_slope)
88 // default value 0 means direct!
89 // #define POWER_OUTPUT_ANALOG (hardware_int(HARDWARE_power_control)==1) // frsky only
90 // #define POWER_OUTPUT_DAC (hardware_int(HARDWARE_power_control)==2) // stm32 only
91 #define POWER_OUTPUT_DACWRITE (hardware_int(HARDWARE_power_control)==3)
92 #define POWER_OUTPUT_FIXED -99
93 #define POWER_OUTPUT_VALUES hardware_i16_array(HARDWARE_power_values)
94 #define POWER_OUTPUT_VALUES_COUNT hardware_int(HARDWARE_power_values_count)
95 #define POWER_OUTPUT_VALUES2 hardware_i16_array(HARDWARE_power_values2)
96 #define POWER_OUTPUT_VALUES_DUAL hardware_i16_array(HARDWARE_power_values_dual)
97 #define POWER_OUTPUT_VALUES_DUAL_COUNT hardware_int(HARDWARE_power_values_dual_count)
99 // Input
100 #define GPIO_PIN_BUTTON hardware_pin(HARDWARE_button)
102 // Lighting
103 #define GPIO_PIN_LED hardware_pin(HARDWARE_led)
104 #define GPIO_PIN_LED_BLUE hardware_pin(HARDWARE_led_blue)
105 #define GPIO_LED_BLUE_INVERTED hardware_pin(HARDWARE_led_blue_invert)
106 #define GPIO_PIN_LED_GREEN hardware_pin(HARDWARE_led_green)
107 #define GPIO_LED_GREEN_INVERTED hardware_flag(HARDWARE_led_green_invert)
108 #define GPIO_PIN_LED_GREEN_RED hardware_pin(HARDWARE_led_green_red)
109 #define GPIO_PIN_LED_RED hardware_pin(HARDWARE_led_red)
110 #define GPIO_LED_RED_INVERTED hardware_pin(HARDWARE_led_red_invert)
111 #define GPIO_PIN_LED_RED_GREEN hardware_pin(HARDWARE_led_red_green)
112 #define GPIO_PIN_LED_WS2812 hardware_pin(HARDWARE_led_rgb)
113 // #define GPIO_PIN_LED_WS2812_FAST // stm32
114 #define WS2812_IS_GRB
115 #define OPT_WS2812_IS_GRB hardware_flag(HARDWARE_led_rgb_isgrb)
116 #define WS2812_STATUS_LEDS hardware_i16_array(HARDWARE_ledidx_rgb_status)
117 #define WS2812_STATUS_LEDS_COUNT hardware_int(HARDWARE_ledidx_rgb_status_count)
118 #define WS2812_VTX_STATUS_LEDS hardware_i16_array(HARDWARE_ledidx_rgb_vtx)
119 #define WS2812_VTX_STATUS_LEDS_COUNT hardware_int(HARDWARE_ledidx_rgb_vtx_count)
120 #define WS2812_BOOT_LEDS hardware_i16_array(HARDWARE_ledidx_rgb_boot)
121 #define WS2812_BOOT_LEDS_COUNT hardware_int(HARDWARE_ledidx_rgb_boot_count)
123 // I2C
124 #define GPIO_PIN_SCL hardware_pin(HARDWARE_i2c_scl)
125 #define GPIO_PIN_SDA hardware_pin(HARDWARE_i2c_sda)
127 // PWM
128 #define GPIO_PIN_PWM_OUTPUTS hardware_i16_array(HARDWARE_pwm_outputs)
129 #define GPIO_PIN_PWM_OUTPUTS_COUNT hardware_int(HARDWARE_pwm_outputs_count)
131 // VBat
132 #define USE_ANALOG_VBAT
133 #define GPIO_ANALOG_VBAT hardware_pin(HARDWARE_vbat)
134 #define ANALOG_VBAT_OFFSET hardware_int(HARDWARE_vbat_offset)
135 #define ANALOG_VBAT_SCALE hardware_int(HARDWARE_vbat_scale)
137 #if defined(PLATFORM_ESP32)
138 // VTX
139 #define HAS_VTX_SPI
140 #define HAS_MSP_VTX
141 #define OPT_HAS_VTX_SPI (hardware_pin(HARDWARE_vtx_nss) != UNDEF_PIN)
142 #define GPIO_PIN_RF_AMP_PWM hardware_pin(HARDWARE_vtx_amp_pwm)
143 #define GPIO_PIN_RF_AMP_VPD hardware_pin(HARDWARE_vtx_amp_vpd)
144 #define GPIO_PIN_RF_AMP_VREF hardware_pin(HARDWARE_vtx_amp_vref)
145 #define GPIO_PIN_SPI_VTX_NSS hardware_pin(HARDWARE_vtx_nss)
146 #define GPIO_PIN_SPI_VTX_MISO hardware_pin(HARDWARE_vtx_miso)
147 #define GPIO_PIN_SPI_VTX_MOSI hardware_pin(HARDWARE_vtx_mosi)
148 #define GPIO_PIN_SPI_VTX_SCK hardware_pin(HARDWARE_vtx_sck)
149 #define VPD_VALUES_25MW hardware_u16_array(HARDWARE_vtx_amp_vpd_25mW)
150 #define VPD_VALUES_100MW hardware_u16_array(HARDWARE_vtx_amp_vpd_100mW)
151 #define PWM_VALUES_25MW hardware_u16_array(HARDWARE_vtx_amp_pwm_25mW)
152 #define PWM_VALUES_100MW hardware_u16_array(HARDWARE_vtx_amp_pwm_100mW)
153 #endif
155 #define GPIO_PIN_FAN_EN hardware_pin(HARDWARE_misc_fan_en)