menu "Lua RTOS"
   config LUA_RTOS_VDD
      int "CPU power voltage (VDDA)"
      range 2300 3600
      default 3332
      help
         This sets the CPU power voltage (VDDA). The ideal value of this voltage is generally 3300 mVolts,
         but due to the manufacturing processes and components used that may not always be the same this
         value may be different from the ideal one.

         For a correct operation of the ADC and some sensors it is necessary that you indicate the exact
         value for your board. Please measure this value with a suitable equipment. A good and cheap
         choice is using an external ADC as an ADS1115.

   choice LUA_RTOS_BOARD_TYPE
      prompt "Firmware type"
      default LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N1

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N1
         bool "Whitecat ESP32N1"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N1_OTA
         bool "Whitecat ESP32N1 with OTA"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N1_DEVKIT
         bool "Whitecat ESP32N1 DEVKIT"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N1_DEVKIT_OTA
         bool "Whitecat ESP32N1 DEVKIT with OTA"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N2_DEVKIT
         bool "Whitecat ESP32N2 DEVKIT"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_N2_DEVKIT_OTA
         bool "Whitecat ESP32N2 DEVKIT with OTA"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_LORA_GW
         bool "Whitecat ESP32 LORA GW"

      config LUA_RTOS_FIRMWARE_WHITECAT_ESP32_LORA_GW_OTA
         bool "Whitecat ESP32 LORA GW with OTA"

      config LUA_RTOS_FIRMWARE_CITILAB_ED1
         bool "CITILAB ED1"

      config LUA_RTOS_FIRMWARE_ESP32_CORE_BOARD
         bool "Espressif Systems ESP32-CoreBoard"

      config LUA_RTOS_FIRMWARE_ESP32_CORE_BOARD_OTA
         bool "Espressif Systems ESP32-CoreBoard with OTA"

      config LUA_RTOS_FIRMWARE_ESP32_PICO_KIT
         bool "Espressif Systems ESP32 PICO KIT"

      config LUA_RTOS_FIRMWARE_ESP32_PICO_KIT_OTA
         bool "Espressif Systems ESP32 PICO KIT with OTA"

      config LUA_RTOS_FIRMWARE_ESP_WROVER_KIT
         bool "Espressif Systems ESP-WROVER-KIT"

      config LUA_RTOS_FIRMWARE_ESP_WROVER_KIT_OTA
         bool "Espressif Systems ESP-WROVER-KIT with OTA"

      config LUA_RTOS_FIRMWARE_ESP32_THING
         bool "SparkFun ESP32 Thing"

      config LUA_RTOS_FIRMWARE_ESP32_THING_OTA
         bool "SparkFun ESP32 Thing with OTA"

      config LUA_RTOS_FIRMWARE_ADAFRUIT_HUZZAH32
         bool "Adafruit HUZZAH32"

      config LUA_RTOS_FIRMWARE_ADAFRUIT_HUZZAH32_OTA
         bool "Adafruit HUZZAH32 with OTA"

      config LUA_RTOS_FIRMWARE_PYCOM_FIPY
         bool "Pycom FIPY"

      config LUA_RTOS_FIRMWARE_PYCOM_FIPY_OTA
         bool "Pycom FIPY with OTA"

      config LUA_RTOS_FIRMWARE_ESP32_POE
         bool "Olimex ESP32-POE"

      config LUA_RTOS_FIRMWARE_ESP32_POE_OTA
         bool "Olimex ESP32-POE with OTA"

      config LUA_RTOS_FIRMWARE_ESP32_GATEWAY
         bool "Olimex ESP32-Gateway"

      config LUA_RTOS_FIRMWARE_ESP32_GATEWAY_OTA
         bool "Olimex ESP32-Gateway with OTA"

      config LUA_RTOS_FIRMWARE_ESP32_EVB
         bool "Olimex ESP32-EVB"

      config LUA_RTOS_FIRMWARE_ESP32_EVB_OTA
         bool "Olimex ESP32-EVB with OTA"

      config LUA_RTOS_FIRMWARE_TRAVIS_ESP32_EVB_OTA
         bool "TRAVIS on Olimex ESP32-EVB with OTA"

      config LUA_RTOS_FIRMWARE_DOIT_ESP32_DEVKIT_V1
         bool "DOIT ESP32 DEVKIT V1"

      config LUA_RTOS_FIRMWARE_DOIT_ESP32_DEVKIT_V1_OTA
         bool "DOIT ESP32 DEVKIT V1 with OTA"

      config LUA_RTOS_FIRMWARE_WEMOS_ESP32_OLED
         bool "WeMos ESP32 with 128x64 OLED"

      config LUA_RTOS_FIRMWARE_WEMOS_ESP32_OLED_OTA
         bool "WeMos ESP32 with 128x64 OLED with OTA"

      config LUA_RTOS_FIRMWARE_EVK_NINA_W
         bool "EVK-NINA-W"

      config LUA_RTOS_FIRMWARE_WESP32
         bool "Silicognition wESP32"

      config LUA_RTOS_FIRMWARE_WESP32_OTA
         bool "Silicognition wESP32 with OTA"

      config LUA_RTOS_FIRMWARE_M5STACK
         bool "M5Stack Core Board"

      config LUA_RTOS_FIRMWARE_M5STACK_OTA
         bool "M5Stack Core Board with OTA"

      config LUA_RTOS_FIRMWARE_TTGO_LORA32
         bool "TTGO Lora32 without OLED"

      config LUA_RTOS_FIRMWARE_TTGO_LORA32_OTA
         bool "TTGO Lora32 without OLED with OTA"

      config LUA_RTOS_FIRMWARE_GENERIC
         bool "Generic ESP32 board"

      config LUA_RTOS_FIRMWARE_GENERIC_OTA
         bool "Generic ESP32 board with OTA"

   endchoice

   menu "OTA"
      config LUA_RTOS_USE_OTA
          bool "Include OTA support in build"
          default n

      config LUA_RTOS_OTA_SERVER_NAME
          string "OTA server name"
          default "ota.whitecatboard.org"
          depends on LUA_RTOS_USE_OTA
          help
            OTA server name. Only OTA SSL servers are allowed.

      config LUA_RTOS_USE_FACTORY_PARTITION
          bool "Include factory partition"
          default n
          depends on LUA_RTOS_USE_OTA
          help
            The factory partition is the default app partition, which is used when not OTA updates have been
            done in the device. The OTA update never updates the factory partition, so the user can reset the
            device to the factory settings in case of problems. When this option is enabled the device stores
            a minimum of 3 copies of the app, so the FLASH memory must have a lot of space to enable this
            option. We recommend to enable this option only in devices with a 8 MB FLASH, or greater.
   endmenu

   menu "General"
      menu "Deep Sleep"
         config LUA_RTOS_DEEP_SLEEP_RTC_PERIPH
               bool "Mantain power for RTC IO, sensors and ULP co-processor by default"
               default n

         config LUA_RTOS_DEEP_SLEEP_RTC_SLOW_MEM
               bool "Mantain power for RTC slow memory by default"
               default y

         config LUA_RTOS_DEEP_SLEEP_RTC_FAST_MEM
               bool "Mantain power for RTC fast memory by default"
               default n
      endmenu

      config LUA_RTOS_READ_FLASH_UNIQUE_ID
            bool "Read SPI flash EUI"
         default n
            help
               Lua RTOS can get a EUI from the SPI Flash Memory. This is a 8-byte length identifier that can
               be used for indentify your board. In the WHITECAT ESP32 N1 board this EUI is used in the LoRa WAN
               stack to set the DevEUI.

      config LUA_RTOS_LED_ACT
            int "Activity led GPIO number"
            range -1 39
            default 22

      menu "Console"
         config LUA_RTOS_USE_CONSOLE
            bool "Use console"
            default y
            help
            Select this to enable the Lua RTOS console.

      choice LUA_RTOS_CONSOLE_UART
         depends on LUA_RTOS_USE_CONSOLE
         prompt "UART"
         default LUA_RTOS_CONSOLE_UART0
         help
            Select the uart number used by the Lua RTOS console.

      config LUA_RTOS_CONSOLE_UART0
         bool "UART 0"

      config LUA_RTOS_CONSOLE_UART1
         bool "UART 1"

      config LUA_RTOS_CONSOLE_UART2
         bool "UART 2"

      endchoice

      choice LUA_RTOS_CONSOLE_BR
         depends on LUA_RTOS_USE_CONSOLE
         prompt "Baud rate"
         default LUA_RTOS_CONSOLE_BR_115200
         help
            Baud rate to use by the Lua RTOS console.

      config LUA_RTOS_CONSOLE_BR_57600
         bool "57600 baud"

      config LUA_RTOS_CONSOLE_BR_115200
         bool "115200 baud"
      endchoice

      config LUA_RTOS_CONSOLE_BUFFER_LEN
         depends on LUA_RTOS_USE_CONSOLE
            int "Buffer length"
            range 32 2048
            default 1024
            help
                  Select the the buffer length used by the console, in bytes,
      endmenu
      endmenu

      menu "Partition Table"
         config LUA_RTOS_PART_NVS_SIZE
            int "NVS partition size"
            range 1024 4194304
            default 24576
            help
                  Size of the NVS partition (in bytes). Currently this partition is
                  always included in the partition table.

         config LUA_RTOS_PART_STORAGE_SIZE
            int "FLASH storage partition size"
            range 1024 4194304
            default 524288
            help
                  Size of the storage partition (in bytes), which it's used by
                  SPIFFS and LFS file systems to store its data. This partition is
                  only included in the partition table if the support for SPIFFS
                  or LFS file systems is enabled.
      endmenu

      menu "File Systems"
         choice LUA_RTOS_ROM_STORAGE_FS
            prompt "ROM storage"
            default LUA_RTOS_USE_NONE_ROM_STORAGE_FS

            config LUA_RTOS_USE_NONE_ROM_STORAGE_FS
               bool "None"

            config LUA_RTOS_USE_ROM_FS
               bool "ROM file system"
         endchoice

         choice LUA_RTOS_RAM_FS
            prompt "RAM storage"
            default LUA_RTOS_USE_RAM_FS

            config LUA_RTOS_USE_NONE_RAM_FLASH_FS
               bool "None"

            config LUA_RTOS_USE_RAM_FS
               bool "RAM file system"
         endchoice

         choice LUA_RTOS_FLASH_STORAGE_FS
            prompt "FLASH storage"
            default LUA_RTOS_USE_SPIFFS

            config LUA_RTOS_USE_NONE_FLASH_STORAGE_FS
               bool "None"

            config LUA_RTOS_USE_SPIFFS
               bool "SPIFFS file system"

            config LUA_RTOS_USE_LFS
               bool "LFS (little file system)"
         endchoice

         choice LUA_RTOS_SD_CRD_FS
            prompt "SD Card storage"
            default LUA_RTOS_USE_NONE_SD_CARD_FS

            config LUA_RTOS_USE_NONE_SD_CARD_FS
               bool "None"

            config LUA_RTOS_USE_FAT
               bool "FAT"
         endchoice

         choice LUA_RTOS_ROOT_FS
            prompt "Root file system"
            default LUA_RTOS_SPIFFS_ROOT_FS

            config LUA_RTOS_RAM_FS_ROOT_FS
               bool "RAM file system"
               depends on LUA_RTOS_USE_RAM_FS

            config LUA_RTOS_ROM_FS_ROOT_FS
               bool "ROM file system"
               depends on LUA_RTOS_USE_ROM_FS

            config LUA_RTOS_SPIFFS_ROOT_FS
               bool "SPIFFS  file system"
               depends on LUA_RTOS_USE_SPIFFS

            config LUA_RTOS_LFS_ROOT_FS
               bool "LFS (little file system)"
               depends on LUA_RTOS_USE_LFS

            config LUA_RTOS_FAT_ROOT_FS
               bool "FAT file system"
               depends on LUA_RTOS_USE_FAT
        endchoice

        config LUA_RTOS_RAM_FS_SIZE
           depends on LUA_RTOS_USE_RAM_FS
           int "RAM file system size"
           range 4096 1048576
           default 4096

        config LUA_RTOS_RAM_FS_BLOCK_SIZE
           depends on LUA_RTOS_USE_RAM_FS
           int "RAM file system block size"
           range 64 1024
           default 128

        config LUA_RTOS_SPIFFS_LOG_PAGE_SIZE
           depends on LUA_RTOS_USE_SPIFFS
           int "SPIFFS file system logical page size"
           range 256 2048
           default 256

        config LUA_RTOS_SPIFFS_LOG_BLOCK_SIZE
           depends on LUA_RTOS_USE_SPIFFS
           int "SPIFFS file system logical block size"
           range 4096 65536
           default 4096

        config LUA_RTOS_SPIFFS_ERASE_SIZE
           depends on LUA_RTOS_USE_SPIFFS
           int "SPIFFS file system erase size"
           range 4096 65536
           default 4096

        config LUA_RTOS_LFS_BLOCK_SIZE
           depends on LUA_RTOS_USE_LFS
           int "LFS file system block size"
           range 64 65536
           default 4096

        config LUA_RTOS_LFS_READ_SIZE
           depends on LUA_RTOS_USE_LFS
           int "LFS file system read size"
           range 64 65536
           default 1024

        config LUA_RTOS_LFS_PROG_SIZE
           depends on LUA_RTOS_USE_LFS
           int "LFS file system prog size"
           range 64 65536
           default 1024
      endmenu

      menu "Network services"
         menu "OpenVPN client"
            config LUA_RTOS_USE_OPENVPN
               bool "Enable OpenVPN client support"
               default n

           config LUA_RTOS_OPENVPN_CONFIG_FILE
               string "Config file"
                  default "/etc/openvpn/client.conf"
         endmenu

         menu "SSH server"
            config LUA_RTOS_USE_SSH_SERVER
               bool "Enable SSH server"
               default y

            config LUA_RTOS_SSH_SERVER_STACK_SIZE
                depends on LUA_RTOS_USE_SSH_SERVER
                int "SSH thread stack size"
                range 10240 20480
                default 10240
                help
                    Default stack size assigned to SSH thread.

            config LUA_RTOS_SSH_SERVER_TASK_PRIORITY
                depends on LUA_RTOS_USE_SSH_SERVER
                int "SSH thread priority"
                range 3 25
                default 10
                help
                    Task priority assigned to SSH thread.

            config LUA_RTOS_SSH_SERVER_TASK_CPU
                depends on !FREERTOS_UNICORE && LUA_RTOS_USE_SSH_SERVER
                int "SSH task CPU affinity"
                range 0 1
                default 1
                help
                    CPU affinity for the task assigned to the SSH server.

            config LUA_RTOS_SSH_SHELL_STACK_SIZE
                depends on LUA_RTOS_USE_SSH_SERVER
                int "SSH thread stack size"
                range 10240 20480
                default 10240
                help
                    Default stack size assigned to SSH thread.

            config LUA_RTOS_SSH_SHELL_TASK_PRIORITY
                depends on LUA_RTOS_USE_SSH_SERVER
                int "SSH thread priority"
                range 3 25
                default 10
                help
                    Task priority assigned to SSH thread.

            config LUA_RTOS_SSH_SHELL_TASK_CPU
                depends on !FREERTOS_UNICORE && LUA_RTOS_USE_SSH_SERVER
                int "SSH task CPU affinity"
                range 0 1
                default 1
                help
                    CPU affinity for the task assigned to the SSH server.
         endmenu

         menu "HTTP client"
            config LUA_RTOS_USE_HTTP_CLIENT
                depends on LUA_RTOS_LUA_USE_NET
                bool "Enable HTTP client"
                default y
         endmenu

         menu "HTTP server"
            config LUA_RTOS_USE_HTTP_SERVER
                depends on LUA_RTOS_LUA_USE_NET
                bool "Enable HTTP server"
                default y

            config LUA_RTOS_HTTP_SERVER_PORT
                depends on LUA_RTOS_USE_HTTP_SERVER
                   int "HTTP server port"
                   range 0 65536
                   default 80
                help
                   TCP port where HTTP server listens

            config LUA_RTOS_HTTP_SERVER_PORT_SSL
                depends on LUA_RTOS_USE_HTTP_SERVER
                   int "HTTPS server port"
                   range 0 65536
                   default 443
                help
                   TCP port where HTTPS server listens

            config LUA_RTOS_HTTP_SERVER_DOCUMENT_ROOT
                depends on LUA_RTOS_USE_HTTP_SERVER
                   string "HTTP document root"
                   default /
                help
                   base folder where HTTP server looks for files

            config LUA_RTOS_HTTP_SERVER_STACK_SIZE
                depends on LUA_RTOS_USE_HTTP_SERVER
                int "HTTP thread stack size"
                range 4096 20480
                default 10240
                help
                    Default stack size assigned to HTTP thread.

            config LUA_RTOS_HTTP_SERVER_TASK_PRIORITY
                depends on LUA_RTOS_USE_HTTP_SERVER
                int "HTTP thread priority"
                range 3 25
                default 18
                help
                    Task priority assigned to HTTP thread.

            config LUA_RTOS_HTTP_SERVER_TASK_CPU
                depends on !FREERTOS_UNICORE && LUA_RTOS_USE_HTTP_SERVER
                int "HTTP task CPU affinity"
                range 0 1
                default 1
                help
                    CPU affinity for the task assigned to the HTTP server.
        endmenu

        menu "Rsyslog client"
            config LUA_RTOS_USE_RSYSLOG
                bool "Enable rsyslog client support"
                default y

            config LUA_RTOS_RSYSLOG_SERVER
                depends on LUA_RTOS_USE_RSYSLOG
                string "Default rsyslog server address"
                default "0.0.0.0"
                help
                    Empty string or 0.0.0.0 to disable at boot-up

            config LUA_RTOS_RSYSLOG_PORT
                depends on LUA_RTOS_USE_RSYSLOG
                int "Rsyslog server port"
                range 0 65536
                default 514
                help
                    UDP port where Rsyslog server listens

        endmenu

        menu "TELNET server"
            config LUA_RTOS_USE_TELNET_SERVER
               depends on LUA_RTOS_LUA_USE_NET
               bool "Enable TELNET server"
               default y

            config LUA_RTOS_TELNET_SERVER_PORT
                depends on LUA_RTOS_USE_TELNET_SERVER
                int "TELNET server port"
                range 0 65536
                default 23
                help
                    TCP port where TELNET server listens

            config LUA_RTOS_TELNET_SERVER_STACK_SIZE
                depends on LUA_RTOS_USE_TELNET_SERVER
                int "TELNET thread stack size"
                range 2048 10240
                default 2048
                help
                    Default stack size assigned to TELNET thread.

            config LUA_RTOS_TELNET_SERVER_TASK_PRIORITY
                depends on LUA_RTOS_USE_TELNET_SERVER
                int "TELNET thread priority"
                range 3 25
                default 10
                help
                    Task priority assigned to TELNET thread.

            config LUA_RTOS_TELNET_SERVER_TASK_CPU
                depends on !FREERTOS_UNICORE && LUA_RTOS_USE_TELNET_SERVER
                int "TELNET task CPU affinity"
                range 0 1
                default 1
                help
                    CPU affinity for the task assigned to the TELNET server.

            config LUA_RTOS_TELNET_SERVER_CHILD_STACK_SIZE
                depends on LUA_RTOS_USE_TELNET_SERVER
                int "TELNET child thread stack size"
                range 2048 10240
                default 3072
                help
                    Default stack size assigned to TELNET thread.

         endmenu

      endmenu

      menu "Hardware"

      menu "Power BUS"
         config LUA_RTOS_POWER_BUS_PIN
            int "Power BUS GPIO number"
            range -1 39
            default 27
            help
               Some Lua RTOS compatible boards, such as WHITECAT N2 DEVKIT, have a load switch that can turn on and
               off power rails through a GPIO. In Lua RTOS this feature is know as Power BUS, on which you can connect
               devices that can be turn on and off on-demand, such as sensors and transceivers that are turn off when
               they are not needed to save power consumption.

         config LUA_RTOS_POWER_BUS_DELAY
            int "Delay (ms) when Power BUS is turned on"
            default 100
            help
               Load switches need a certain time to stabilize the voltage when they are turned on. This option performs
               a msec delay before the Power BUS is turned on.
      endmenu

      menu "CAN pin map"
         choice LUA_RTOS_CAN_TX_CHOICE
            prompt "TX"
            default LUA_RTOS_CAN_TX_GPIO12

            config LUA_RTOS_CAN_TX_GPIO5
               bool "GPIO5"

            config LUA_RTOS_CAN_TX_GPIO12
               bool "GPIO12"

            config LUA_RTOS_CAN_TX_GPIO25
               bool "GPIO25"
         endchoice

         choice LUA_RTOS_CAN_RX_CHOICE
            prompt "RX"
            default LUA_RTOS_CAN_RX_GPIO14

            config LUA_RTOS_CAN_RX_GPIO4
               bool "GPIO4"

            config LUA_RTOS_CAN_RX_GPIO14
               bool "GPIO14"

            config LUA_RTOS_CAN_RX_GPIO35
               bool "GPIO35"
         endchoice
      endmenu

      menu "I2C pin map"
         config LUA_RTOS_I2C_DEVICES_PER_BUS
            int "Max number of I2C devices per bus"
            range 1 10
            default 3

         config LUA_RTOS_I2C0_SCL
            int "I2C0 SCL"
            range 0 39
            default 21

         config LUA_RTOS_I2C0_SDA
            int "I2C0 SDA"
            range 0 39
            default 22

         config LUA_RTOS_I2C1_SCL
            int "I2C1 SCL"
            range 0 39
            default 32

         config LUA_RTOS_I2C1_SDA
            int "I2C1 SDA"
            range 0 39
            default 33
      endmenu

      menu "SPI pin map"
         config LUA_RTOS_SPI2_CS
            int "SPI2 default CS"
            range -1 39
            default -1
            help
               Default GPIO attached to the CS signal. Set to -1 if no default CS signal is used.

         config LUA_RTOS_SPI2_MISO
            int "SPI2 MISO"
            range 0 39
            default 12

         config LUA_RTOS_SPI2_MOSI
            int "SPI2 MOSI"
            range 0 39
            default 13

         config LUA_RTOS_SPI2_CLK
            int "SPI2 CLK"
            range 0 39
            default 14

         config LUA_RTOS_SPI3_CS
            int "SPI3 default CS"
            range -1 39
            default -1
            help
               Default GPIO attached to the CS signal. Set -1 if no default CS signal is used.

         config LUA_RTOS_SPI3_MISO
            int "SPI3 MISO"
            range 0 39
            default 19

         config LUA_RTOS_SPI3_MOSI
            int "SPI3 MOSI"
            range 0 39
            default 23

         config LUA_RTOS_SPI3_CLK
            int "SPI3 CLK"
            range 0 39
            default 18
      endmenu

      menu "UART pin map"
         config LUA_RTOS_UART0_RX
            int "UART0 RX"
            range 0 39
            default 3

         config LUA_RTOS_UART0_TX
            int "UART0 TX"
            range 0 39
            default 1

         config LUA_RTOS_UART1_RX
            int "UART1 RX"
            range 0 39
            default 9

         config LUA_RTOS_UART1_TX
            int "UART1 TX"
            range 0 39
            default 10

         config LUA_RTOS_UART2_RX
            int "UART2 RX"
            range 0 39
            default 16

         config LUA_RTOS_UART2_TX
            int "UART2 TX"
            range 0 39
            default 17
      endmenu

      menu "Internal ADC"
         config ADC_INTERNAL_VREF
            int "vref"
            range 1000 1200
            default 1108
            help
               Voltage reference in mVolts.
      endmenu

      menu "External GPIO"
         choice EXTERNAL_GPIO_TYPE
            prompt "External GPIO chip"
            default EXTERNAL_GPIO_NONE

            config EXTERNAL_GPIO_NONE
               bool "None"

            config GPIO_MCP23S17
               bool "MCP23S17, 16 IO"

            config GPIO_PCA9698
               bool "PCA9698, 40 IO, no pull-up"

            config GPIO_PCA9505
               bool "PCA9505, 40 IO, pull-up"
         endchoice

         config MCP23S17_SPI_PORT
             depends on GPIO_MCP23S17
                int "MCP23S17 SPI port"
                range 2 3
                default 3
                help
                   SPI port where MCP23S17 is attached
             
         config MCP23S17_SPI_CS
             depends on GPIO_MCP23S17
                int "MCP23S17 CS pin"
                range 0 39
                default 4
                help
                    The GPIO port number used to select MCP23S17.

         config MCP23S17_INTA
             depends on GPIO_MCP23S17
                int "MCP23S17 INTA pin"
                range -1 39
                default 35
                help
                    The GPIO port number used to connect the INTA pin. Use -1 if INTA is not connected.

         config MCP23S17_INTB
             depends on GPIO_MCP23S17
                int "MCP23S17 INTB pin"
                range -1 39
                default 5
                help
                    The GPIO port number used to connect the INTB pin. Use -1 if INTB is not connected.
                     
         config PCA9xxx_I2C
            depends on (GPIO_PCA9698 || GPIO_PCA9505)
               int "PCA9xxx I2C port"
               range 0 1
               default 0
               help
                  I2C port where PCA9xxx is attached

         config PCA9xxx_INT
            depends on (GPIO_PCA9698 || GPIO_PCA9505)
               int "PCA9xxx INT pint"
               range 0 39
               default 26
               help
                  GPIO where PCA9xxx INT pin is attached.

         config PCA9xxx_I2C_SPEED
            depends on (GPIO_PCA9698 || GPIO_PCA9505)
               int "PCA9xxx I2C port speed"
               range 100000 1000000
               default 1000000
               help
                  I2C PCA9xxx port speed in hertz

         config PCA9xxx_I2C_ADDRESS
            depends on (GPIO_PCA9698 || GPIO_PCA9505)
               int "PCA9xxx I2C port address"
               range 0 255
               default 32
               help
                  I2C PCA9xxx port speed in hertz
      endmenu

      menu "External ADC"
            choice LUA_RTOS_EXTERNAL_ADC_TYPE
                prompt "External ADC Type"
                    default EXTERNAL_ADC_NONE

                config EXTERNAL_ADC_NONE
                    bool "None"

                config ADC_ADS1015
                    bool "Use I2C ADC ADS1015"
                    help
                        ADS1015 is an ADC converter with I2C interface. 4 channels, resolution of 12 bits.

                config ADC_ADS1115
                    bool "Use I2C ADC ADS1115"
                    help
                        ADS1115 is an ADC converter with I2C interface. 4 channels, resolution of 16 bits.

                config ADC_MCP3008
                    bool "Use SPI ADC MCP3008"
                    help
                        MCP3008 is an ADC converter with SPI interface. 8 channels, resolution of 10 bits.

                config ADC_MCP3208
                    bool "Use SPI ADC MCP3208"
                    help
                        MCP3208 is an ADC converter with SPI interface. 8 channels, resolution of 12 bits.
            endchoice

         config LUA_RTOS_EXTERNAL_ADC_CONNECTED_TO_POWER_BUS
             bool "Connected to Power BUS"
             depends on (ADC_ADS1015 || ADC_ADS1115 || ADC_MCP3008 || ADC_MCP3208)
             default n
             help
               Some Lua RTOS compatible boards, such as WHITECAT N2 DEVKIT, have a load switch that can turn on and
               off power rails through a GPIO. In Lua RTOS this feature is know as Power BUS, on which you can connect
               devices that can be turn on and off on-demand, such as sensors and transceivers that are turn off when
               they are not needed, to save power consumption. If the external ADC device is connected to Power BUS,
               enable this option.

         config ADC_I2C
            depends on (ADC_ADS1115 || ADC_ADS1015)
               int "ADS1115 I2C port"
               range 0 1
               default 0
               help
                  I2C port where ADS1115 is attached

         config ADC_SPEED
            depends on (ADC_ADS1115 || ADC_ADS1015)
               int "ADS1115 I2C port speed"
               range 100000 3400000
               default 400000
               help
                  I2C port speed in hertz

         config ADC_MCP3008_SPI
            depends on ADC_MCP3008
               int "MCP3008 SPI port"
               range 2 3
               default 2

         config ADC_MCP3008_CS
            depends on ADC_MCP3008
               int "MCP3008 CS GPIO number"
                  range -1 39
                  default 15
                  help
                     GPIO attached to the CS signal. Set to -1 to use the default CS assigned to the SPI port.

         config ADC_MCP3008_SPEED
            depends on ADC_MCP3008
               int "MCP3008 speed in Hertz"
               range 1000000 3600000
               default 1000000

         config ADC_MCP3208_SPI
            depends on ADC_MCP3208
               int "MCP3208 SPI port"
               range 2 3
               default 2

         config ADC_MCP3208_CS
            depends on ADC_MCP3208
               int "MCP3208 CS GPIO number"
                  range -1 39
                  default 15
                  help
                     GPIO attached to the CS signal. Set to -1 to use the default CS assigned to the SPI port.

         config ADC_MCP3208_SPEED
            depends on ADC_MCP3208
               int "MCP3208 speed in Hertz"
               range 1000000 3600000
               default 1000000
      endmenu

      menu "Ethernet"
            choice LUA_RTOS_ETH_HW_TYPE
                prompt "Ethernet hardware type"
                default LUA_RTOS_ETH_NONE
                help
                    Select the ethernet hardware type.

                config LUA_RTOS_ETH_NONE
                    bool "None"

                config LUA_RTOS_ETH_HW_TYPE_RMII
                    bool "RMII interface"

                config LUA_RTOS_ETH_HW_TYPE_SPI
                    bool "SPI interface"
            endchoice

            choice LUA_RTOS_ETH_PHY_TYPE
                depends on LUA_RTOS_ETH_HW_TYPE_RMII
                prompt "PHY type"
                default PHY_LAN8720
                help
                    Select the ethernet phy type.

                config PHY_LAN8720
                    bool "LAN8720"

                config PHY_TLK110
                    bool "TLK110"
            endchoice

            config PHY_ADDRESS
                depends on LUA_RTOS_ETH_HW_TYPE_RMII
                int "PHY Address (0-31)"
                default 1  if PHY_LAN8720
                default 31 if PHY_TLK110
                range 0 31
                help
                    Select the PHY Address (0-31) for the hardware configuration and PHY model.

             choice LUA_RTOS_ETH_EMAC_CLOCK_SOURCE
                depends on LUA_RTOS_ETH_HW_TYPE_RMII
                prompt "EMAC clock source"
                default LUA_RTOS_ETH_EMAC_CLOCK_SOURCE_EXTERNAL

                config LUA_RTOS_ETH_EMAC_CLOCK_SOURCE_EXTERNAL
                   bool "External - GPIO0"

                config LUA_RTOS_ETH_EMAC_CLOCK_SOURCE_INTERNAL_GPIO17
                   bool "Internal - GPIO17"

                help
                    The MAC reference clock can be obtained from the ESP32 using the APLL, or from
                    an external 50 Mhz oscillator.When using internal clock the reference clock is
                    put out on a GPIO that must be connected to the PHY's clock input pin.

             endchoice

            config PHY_POWER_PIN
                depends on LUA_RTOS_ETH_HW_TYPE_RMII
                int "PHY Power GPIO"
                range -1 39
                default 2
                help
                    GPIO number to use for powering on/off the PHY.

            config PHY_SMI_MDC_PIN
                depends on LUA_RTOS_ETH_HW_TYPE_RMII
                int "SMI MDC Pin"
                range 0 39
                default 23
                help
                    GPIO number to use for SMI clock output MDC to PHY.

            config PHY_SMI_MDIO_PIN
                depends on LUA_RTOS_ETH_HW_TYPE_RMII
                int "SMI MDIO Pin"
                range 0 39
                default 18
                help
                   GPIO number to use for SMI data pin MDIO to/from PHY.

            config SPI_ETHERNET_SPI
               depends on LUA_RTOS_ETH_HW_TYPE_SPI
                  int "SPI Ethernet port"
                  range 2 3
                  default 3
               help
                  Select the SPI port number SPI Ethernet is attached

            config SPI_ETHERNET_SPEED
               depends on LUA_RTOS_ETH_HW_TYPE_SPI
                  int "SPI Ethernet speed in Hertz"
                  range 1000000 14000000
                  default 14000000

            config SPI_ETHERNET_CS
               depends on LUA_RTOS_ETH_HW_TYPE_SPI
                  int "SPI Ethernet CS GPIO number"
                     range -1 39
                     default 26
                     help
                        GPIO attached to the CS signal. Set -1 to use the default CS assigned to the SPI port.

            config SPI_ETHERNET_INT
               depends on LUA_RTOS_ETH_HW_TYPE_SPI
                  int "SPI Ethernet Interrupt GPIO number"
                     range 1 39
                     default 35
      endmenu

      menu "LoRa Wan"
            choice LUA_RTOS_LORA_HW_TYPE
                prompt "LoRa hardware type"
                default LUA_RTOS_LORA_NONE
                help
                    Select the LoRa hardware type.

                config LUA_RTOS_LORA_NONE
                    bool "None"

                config LUA_RTOS_LORA_HW_TYPE_SX1276
                    bool "sx1276, used in nodes and single-channel gateways"

                config LUA_RTOS_LORA_HW_TYPE_SX1272
                    bool "sx1272, used in nodes and single-channel gateways"

                config LUA_RTOS_LORA_HW_TYPE_SX1301
                    bool "sx1301, used in multi-channel gateways"
            endchoice

            choice LUA_RTOS_LORA_BAND
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272
                prompt "ISM band"
                default LUA_RTOS_LORA_BAND_EU868
                help
                    Select the ISM band to use. Please, select band allowed in your region according to ISM regulations.

                config LUA_RTOS_LORA_BAND_EU868
                    bool "Europe - 868 Mhz"

                config LUA_RTOS_LORA_BAND_US915
                    bool "United States - 915 Mhz"
            endchoice

            config LUA_RTOS_LORA_SPI
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272 || LUA_RTOS_LORA_HW_TYPE_SX1301
                int "LoRa SPI port"
                    range 2 3
                    default 3
                    help
                        The SPI port number where LoRa hardware is attached

            config LUA_RTOS_LORA_CS
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272 || LUA_RTOS_LORA_HW_TYPE_SX1301
                int "LoRa SPI CS GPIO number"
                    range 0 39
                    default 5
                    help
                        The GPIO port number used to select the LoRa hardware. Set -1 to use the default CS assigned to the SPI port.

            config LUA_RTOS_LORA_RST
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272 || LUA_RTOS_LORA_HW_TYPE_SX1301
                int "LoRa RST GPIO number"
                    range -1 39
                    default -1 if (LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    default 27 if !(LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    help
                        The GPIO port number used to select the LoRa hardware. Use -1 if RST pin is not used.

            config LUA_RTOS_LORA_DIO0
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272
                int "LoRa DIO0 GPIO number"
                    range -1 39
                    default 4 if (LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    default 26 if !(LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    help
                        The GPIO port number used for the DIO0 signal. Use -1 if DIO0 pin is not used.

            config LUA_RTOS_LORA_DIO1
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272
                int "LoRa DIO1 GPIO number"
                    range -1 39
                    default 16 if (LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    default 25 if !(LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    help
                        The GPIO port number used for the DIO1 signal. Use -1 if DIO1 pin is not used.

            config LUA_RTOS_LORA_DIO2
                depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272
                int "LoRa DIO2 GPIO number"
                    range -1 39
                    default 17 if (LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    default 33 if !(LUA_RTOS_BOARD_WHITECAT_N1ESP32 || LUA_RTOS_BOARD_WHITECAT_N1ESP32_DEVKIT || LUA_RTOS_BOARD_WHITECAT_N2ESP32_DEVKIT)
                    help
                        The GPIO port number used for the DIO2 signal. Use -1 if DIO2 pin is not used.

         config LUA_RTOS_LORA_CONNECTED_TO_POWER_BUS
             bool "Connected to Power BUS"
             depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272 || LUA_RTOS_LORA_HW_TYPE_SX1301
             default n
             help
               Some Lua RTOS compatible boards, such as WHITECAT N2 DEVKIT, have a load switch that can turn on and
               off power rails through a GPIO. In Lua RTOS this feature is know as Power BUS, on which you can connect
               devices that can be turn on and off on-demand, such as sensors and transceivers that are turn off when
               they are not needed, to save power consumption. If your LoraWAN module is connected to Power BUS,
               enable this option.

         config LUA_RTOS_LORA_STACK_SIZE
            depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272
                int "LoRa WAN thread stack size"
                range 1024 4096
                default 2048
                help
                   Default stack size assigned to LoRa WAN thread.

         config LUA_RTOS_LORA_TASK_PRIORITY
            depends on LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272
                int "LoRa WAN thread priority"
                range 3 25
                default 21
                help
                   Task priority assigned to LoRa WAN thread.

         config LUA_RTOS_LORA_TASK_CPU
            depends on !FREERTOS_UNICORE && (LUA_RTOS_LORA_HW_TYPE_SX1276 || LUA_RTOS_LORA_HW_TYPE_SX1272)
            int "to LoRa WAN thread CPU affinity"
                range 0 1
                default 0
                help
                   CPU affinity for LoRa WAN thread.
       endmenu

      menu "SD Card"
         choice LUA_RTOS_SD_CARD_INTERFACE
            prompt "Interface"
                default SD_CARD_NONE

            config SD_CARD_NONE
                bool "None"

            config SD_CARD_MMC
                bool "MMC interface"

            config SD_CARD_SPI
                bool "SPI interface"
         endchoice

         config LUA_RTOS_SD_SPI
            depends on SD_CARD_SPI
               int "SDCARD SPI port"
               range 1 3
               default 3
            help
               Select the SPI port number where SD Card is attached.

         config LUA_RTOS_SD_CS
            depends on SD_CARD_SPI
               int "SDCARD SPI CS GPIO number"
               range -1 39
               default 15
               help
                  GPIO attached to the CS signal. Set -1 to use the default CS assigned to the SPI port.

         choice LUA_RTOS_MCC_LINES
            prompt "Protocol"
                depends on SD_CARD_MMC
                default LUA_RTOS_MCC_4_LINE

            config LUA_RTOS_MCC_1_LINE
                bool "1-line"

            config LUA_RTOS_MCC_4_LINE
                bool "4-line"
         endchoice

         config LUA_RTOS_MCC_CD
            depends on SD_CARD_MMC
               int "CD signal GPIO number"
               range -1 39
               default -1
             help
                Select the GPIO number where CD (card detect) signal is attached. Set to -1 if no CD is used.

         config LUA_RTOS_MCC_WP
            depends on SD_CARD_MMC
               int "WP signal GPIO number"
               range -1 39
               default -1
             help
                Select the GPIO number where WP signal is attached. Set to -1 if no CD is used.

         config LUA_RTOS_SD_CONNECTED_TO_POWER_BUS
             bool "Connected to Power BUS"
             depends on (SD_CARD_MMC || SD_CARD_SPI)
             default n
             help
               Some Lua RTOS compatible boards, such as WHITECAT N2 DEVKIT, have a load switch that can turn on and
               off power rails through a GPIO. In Lua RTOS this feature is know as Power BUS, on which you can connect
               devices that can be turn on and off on-demand, such as sensors and transceivers that are turn off when
               they are not needed, to save power consumption. If your SD Card is connected to Power BUS,
               enable this option.
      endmenu

      menu "Graphic Display"
         menu "SPI displays"
            config LUA_RTOS_GDISPLAY_SPI
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Display SPI port"
                  range 1 3
                  default 3
               help
                  Select the SPI port number where display is attached.

            config LUA_RTOS_GDISPLAY_CS
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Display SPI CS GPIO number"
                  range -1 39
                  default 14
               help
                  GPIO where display CS signal is attached. Set -1 to use the default CS assigned to the SPI port.

            config LUA_RTOS_GDISPLAY_RESET
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Display RESET GPIO number"
                  range -1 39
                  default -1
               help
                  GPIO where display RESET signal is attached. Select -1 if no RESET is used.

            config LUA_RTOS_GDISPLAY_CMD
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Display CMD GPIO number"
                  range 0 39
                  default 26
               help
                  GPIO where display CMD signal is attached.

            config LUA_RTOS_GDISPLAY_BACKLIGHT
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Backlight CMD GPIO number"
                  range -1 39
                  default -1
               help
                  GPIO where display BACKLIGHT signal is attached.

            config LUA_RTOS_GDISPLAY_TP_SPI
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Display touch pannel SPI port"
                  range 0 3
                  default 3
               help
                  Select the SPI port number where display touch pannel is attached. Select 0 if you don't want spport for touch pannel.

            config LUA_RTOS_GDISPLAY_TP_CS
               depends on LUA_RTOS_LUA_USE_GDISPLAY
                  int "Display touch pannel SPI CS GPIO number"
                  range -2 39
                  default 21
               help
                  GPIO where display touch pannel CS signal is attached. Select -2 if you don't want spport for touch pannel. Set -1
                  to use the default CS assigned to the SPI port.
            config LUA_RTOS_GDISPLAY_CONNECTED_TO_POWER_BUS
                bool "Connected to Power BUS"
                depends on LUA_RTOS_LUA_USE_GDISPLAY
                default n
                help
                  Some Lua RTOS compatible boards, such as WHITECAT N2 DEVKIT, have a load switch that can turn on and
                  off power rails through a GPIO. In Lua RTOS this feature is know as Power BUS, on which you can connect
                  devices that can be turn on and off on-demand, such as sensors and transceivers that are turn off when
                  they are not needed, to save power consumption. If your display is connected to Power BUS,
                  enable this option.
         endmenu
         menu "I2C displays"
            config LUA_RTOS_GDISPLAY_I2C
               depends on LUA_RTOS_LUA_USE_GDISPLAY
               int "Display I2C port"
               range 0 1
               default 0
               help
                  I2C port where display is attached
            config LUA_RTOS_GDISPLAY_I2C_CONNECTED_TO_POWER_BUS
                bool "Connected to Power BUS"
                depends on LUA_RTOS_LUA_USE_GDISPLAY
                default n
                help
                  Some Lua RTOS compatible boards, such as WHITECAT N2 DEVKIT, have a load switch that can turn on and
                  off power rails through a GPIO. In Lua RTOS this feature is know as Power BUS, on which you can connect
                  devices that can be turn on and off on-demand, such as sensors and transceivers that are turn off when
                  they are not needed, to save power consumption. If your display is connected to Power BUS,
                  enable this option.
         endmenu

        menu "RC-Switch"
            config LUA_RTOS_RCSWITCH_SERVER_STACK_SIZE
                depends on LUA_RTOS_LUA_USE_RCSWITCH
                int "RC-Switch listen thread stack size"
                range 2048 10240
                default 4096
                help
                    Default stack size assigned to RC-Switch thread.

            config LUA_RTOS_RCSWITCH_SERVER_TASK_PRIORITY
                depends on LUA_RTOS_LUA_USE_RCSWITCH
                int "RC-Switch listen thread priority"
                range 3 25
                default 10
                help
                    Task priority assigned to RC-Switch thread.

            config LUA_RTOS_RCSWITCH_SERVER_TASK_CPU
                depends on !FREERTOS_UNICORE
                int "RC-Switch task CPU affinity"
                range 0 1
                default 1
                help
                    CPU affinity for the task assigned to the RC-Switch listen thread.
         endmenu

      endmenu

         menu "Sensors"
            config LUA_RTOS_USE_SENSOR_2Y0A21
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "2Y0A21"
               default y
            config LUA_RTOS_USE_SENSOR_KEY_MATRIX_4_4
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "4 x 4 key matrix"
               default y
            config LUA_RTOS_USE_SENSOR_A49E
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "A49E"
               default y
            config LUA_RTOS_USE_SENSOR_ANALOG_JOYSTICK
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Analog Joystick"
               default y
            config LUA_RTOS_USE_SENSOR_BH1620FVC
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "BH1620FVC"
               default y
            config LUA_RTOS_USE_SENSOR_BH1721FVC
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "BH1721FVC"
               default y
            config LUA_RTOS_USE_SENSOR_BDE0600G
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "BDE0600G"
               default y
            config LUA_RTOS_USE_SENSOR_BME280
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "BME280"
               default y
            config LUA_RTOS_USE_SENSOR_DHT11
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "DHT11"
               default y
            config LUA_RTOS_USE_SENSOR_DHT22
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "DHT22"
               default y
            config LUA_RTOS_USE_SENSOR_DHT23
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "DHT23"
               default y
            config LUA_RTOS_USE_SENSOR_DS1820
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "DS1820"
               default y
            config LUA_RTOS_USE_SENSOR_GPS
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "GPS"
               default y
            config LUA_RTOS_USE_SENSOR_GUVA_S12SD
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "GUVA-S12SD"
               default y
            config LUA_RTOS_USE_SENSOR_HALL_SWITCH
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Hall effect switch"
               default y
            config LUA_RTOS_USE_SENSOR_HALL_INTERNAL
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Internal Hall effect sensor"
               default y
            config LUA_RTOS_USE_SENSOR_HALL_FLOW_SENSOR
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Hall effect flow sensor"
               default y
            config LUA_RTOS_USE_SENSOR_LDR
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "LDR"
               default y
            config LUA_RTOS_USE_SENSOR_LM35
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "LM35"
               default y
            config LUA_RTOS_USE_SENSOR_ML8511
                depends on LUA_RTOS_LUA_USE_SENSOR
                bool "ML8511"
                default y    
            config LUA_RTOS_USE_MPXV6115V
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "MPXV6115V"
               default y
            config LUA_RTOS_USE_SENSOR_PIR_AM412
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "AM412 based PIR sensor"
               default y
            config LUA_RTOS_USE_SENSOR_POT
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Potentiometer"
               default y
            config LUA_RTOS_USE_SENSOR_PING28015
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "PING28015"
               default y
            config LUA_RTOS_USE_SENSOR_PUSH_SWITCH
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Push switch"
               default y
            config LUA_RTOS_USE_SENSOR_RELATIVE_ROTARY_ENCODER
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Relative rotary encoder"
               default y
            config LUA_RTOS_USE_SENSOR_SDS011
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "SDS011"
               default y
            config LUA_RTOS_USE_SENSOR_THERMISTOR
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Thermistor"
               default y
            config LUA_RTOS_USE_SENSOR_TILT_SWITCH
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Tilt Switch"
               default y
            config LUA_RTOS_USE_SENSOR_US015
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "US-015"
               default y
            config LUA_RTOS_USE_SENSOR_2P_TOGGLE_SWITCH
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Toggle switch (2 positions)"
               default y
            config LUA_RTOS_USE_SENSOR_3P_TOGGLE_SWITCH
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "Toggle switch (3 positions)"
               default y
            config LUA_RTOS_USE_SENSOR_TMP36
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "TMP36"
               default y
            config LUA_RTOS_USE_VH400
               depends on LUA_RTOS_LUA_USE_SENSOR
               bool "VH400"
               default y
         endmenu
      endmenu

      menu "Lua"
         menu "Tuning"
         config LUA_RTOS_LUA_STACK_SIZE
            int "Lua RTOS interpreter stack size"
            range 1024 40960
            default 20480
            help
               Default stack size assigned to the Lua RTOS interpreter.

         config LUA_RTOS_LUA_TASK_PRIORITY
            int "Lua RTOS interpreter task priority"
            range 3 25
            default 3
            help
               Task priority assigned to the Lua RTOS interpreter. Lua RTOS has a thread-oriented programming model and
               basically the Lua RTOS interpreter is used only for launch new threads and configure the system, so
               it's not necessary to assing a high piority to the interpreter.

         config LUA_RTOS_LUA_TASK_CPU
            depends on !FREERTOS_UNICORE
            int "Lua RTOS interpreter task CPU affinity"
            range 0 1
            default 0
            help
               CPU affinity for the task assigned to the Lua RTOS interpreter.

         config LUA_RTOS_LUA_THREAD_STACK_SIZE
            int "Default Lua RTOS thread stack size"
            range 1024 40960
            default 10240
            help
               Default Stack size assigned to Lua RTOS threads.

         config LUA_RTOS_LUA_THREAD_PRIORITY
            int "Default Lua RTOS thread priority"
            range 3 25
            default 20
            help
               Default priority assigned to Lua RTOS threads.

         config LUA_RTOS_LUA_THREAD_CPU
            depends on !FREERTOS_UNICORE
            int "Default Lua RTOS thread CPU affinity"
            range 0 1
            default 1
            help
               Default CPU affinity for Lua RTOS threads.

         config LUA_RTOS_LUA_USE_LOCKS
            bool "Use locks when the program enters the Lua core"
            default y
            help
               Use locks when the program enters the Lua core. This option is disabled when the JIT bytecode
               optimizer is enabled.

         config LUA_RTOS_LUA_USE_ROTABLE_CACHE
            bool "Use cache for readonly tables access"
            default n
            help
               When accessing to readonly tables, Lua RTOS can get the key/value pair from a cache. This can
               speedud the execution of Lua RTOS scripts. This option is disabled when the JIT bytecode
               optimizer is enabled.

         config LUA_RTOS_LUA_USE_BLOCK_CONTEXT
            bool "Add block context for the Whitecat IDE"
            default y
            help
               Add some modifications into the Lua VM to provide the block-based language some vital
               features required to improve the block-programming experience

         config LUA_RTOS_LUA_USE_JIT_BYTECODE_OPTIMIZER
            bool "Use JIT bytecode optimizer (experimental)"
            default n
            help
               As Lua RTOS makes intensive use of read-only tables, a series of optimizations can be performed
               on the program's bytecode to speed-up the program execution. This can help that programs written
               for Lua RTOS to have a similar performance than the writtens in C, and takes a special importance
               when the programmer use the Lua RTOS hardware-access modules.

         config LUA_RTOS_USE_HARDWARE_LOCKS
            bool "Enable hardware locks"
            default y
            help
                If this feature is enabled, Lua RTOS takes care about all the hardware
                resources that your application use. This is useful in the developing
                and debuging phase, because in case that your application try to use
                a hardware resource that is used in other part of your application, an
                exeption will be raised. This feature consumes arround 3 Kb of memory.

         config LUA_RTOS_LUA_USE_NUM_64BIT
            bool "Use 64 bits for integer and real numbers (experimental)"
            default n
            help
                If enabled, Lua RTOS use 64 bits to represent integer and real numbers. Enable
                if you need to work with large integers, or you need more precission when working
                with real numbers.
         endmenu

         menu "Lua Modules"
            config LUA_RTOS_LUA_USE__G
               bool "Include base module in build"
               default y

            config LUA_RTOS_LUA_USE_OS
               bool "Include os module in build"
               default y

            config LUA_RTOS_LUA_USE_MATH
               bool "Include math module in build"
               default y

            config LUA_RTOS_LUA_USE_TABLE
               bool "Include table module in build"
               default y

            config LUA_RTOS_LUA_USE_IO
               bool "Include io module in build"
               default y

            config LUA_RTOS_LUA_USE_STRING
               bool "Include string module in build"
               default y

            config LUA_RTOS_LUA_USE_COROUTINE
               bool "Include coroutine module in build"
               default y

            config LUA_RTOS_LUA_USE_DEBUG
               bool "Include debug module in build"
               default y

            config LUA_RTOS_LUA_USE_UTF8
               bool "Include utf8 module in build"
               default y

            config LUA_RTOS_LUA_USE_PACKAGE
               bool "Include package module in build"
               default y

            config LUA_RTOS_LUA_USE_CRC
               bool "Include crc module in build"
               default y

            config LUA_RTOS_LUA_USE_MD5
               bool "Include md5 module in build"
               default y
         endmenu

         menu "Lua RTOS Modules"
            config LUA_RTOS_LUA_USE_FS
               bool "Include fs module in build"
               default y

            config LUA_RTOS_LUA_USE_ADC
               bool "Include adc module in build"
               default y

            config LUA_RTOS_LUA_USE_BT
               bool "Include bluetooth module in build"
               default y

            config LUA_RTOS_LUA_USE_CAN
               bool "Include CAN module in build"
               default y

            config LUA_RTOS_LUA_USE_CPU
               bool "Include CPU module in build"
               default y

            config LUA_RTOS_LUA_USE_CURL_NET
               depends on LUA_RTOS_LUA_USE_NET
               bool "Include curl support in net module"
               default y

            config LUA_RTOS_LUA_USE_ENCODER
               bool "Include encoder module in build"
               default y

            config LUA_RTOS_LUA_USE_CJSON
               bool "Include cjson module in build"
               default y

            config LUA_RTOS_LUA_USE_EVENT
               bool "Include event module in build"
               default y

            config LUA_RTOS_LUA_USE_GDISPLAY
               bool "Include gdisplay module in build"
               default y

            config LUA_RTOS_LUA_USE_I2C
               bool "Include i2c module in build"
               default y

            config LUA_RTOS_LUA_USE_VM
               depends on LUA_RTOS_LUA_USE_BLOCK_CONTEXT
               bool "Include Lua VM module in build"
               default y

            config LUA_RTOS_LUA_USE_MQTT
               depends on LUA_RTOS_LUA_USE_NET
               bool "Include MQTT module in build"
               default y

            config LUA_RTOS_LUA_USE_MDNS
               depends on LUA_RTOS_LUA_USE_NET
               bool "Include MDNS module in build"
               default n

            config LUA_RTOS_LUA_USE_NEOPIXEL
               bool "Include neopixel module in build"
               default y

            config LUA_RTOS_LUA_USE_NET
               bool "Include net module in build"
               default y

            config LUA_RTOS_LUA_USE_NVS
               bool "Include nvs module in build"
               default y

            config LUA_RTOS_LUA_USE_PACK
               bool "Include pack module in build"
               default y

            config LUA_RTOS_LUA_USE_PIO
               bool "Include pio (gpio) module in build"
               default y

            config LUA_RTOS_LUA_USE_PWM
               bool "Include pwm module in build"
               default y

            config LUA_RTOS_LUA_USE_RCSWITCH
               bool "Include RC-Switch module in build"
               default y

            config LUA_RTOS_LUA_USE_RMT
               bool "Include RMT module in build"
               default y

            config LUA_RTOS_LUA_USE_RTC
               bool "Include RTC module in build"
               default y

            config LUA_RTOS_LUA_USE_SENSOR
               bool "Include sensor module in build"
               default y

            config LUA_RTOS_LUA_USE_SERVO
               bool "Include servo module in build"
               default y

            config LUA_RTOS_LUA_USE_SOCKET
               bool "Include socket module in build"
               default y

            config LUA_RTOS_LUA_USE_SOUND
               bool "Include sound module in build"
               default y

            config LUA_RTOS_LUA_USE_SPI
               bool "Include spi module in build"
               default y

            config LUA_RTOS_LUA_USE_SCP_NET
               depends on LUA_RTOS_LUA_USE_NET
               bool "Include scp support in net module"
               default y

            config LUA_RTOS_LUA_USE_SDISPLAY
               bool "Include Segment Display module in build"
               default n

            config LUA_RTOS_LUA_USE_STEPPER
               bool "Include stepper module in build"
               default y

            config LUA_RTOS_LUA_USE_THREAD
               bool "Include thread module in build"
               default y

            config LUA_RTOS_LUA_USE_TMR
               bool "Include tmr (timer) module in build"
               default y

            config LUA_RTOS_LUA_USE_TOUCH
               bool "Include capacitive touch module in build"
               default n

            config LUA_RTOS_LUA_USE_UART
               bool "Include uart module in build"
               default y

            config LUA_RTOS_LUA_USE_ULP
               bool "Include ULP (Ultra Low Power coprocessor) module in build"
               default y
         endmenu
      endmenu
endmenu
