Add missing wifi targets for some DIY modules (#1210)
[ExpressLRS.git] / src / include / targets.h
blobc2b50f53ca75d3a9d3eaf00f8b0d4749a10d4ee8
1 #pragma once
2 #if !defined TARGET_NATIVE
3 #include <Arduino.h>
4 #endif
6 #define UNDEF_PIN (-1)
8 /// General Features ///
9 #define LED_MAX_BRIGHTNESS 50 //0..255 for max led brightness
11 /////////////////////////
13 #define WORD_ALIGNED_ATTR __attribute__((aligned(4)))
15 #ifdef PLATFORM_STM32
16 #define ICACHE_RAM_ATTR //nothing//
17 #else
18 #undef ICACHE_RAM_ATTR //fix to allow both esp32 and esp8266 to use ICACHE_RAM_ATTR for mapping to IRAM
19 #define ICACHE_RAM_ATTR IRAM_ATTR
20 #endif
22 #if defined(TARGET_NATIVE)
23 #define IRAM_ATTR
24 #include "native.h"
25 #endif
27 #if defined(PLATFORM_STM32)
28 #ifdef GPIO_PIN_LED_WS2812
29 #ifndef GPIO_PIN_LED_WS2812_FAST
30 #error "WS2812 support requires _FAST pin!"
31 #endif
32 #else
33 #define GPIO_PIN_LED_WS2812 UNDEF_PIN
34 #define GPIO_PIN_LED_WS2812_FAST UNDEF_PIN
35 #endif
36 #endif
38 /* Set red led to default */
39 #ifndef GPIO_PIN_LED
40 #ifdef GPIO_PIN_LED_RED
41 #define GPIO_PIN_LED GPIO_PIN_LED_RED
42 #endif /* GPIO_PIN_LED_RED */
43 #endif /* GPIO_PIN_LED */
45 #ifndef GPIO_PIN_BUFFER_OE
46 #define GPIO_PIN_BUFFER_OE UNDEF_PIN
47 #endif
48 #ifndef GPIO_PIN_RST
49 #define GPIO_PIN_RST UNDEF_PIN
50 #endif
51 #ifndef GPIO_PIN_BUSY
52 #define GPIO_PIN_BUSY UNDEF_PIN
53 #endif
54 #ifndef GPIO_PIN_DIO0
55 #define GPIO_PIN_DIO0 UNDEF_PIN
56 #endif
57 #ifndef GPIO_PIN_DIO1
58 #define GPIO_PIN_DIO1 UNDEF_PIN
59 #endif
60 #ifndef GPIO_PIN_DIO2
61 #define GPIO_PIN_DIO2 UNDEF_PIN
62 #endif
63 #ifndef GPIO_PIN_PA_ENABLE
64 #define GPIO_PIN_PA_ENABLE UNDEF_PIN
65 #endif
66 #ifndef GPIO_BUTTON_INVERTED
67 #define GPIO_BUTTON_INVERTED 0
68 #endif
69 #ifndef GPIO_LED_RED_INVERTED
70 #define GPIO_LED_RED_INVERTED 0
71 #endif
72 #ifndef GPIO_LED_GREEN_INVERTED
73 #define GPIO_LED_GREEN_INVERTED 0
74 #endif
76 #if defined(Regulatory_Domain_ISM_2400)
77 // ISM 2400 band is use => undefine other requlatory domain defines
78 #undef Regulatory_Domain_AU_915
79 #undef Regulatory_Domain_EU_868
80 #undef Regulatory_Domain_IN_866
81 #undef Regulatory_Domain_FCC_915
82 #undef Regulatory_Domain_AU_433
83 #undef Regulatory_Domain_EU_433
85 #elif !(defined(Regulatory_Domain_AU_915) || defined(Regulatory_Domain_FCC_915) || \
86 defined(Regulatory_Domain_EU_868) || defined(Regulatory_Domain_IN_866) || \
87 defined(Regulatory_Domain_AU_433) || defined(Regulatory_Domain_EU_433) || \
88 defined(UNIT_TEST))
89 #error "Regulatory_Domain is not defined for 900MHz devices. Check user_defines.txt!"
90 #endif