Fix Berry `gpio.INPUT` conflict

This commit is contained in:
Stephan Hadinger 2022-10-25 11:49:39 +02:00
parent 4ec5c16ef8
commit 549f13f7a8
4 changed files with 42 additions and 264 deletions

View File

@ -19,7 +19,7 @@ class lv_touch_3_buttons
static ACTIVE_LOW = true
# Arguments:
# Physical GPIOs, generally through `gpio.pin(gpio.INPUT, 0), gpio.pin(gpio.INPUT, 1), gpio.pin(gpio.INPUT, 2)`
# Physical GPIOs, generally through `gpio.pin(gpio.GPIO_INPUT, 0), gpio.pin(gpio.GPIO_INPUT, 1), gpio.pin(gpio.GPIO_INPUT, 2)`
#
# Pre-condition:
# LVGL must be already started
@ -85,9 +85,9 @@ class lv_touch_3_buttons
end
end
return lv_touch_3_buttons(gpio.pin(gpio.INPUT, 0), gpio.pin(gpio.INPUT, 1), gpio.pin(gpio.INPUT, 2), true)
return lv_touch_3_buttons(gpio.pin(gpio.GPIO_INPUT, 0), gpio.pin(gpio.GPIO_INPUT, 1), gpio.pin(gpio.GPIO_INPUT, 2), true)
#-
lv_btn3 = lv_touch_3_buttons(gpio.pin(gpio.INPUT, 0), gpio.pin(gpio.INPUT, 1), gpio.pin(gpio.INPUT, 2), lv_touch_3_buttons.ACTIVE_LOW)
lv_btn3 = lv_touch_3_buttons(gpio.pin(gpio.GPIO_INPUT, 0), gpio.pin(gpio.GPIO_INPUT, 1), gpio.pin(gpio.GPIO_INPUT, 2), lv_touch_3_buttons.ACTIVE_LOW)
tasmota.add_driver(lv_btn3)
-#

View File

@ -19,7 +19,9 @@ const be_const_member_t lv_gpio_constants[] = {
{ "ADC_RANGE", (int32_t) GPIO_ADC_RANGE },
{ "ADC_TEMP", (int32_t) GPIO_ADC_TEMP },
{ "ADE7880_IRQ", (int32_t) GPIO_ADE7880_IRQ },
{ "ADE7953_CS", (int32_t) GPIO_ADE7953_CS },
{ "ADE7953_IRQ", (int32_t) GPIO_ADE7953_IRQ },
{ "ADE7953_RST", (int32_t) GPIO_ADE7953_RST },
{ "ARIRFRCV", (int32_t) GPIO_ARIRFRCV },
{ "ARIRFSEL", (int32_t) GPIO_ARIRFSEL },
{ "AS3935", (int32_t) GPIO_AS3935 },
@ -35,6 +37,8 @@ const be_const_member_t lv_gpio_constants[] = {
{ "BL6523_TX", (int32_t) GPIO_BL6523_TX },
{ "BOILER_OT_RX", (int32_t) GPIO_BOILER_OT_RX },
{ "BOILER_OT_TX", (int32_t) GPIO_BOILER_OT_TX },
{ "BP5758D_CLK", (int32_t) GPIO_BP5758D_CLK },
{ "BP5758D_DAT", (int32_t) GPIO_BP5758D_DAT },
{ "BS814_CLK", (int32_t) GPIO_BS814_CLK },
{ "BS814_DAT", (int32_t) GPIO_BS814_DAT },
{ "BUZZER", (int32_t) GPIO_BUZZER },
@ -75,6 +79,7 @@ const be_const_member_t lv_gpio_constants[] = {
{ "FALLING", FALLING },
{ "FLOWRATEMETER_SIGNAL", (int32_t) GPIO_FLOWRATEMETER_IN },
{ "FTC532", (int32_t) GPIO_FTC532 },
{ "GPIO_INPUT", (int32_t) GPIO_INPUT },
{ "GPS_RX", (int32_t) GPIO_GPS_RX },
{ "GPS_TX", (int32_t) GPIO_GPS_TX },
{ "HALLEFFECT", (int32_t) GPIO_HALLEFFECT },
@ -99,6 +104,7 @@ const be_const_member_t lv_gpio_constants[] = {
{ "I2S_IN_CLK", (int32_t) GPIO_I2S_BCLK_IN },
{ "I2S_IN_DATA", (int32_t) GPIO_I2S_DIN },
{ "I2S_IN_SLCT", (int32_t) GPIO_I2S_WS_IN },
{ "I2S_MCLK", (int32_t) GPIO_I2S_MCLK },
{ "I2S_OUT_CLK", (int32_t) GPIO_I2S_BCLK },
{ "I2S_OUT_DATA", (int32_t) GPIO_I2S_DOUT },
{ "I2S_OUT_SLCT", (int32_t) GPIO_I2S_WS },
@ -109,7 +115,7 @@ const be_const_member_t lv_gpio_constants[] = {
{ "ILI9341_CS", (int32_t) GPIO_ILI9341_CS },
{ "ILI9341_DC", (int32_t) GPIO_ILI9341_DC },
{ "ILI9488_CS", (int32_t) GPIO_ILI9488_CS },
{ "INPUT", (int32_t) GPIO_INPUT },
{ "INPUT", INPUT },
{ "INPUT_PULLDOWN", INPUT_PULLDOWN },
{ "INPUT_PULLUP", INPUT_PULLUP },
{ "INTERRUPT", (int32_t) GPIO_INTERRUPT },
@ -137,6 +143,8 @@ const be_const_member_t lv_gpio_constants[] = {
{ "MAX7219CS", (int32_t) GPIO_MAX7219CS },
{ "MAX7219DIN", (int32_t) GPIO_MAX7219DIN },
{ "MAX_RMT", MAX_RMT },
{ "MBR_RX", (int32_t) GPIO_MBR_RX },
{ "MBR_TX", (int32_t) GPIO_MBR_TX },
{ "MCP2515_CS", (int32_t) GPIO_MCP2515_CS },
{ "MCP39F5_RST", (int32_t) GPIO_MCP39F5_RST },
{ "MCP39F5_RX", (int32_t) GPIO_MCP39F5_RX },
@ -148,6 +156,7 @@ const be_const_member_t lv_gpio_constants[] = {
{ "MIEL_HVAC_RX", (int32_t) GPIO_MIEL_HVAC_RX },
{ "MIEL_HVAC_TX", (int32_t) GPIO_MIEL_HVAC_TX },
{ "MP3_DFR562", (int32_t) GPIO_MP3_DFR562 },
{ "MP3_DFR562_BUSY", (int32_t) GPIO_MP3_DFR562_BUSY },
{ "MS01", (int32_t) GPIO_MS01 },
{ "NEOPOOL_RX", (int32_t) GPIO_NEOPOOL_RX },
{ "NEOPOOL_TX", (int32_t) GPIO_NEOPOOL_TX },
@ -155,6 +164,8 @@ const be_const_member_t lv_gpio_constants[] = {
{ "NRF24_CS", (int32_t) GPIO_NRF24_CS },
{ "NRF24_DC", (int32_t) GPIO_NRF24_DC },
{ "NRG_CF1", (int32_t) GPIO_NRG_CF1 },
{ "NRG_MBS_RX", (int32_t) GPIO_NRG_MBS_RX },
{ "NRG_MBS_TX", (int32_t) GPIO_NRG_MBS_TX },
{ "NRG_SEL", (int32_t) GPIO_NRG_SEL },
{ "NRG_SEL_INV", (int32_t) GPIO_NRG_SEL_INV },
{ "OLED_RESET", (int32_t) GPIO_OLED_RESET },
@ -186,6 +197,8 @@ const be_const_member_t lv_gpio_constants[] = {
{ "RC522_RST", (int32_t) GPIO_RC522_RST },
{ "RDM6300_RX", (int32_t) GPIO_RDM6300_RX },
{ "REL1", (int32_t) GPIO_REL1 },
{ "REL1_BI", (int32_t) GPIO_REL1_BI },
{ "REL1_BI_INV", (int32_t) GPIO_REL1_BI_INV },
{ "REL1_INV", (int32_t) GPIO_REL1_INV },
{ "RESET", (int32_t) GPIO_RESET },
{ "RFRECV", (int32_t) GPIO_RFRECV },
@ -231,6 +244,8 @@ const be_const_member_t lv_gpio_constants[] = {
{ "SM16716_SEL", (int32_t) GPIO_SM16716_SEL },
{ "SM2135_CLK", (int32_t) GPIO_SM2135_CLK },
{ "SM2135_DAT", (int32_t) GPIO_SM2135_DAT },
{ "SM2335_CLK", (int32_t) GPIO_SM2335_CLK },
{ "SM2335_DAT", (int32_t) GPIO_SM2335_DAT },
{ "SOLAXX1_RTS", (int32_t) GPIO_SOLAXX1_RTS },
{ "SOLAXX1_RX", (int32_t) GPIO_SOLAXX1_RX },
{ "SOLAXX1_TX", (int32_t) GPIO_SOLAXX1_TX },
@ -266,6 +281,10 @@ const be_const_member_t lv_gpio_constants[] = {
{ "TELEINFO_RX", (int32_t) GPIO_TELEINFO_RX },
{ "TFMINIPLUS_RX", (int32_t) GPIO_TFMINIPLUS_RX },
{ "TFMINIPLUS_TX", (int32_t) GPIO_TFMINIPLUS_TX },
{ "TM1621_CS", (int32_t) GPIO_TM1621_CS },
{ "TM1621_DAT", (int32_t) GPIO_TM1621_DAT },
{ "TM1621_RD", (int32_t) GPIO_TM1621_RD },
{ "TM1621_WR", (int32_t) GPIO_TM1621_WR },
{ "TM1637CLK", (int32_t) GPIO_TM1637CLK },
{ "TM1637DIO", (int32_t) GPIO_TM1637DIO },
{ "TM1638CLK", (int32_t) GPIO_TM1638CLK },
@ -300,8 +319,6 @@ const be_const_member_t lv_gpio_constants[] = {
{ "ZIGBEE_RST", (int32_t) GPIO_ZIGBEE_RST },
{ "ZIGBEE_RX", (int32_t) GPIO_ZIGBEE_RX },
{ "ZIGBEE_TX", (int32_t) GPIO_ZIGBEE_TX },
{ "MBR_RX", (int32_t) GPIO_MBR_RX },
{ "MBR_TX", (int32_t) GPIO_MBR_TX },
};

View File

@ -1,257 +0,0 @@
gpio = module('gpio')
#- HIGH/LOW -#
gpio.LOW = 0
gpio.HIGH = 1
#- GPIO states -#
gpio.INPUT = 1
gpio.OUTPUT = 2
gpio.PULLUP = 4
gpio.INPUT_PULLUP = 5
gpio.PULLDOWN = 8
gpio.OPEN_DRAIN = 16
gpio.OUTPUT_OPEN_DRAIN = 18
#- Interrupt trigger -#
gpio.RISING = 1
gpio.FALLING = 2
gpio.CHANGE = 4
#- Tasmota GPIOs -#
gpio.NONE = 0
gpio.KEY1 = 1
gpio.KEY1_NP = 2
gpio.KEY1_INV = 3
gpio.KEY1_INV_NP = 4
gpio.SWT1 = 5
gpio.SWT1_NP = 6
gpio.REL1 = 7
gpio.REL1_INV = 8
gpio.LED1 = 9
gpio.LED1_INV = 10
gpio.CNTR1 = 11
gpio.CNTR1_NP = 12
gpio.PWM1 = 13
gpio.PWM1_INV = 14
gpio.BUZZER = 15
gpio.BUZZER_INV = 16
gpio.LEDLNK = 17
gpio.LEDLNK_INV = 18
gpio.I2C_SCL = 19
gpio.I2C_SDA = 20
gpio.SPI_MISO = 21
gpio.SPI_MOSI = 22
gpio.SPI_CLK = 23
gpio.SPI_CS = 24
gpio.SPI_DC = 25
gpio.SSPI_MISO = 26
gpio.SSPI_MOSI = 27
gpio.SSPI_SCLK = 28
gpio.SSPI_CS = 29
gpio.SSPI_DC = 30
gpio.BACKLIGHT = 31
gpio.OLED_RESET = 32
gpio.IRSEND = 33
gpio.IRRECV = 34
gpio.RFSEND = 35
gpio.RFRECV = 36
gpio.DHT11 = 37
gpio.DHT22 = 38
gpio.SI7021 = 39
gpio.DHT11_OUT = 40
gpio.DSB = 41
gpio.DSB_OUT = 42
gpio.WS2812 = 43
gpio.MHZ_TXD = 44
gpio.MHZ_RXD = 45
gpio.PZEM0XX_TX = 46
gpio.PZEM004_RX = 47
gpio.PZEM016_RX = 48
gpio.PZEM017_RX = 49
gpio.SAIR_TX = 50
gpio.SAIR_RX = 51
gpio.PMS5003_TX = 52
gpio.PMS5003_RX = 53
gpio.SDS0X1_TX = 54
gpio.SDS0X1_RX = 55
gpio.SBR_TX = 56
gpio.SBR_RX = 57
gpio.SR04_TRIG = 58
gpio.SR04_ECHO = 59
gpio.SDM120_TX = 60
gpio.SDM120_RX = 61
gpio.SDM630_TX = 62
gpio.SDM630_RX = 63
gpio.TM1638CLK = 64
gpio.TM1638DIO = 65
gpio.TM1638STB = 66
gpio.MP3_DFR562 = 67
gpio.HX711_SCK = 68
gpio.HX711_DAT = 69
gpio.TX2X_TXD_BLACK = 70
gpio.TUYA_TX = 71
gpio.TUYA_RX = 72
gpio.MGC3130_XFER = 73
gpio.MGC3130_RESET = 74
gpio.RF_SENSOR = 75
gpio.AZ_TXD = 76
gpio.AZ_RXD = 77
gpio.MAX31855CS = 78
gpio.MAX31855CLK = 79
gpio.MAX31855DO = 80
gpio.NRG_SEL = 81
gpio.NRG_SEL_INV = 82
gpio.NRG_CF1 = 83
gpio.HLW_CF = 84
gpio.HJL_CF = 85
gpio.MCP39F5_TX = 86
gpio.MCP39F5_RX = 87
gpio.MCP39F5_RST = 88
gpio.PN532_TXD = 89
gpio.PN532_RXD = 90
gpio.SM16716_CLK = 91
gpio.SM16716_DAT = 92
gpio.SM16716_SEL = 93
gpio.DI = 94
gpio.DCKI = 95
gpio.CSE7766_TX = 96
gpio.CSE7766_RX = 97
gpio.ARIRFRCV = 98
gpio.ARIRFSEL = 99
gpio.TXD = 100
gpio.RXD = 101
gpio.ROT1A = 102
gpio.ROT1B = 103
gpio.ADC_JOY = 104
gpio.SSPI_MAX31865_CS1 = 105
gpio.HRE_CLOCK = 106
gpio.HRE_DATA = 107
gpio.ADE7953_IRQ = 108
gpio.SOLAXX1_TX = 109
gpio.SOLAXX1_RX = 110
gpio.ZIGBEE_TX = 111
gpio.ZIGBEE_RX = 112
gpio.RDM6300_RX = 113
gpio.IBEACON_TX = 114
gpio.IBEACON_RX = 115
gpio.A4988_DIR = 116
gpio.A4988_STP = 117
gpio.A4988_ENA = 118
gpio.A4988_MS1 = 119
gpio.OUTPUT_HI = 120
gpio.OUTPUT_LO = 121
gpio.DDS2382_TX = 122
gpio.DDS2382_RX = 123
gpio.DDSU666_TX = 124
gpio.DDSU666_RX = 125
gpio.SM2135_CLK = 126
gpio.SM2135_DAT = 127
gpio.DEEPSLEEP = 128
gpio.EXS_ENABLE = 129
gpio.TASMOTACLIENT_TXD = 130
gpio.TASMOTACLIENT_RXD = 131
gpio.TASMOTACLIENT_RST = 132
gpio.TASMOTACLIENT_RST_INV = 133
gpio.HPMA_RX = 134
gpio.HPMA_TX = 135
gpio.GPS_RX = 136
gpio.GPS_TX = 137
gpio.HM10_RX = 138
gpio.HM10_TX = 139
gpio.LE01MR_RX = 140
gpio.LE01MR_TX = 141
gpio.CC1101_GDO0 = 142
gpio.CC1101_GDO2 = 143
gpio.HRXL_RX = 144
gpio.ELECTRIQ_MOODL_TX = 145
gpio.AS3935 = 146
gpio.ADC_INPUT = 147
gpio.ADC_TEMP = 148
gpio.ADC_LIGHT = 149
gpio.ADC_BUTTON = 150
gpio.ADC_BUTTON_INV = 151
gpio.ADC_RANGE = 152
gpio.ADC_CT_POWER = 153
gpio.WEBCAM_PWDN = 154
gpio.WEBCAM_RESET = 155
gpio.WEBCAM_XCLK = 156
gpio.WEBCAM_SIOD = 157
gpio.WEBCAM_SIOC = 158
gpio.WEBCAM_DATA = 159
gpio.WEBCAM_VSYNC = 160
gpio.WEBCAM_HREF = 161
gpio.WEBCAM_PCLK = 162
gpio.WEBCAM_PSCLK = 163
gpio.WEBCAM_HSD = 164
gpio.WEBCAM_PSRCS = 165
gpio.BOILER_OT_RX = 166
gpio.BOILER_OT_TX = 167
gpio.WINDMETER_SPEED = 168
gpio.KEY1_TC = 169
gpio.BL0940_RX = 170
gpio.TCP_TX = 171
gpio.TCP_RX = 172
gpio.ETH_PHY_POWER = 173
gpio.ETH_PHY_MDC = 174
gpio.ETH_PHY_MDIO = 175
gpio.TELEINFO_RX = 176
gpio.TELEINFO_ENABLE = 177
gpio.LMT01 = 178
gpio.IEM3000_TX = 179
gpio.IEM3000_RX = 180
gpio.ZIGBEE_RST = 181
gpio.DYP_RX = 182
gpio.MIEL_HVAC_TX = 183
gpio.MIEL_HVAC_RX = 184
gpio.WE517_TX = 185
gpio.WE517_RX = 186
gpio.AS608_TX = 187
gpio.AS608_RX = 188
gpio.SHELLY_DIMMER_BOOT0 = 189
gpio.SHELLY_DIMMER_RST_INV = 190
gpio.RC522_RST = 191
gpio.P9813_CLK = 192
gpio.P9813_DAT = 193
gpio.OPTION_A = 194
gpio.FTC532 = 195
gpio.RC522_CS = 196
gpio.NRF24_CS = 197
gpio.NRF24_DC = 198
gpio.ILI9341_CS = 199
gpio.ILI9341_DC = 200
gpio.ILI9488_CS = 201
gpio.EPAPER29_CS = 202
gpio.EPAPER42_CS = 203
gpio.SSD1351_CS = 204
gpio.RA8876_CS = 205
gpio.ST7789_CS = 206
gpio.ST7789_DC = 207
gpio.SSD1331_CS = 208
gpio.SSD1331_DC = 209
gpio.SDCARD_CS = 210
gpio.ROT1A_NP = 211
gpio.ROT1B_NP = 212
gpio.ADC_PH = 213
gpio.BS814_CLK = 214
gpio.BS814_DAT = 215
gpio.WIEGAND_D0 = 216
gpio.WIEGAND_D1 = 217
gpio.NEOPOOL_TX = 218
gpio.NEOPOOL_RX = 219
gpio.SDM72_TX = 220
gpio.SDM72_RX = 221
gpio.TM1637CLK = 222
gpio.TM1637DIO = 223
gpio.PROJECTOR_CTRL_TX = 224
gpio.PROJECTOR_CTRL_RX = 225
gpio.SSD1351_DC = 226
gpio.XPT2046_CS = 227
gpio.CSE7761_TX = 228
gpio.CSE7761_RX = 229
gpio.VL53LXX_XSHUT1 = 230
gpio.MAX7219CLK = 231
gpio.MAX7219DIN = 232
gpio.MAX7219CS = 233
gpio.TFMINIPLUS_TX = 234
gpio.TFMINIPLUS_RX = 235
gpio.ZEROCROSS = 236
gpio.HALLEFFECT = 237
gpio.SENSOR_END = 238
gpio.ADC_MQ = 239

View File

@ -261,7 +261,7 @@ TFMINIPLUS_RX = GPIO_TFMINIPLUS_RX
ZEROCROSS = GPIO_ZEROCROSS
HALLEFFECT = GPIO_HALLEFFECT
EPD_DATA = GPIO_EPD_DATA
INPUT = GPIO_INPUT
GPIO_INPUT = GPIO_INPUT // avoid conflict with INPUT
KEY1_PD = GPIO_KEY1_PD
KEY1_INV_PD = GPIO_KEY1_INV_PD
SWT1_PD = GPIO_SWT1_PD
@ -307,5 +307,23 @@ SDIO_D2 = GPIO_SDIO_D2
SDIO_D3 = GPIO_SDIO_D3
FLOWRATEMETER_SIGNAL = GPIO_FLOWRATEMETER_IN
BP5758D_CLK = GPIO_BP5758D_CLK
BP5758D_DAT = GPIO_BP5758D_DAT
SM2335_CLK = GPIO_SM2335_CLK
SM2335_DAT = GPIO_SM2335_DAT
MP3_DFR562_BUSY = GPIO_MP3_DFR562_BUSY
TM1621_CS = GPIO_TM1621_CS
TM1621_WR = GPIO_TM1621_WR
TM1621_RD = GPIO_TM1621_RD
TM1621_DAT = GPIO_TM1621_DAT
REL1_BI = GPIO_REL1_BI
REL1_BI_INV = GPIO_REL1_BI_INV
I2S_MCLK = GPIO_I2S_MCLK
MBR_TX = GPIO_MBR_TX
MBR_RX = GPIO_MBR_RX
ADE7953_RST = GPIO_ADE7953_RST
NRG_MBS_TX = GPIO_NRG_MBS_TX
NRG_MBS_RX = GPIO_NRG_MBS_RX
ADE7953_CS = GPIO_ADE7953_CS
SENSOR_END = GPIO_SENSOR_END