mirror of https://github.com/arendst/Tasmota.git
3160 lines
153 KiB
C
3160 lines
153 KiB
C
/*
|
||
tasmota_template.h - template settings for Tasmota
|
||
|
||
Copyright (C) 2021 Theo Arends
|
||
|
||
This program is free software: you can redistribute it and/or modify
|
||
it under the terms of the GNU General Public License as published by
|
||
the Free Software Foundation, either version 3 of the License, or
|
||
(at your option) any later version.
|
||
|
||
This program is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
|
||
You should have received a copy of the GNU General Public License
|
||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
*/
|
||
|
||
#ifndef _TASMOTA_TEMPLATE_H_
|
||
#define _TASMOTA_TEMPLATE_H_
|
||
|
||
// User selectable GPIO functionality
|
||
// ATTENTION: Only add at the end of this list just before GPIO_SENSOR_END
|
||
// Then add the same name(s) in a nice location in array kGpioNiceList
|
||
enum UserSelectablePins {
|
||
GPIO_NONE, // Not used
|
||
GPIO_KEY1, GPIO_KEY1_NP, GPIO_KEY1_INV, GPIO_KEY1_INV_NP, // 4 x Button
|
||
GPIO_SWT1, GPIO_SWT1_NP, // 8 x User connected external switches
|
||
GPIO_REL1, GPIO_REL1_INV, // 8 x Relays
|
||
GPIO_LED1, GPIO_LED1_INV, // 4 x Leds
|
||
GPIO_CNTR1, GPIO_CNTR1_NP, // 4 x Counter
|
||
GPIO_PWM1, GPIO_PWM1_INV, // 5 x PWM
|
||
GPIO_BUZZER, GPIO_BUZZER_INV, // Buzzer
|
||
GPIO_LEDLNK, GPIO_LEDLNK_INV, // Link led
|
||
GPIO_I2C_SCL, GPIO_I2C_SDA, // Software I2C
|
||
GPIO_SPI_MISO, GPIO_SPI_MOSI, GPIO_SPI_CLK, GPIO_SPI_CS, GPIO_SPI_DC, // Hardware SPI
|
||
GPIO_SSPI_MISO, GPIO_SSPI_MOSI, GPIO_SSPI_SCLK, GPIO_SSPI_CS, GPIO_SSPI_DC, // Software SPI
|
||
GPIO_BACKLIGHT, // Display backlight control
|
||
GPIO_OLED_RESET, // OLED Display Reset
|
||
GPIO_IRSEND, GPIO_IRRECV, // IR interface
|
||
GPIO_RFSEND, GPIO_RFRECV, // RF interface
|
||
GPIO_DHT11, GPIO_DHT22, GPIO_SI7021, GPIO_DHT11_OUT, // DHT11, DHT21, DHT22, AM2301, AM2302, AM2321
|
||
GPIO_DSB, GPIO_DSB_OUT, // DS18B20 or DS18S20
|
||
GPIO_WS2812, // WS2812 Led string
|
||
GPIO_MHZ_TXD, GPIO_MHZ_RXD, // MH-Z19 Serial interface
|
||
GPIO_PZEM0XX_TX, GPIO_PZEM004_RX, GPIO_PZEM016_RX, GPIO_PZEM017_RX, // PZEM Serial Modbus interface
|
||
GPIO_SAIR_TX, GPIO_SAIR_RX, // SenseAir Serial interface
|
||
GPIO_PMS5003_TX, GPIO_PMS5003_RX, // Plantower PMS5003 Serial interface
|
||
GPIO_SDS0X1_TX, GPIO_SDS0X1_RX, // Nova Fitness SDS011 Serial interface
|
||
GPIO_SBR_TX, GPIO_SBR_RX, // Serial Bridge Serial interface
|
||
GPIO_SR04_TRIG, GPIO_SR04_ECHO, // SR04 interface
|
||
GPIO_SDM120_TX, GPIO_SDM120_RX, // SDM120 Serial interface
|
||
GPIO_SDM630_TX, GPIO_SDM630_RX, // SDM630 Serial interface
|
||
GPIO_TM1638CLK, GPIO_TM1638DIO, GPIO_TM1638STB, // TM1638 interface
|
||
GPIO_MP3_DFR562, // RB-DFR-562, DFPlayer Mini MP3 Player
|
||
GPIO_HX711_SCK, GPIO_HX711_DAT, // HX711 Load Cell interface
|
||
GPIO_TX2X_TXD_BLACK, // TX20/TX23 Transmission Pin
|
||
GPIO_TUYA_TX, GPIO_TUYA_RX, // Tuya Serial interface
|
||
GPIO_MGC3130_XFER, GPIO_MGC3130_RESET, // MGC3130 interface
|
||
GPIO_RF_SENSOR, // Rf receiver with sensor decoding
|
||
GPIO_AZ_TXD, GPIO_AZ_RXD, // AZ-Instrument 7798 Serial interface
|
||
GPIO_MAX31855CS, GPIO_MAX31855CLK, GPIO_MAX31855DO, // MAX31855 Serial interface
|
||
GPIO_NRG_SEL, GPIO_NRG_SEL_INV, GPIO_NRG_CF1, GPIO_HLW_CF, GPIO_HJL_CF, // HLW8012/HJL-01/BL0937 energy monitoring
|
||
GPIO_MCP39F5_TX, GPIO_MCP39F5_RX, GPIO_MCP39F5_RST, // MCP39F501 Energy monitoring (Shelly2)
|
||
GPIO_PN532_TXD, GPIO_PN532_RXD, // PN532 NFC Serial interface
|
||
GPIO_SM16716_CLK, GPIO_SM16716_DAT, GPIO_SM16716_SEL, // SM16716 SELECT
|
||
GPIO_DI, GPIO_DCKI, // my92x1 PWM controller
|
||
GPIO_CSE7766_TX, GPIO_CSE7766_RX, // CSE7766 Serial interface (S31 and Pow R2)
|
||
GPIO_ARIRFRCV, GPIO_ARIRFSEL, // Arilux RF Receive input
|
||
GPIO_TXD, GPIO_RXD, // Serial interface
|
||
GPIO_ROT1A, GPIO_ROT1B, // Rotary switch
|
||
GPIO_ADC_JOY, // Analog joystick
|
||
GPIO_SSPI_MAX31865_CS1, // MAX31865 Chip Select
|
||
GPIO_HRE_CLOCK, GPIO_HRE_DATA, // HR-E Water Meter
|
||
GPIO_ADE7953_IRQ, // ADE7953 IRQ
|
||
GPIO_SOLAXX1_TX, GPIO_SOLAXX1_RX, // Solax Inverter Serial interface
|
||
GPIO_ZIGBEE_TX, GPIO_ZIGBEE_RX, // Zigbee Serial interface
|
||
GPIO_RDM6300_RX, // RDM6300 RX
|
||
GPIO_IBEACON_TX, GPIO_IBEACON_RX, // HM17 IBEACON Serial interface
|
||
GPIO_A4988_DIR, GPIO_A4988_STP, GPIO_A4988_ENA, GPIO_A4988_MS1, // A4988 interface
|
||
GPIO_OUTPUT_HI, GPIO_OUTPUT_LO, // Fixed output state
|
||
GPIO_DDS2382_TX, GPIO_DDS2382_RX, // DDS2382 Serial interface
|
||
GPIO_DDSU666_TX, GPIO_DDSU666_RX, // DDSU666 Serial interface
|
||
GPIO_SM2135_CLK, GPIO_SM2135_DAT, // SM2135 PWM controller
|
||
GPIO_DEEPSLEEP, // Kill switch for deepsleep
|
||
GPIO_EXS_ENABLE, // EXS MCU Enable
|
||
GPIO_TASMOTACLIENT_TXD, GPIO_TASMOTACLIENT_RXD, // Client Serial interface
|
||
GPIO_TASMOTACLIENT_RST, GPIO_TASMOTACLIENT_RST_INV, // Client Reset
|
||
GPIO_HPMA_RX, GPIO_HPMA_TX, // Honeywell HPMA115S0 Serial interface
|
||
GPIO_GPS_RX, GPIO_GPS_TX, // GPS Serial interface
|
||
GPIO_HM10_RX, GPIO_HM10_TX, // HM10-BLE-Mijia-bridge Serial interface
|
||
GPIO_LE01MR_RX, GPIO_LE01MR_TX, // F&F LE-01MR energy meter
|
||
GPIO_CC1101_GDO0, GPIO_CC1101_GDO2, // CC1101 Serial interface
|
||
GPIO_HRXL_RX, // Data from MaxBotix HRXL sonar range sensor
|
||
GPIO_ELECTRIQ_MOODL_TX, // ElectriQ iQ-wifiMOODL Serial TX
|
||
GPIO_AS3935, // Franklin Lightning Sensor
|
||
GPIO_ADC_INPUT, // Analog input
|
||
GPIO_ADC_TEMP, // Analog Thermistor
|
||
GPIO_ADC_LIGHT, // Analog Light sensor
|
||
GPIO_ADC_BUTTON, GPIO_ADC_BUTTON_INV, // Analog Button
|
||
GPIO_ADC_RANGE, // Analog Range
|
||
GPIO_ADC_CT_POWER, // ANalog Current
|
||
#ifdef ESP32
|
||
GPIO_WEBCAM_PWDN, GPIO_WEBCAM_RESET, GPIO_WEBCAM_XCLK, // Webcam
|
||
GPIO_WEBCAM_SIOD, GPIO_WEBCAM_SIOC, // Webcam I2C
|
||
GPIO_WEBCAM_DATA,
|
||
GPIO_WEBCAM_VSYNC, GPIO_WEBCAM_HREF, GPIO_WEBCAM_PCLK,
|
||
GPIO_WEBCAM_PSCLK,
|
||
GPIO_WEBCAM_HSD,
|
||
GPIO_WEBCAM_PSRCS,
|
||
#endif
|
||
GPIO_BOILER_OT_RX, GPIO_BOILER_OT_TX, // OpenTherm Boiler TX pin
|
||
GPIO_WINDMETER_SPEED, // WindMeter speed counter pin
|
||
GPIO_KEY1_TC, // Touch pin as button
|
||
GPIO_BL0940_RX, // BL0940 serial interface
|
||
GPIO_TCP_TX, GPIO_TCP_RX, // TCP to serial bridge
|
||
#ifdef ESP32
|
||
GPIO_ETH_PHY_POWER, GPIO_ETH_PHY_MDC, GPIO_ETH_PHY_MDIO, // Ethernet
|
||
#endif
|
||
GPIO_TELEINFO_RX, // Teleinfo telemetry data receive pin
|
||
GPIO_TELEINFO_ENABLE, // Teleinfo Enable Receive Pin
|
||
GPIO_LMT01, // LMT01 input counting pin
|
||
GPIO_IEM3000_TX, GPIO_IEM3000_RX, // IEM3000 Serial interface
|
||
GPIO_ZIGBEE_RST, // Zigbee reset
|
||
GPIO_DYP_RX,
|
||
GPIO_MIEL_HVAC_TX, GPIO_MIEL_HVAC_RX, // Mitsubishi Electric HVAC
|
||
GPIO_WE517_TX, GPIO_WE517_RX, // ORNO WE517 Serial interface
|
||
GPIO_AS608_TX, GPIO_AS608_RX, // Serial interface AS608 / R503
|
||
GPIO_SHELLY_DIMMER_BOOT0, GPIO_SHELLY_DIMMER_RST_INV,
|
||
GPIO_RC522_RST, // RC522 reset
|
||
GPIO_P9813_CLK, GPIO_P9813_DAT, // P9813 Clock and Data
|
||
GPIO_OPTION_A, // Specific device options to be served in code
|
||
GPIO_FTC532, // FTC532 touch ctrlr serial input
|
||
GPIO_RC522_CS,
|
||
GPIO_NRF24_CS, GPIO_NRF24_DC,
|
||
GPIO_ILI9341_CS, GPIO_ILI9341_DC,
|
||
GPIO_ILI9488_CS,
|
||
GPIO_EPAPER29_CS,
|
||
GPIO_EPAPER42_CS,
|
||
GPIO_SSD1351_CS,
|
||
GPIO_RA8876_CS,
|
||
GPIO_ST7789_CS, GPIO_ST7789_DC,
|
||
GPIO_SSD1331_CS, GPIO_SSD1331_DC,
|
||
GPIO_SDCARD_CS,
|
||
GPIO_ROT1A_NP, GPIO_ROT1B_NP, // Rotary switch
|
||
GPIO_ADC_PH, // Analog PH Sensor
|
||
GPIO_BS814_CLK, GPIO_BS814_DAT, // Holtek BS814A2 touch ctrlr
|
||
GPIO_WIEGAND_D0, GPIO_WIEGAND_D1, // Wiegand Data lines
|
||
GPIO_NEOPOOL_TX, GPIO_NEOPOOL_RX, // Sugar Valley RS485 interface
|
||
GPIO_SDM72_TX, GPIO_SDM72_RX, // SDM72 Serial interface
|
||
GPIO_TM1637CLK, GPIO_TM1637DIO, // TM1637 interface
|
||
GPIO_PROJECTOR_CTRL_TX, GPIO_PROJECTOR_CTRL_RX, // LCD/DLP Projector Serial Control
|
||
GPIO_SSD1351_DC,
|
||
GPIO_XPT2046_CS, // XPT2046 SPI Chip Select
|
||
GPIO_CSE7761_TX, GPIO_CSE7761_RX, // CSE7761 Serial interface (Dual R3)
|
||
GPIO_VL53LXX_XSHUT1, // VL53LXX_XSHUT (the max number of sensors is VL53LXX_MAX_SENSORS)- Used when connecting multiple VL53LXX
|
||
GPIO_MAX7219CLK, GPIO_MAX7219DIN, GPIO_MAX7219CS, // MAX7219 interface
|
||
GPIO_TFMINIPLUS_TX, GPIO_TFMINIPLUS_RX, // TFmini Plus ToF sensor
|
||
GPIO_ZEROCROSS,
|
||
#ifdef ESP32
|
||
GPIO_HALLEFFECT,
|
||
GPIO_EPD_DATA, // Base connection EPD driver
|
||
#endif
|
||
GPIO_INPUT,
|
||
#ifdef ESP32
|
||
GPIO_KEY1_PD, GPIO_KEY1_INV_PD, GPIO_SWT1_PD,
|
||
#endif
|
||
GPIO_I2S_OUT_DATA, GPIO_I2S_OUT_CLK, GPIO_I2S_OUT_SLCT,
|
||
GPIO_I2S_IN_DATA, GPIO_I2S_IN_CLK, GPIO_I2S_IN_SLCT,
|
||
GPIO_INTERRUPT,
|
||
GPIO_MCP2515_CS, // MCP2515 Chip Select
|
||
GPIO_HRG15_TX, GPIO_HRG15_RX, // Hydreon RG-15 rain sensor serial interface
|
||
GPIO_VINDRIKTNING_RX, // IKEA VINDRIKTNING Serial interface
|
||
GPIO_BL0939_RX, // BL0939 Serial interface (Dual R3 v2)
|
||
GPIO_BL0942_RX, // BL0942 Serial interface
|
||
GPIO_HM330X_SET, // HM330X SET pin (sleep when low)
|
||
GPIO_HEARTBEAT, GPIO_HEARTBEAT_INV,
|
||
GPIO_SHIFT595_SRCLK, GPIO_SHIFT595_RCLK, GPIO_SHIFT595_OE, GPIO_SHIFT595_SER, // 74x595 Shift register
|
||
GPIO_SOLAXX1_RTS, // Solax Inverter Serial interface
|
||
GPIO_OPTION_E, // Emulated module
|
||
GPIO_SDM230_TX, GPIO_SDM230_RX, // SDM230 Serial interface
|
||
GPIO_ADC_MQ, // Analog MQ Sensor
|
||
GPIO_CM11_TXD, GPIO_CM11_RXD, // CM11 Serial interface
|
||
GPIO_BL6523_TX, GPIO_BL6523_RX, // BL6523 based Watt meter Serial interface
|
||
GPIO_ADE7880_IRQ, // ADE7880 IRQ
|
||
GPIO_RESET, // Generic reset
|
||
GPIO_SENSOR_END };
|
||
|
||
enum ProgramSelectablePins {
|
||
GPIO_FIX_START = 2046,
|
||
GPIO_USER, // User configurable needs to be 2047
|
||
GPIO_MAX };
|
||
|
||
#define MAX_OPTIONS_A 6 // Increase if more bits are used from GpioOptionABits
|
||
|
||
typedef union { // Restricted by MISRA-C Rule 18.4 but so useful...
|
||
uint32_t data; // Allow bit manipulation using SetOption
|
||
struct { // GPIO Option_A1 .. Option_A32
|
||
uint32_t pwm1_input : 1; // bit 0 (v9.2.0.1) - Option_A1 - (Light) Change PWM1 to input on power off and no fade running (1)
|
||
uint32_t dummy_energy : 1; // bit 1 (v9.3.1.2) - Option_A2 - (Energy) Enable dummy values
|
||
uint32_t udisplay_driver : 1; // bit 2 (v9.3.1.2) - Option_A3 - (Display) Universal display driver
|
||
uint32_t enable_ccloader : 1; // bit 3 (v9.4.0.5) - Option_A4 - (Zigbee) Enable CCLoader using Zigbee Rx/Tx/Rst Gpios
|
||
uint32_t rotary_mi_desk : 1; // bit 4 (v9.5.0.5) - Option_A5 - (Rotary) Enable Mi Desk emulation
|
||
uint32_t linkind_support : 1; // bit 5 (v10.1.0.4) - Option_A6 - (Light) LinkInd support
|
||
uint32_t spare06 : 1; // bit 6
|
||
uint32_t spare07 : 1; // bit 7
|
||
uint32_t spare08 : 1; // bit 8
|
||
uint32_t spare09 : 1; // bit 9
|
||
uint32_t spare10 : 1; // bit 10
|
||
uint32_t spare11 : 1; // bit 11
|
||
uint32_t spare12 : 1; // bit 12
|
||
uint32_t spare13 : 1; // bit 13
|
||
uint32_t spare14 : 1; // bit 14
|
||
uint32_t spare15 : 1; // bit 15
|
||
uint32_t spare16 : 1; // bit 16
|
||
uint32_t spare17 : 1; // bit 17
|
||
uint32_t spare18 : 1; // bit 18
|
||
uint32_t spare19 : 1; // bit 19
|
||
uint32_t spare20 : 1; // bit 20
|
||
uint32_t spare21 : 1; // bit 21
|
||
uint32_t spare22 : 1; // bit 22
|
||
uint32_t spare23 : 1; // bit 23
|
||
uint32_t spare24 : 1; // bit 24
|
||
uint32_t spare25 : 1; // bit 25
|
||
uint32_t spare26 : 1; // bit 26
|
||
uint32_t spare27 : 1; // bit 27
|
||
uint32_t spare28 : 1; // bit 28
|
||
uint32_t spare29 : 1; // bit 29
|
||
uint32_t spare30 : 1; // bit 30
|
||
uint32_t spare31 : 1; // bit 31
|
||
};
|
||
} GpioOptionABits;
|
||
|
||
#ifdef ESP32
|
||
enum SupportedEmulationModules {
|
||
SONOFF_BASIC, SONOFF_RF, SONOFF_SV, SONOFF_TH, SONOFF_DUAL, SONOFF_POW, SONOFF_4CH, SONOFF_S2X, SLAMPHER, SONOFF_TOUCH,
|
||
SONOFF_LED, CH1, CH4, MOTOR, ELECTRODRAGON, EXS_RELAY, WION, WEMOS_DUMMY, SONOFF_DEV, H801,
|
||
SONOFF_SC, SONOFF_BN, SONOFF_4CHPRO, HUAFAN_SS, SONOFF_BRIDGE, SONOFF_B1, AILIGHT, SONOFF_T11, SONOFF_T12, SONOFF_T13,
|
||
SUPLA1, WITTY, YUNSHAN, MAGICHOME, LUANIHVIO, KMC_70011, ARILUX_LC01, ARILUX_LC11, SONOFF_DUAL_R2, ARILUX_LC06,
|
||
SONOFF_S31, ZENGGE_ZF_WF017, SONOFF_POW_R2, SONOFF_IFAN02, BLITZWOLF_BWSHP, SHELLY1, SHELLY2, PHILIPS, NEO_COOLCAM, ESP_SWITCH,
|
||
OBI, TECKIN, APLIC_WDP303075, TUYA_DIMMER, GOSUND, ARMTRONIX_DIMMERS, SK03_TUYA, PS_16_DZ, TECKIN_US, MANZOKU_EU_4,
|
||
OBI2, YTF_IR_BRIDGE, DIGOO, KA10, ZX2820, MI_DESK_LAMP, SP10, WAGA, SYF05, SONOFF_L1,
|
||
SONOFF_IFAN03, EXS_DIMMER, PWM_DIMMER, SONOFF_D1, SONOFF_ZB_BRIDGE,
|
||
MAXMODULE_EMULATION };
|
||
|
||
#define MAX_OPTIONS_E 1 // Increase if more emulated modules are supported from kModuleEmulationList
|
||
|
||
const uint8_t kModuleEmulationList[] PROGMEM = {
|
||
PWM_DIMMER // (v10.1.0.4) - Option_E1 - (Light) USE_PWM_DIMMER support
|
||
};
|
||
#endif // ESP32
|
||
|
||
// Text in webpage Module Parameters and commands GPIOS and GPIO
|
||
const char kSensorNames[] PROGMEM =
|
||
D_SENSOR_NONE "|"
|
||
D_SENSOR_BUTTON "|" D_SENSOR_BUTTON "_n|" D_SENSOR_BUTTON "_i|" D_SENSOR_BUTTON "_in|"
|
||
D_SENSOR_SWITCH "|" D_SENSOR_SWITCH "_n|"
|
||
D_SENSOR_RELAY "|" D_SENSOR_RELAY "_i|"
|
||
D_SENSOR_LED "|" D_SENSOR_LED "_i|"
|
||
D_SENSOR_COUNTER "|" D_SENSOR_COUNTER "_n|"
|
||
D_SENSOR_PWM "|" D_SENSOR_PWM "_i|"
|
||
D_SENSOR_BUZZER "|" D_SENSOR_BUZZER "_i|"
|
||
D_SENSOR_LED_LINK "|" D_SENSOR_LED_LINK "_i|"
|
||
D_SENSOR_I2C_SCL "|" D_SENSOR_I2C_SDA "|"
|
||
D_SENSOR_SPI_MISO "|" D_SENSOR_SPI_MOSI "|" D_SENSOR_SPI_CLK "|" D_SENSOR_SPI_CS "|" D_SENSOR_SPI_DC "|"
|
||
D_SENSOR_SSPI_MISO "|" D_SENSOR_SSPI_MOSI "|" D_SENSOR_SSPI_SCLK "|" D_SENSOR_SSPI_CS "|" D_SENSOR_SSPI_DC "|"
|
||
D_SENSOR_BACKLIGHT "|" D_SENSOR_DISP_RESET "|"
|
||
D_SENSOR_IRSEND "|" D_SENSOR_IRRECV "|"
|
||
D_SENSOR_RFSEND "|" D_SENSOR_RFRECV "|"
|
||
D_SENSOR_DHT11 "|" D_SENSOR_AM2301 "|" D_SENSOR_SI7021 "|" D_SENSOR_DHT11 "_o|"
|
||
D_SENSOR_DS18X20 "|" D_SENSOR_DS18X20 "_o|"
|
||
D_SENSOR_WS2812 "|"
|
||
D_SENSOR_MHZ_TX "|" D_SENSOR_MHZ_RX "|"
|
||
D_SENSOR_PZEM0XX_TX "|" D_SENSOR_PZEM004_RX "|" D_SENSOR_PZEM016_RX "|" D_SENSOR_PZEM017_RX "|"
|
||
D_SENSOR_SAIR_TX "|" D_SENSOR_SAIR_RX "|"
|
||
D_SENSOR_PMS5003_TX "|" D_SENSOR_PMS5003_RX "|"
|
||
D_SENSOR_SDS0X1_TX "|" D_SENSOR_SDS0X1_RX "|"
|
||
D_SENSOR_SBR_TX "|" D_SENSOR_SBR_RX "|"
|
||
D_SENSOR_SR04_TRIG "|" D_SENSOR_SR04_ECHO "|"
|
||
D_SENSOR_SDM120_TX "|" D_SENSOR_SDM120_RX "|"
|
||
D_SENSOR_SDM630_TX "|" D_SENSOR_SDM630_RX "|"
|
||
D_SENSOR_TM1638_CLK "|" D_SENSOR_TM1638_DIO "|" D_SENSOR_TM1638_STB "|"
|
||
D_SENSOR_DFR562 "|"
|
||
D_SENSOR_HX711_SCK "|" D_SENSOR_HX711_DAT "|"
|
||
D_SENSOR_TX2X_TX "|"
|
||
D_SENSOR_TUYA_TX "|" D_SENSOR_TUYA_RX "|"
|
||
D_SENSOR_MGC3130_XFER "|" D_SENSOR_MGC3130_RESET "|"
|
||
D_SENSOR_RF_SENSOR "|"
|
||
D_SENSOR_AZ_TX "|" D_SENSOR_AZ_RX "|"
|
||
D_SENSOR_MAX31855_CS "|" D_SENSOR_MAX31855_CLK "|" D_SENSOR_MAX31855_DO "|"
|
||
D_SENSOR_NRG_SEL "|" D_SENSOR_NRG_SEL "_i|" D_SENSOR_NRG_CF1 "|" D_SENSOR_HLW_CF "|" D_SENSOR_HJL_CF "|"
|
||
D_SENSOR_MCP39F5_TX "|" D_SENSOR_MCP39F5_RX "|" D_SENSOR_MCP39F5_RST "|"
|
||
D_SENSOR_PN532_TX "|" D_SENSOR_PN532_RX "|"
|
||
D_SENSOR_SM16716_CLK "|" D_SENSOR_SM16716_DAT "|" D_SENSOR_SM16716_POWER "|"
|
||
D_SENSOR_MY92X1_DI "|" D_SENSOR_MY92X1_DCKI "|"
|
||
D_SENSOR_CSE7766_TX "|" D_SENSOR_CSE7766_RX "|"
|
||
D_SENSOR_ARIRFRCV "|" D_SENSOR_ARIRFSEL "|"
|
||
D_SENSOR_TXD "|" D_SENSOR_RXD "|"
|
||
D_SENSOR_ROTARY " A|" D_SENSOR_ROTARY " B|"
|
||
D_SENSOR_ADC_JOYSTICK "|"
|
||
D_SENSOR_MAX31865_CS "|"
|
||
D_SENSOR_HRE_CLOCK "|" D_SENSOR_HRE_DATA "|"
|
||
D_SENSOR_ADE7953_IRQ "|"
|
||
D_SENSOR_SOLAXX1_TX "|" D_SENSOR_SOLAXX1_RX "|"
|
||
D_SENSOR_ZIGBEE_TXD "|" D_SENSOR_ZIGBEE_RXD "|"
|
||
D_SENSOR_RDM6300_RX "|"
|
||
D_SENSOR_IBEACON_TX "|" D_SENSOR_IBEACON_RX "|"
|
||
D_SENSOR_A4988_DIR "|" D_SENSOR_A4988_STP "|" D_SENSOR_A4988_ENA "|" D_SENSOR_A4988_MS1 "|"
|
||
D_SENSOR_OUTPUT_HI "|" D_SENSOR_OUTPUT_LO "|"
|
||
D_SENSOR_DDS2382_TX "|" D_SENSOR_DDS2382_RX "|"
|
||
D_SENSOR_DDSU666_TX "|" D_SENSOR_DDSU666_RX "|"
|
||
D_SENSOR_SM2135_CLK "|" D_SENSOR_SM2135_DAT "|"
|
||
D_SENSOR_DEEPSLEEP "|" D_SENSOR_EXS_ENABLE "|"
|
||
D_SENSOR_CLIENT_TX "|" D_SENSOR_CLIENT_RX "|" D_SENSOR_CLIENT_RESET "|" D_SENSOR_CLIENT_RESET "_i|"
|
||
D_SENSOR_HPMA_RX "|" D_SENSOR_HPMA_TX "|"
|
||
D_SENSOR_GPS_RX "|" D_SENSOR_GPS_TX "|"
|
||
D_SENSOR_HM10_RX "|" D_SENSOR_HM10_TX "|"
|
||
D_SENSOR_LE01MR_RX "|" D_SENSOR_LE01MR_TX "|"
|
||
D_SENSOR_CC1101_GDO0 "|" D_SENSOR_CC1101_GDO2 "|"
|
||
D_SENSOR_HRXL_RX "|"
|
||
D_SENSOR_ELECTRIQ_MOODL "|"
|
||
D_SENSOR_AS3935 "|"
|
||
D_SENSOR_ADC_INPUT "|"
|
||
D_SENSOR_ADC_TEMP "|"
|
||
D_SENSOR_ADC_LIGHT "|"
|
||
D_SENSOR_ADC_BUTTON "|" D_SENSOR_ADC_BUTTON "_i|"
|
||
D_SENSOR_ADC_RANGE "|"
|
||
D_SENSOR_ADC_CT_POWER "|"
|
||
#ifdef ESP32
|
||
D_GPIO_WEBCAM_PWDN "|" D_GPIO_WEBCAM_RESET "|" D_GPIO_WEBCAM_XCLK "|"
|
||
D_GPIO_WEBCAM_SIOD "|" D_GPIO_WEBCAM_SIOC "|"
|
||
D_GPIO_WEBCAM_DATA "|"
|
||
D_GPIO_WEBCAM_VSYNC "|" D_GPIO_WEBCAM_HREF "|" D_GPIO_WEBCAM_PCLK "|"
|
||
D_GPIO_WEBCAM_PSCLK "|"
|
||
D_GPIO_WEBCAM_HSD "|"
|
||
D_GPIO_WEBCAM_PSRCS "|"
|
||
#endif
|
||
D_SENSOR_BOILER_OT_RX "|" D_SENSOR_BOILER_OT_TX "|"
|
||
D_SENSOR_WINDMETER_SPEED "|" D_SENSOR_BUTTON "_tc|"
|
||
D_SENSOR_BL0940_RX "|"
|
||
D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD "|"
|
||
#ifdef ESP32
|
||
D_SENSOR_ETH_PHY_POWER "|" D_SENSOR_ETH_PHY_MDC "|" D_SENSOR_ETH_PHY_MDIO "|"
|
||
#endif
|
||
D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE "|"
|
||
D_SENSOR_LMT01_PULSE "|"
|
||
D_SENSOR_IEM3000_TX "|" D_SENSOR_IEM3000_RX "|"
|
||
D_SENSOR_ZIGBEE_RST "|"
|
||
D_SENSOR_DYP_RX "|"
|
||
D_SENSOR_MIEL_HVAC_TX "|" D_SENSOR_MIEL_HVAC_RX "|"
|
||
D_SENSOR_WE517_TX "|" D_SENSOR_WE517_RX "|"
|
||
D_SENSOR_AS608_TX "|" D_SENSOR_AS608_RX "|"
|
||
D_SENSOR_SHELLY_DIMMER_BOOT0 "|" D_SENSOR_SHELLY_DIMMER_RST_INV "|"
|
||
D_SENSOR_RC522_RST "|"
|
||
D_SENSOR_P9813_CLK "|" D_SENSOR_P9813_DAT "|"
|
||
D_SENSOR_OPTION " A|"
|
||
D_SENSOR_FTC532 "|"
|
||
D_SENSOR_RC522_CS "|"
|
||
D_SENSOR_NRF24_CS "|" D_SENSOR_NRF24_DC "|"
|
||
D_SENSOR_ILI9341_CS "|" D_SENSOR_ILI9341_DC "|"
|
||
D_SENSOR_ILI9488_CS "|"
|
||
D_SENSOR_EPAPER29_CS "|"
|
||
D_SENSOR_EPAPER42_CS "|"
|
||
D_SENSOR_SSD1351_CS "|"
|
||
D_SENSOR_RA8876_CS "|"
|
||
D_SENSOR_ST7789_CS "|" D_SENSOR_ST7789_DC "|"
|
||
D_SENSOR_SSD1331_CS "|" D_SENSOR_SSD1331_DC "|"
|
||
D_SENSOR_SDCARD_CS "|"
|
||
D_SENSOR_ROTARY " A_n|" D_SENSOR_ROTARY " B_n|"
|
||
D_SENSOR_ADC_PH "|"
|
||
D_SENSOR_BS814_CLK "|" D_SENSOR_BS814_DAT "|"
|
||
D_SENSOR_WIEGAND_D0 "|" D_SENSOR_WIEGAND_D1 "|"
|
||
D_SENSOR_NEOPOOL_TX "|" D_SENSOR_NEOPOOL_RX "|"
|
||
D_SENSOR_SDM72_TX "|" D_SENSOR_SDM72_RX "|"
|
||
D_SENSOR_TM1637_CLK "|" D_SENSOR_TM1637_DIO "|"
|
||
D_SENSOR_PROJECTOR_CTRL_TX "|" D_SENSOR_PROJECTOR_CTRL_RX "|"
|
||
D_SENSOR_SSD1351_DC "|"
|
||
D_SENSOR_XPT2046_CS "|"
|
||
D_SENSOR_CSE7761_TX "|" D_SENSOR_CSE7761_RX "|"
|
||
D_SENSOR_VL53LXX_XSHUT "|"
|
||
D_SENSOR_MAX7219_CLK "|" D_SENSOR_MAX7219_DIN "|" D_SENSOR_MAX7219_CS "|"
|
||
D_SENSOR_TFMINIPLUS_TX "|" D_SENSOR_TFMINIPLUS_RX "|"
|
||
D_SENSOR_ZEROCROSS "|"
|
||
#ifdef ESP32
|
||
D_SENSOR_HALLEFFECT "|"
|
||
D_SENSOR_EPD_DATA "|"
|
||
#endif
|
||
D_SENSOR_INPUT "|"
|
||
#ifdef ESP32
|
||
D_SENSOR_BUTTON "_d|" D_SENSOR_BUTTON "_id|" D_SENSOR_SWITCH "_d|"
|
||
#endif
|
||
D_SENSOR_I2S_OUT_DATA "|" D_SENSOR_I2S_OUT_CLK "|" D_SENSOR_I2S_OUT_SLCT "|"
|
||
D_SENSOR_I2S_IN_DATA "|" D_SENSOR_I2S_IN_CLK "|" D_SENSOR_I2S_IN_SLCT "|"
|
||
D_SENSOR_INTERRUPT "|"
|
||
D_SENSOR_MCP2515_CS "|"
|
||
D_SENSOR_HRG15_TX "|" D_SENSOR_HRG15_RX "|"
|
||
D_SENSOR_VINDRIKTNING_RX "|"
|
||
D_SENSOR_BL0939_RX "|"
|
||
D_SENSOR_BL0942_RX "|"
|
||
D_SENSOR_HM330X_SET "|"
|
||
D_SENSOR_HEARTBEAT "|" D_SENSOR_HEARTBEAT "_i|"
|
||
D_GPIO_SHIFT595_SRCLK "|" D_GPIO_SHIFT595_RCLK "|" D_GPIO_SHIFT595_OE "|" D_GPIO_SHIFT595_SER "|"
|
||
D_SENSOR_SOLAXX1_RTS "|"
|
||
D_SENSOR_OPTION " E|"
|
||
D_SENSOR_SDM230_TX "|" D_SENSOR_SDM230_RX "|"
|
||
D_SENSOR_ADC_MQ "|"
|
||
D_SENSOR_CM11_TX "|" D_SENSOR_CM11_RX "|"
|
||
D_SENSOR_BL6523_TX "|" D_SENSOR_BL6523_RX "|"
|
||
D_SENSOR_ADE7880_IRQ "|"
|
||
D_SENSOR_RESET "|"
|
||
;
|
||
|
||
const char kSensorNamesFixed[] PROGMEM =
|
||
D_SENSOR_USER;
|
||
|
||
#define MAX_MAX31865S 6
|
||
#define MAX_A4988_MSS 3
|
||
#define MAX_WEBCAM_DATA 8
|
||
#define MAX_WEBCAM_HSD 3
|
||
#define MAX_SM2135_DAT 7
|
||
|
||
const uint16_t kGpioNiceList[] PROGMEM = {
|
||
GPIO_NONE, // Not used
|
||
AGPIO(GPIO_OPTION_A) + MAX_OPTIONS_A, // Device specific options
|
||
#ifdef ESP32
|
||
AGPIO(GPIO_OPTION_E) + MAX_OPTIONS_E, // Device module emulation
|
||
#endif
|
||
AGPIO(GPIO_KEY1) + MAX_KEYS, // Buttons
|
||
AGPIO(GPIO_KEY1_NP) + MAX_KEYS,
|
||
#ifdef ESP32
|
||
AGPIO(GPIO_KEY1_PD) + MAX_KEYS,
|
||
#endif
|
||
AGPIO(GPIO_KEY1_INV) + MAX_KEYS,
|
||
AGPIO(GPIO_KEY1_INV_NP) + MAX_KEYS,
|
||
#ifdef ESP32
|
||
AGPIO(GPIO_KEY1_INV_PD) + MAX_KEYS,
|
||
AGPIO(GPIO_KEY1_TC) + MAX_KEYS, // Touch button
|
||
#endif
|
||
AGPIO(GPIO_SWT1) + MAX_SWITCHES, // User connected external switches
|
||
AGPIO(GPIO_SWT1_NP) + MAX_SWITCHES,
|
||
#ifdef ESP32
|
||
AGPIO(GPIO_SWT1_PD) + MAX_SWITCHES,
|
||
#endif
|
||
#ifdef ROTARY_V1
|
||
AGPIO(GPIO_ROT1A) + MAX_ROTARIES, // Rotary A Pin
|
||
AGPIO(GPIO_ROT1B) + MAX_ROTARIES, // Rotary B Pin
|
||
AGPIO(GPIO_ROT1A_NP) + MAX_ROTARIES, // Rotary A Pin No Pullup
|
||
AGPIO(GPIO_ROT1B_NP) + MAX_ROTARIES, // Rotary B Pin No Pullup
|
||
#endif
|
||
AGPIO(GPIO_REL1) + MAX_RELAYS, // Relays
|
||
AGPIO(GPIO_REL1_INV) + MAX_RELAYS,
|
||
AGPIO(GPIO_LED1) + MAX_LEDS, // Leds
|
||
AGPIO(GPIO_LED1_INV) + MAX_LEDS,
|
||
#ifdef USE_COUNTER
|
||
AGPIO(GPIO_CNTR1) + MAX_COUNTERS, // Counters
|
||
AGPIO(GPIO_CNTR1_NP) + MAX_COUNTERS,
|
||
#endif
|
||
AGPIO(GPIO_PWM1) + MAX_PWMS, // RGB Red or C Cold White
|
||
AGPIO(GPIO_PWM1_INV) + MAX_PWMS, // or extended PWM for ESP32
|
||
#ifdef USE_BUZZER
|
||
AGPIO(GPIO_BUZZER), // Buzzer
|
||
AGPIO(GPIO_BUZZER_INV), // Inverted buzzer
|
||
#endif
|
||
AGPIO(GPIO_LEDLNK), // Link led
|
||
AGPIO(GPIO_LEDLNK_INV), // Inverted link led
|
||
#ifdef USE_BERRY
|
||
AGPIO(GPIO_INPUT) + MAX_SWITCHES, // Pure digital input to be read via Berry
|
||
AGPIO(GPIO_INTERRUPT) + MAX_SWITCHES, // Interrupt pins to be catched by Berry
|
||
#endif
|
||
AGPIO(GPIO_OUTPUT_HI), // Fixed output high
|
||
AGPIO(GPIO_OUTPUT_LO), // Fixed output low
|
||
AGPIO(GPIO_HEARTBEAT), // Every second pulsed high
|
||
AGPIO(GPIO_HEARTBEAT_INV), // Every second pulsed low
|
||
AGPIO(GPIO_RESET), // Generic reset
|
||
#ifdef USE_FTC532
|
||
AGPIO(GPIO_FTC532), // FTC532 touch input
|
||
#endif
|
||
#ifdef USE_BS814A2
|
||
AGPIO(GPIO_BS814_CLK), // Holtek BS814A2 touch ctrlr
|
||
AGPIO(GPIO_BS814_DAT),
|
||
#endif
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Protocol specifics
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef USE_I2C
|
||
AGPIO(GPIO_I2C_SCL) + MAX_I2C, // I2C SCL
|
||
AGPIO(GPIO_I2C_SDA) + MAX_I2C, // I2C SDA
|
||
#endif
|
||
|
||
#ifdef USE_I2S
|
||
AGPIO(GPIO_I2S_OUT_DATA) + MAX_I2S, // I2S Out Data
|
||
AGPIO(GPIO_I2S_OUT_CLK) + MAX_I2S, // I2C Out Clock
|
||
AGPIO(GPIO_I2S_OUT_SLCT) + MAX_I2S, // I2C Out Word Select
|
||
AGPIO(GPIO_I2S_IN_DATA) + MAX_I2S, // I2S In Data
|
||
AGPIO(GPIO_I2S_IN_CLK) + MAX_I2S, // I2C In Clock
|
||
AGPIO(GPIO_I2S_IN_SLCT) + MAX_I2S, // I2C In Word Select
|
||
#endif
|
||
|
||
#ifdef USE_SPI
|
||
AGPIO(GPIO_SPI_MISO) + MAX_SPI, // SPI MISO
|
||
AGPIO(GPIO_SPI_MOSI) + MAX_SPI, // SPI MOSI
|
||
AGPIO(GPIO_SPI_CLK) + MAX_SPI, // SPI Clk
|
||
AGPIO(GPIO_SPI_CS) + MAX_SPI, // SPI Chip Select
|
||
AGPIO(GPIO_SPI_DC) + MAX_SPI, // SPI Data Direction
|
||
#ifdef USE_NRF24
|
||
AGPIO(GPIO_NRF24_CS),
|
||
AGPIO(GPIO_NRF24_DC),
|
||
#endif
|
||
#ifdef USE_RC522
|
||
AGPIO(GPIO_RC522_CS), // RC522 Rfid Chip Select
|
||
AGPIO(GPIO_RC522_RST), // RC522 Rfid Reset
|
||
#endif
|
||
#ifdef USE_SDCARD
|
||
AGPIO(GPIO_SDCARD_CS),
|
||
#endif // USE_SDCARD
|
||
#ifdef USE_MCP2515
|
||
AGPIO(GPIO_MCP2515_CS),
|
||
#endif // USE_MCP2515
|
||
#endif // USE_SPI
|
||
|
||
AGPIO(GPIO_SSPI_MISO), // Software SPI Master Input Client Output
|
||
AGPIO(GPIO_SSPI_MOSI), // Software SPI Master Output Client Input
|
||
AGPIO(GPIO_SSPI_SCLK), // Software SPI Serial Clock
|
||
AGPIO(GPIO_SSPI_CS), // Software SPI Chip Select
|
||
AGPIO(GPIO_SSPI_DC), // Software SPI Data or Command
|
||
|
||
#if defined(USE_DISPLAY) || defined(USE_LVGL)
|
||
#ifdef USE_DISPLAY_ILI9341
|
||
AGPIO(GPIO_ILI9341_CS),
|
||
AGPIO(GPIO_ILI9341_DC),
|
||
#endif // USE_DISPLAY_ILI9341
|
||
|
||
#ifdef USE_XPT2046
|
||
AGPIO(GPIO_XPT2046_CS), // XPT2046 SPI Chip Select
|
||
#endif
|
||
|
||
#ifdef USE_DISPLAY_ILI9488
|
||
AGPIO(GPIO_ILI9488_CS),
|
||
#endif // USE_DISPLAY_ILI9488
|
||
#ifdef USE_DISPLAY_EPAPER_29
|
||
AGPIO(GPIO_EPAPER29_CS),
|
||
#endif // USE_DISPLAY_EPAPER_29
|
||
#ifdef USE_DISPLAY_EPAPER_42
|
||
AGPIO(GPIO_EPAPER42_CS),
|
||
#endif // USE_DISPLAY_EPAPER_42
|
||
#ifdef USE_DISPLAY_SSD1351
|
||
AGPIO(GPIO_SSD1351_CS),
|
||
AGPIO(GPIO_SSD1351_DC),
|
||
#endif // USE_DISPLAY_SSD1351
|
||
#ifdef USE_DISPLAY_RA8876
|
||
AGPIO(GPIO_RA8876_CS),
|
||
#endif // USE_DISPLAY_RA8876
|
||
#ifdef USE_DISPLAY_ST7789
|
||
AGPIO(GPIO_ST7789_CS),
|
||
AGPIO(GPIO_ST7789_DC),
|
||
#endif // USE_DISPLAY_ST7789
|
||
#ifdef USE_DISPLAY_SSD1331
|
||
AGPIO(GPIO_SSD1331_CS),
|
||
AGPIO(GPIO_SSD1331_DC),
|
||
#endif // USE_DISPLAY_SSD1331
|
||
|
||
#ifdef USE_DISPLAY_MAX7219_MATRIX
|
||
#undef USE_DISPLAY_MAX7219
|
||
#undef USE_DISPLAY_TM1637
|
||
AGPIO(GPIO_MAX7219CLK),
|
||
AGPIO(GPIO_MAX7219DIN),
|
||
AGPIO(GPIO_MAX7219CS),
|
||
#endif // USE_DISPLAY_MAX7219_MATRIX
|
||
|
||
#ifdef USE_DISPLAY_TM1637
|
||
AGPIO(GPIO_TM1637CLK),
|
||
AGPIO(GPIO_TM1637DIO),
|
||
AGPIO(GPIO_TM1638CLK),
|
||
AGPIO(GPIO_TM1638DIO),
|
||
AGPIO(GPIO_TM1638STB),
|
||
#endif // USE_DISPLAY_TM1637
|
||
AGPIO(GPIO_BACKLIGHT), // Display backlight control
|
||
AGPIO(GPIO_OLED_RESET), // OLED Display Reset
|
||
#ifdef ESP32
|
||
AGPIO(GPIO_EPD_DATA), // Base connection EPD driver
|
||
#endif
|
||
#endif // USE_DISPLAY
|
||
|
||
#ifdef USE_MAX31865
|
||
AGPIO(GPIO_SSPI_MAX31865_CS1) + MAX_MAX31865S,
|
||
#endif
|
||
|
||
AGPIO(GPIO_TXD), // Serial interface
|
||
AGPIO(GPIO_RXD), // Serial interface
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Single wire sensors
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef USE_DHT
|
||
AGPIO(GPIO_DHT11), // DHT11
|
||
AGPIO(GPIO_DHT22), // DHT21, DHT22, AM2301, AM2302, AM2321
|
||
AGPIO(GPIO_SI7021), // iTead SI7021
|
||
AGPIO(GPIO_DHT11_OUT), // Pseudo Single wire DHT11, DHT21, DHT22, AM2301, AM2302, AM2321
|
||
#endif
|
||
#ifdef USE_DS18x20
|
||
AGPIO(GPIO_DSB), // Single wire DS18B20 or DS18S20
|
||
AGPIO(GPIO_DSB_OUT), // Pseudo Single wire DS18B20 or DS18S20
|
||
#endif
|
||
#ifdef USE_LMT01
|
||
AGPIO(GPIO_LMT01), // LMT01, count pulses on GPIO
|
||
#endif
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Light
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef USE_LIGHT
|
||
#ifdef USE_WS2812
|
||
#if (USE_WS2812_HARDWARE == NEO_HW_P9813)
|
||
AGPIO(GPIO_P9813_CLK), // P9813 CLOCK
|
||
AGPIO(GPIO_P9813_DAT), // P9813 DATA
|
||
#else
|
||
AGPIO(GPIO_WS2812) + (MAX_RMT ? MAX_RMT + 1 : 0),// WS2812 Led string, using RMT on ESP32
|
||
#endif // NEO_HW_P9813
|
||
#endif
|
||
#ifdef USE_ARILUX_RF
|
||
AGPIO(GPIO_ARIRFRCV), // AriLux RF Receive input
|
||
AGPIO(GPIO_ARIRFSEL), // Arilux RF Receive input selected
|
||
#endif
|
||
#ifdef USE_MY92X1
|
||
AGPIO(GPIO_DI), // my92x1 PWM input
|
||
AGPIO(GPIO_DCKI), // my92x1 CLK input
|
||
#endif // USE_MY92X1
|
||
#ifdef USE_SM16716
|
||
AGPIO(GPIO_SM16716_CLK), // SM16716 CLOCK
|
||
AGPIO(GPIO_SM16716_DAT), // SM16716 DATA
|
||
AGPIO(GPIO_SM16716_SEL), // SM16716 SELECT
|
||
#endif // USE_SM16716
|
||
#ifdef USE_SM2135
|
||
AGPIO(GPIO_SM2135_CLK), // SM2135 CLOCK
|
||
AGPIO(GPIO_SM2135_DAT) + MAX_SM2135_DAT, // SM2135 DATA
|
||
#endif // USE_SM2135
|
||
#ifdef USE_TUYA_MCU
|
||
AGPIO(GPIO_TUYA_TX), // Tuya Serial interface
|
||
AGPIO(GPIO_TUYA_RX), // Tuya Serial interface
|
||
#endif
|
||
#ifdef USE_EXS_DIMMER
|
||
AGPIO(GPIO_EXS_ENABLE), // EXS MCU Enable
|
||
#endif
|
||
#ifdef USE_ELECTRIQ_MOODL
|
||
AGPIO(GPIO_ELECTRIQ_MOODL_TX),
|
||
#endif
|
||
#ifdef USE_SHELLY_DIMMER
|
||
AGPIO(GPIO_SHELLY_DIMMER_BOOT0),
|
||
AGPIO(GPIO_SHELLY_DIMMER_RST_INV),
|
||
#endif
|
||
#endif // USE_LIGHT
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Transmission sensors
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#if defined(USE_IR_REMOTE) || defined(USE_IR_REMOTE_FULL)
|
||
AGPIO(GPIO_IRSEND), // IR remote
|
||
#if defined(USE_IR_RECEIVE) || defined(USE_IR_REMOTE_FULL)
|
||
AGPIO(GPIO_IRRECV), // IR receiver
|
||
#endif
|
||
#endif
|
||
#ifdef USE_RC_SWITCH
|
||
AGPIO(GPIO_RFSEND), // RF transmitter
|
||
AGPIO(GPIO_RFRECV), // RF receiver
|
||
#endif
|
||
#ifdef USE_RF_SENSOR
|
||
AGPIO(GPIO_RF_SENSOR), // Rf receiver with sensor decoding
|
||
#endif
|
||
#ifdef USE_SR04
|
||
AGPIO(GPIO_SR04_TRIG), // SR04 Tri/TXgger pin
|
||
AGPIO(GPIO_SR04_ECHO), // SR04 Ech/RXo pin
|
||
#endif
|
||
#ifdef USE_TM1638
|
||
AGPIO(GPIO_TM1638CLK), // TM1638 Clock
|
||
AGPIO(GPIO_TM1638DIO), // TM1638 Data I/O
|
||
AGPIO(GPIO_TM1638STB), // TM1638 Strobe
|
||
#endif
|
||
#ifdef USE_HX711
|
||
AGPIO(GPIO_HX711_SCK), // HX711 Load Cell clock
|
||
AGPIO(GPIO_HX711_DAT), // HX711 Load Cell data
|
||
#endif
|
||
#ifdef USE_TFMINIPLUS
|
||
AGPIO(GPIO_TFMINIPLUS_TX), // TFmini Plus TX pin
|
||
AGPIO(GPIO_TFMINIPLUS_RX), // TFmini Plus RX pin
|
||
#endif
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Energy sensors
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef USE_ENERGY_SENSOR
|
||
#ifdef USE_HLW8012
|
||
AGPIO(GPIO_NRG_SEL), // HLW8012/HLJ-01 Sel output (1 = Voltage)
|
||
AGPIO(GPIO_NRG_SEL_INV), // HLW8012/HLJ-01 Sel output (0 = Voltage)
|
||
AGPIO(GPIO_NRG_CF1), // HLW8012/HLJ-01 CF1 voltage / current
|
||
AGPIO(GPIO_HLW_CF), // HLW8012 CF power
|
||
AGPIO(GPIO_HJL_CF), // HJL-01/BL0937 CF power
|
||
#endif
|
||
#if defined(USE_I2C) && defined(USE_ADE7880)
|
||
AGPIO(GPIO_ADE7880_IRQ) + 2, // ADE7880 IRQ
|
||
#endif
|
||
#if defined(USE_I2C) && defined(USE_ADE7953)
|
||
AGPIO(GPIO_ADE7953_IRQ) + 2, // ADE7953 IRQ
|
||
#endif
|
||
#ifdef USE_CSE7761
|
||
AGPIO(GPIO_CSE7761_TX), // CSE7761 Serial interface (Dual R3)
|
||
AGPIO(GPIO_CSE7761_RX), // CSE7761 Serial interface (Dual R3)
|
||
#endif
|
||
#ifdef USE_CSE7766
|
||
AGPIO(GPIO_CSE7766_TX), // CSE7766 Serial interface (S31 and Pow R2)
|
||
AGPIO(GPIO_CSE7766_RX), // CSE7766 Serial interface (S31 and Pow R2)
|
||
#endif
|
||
#ifdef USE_MCP39F501
|
||
AGPIO(GPIO_MCP39F5_TX), // MCP39F501 Serial interface (Shelly2)
|
||
AGPIO(GPIO_MCP39F5_RX), // MCP39F501 Serial interface (Shelly2)
|
||
AGPIO(GPIO_MCP39F5_RST), // MCP39F501 Reset (Shelly2)
|
||
#endif
|
||
#if defined(USE_PZEM004T) || defined(USE_PZEM_AC) || defined(USE_PZEM_DC)
|
||
AGPIO(GPIO_PZEM0XX_TX), // PZEM0XX Serial interface
|
||
#endif
|
||
#ifdef USE_PZEM004T
|
||
AGPIO(GPIO_PZEM004_RX), // PZEM004T Serial interface
|
||
#endif
|
||
#ifdef USE_PZEM_AC
|
||
AGPIO(GPIO_PZEM016_RX), // PZEM-014,016 Serial Modbus interface
|
||
#endif
|
||
#ifdef USE_PZEM_DC
|
||
AGPIO(GPIO_PZEM017_RX), // PZEM-003,017 Serial Modbus interface
|
||
#endif
|
||
#ifdef USE_SDM120
|
||
AGPIO(GPIO_SDM120_TX), // SDM120 Serial interface
|
||
AGPIO(GPIO_SDM120_RX), // SDM120 Serial interface
|
||
#endif
|
||
#ifdef USE_SDM630
|
||
AGPIO(GPIO_SDM630_TX), // SDM630 Serial interface
|
||
AGPIO(GPIO_SDM630_RX), // SDM630 Serial interface
|
||
#endif
|
||
#ifdef USE_DDS2382
|
||
AGPIO(GPIO_DDS2382_TX), // DDS2382 Serial interface
|
||
AGPIO(GPIO_DDS2382_RX), // DDS2382 Serial interface
|
||
#endif
|
||
#ifdef USE_DDSU666
|
||
AGPIO(GPIO_DDSU666_TX), // DDSU666 Serial interface
|
||
AGPIO(GPIO_DDSU666_RX), // DDSU666 Serial interface
|
||
#endif // USE_DDSU666
|
||
#ifdef USE_SOLAX_X1
|
||
AGPIO(GPIO_SOLAXX1_TX), // Solax Inverter tx pin
|
||
AGPIO(GPIO_SOLAXX1_RX), // Solax Inverter rx pin
|
||
AGPIO(GPIO_SOLAXX1_RTS), // Solax Inverter RTS pin
|
||
#endif // USE_SOLAX_X1
|
||
#ifdef USE_LE01MR
|
||
AGPIO(GPIO_LE01MR_TX), // F7F LE-01MR energy meter tx pin
|
||
AGPIO(GPIO_LE01MR_RX), // F7F LE-01MR energy meter rx pin
|
||
#endif // IFDEF:USE_LE01MR
|
||
#if defined(USE_BL0940) || defined(USE_BL09XX)
|
||
AGPIO(GPIO_BL0939_RX), // BL0939 Serial interface (Dual R3 v2)
|
||
AGPIO(GPIO_BL0940_RX), // BL0940 Serial interface
|
||
AGPIO(GPIO_BL0942_RX), // BL0940 Serial interface
|
||
#endif
|
||
#ifdef USE_IEM3000
|
||
AGPIO(GPIO_IEM3000_TX), // IEM3000 Serial interface
|
||
AGPIO(GPIO_IEM3000_RX), // IEM3000 Serial interface
|
||
#endif
|
||
#ifdef USE_WE517
|
||
AGPIO(GPIO_WE517_TX), // WE517 Serial interface
|
||
AGPIO(GPIO_WE517_RX), // WE517 Serial interface
|
||
#endif
|
||
#ifdef USE_SDM72
|
||
AGPIO(GPIO_SDM72_TX), // SDM72 Serial interface
|
||
AGPIO(GPIO_SDM72_RX), // SDM72 Serial interface
|
||
#endif
|
||
AGPIO(GPIO_ZEROCROSS),
|
||
#ifdef USE_SDM230
|
||
AGPIO(GPIO_SDM230_TX), // SDM230 Serial interface
|
||
AGPIO(GPIO_SDM230_RX), // SDM230 Serial interface
|
||
#endif
|
||
#ifdef USE_BL6523
|
||
AGPIO(GPIO_BL6523_TX), // BL6523 based Watt meter Serial interface
|
||
AGPIO(GPIO_BL6523_RX), // BL6523 based Watt meter Serial interface
|
||
#endif
|
||
#endif // USE_ENERGY_SENSOR
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Serial sensors
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef USE_SERIAL_BRIDGE
|
||
AGPIO(GPIO_SBR_TX), // Serial Bridge Serial interface
|
||
AGPIO(GPIO_SBR_RX), // Serial Bridge Serial interface
|
||
#endif
|
||
#ifdef USE_TCP_BRIDGE
|
||
AGPIO(GPIO_TCP_TX), // TCP Serial bridge
|
||
AGPIO(GPIO_TCP_RX), // TCP Serial bridge
|
||
#endif
|
||
#ifdef USE_ZIGBEE
|
||
AGPIO(GPIO_ZIGBEE_TX), // Zigbee Serial interface
|
||
AGPIO(GPIO_ZIGBEE_RX), // Zigbee Serial interface
|
||
AGPIO(GPIO_ZIGBEE_RST) + 2, // Zigbee reset, pin 1 is reset, pin 2 is bootloader mode
|
||
#endif
|
||
#ifdef USE_MHZ19
|
||
AGPIO(GPIO_MHZ_TXD), // MH-Z19 Serial interface
|
||
AGPIO(GPIO_MHZ_RXD), // MH-Z19 Serial interface
|
||
#endif
|
||
#ifdef USE_SENSEAIR
|
||
AGPIO(GPIO_SAIR_TX), // SenseAir Serial interface
|
||
AGPIO(GPIO_SAIR_RX), // SenseAir Serial interface
|
||
#endif
|
||
#ifdef USE_NOVA_SDS
|
||
AGPIO(GPIO_SDS0X1_TX), // Nova Fitness SDS011 Serial interface
|
||
AGPIO(GPIO_SDS0X1_RX), // Nova Fitness SDS011 Serial interface
|
||
#endif
|
||
#ifdef USE_HPMA
|
||
AGPIO(GPIO_HPMA_TX), // Honeywell HPMA115S0 Serial interface
|
||
AGPIO(GPIO_HPMA_RX), // Honeywell HPMA115S0 Serial interface
|
||
#endif
|
||
#ifdef USE_PMS5003
|
||
AGPIO(GPIO_PMS5003_TX), // Plantower PMS5003 Serial interface
|
||
AGPIO(GPIO_PMS5003_RX), // Plantower PMS5003 Serial interface
|
||
#endif
|
||
#ifdef USE_VINDRIKTNING
|
||
AGPIO(GPIO_VINDRIKTNING_RX),
|
||
#endif
|
||
#ifdef USE_HM330X
|
||
AGPIO(GPIO_HM330X_SET), // HM330X Sleep pin (active low)
|
||
#endif
|
||
#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) || defined(USE_WS2300_WIND_SENSOR)
|
||
AGPIO(GPIO_TX2X_TXD_BLACK), // TX20/TX23 Transmission Pin
|
||
#endif
|
||
#ifdef USE_WINDMETER
|
||
AGPIO(GPIO_WINDMETER_SPEED),
|
||
#endif
|
||
#ifdef USE_MP3_PLAYER
|
||
AGPIO(GPIO_MP3_DFR562), // RB-DFR-562, DFPlayer Mini MP3 Player Serial interface
|
||
#endif
|
||
#ifdef USE_AZ7798
|
||
AGPIO(GPIO_AZ_TXD), // AZ-Instrument 7798 CO2 datalogger Serial interface
|
||
AGPIO(GPIO_AZ_RXD), // AZ-Instrument 7798 CO2 datalogger Serial interface
|
||
#endif
|
||
#ifdef USE_PN532_HSU
|
||
AGPIO(GPIO_PN532_TXD), // PN532 HSU Tx
|
||
AGPIO(GPIO_PN532_RXD), // PN532 HSU Rx
|
||
#endif
|
||
#ifdef USE_TASMOTA_CLIENT
|
||
AGPIO(GPIO_TASMOTACLIENT_TXD), // Tasmota Client TX
|
||
AGPIO(GPIO_TASMOTACLIENT_RXD), // Tasmota Client RX
|
||
AGPIO(GPIO_TASMOTACLIENT_RST), // Tasmota Client Reset
|
||
AGPIO(GPIO_TASMOTACLIENT_RST_INV), // Tasmota Client Reset Inverted
|
||
#endif
|
||
#ifdef USE_RDM6300
|
||
AGPIO(GPIO_RDM6300_RX),
|
||
#endif
|
||
#ifdef USE_IBEACON
|
||
AGPIO(GPIO_IBEACON_TX),
|
||
AGPIO(GPIO_IBEACON_RX),
|
||
#endif
|
||
#ifdef USE_GPS
|
||
AGPIO(GPIO_GPS_TX), // GPS serial interface
|
||
AGPIO(GPIO_GPS_RX), // GPS serial interface
|
||
#endif
|
||
#ifdef USE_HM10
|
||
AGPIO(GPIO_HM10_TX), // GPS serial interface
|
||
AGPIO(GPIO_HM10_RX), // GPS serial interface
|
||
#endif
|
||
#ifdef USE_OPENTHERM
|
||
AGPIO(GPIO_BOILER_OT_TX),
|
||
AGPIO(GPIO_BOILER_OT_RX),
|
||
#endif
|
||
#ifdef USE_AS608
|
||
AGPIO(GPIO_AS608_TX),
|
||
AGPIO(GPIO_AS608_RX),
|
||
#endif
|
||
#ifdef USE_HRG15
|
||
AGPIO(GPIO_HRG15_TX),
|
||
AGPIO(GPIO_HRG15_RX),
|
||
#endif
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* Other sensors
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef USE_MGC3130
|
||
AGPIO(GPIO_MGC3130_XFER),
|
||
AGPIO(GPIO_MGC3130_RESET),
|
||
#endif
|
||
#ifdef USE_MAX31855
|
||
AGPIO(GPIO_MAX31855CS), // MAX31855 Serial interface
|
||
AGPIO(GPIO_MAX31855CLK), // MAX31855 Serial interface
|
||
AGPIO(GPIO_MAX31855DO), // MAX31855 Serial interface
|
||
#endif
|
||
#ifdef USE_HRE
|
||
AGPIO(GPIO_HRE_CLOCK),
|
||
AGPIO(GPIO_HRE_DATA),
|
||
#endif
|
||
#ifdef USE_A4988_STEPPER
|
||
AGPIO(GPIO_A4988_DIR), // A4988 direction pin
|
||
AGPIO(GPIO_A4988_STP), // A4988 step pin
|
||
// folowing are not mandatory
|
||
AGPIO(GPIO_A4988_ENA), // A4988 enabled pin
|
||
AGPIO(GPIO_A4988_MS1) + MAX_A4988_MSS, // A4988 microstep pin1 to pin3
|
||
#endif
|
||
#ifdef USE_DEEPSLEEP
|
||
AGPIO(GPIO_DEEPSLEEP),
|
||
#endif
|
||
#ifdef USE_KEELOQ
|
||
AGPIO(GPIO_CC1101_GDO0), // CC1101 pin for RX
|
||
AGPIO(GPIO_CC1101_GDO2), // CC1101 pin for RX
|
||
#endif
|
||
#ifdef USE_HRXL
|
||
AGPIO(GPIO_HRXL_RX),
|
||
#endif
|
||
#ifdef USE_DYP
|
||
AGPIO(GPIO_DYP_RX),
|
||
#endif
|
||
#ifdef USE_AS3935
|
||
AGPIO(GPIO_AS3935), // AS3935 IRQ Pin
|
||
#endif
|
||
#ifdef USE_TELEINFO
|
||
AGPIO(GPIO_TELEINFO_RX),
|
||
AGPIO(GPIO_TELEINFO_ENABLE),
|
||
#endif
|
||
#ifdef USE_MIEL_HVAC
|
||
AGPIO(GPIO_MIEL_HVAC_TX), // Mitsubishi Electric HVAC TX pin
|
||
AGPIO(GPIO_MIEL_HVAC_RX), // Mitsubishi Electric HVAC RX pin
|
||
#endif
|
||
#ifdef USE_WIEGAND
|
||
AGPIO(GPIO_WIEGAND_D0), // Date line D0 of Wiegand devices
|
||
AGPIO(GPIO_WIEGAND_D1), // Date line D1 of Wiegand devices
|
||
#endif
|
||
#ifdef USE_NEOPOOL
|
||
AGPIO(GPIO_NEOPOOL_TX), // Sugar Valley RS485 Interface
|
||
AGPIO(GPIO_NEOPOOL_RX), // Sugar Valley RS485 Interface
|
||
#endif
|
||
#ifdef USE_PROJECTOR_CTRL
|
||
AGPIO(GPIO_PROJECTOR_CTRL_TX), // LCD/DLP Projector Serial Control
|
||
AGPIO(GPIO_PROJECTOR_CTRL_RX), // LCD/DLP Projector Serial Control
|
||
#endif
|
||
#if defined(USE_VL53L0X) or defined (USE_VL53L1X)
|
||
AGPIO(GPIO_VL53LXX_XSHUT1) + VL53LXX_MAX_SENSORS, // When using multiple VL53LXX.
|
||
#endif
|
||
|
||
#ifdef USE_DISPLAY_MAX7219
|
||
AGPIO(GPIO_MAX7219CLK),
|
||
AGPIO(GPIO_MAX7219DIN),
|
||
AGPIO(GPIO_MAX7219CS),
|
||
#endif // USE_DISPLAY_MAX7219
|
||
|
||
#ifdef USE_CM110x
|
||
AGPIO(GPIO_CM11_TXD), // CM110x Serial interface
|
||
AGPIO(GPIO_CM11_RXD), // CM110x Serial interface
|
||
#endif
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* ESP32 specifics
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef ESP32
|
||
#if CONFIG_IDF_TARGET_ESP32
|
||
AGPIO(GPIO_HALLEFFECT) + 2, // Hall effect sensor connected to GPIO36 and 39
|
||
#endif // CONFIG_IDF_TARGET_ESP32
|
||
#ifdef USE_WEBCAM
|
||
AGPIO(GPIO_WEBCAM_PWDN),
|
||
AGPIO(GPIO_WEBCAM_RESET),
|
||
AGPIO(GPIO_WEBCAM_XCLK),
|
||
AGPIO(GPIO_WEBCAM_SIOD),
|
||
AGPIO(GPIO_WEBCAM_SIOC),
|
||
AGPIO(GPIO_WEBCAM_DATA) + MAX_WEBCAM_DATA,
|
||
AGPIO(GPIO_WEBCAM_VSYNC),
|
||
AGPIO(GPIO_WEBCAM_HREF),
|
||
AGPIO(GPIO_WEBCAM_PCLK),
|
||
AGPIO(GPIO_WEBCAM_PSCLK),
|
||
AGPIO(GPIO_WEBCAM_HSD) + MAX_WEBCAM_HSD,
|
||
AGPIO(GPIO_WEBCAM_PSRCS),
|
||
#endif // USE_WEBCAM
|
||
#ifdef USE_ETHERNET
|
||
AGPIO(GPIO_ETH_PHY_POWER),
|
||
AGPIO(GPIO_ETH_PHY_MDC),
|
||
AGPIO(GPIO_ETH_PHY_MDIO), // Ethernet
|
||
#endif // USE_ETHERNET
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* ESP32 multiple Analog / Digital converter inputs
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
AGPIO(GPIO_ADC_INPUT) + MAX_ADCS, // Analog inputs
|
||
AGPIO(GPIO_ADC_TEMP) + MAX_ADCS, // Thermistor
|
||
AGPIO(GPIO_ADC_LIGHT) + MAX_ADCS, // Light sensor
|
||
AGPIO(GPIO_ADC_BUTTON) + MAX_KEYS, // Button
|
||
AGPIO(GPIO_ADC_BUTTON_INV) + MAX_KEYS,
|
||
AGPIO(GPIO_ADC_RANGE) + MAX_ADCS, // Range
|
||
AGPIO(GPIO_ADC_CT_POWER) + MAX_ADCS, // Current
|
||
AGPIO(GPIO_ADC_JOY) + MAX_ADCS, // Joystick
|
||
AGPIO(GPIO_ADC_PH) + MAX_ADCS, // Analog PH Sensor
|
||
AGPIO(GPIO_ADC_MQ) + MAX_ADCS, // Analog MQ Sensor
|
||
#endif // ESP32
|
||
|
||
#ifdef USE_SHIFT595
|
||
AGPIO(GPIO_SHIFT595_SRCLK), // 74x595 shift register
|
||
AGPIO(GPIO_SHIFT595_RCLK),
|
||
AGPIO(GPIO_SHIFT595_OE),
|
||
AGPIO(GPIO_SHIFT595_SER),
|
||
#endif
|
||
};
|
||
|
||
/*-------------------------------------------------------------------------------------------*\
|
||
* ESP8266 single Analog / Digital converter input
|
||
\*-------------------------------------------------------------------------------------------*/
|
||
|
||
#ifdef ESP8266
|
||
const uint16_t kAdcNiceList[] PROGMEM = {
|
||
GPIO_NONE, // Not used
|
||
AGPIO(GPIO_ADC_INPUT), // Analog inputs
|
||
AGPIO(GPIO_ADC_TEMP), // Thermistor
|
||
AGPIO(GPIO_ADC_LIGHT), // Light sensor
|
||
AGPIO(GPIO_ADC_BUTTON) + MAX_KEYS, // Button
|
||
AGPIO(GPIO_ADC_BUTTON_INV) + MAX_KEYS,
|
||
AGPIO(GPIO_ADC_RANGE), // Range
|
||
AGPIO(GPIO_ADC_CT_POWER), // Current
|
||
AGPIO(GPIO_ADC_JOY), // Joystick
|
||
AGPIO(GPIO_ADC_PH), // Analog PH Sensor
|
||
AGPIO(GPIO_ADC_MQ), // Analog MQ Sensor
|
||
};
|
||
#endif // ESP8266
|
||
|
||
// User selectable ADC functionality
|
||
enum UserSelectableAdc {
|
||
ADC_NONE, // Not used
|
||
ADC_INPUT, // Analog input
|
||
ADC_TEMP, // Thermistor
|
||
ADC_LIGHT, // Light sensor
|
||
ADC_BUTTON, // Button
|
||
ADC_BUTTON_INV,
|
||
ADC_RANGE, // Range
|
||
ADC_CT_POWER, // Current
|
||
ADC_JOY, // Joystick
|
||
ADC_PH, // Analog PH Sensor
|
||
ADC_MQ, // Analog MQ Sensor
|
||
// ADC_SWITCH, // Switch
|
||
// ADC_SWITCH_INV,
|
||
ADC_END };
|
||
|
||
/*********************************************************************************************\
|
||
* ATTENTION: No user changeable features beyond this point - do not add templates !!!
|
||
\*********************************************************************************************/
|
||
|
||
#define GPIO_ANY 32 // Any GPIO
|
||
|
||
#ifdef ESP8266
|
||
|
||
#define MAX_GPI8_PIN 17 // Number of supported GPIO (0..16)
|
||
#define FLASH_PINS 6 // Number of flash chip pins
|
||
|
||
#define MAX_GPIO_PIN 18 // Number of supported GPIO (0..16 + ADC0)
|
||
#define ADC0_PIN 17 // Pin number of ADC0
|
||
#define MIN_FLASH_PINS 4 // Number of flash chip pins unusable for configuration (GPIO6, 7, 8 and 11)
|
||
#define MAX_USER_PINS 14 // MAX_GPIO_PIN - MIN_FLASH_PINS
|
||
#define WEMOS_MODULE 17 // Wemos module
|
||
|
||
const char PINS_WEMOS[] PROGMEM = "D3TXD4RXD2D1flashcFLFLolD6D7D5D8D0A0";
|
||
|
||
typedef struct MYIO8 {
|
||
uint8_t io[MAX_GPI8_PIN];
|
||
} myio8; // 17 bytes
|
||
|
||
typedef struct MYCFGIO8285 {
|
||
uint8_t io[MAX_GPI8_PIN - MIN_FLASH_PINS];
|
||
} mycfgio8285; // 13 bytes
|
||
|
||
typedef struct MYTMPLT8285 {
|
||
mycfgio8285 gp;
|
||
uint8_t flag;
|
||
} mytmplt8285; // 14 bytes
|
||
|
||
typedef struct MYCFGIO8266 {
|
||
uint8_t io[MAX_GPI8_PIN - FLASH_PINS];
|
||
} mycfgio8266; // 11 bytes
|
||
|
||
typedef struct MYTMPLT8266 {
|
||
mycfgio8266 gp;
|
||
uint8_t flag;
|
||
} mytmplt8266; // 12 bytes
|
||
|
||
#endif // ESP8266
|
||
#ifdef ESP32
|
||
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
||
|
||
/* ****************************************
|
||
* ESP32C3
|
||
* ****************************************/
|
||
#define MAX_GPIO_PIN 22 // Number of supported GPIO
|
||
#define MIN_FLASH_PINS 0 // Number of flash chip pins unusable for configuration (GPIO11 to 17)
|
||
#define MAX_USER_PINS 22 // MAX_GPIO_PIN - MIN_FLASH_PINS
|
||
#define WEMOS_MODULE 0 // Wemos module
|
||
|
||
// 0 1 2 3 4 5 6 7 8 9101112131415161718192021
|
||
const char PINS_WEMOS[] PROGMEM = "AOAOAOAOAOAOIOIOIOIOIOFLFLFLFLFLFLFLIOIORXTX";
|
||
|
||
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
|
||
|
||
/* ****************************************
|
||
* ESP32S2
|
||
* ****************************************/
|
||
#define MAX_GPIO_PIN 47 // Number of supported GPIO
|
||
#define MIN_FLASH_PINS 11 // Number of flash chip pins unusable for configuration (22-25 don't exist, 26-32 for SPI)
|
||
#define MAX_USER_PINS 36 // MAX_GPIO_PIN - MIN_FLASH_PINS
|
||
#define WEMOS_MODULE 0 // Wemos module
|
||
|
||
// 0 1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031323334353637383940414243444546
|
||
const char PINS_WEMOS[] PROGMEM = "IOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOIO--------FLFLFLFLFLFLFLIOIOIOIOIOIOIOIOIOIOIOIOIOI ";
|
||
|
||
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
|
||
/* ****************************************
|
||
* ESP32S3
|
||
* GPIOs 0..21 + 33..48
|
||
* - 22..25 are not used
|
||
* - 26..32 are used for SPI Flash
|
||
* - 33..37 are used by PSRAM
|
||
* ****************************************/
|
||
#define MAX_GPIO_PIN 49 // Number of supported GPIO, 0..48
|
||
#define MIN_FLASH_PINS 11 // Number of flash chip pins unusable for configuration (22-25 don't exist, 26-32 for SPI)
|
||
#define MAX_USER_PINS 38 // MAX_GPIO_PIN - MIN_FLASH_PINS
|
||
#define WEMOS_MODULE 0 // Wemos module
|
||
|
||
// 0 1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839404142434445464748
|
||
const char PINS_WEMOS[] PROGMEM = "IOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOIO--------FLFLFLFLFLFLFLIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIO";
|
||
|
||
#else // not CONFIG_IDF_TARGET_ESP32C3 nor CONFIG_IDF_TARGET_ESP32S2 - ESP32
|
||
|
||
/* ****************************************
|
||
* ESP32 - including Pico
|
||
*
|
||
* The initial template was 0-5 9-10 12-39
|
||
* New template covers 0-27 32-39
|
||
* However to maintain backwards compatibility, the following mapping occures
|
||
* Template GPIO | Phyiscal GPIO
|
||
* 28 | 6
|
||
* 29 | 7
|
||
* 30 | 8
|
||
* 31 | 11
|
||
* ****************************************/
|
||
// Conversion table
|
||
#define ESP32_TEMPLATE_TO_PHY \
|
||
0, 1, 2, 3, 4, 5, \
|
||
9, 10, \
|
||
12, 13, 14, 15, 16, 17, 18, 19, \
|
||
20, 21, 22, 23, 24, 25, 26, 27, \
|
||
6, 7, 8, 11, /* 28-31 */ \
|
||
32, 33, 34, 35, 36, 37, 38, 39
|
||
|
||
#define MAX_GPIO_PIN 40 // Number of supported GPIO
|
||
#define MIN_FLASH_PINS 4 // Number of flash chip pins unusable for configuration (GPIO6, 7, 8 and 11)
|
||
#define MAX_USER_PINS 36 // MAX_GPIO_PIN - MIN_FLASH_PINS
|
||
#define WEMOS_MODULE 0 // Wemos module
|
||
|
||
// 0 1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839
|
||
const char PINS_WEMOS[] PROGMEM = "IOTXIORXIOIOFLFLFLFLFLFLIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIO--------AOAOIAIAIAIAIAIA";
|
||
|
||
#endif // ESP32/S2/C3 selection
|
||
#endif // ESP32
|
||
|
||
/********************************************************************************************\
|
||
* !!! Changes in below type sizes impact Settings layout - Add fill bytes in Settings !!!
|
||
\********************************************************************************************/
|
||
|
||
typedef struct MYIO {
|
||
uint16_t io[MAX_GPIO_PIN];
|
||
} myio; // ESP8266: 18*2 = 36 bytes / ESP32: 40*2 = 80 bytes / ESP32-C3: 22*2 = 44 bytes / ESP32-S2: 47*2 = 94 bytes / ESP32-S3: 49*2 = 98 bytes
|
||
|
||
typedef struct MYCFGIO {
|
||
uint16_t io[MAX_USER_PINS];
|
||
} mycfgio; // ESP8266: 14*2 = 28 bytes / ESP32: 36*2 = 72 bytes / ESP32-C3: 22*2 = 44 bytes / ESP32-S2: 36*2 = 72 bytes / ESP32-S3: 33*2 = 66 bytes
|
||
|
||
#define GPIO_FLAG_USED 0 // Currently no flags used
|
||
|
||
typedef union {
|
||
uint16_t data;
|
||
struct {
|
||
uint16_t spare00 : 1;
|
||
uint16_t spare01 : 1;
|
||
uint16_t spare02 : 1;
|
||
uint16_t spare03 : 1;
|
||
uint16_t spare04 : 1;
|
||
uint16_t spare05 : 1;
|
||
uint16_t spare06 : 1;
|
||
uint16_t spare07 : 1;
|
||
uint16_t spare08 : 1;
|
||
uint16_t spare09 : 1;
|
||
uint16_t spare10 : 1;
|
||
uint16_t spare11 : 1;
|
||
uint16_t spare12 : 1;
|
||
uint16_t spare13 : 1;
|
||
uint16_t spare14 : 1;
|
||
uint16_t spare15 : 1;
|
||
};
|
||
} gpio_flag; // 2 bytes
|
||
|
||
typedef struct MYTMPLT {
|
||
mycfgio gp; // 28 / 72 / 44 / 72 bytes
|
||
gpio_flag flag; // 2 bytes
|
||
} mytmplt; // 30 / 74 / 46 / 74 bytes
|
||
|
||
//********************************************************************************************
|
||
|
||
#ifdef ESP8266
|
||
#include "tasmota_template_legacy.h"
|
||
|
||
/********************************************************************************************\
|
||
* ESP8266 Module Templates
|
||
\********************************************************************************************/
|
||
|
||
#define USER_MODULE 255
|
||
|
||
// Supported ESP8266 hardware modules
|
||
enum SupportedModulesESP8266 {
|
||
SONOFF_BASIC, SONOFF_RF, SONOFF_SV, SONOFF_TH, SONOFF_DUAL, SONOFF_POW, SONOFF_4CH, SONOFF_S2X, SLAMPHER, SONOFF_TOUCH,
|
||
SONOFF_LED, CH1, CH4, MOTOR, ELECTRODRAGON, EXS_RELAY, WION, WEMOS, SONOFF_DEV, H801,
|
||
SONOFF_SC, SONOFF_BN, SONOFF_4CHPRO, HUAFAN_SS, SONOFF_BRIDGE, SONOFF_B1, AILIGHT, SONOFF_T11, SONOFF_T12, SONOFF_T13,
|
||
SUPLA1, WITTY, YUNSHAN, MAGICHOME, LUANIHVIO, KMC_70011, ARILUX_LC01, ARILUX_LC11, SONOFF_DUAL_R2, ARILUX_LC06,
|
||
SONOFF_S31, ZENGGE_ZF_WF017, SONOFF_POW_R2, SONOFF_IFAN02, BLITZWOLF_BWSHP, SHELLY1, SHELLY2, PHILIPS, NEO_COOLCAM, ESP_SWITCH,
|
||
OBI, TECKIN, APLIC_WDP303075, TUYA_DIMMER, GOSUND, ARMTRONIX_DIMMERS, SK03_TUYA, PS_16_DZ, TECKIN_US, MANZOKU_EU_4,
|
||
OBI2, YTF_IR_BRIDGE, DIGOO, KA10, ZX2820, MI_DESK_LAMP, SP10, WAGA, SYF05, SONOFF_L1,
|
||
SONOFF_IFAN03, EXS_DIMMER, PWM_DIMMER, SONOFF_D1, SONOFF_ZB_BRIDGE,
|
||
MAXMODULE };
|
||
|
||
const char kModuleNames[] PROGMEM =
|
||
"Sonoff Basic|Sonoff RF|Sonoff SV|Sonoff TH|Sonoff Dual|Sonoff Pow|Sonoff 4CH|Sonoff S2X|Slampher|Sonoff Touch|"
|
||
"Sonoff LED|1 Channel|4 Channel|Motor C/AC|ElectroDragon|EXS Relay(s)|WiOn|Generic|Sonoff Dev|H801|"
|
||
"Sonoff SC|Sonoff BN-SZ|Sonoff 4CH Pro|Huafan SS|Sonoff Bridge|Sonoff B1|AiLight|Sonoff T1 1CH|Sonoff T1 2CH|Sonoff T1 3CH|"
|
||
"Supla Espablo|Witty Cloud|Yunshan Relay|MagicHome|Luani HVIO|KMC 70011|Arilux LC01|Arilux LC11|Sonoff Dual R2|Arilux LC06|"
|
||
"Sonoff S31|Zengge WF017|Sonoff Pow R2|Sonoff iFan02|BlitzWolf SHP|Shelly 1|Shelly 2|Xiaomi Philips|Neo Coolcam|ESP Switch|"
|
||
"OBI Socket|Teckin|AplicWDP303075|Tuya MCU|Gosund SP1 v23|ARMTR Dimmer|SK03 Outdoor|PS-16-DZ|Teckin US|Manzoku strip|"
|
||
"OBI Socket 2|YTF IR Bridge|Digoo DG-SP202|KA10|Luminea ZX2820|Mi Desk Lamp|SP10|WAGA CHCZ02MB|SYF05|Sonoff L1|"
|
||
"Sonoff iFan03|EXS Dimmer|PWM Dimmer|Sonoff D1|Sonoff ZbBridge"
|
||
;
|
||
|
||
const uint8_t kModuleNiceList[] PROGMEM = {
|
||
SONOFF_BASIC, // Sonoff Relay Devices
|
||
SONOFF_RF,
|
||
SONOFF_TH,
|
||
SONOFF_DUAL,
|
||
SONOFF_DUAL_R2,
|
||
SONOFF_POW,
|
||
SONOFF_POW_R2,
|
||
SONOFF_4CH,
|
||
SONOFF_4CHPRO,
|
||
SONOFF_S31, // Sonoff Socket Relay Devices with Energy Monitoring
|
||
SONOFF_S2X, // Sonoff Socket Relay Devices
|
||
SONOFF_TOUCH, // Sonoff Switch Devices
|
||
SONOFF_T11,
|
||
SONOFF_T12,
|
||
SONOFF_T13,
|
||
#ifdef USE_SONOFF_D1
|
||
SONOFF_D1, // Sonoff D1
|
||
#endif
|
||
SONOFF_LED, // Sonoff Light Devices
|
||
SONOFF_BN,
|
||
#ifdef USE_SONOFF_L1
|
||
SONOFF_L1,
|
||
#endif
|
||
SONOFF_B1, // Sonoff Light Bulbs
|
||
SLAMPHER,
|
||
#ifdef USE_SONOFF_SC
|
||
SONOFF_SC, // Sonoff Environmemtal Sensor
|
||
#endif
|
||
#ifdef USE_SONOFF_IFAN
|
||
SONOFF_IFAN02, // Sonoff Fan
|
||
SONOFF_IFAN03,
|
||
#endif
|
||
#ifdef USE_SONOFF_RF
|
||
SONOFF_BRIDGE, // Sonoff Bridge
|
||
#endif
|
||
#ifdef USE_ZIGBEE_EZSP
|
||
SONOFF_ZB_BRIDGE,
|
||
#endif
|
||
SONOFF_SV, // Sonoff Development Devices
|
||
SONOFF_DEV,
|
||
CH1, // Relay Devices
|
||
CH4,
|
||
MOTOR,
|
||
ELECTRODRAGON,
|
||
EXS_RELAY,
|
||
SUPLA1,
|
||
LUANIHVIO,
|
||
YUNSHAN,
|
||
WION,
|
||
SHELLY1,
|
||
SHELLY2,
|
||
BLITZWOLF_BWSHP, // Socket Relay Devices with Energy Monitoring
|
||
TECKIN,
|
||
TECKIN_US,
|
||
APLIC_WDP303075,
|
||
GOSUND,
|
||
ZX2820,
|
||
SK03_TUYA,
|
||
DIGOO,
|
||
KA10,
|
||
SP10,
|
||
WAGA,
|
||
NEO_COOLCAM, // Socket Relay Devices
|
||
OBI,
|
||
OBI2,
|
||
MANZOKU_EU_4,
|
||
ESP_SWITCH, // Switch Devices
|
||
#ifdef USE_TUYA_MCU
|
||
TUYA_DIMMER, // Dimmer Devices
|
||
#endif
|
||
#ifdef USE_ARMTRONIX_DIMMERS
|
||
ARMTRONIX_DIMMERS,
|
||
#endif
|
||
#ifdef USE_PS_16_DZ
|
||
PS_16_DZ,
|
||
#endif
|
||
#ifdef USE_EXS_DIMMER
|
||
EXS_DIMMER,
|
||
#endif
|
||
#ifdef USE_PWM_DIMMER
|
||
PWM_DIMMER,
|
||
#endif
|
||
H801, // Light Devices
|
||
MAGICHOME,
|
||
ARILUX_LC01,
|
||
ARILUX_LC06,
|
||
ARILUX_LC11,
|
||
ZENGGE_ZF_WF017,
|
||
HUAFAN_SS,
|
||
#ifdef ROTARY_V1
|
||
MI_DESK_LAMP,
|
||
#endif
|
||
KMC_70011,
|
||
AILIGHT, // Light Bulbs
|
||
PHILIPS,
|
||
SYF05,
|
||
YTF_IR_BRIDGE,
|
||
WITTY, // Development Devices
|
||
WEMOS
|
||
};
|
||
|
||
enum SupportedTemplates8285 {
|
||
TMP_SONOFF_BASIC, TMP_SONOFF_SV, TMP_SONOFF_DUAL, TMP_SONOFF_POW, TMP_SONOFF_LED, TMP_ELECTRODRAGON,
|
||
TMP_EXS_RELAY, TMP_WION, TMP_SONOFF_DEV, TMP_H801, TMP_SONOFF_SC, TMP_SONOFF_BN, TMP_HUAFAN_SS, TMP_SONOFF_BRIDGE,
|
||
TMP_SONOFF_B1, TMP_AILIGHT, TMP_SONOFF_T11, TMP_SUPLA1, TMP_WITTY, TMP_YUNSHAN, TMP_MAGICHOME,
|
||
TMP_LUANIHVIO, TMP_KMC_70011, TMP_ARILUX_LC01, TMP_ARILUX_LC11, TMP_ARILUX_LC06, TMP_ZENGGE_ZF_WF017,
|
||
TMP_SONOFF_POW_R2, TMP_BLITZWOLF_BWSHP, TMP_SHELLY1, TMP_SHELLY2, TMP_PHILIPS, TMP_NEO_COOLCAM, TMP_ESP_SWITCH, TMP_OBI,
|
||
TMP_TECKIN, TMP_APLIC_WDP303075, TMP_TUYA_DIMMER, TMP_GOSUND, TMP_ARMTRONIX_DIMMERS, TMP_SK03_TUYA, TMP_PS_16_DZ,
|
||
TMP_TECKIN_US, TMP_MANZOKU_EU_4, TMP_OBI2, TMP_YTF_IR_BRIDGE, TMP_DIGOO, TMP_KA10, TMP_ZX2820, TMP_MI_DESK_LAMP, TMP_SP10,
|
||
TMP_WAGA, TMP_SYF05, TMP_EXS_DIMMER, TMP_PWM_DIMMER, TMP_SONOFF_ZB_BRIDGE,
|
||
TMP_MAXMODULE_8285 };
|
||
|
||
enum SupportedTemplates8266 |