menu "esp32_BNO08x"

    menu "GPIO Configuration"
        
        config ESP32_BNO08X_GPIO_HINT
            int "INT GPIO NUM" 
            range 0 50
            default 26
            help
                Host interrupt GPIO pin connected to BNO08x INT pin.

                    
        config ESP32_BNO08X_GPIO_RST
            int "RST GPIO NUM" 
            range 0 50
            default 32 
            help
                Reset GPIO pin connected to BNO08x RST pin.
                
        config ESP32_BNO08X_GPIO_CS
            int "CS GPIO NUM"
            range 0 50
            default 33
            help
                Chip select GPIO pin connected to BNO08x CS pin.
        
        config ESP32_BNO08X_GPIO_SCL
            int "SCL GPIO NUM" 
            range 0 50
            default 18
            help
                Clock GPIO pin connected to BNO08x SCL pin.

        config ESP32_BNO08X_GPIO_DI
            int "DI GPIO NUM" 
            range 0 50
            default 23
            help
                MOSI GPIO pin connected to BNO08x DI pin.

        config ESP32_BNO08X_GPIO_SDA
            int "SDA GPIO NUM" 
            range 0 50
            default 19
            help
                MISO GPIO pin connected to BNO08x SDA pin.

    endmenu # GPIO Config

    menu "SPI Configuration"

        config ESP32_BNO08x_SPI_HOST
            int "SPI Host Peripheral" 
            range 0 2
            default 2
            help
                SPI controller peripheral inside ESP32. 

        config ESP32_BNO08X_SCL_SPEED_HZ
            int "SCL SPEED (HZ)" 
            range 10000 3000000
            default 2000000
            help
                SPI clock speed in Hz, default 2MHz.

        config ESP32_BNO08X_SPI_QUEUE_SZ
            int "SPI queue size."
            range 1 100
            default 5
            help
               Amount of SPI transactions that can be queued during operation. 
               This argument is loaded directly into the spi_device_interface_config_t struct used for SPI configuration.

    endmenu #SPI Configuration

    menu "Tasks"

        config ESP32_BNO08X_CB_TASK_SZ
            int "Callback task size, (cb_task())"
            range 1024 20480
            default 4096
            help
                Stack size of task responsible for executing callbacks.
                Note that callbacks should remain as short as possible, pass the data out of
                the callback with a queue or save it to different variables for longer operations.

        config ESP32_BNO08X_DATA_PROC_TASK_SZ
            int "Data processing task size, (data_proc_task())"
            range 1024 20480
            default 2048
            help
                Stack size of task responsible for parsing/handling sensor events sent by SH2 HAL and 
                updating data that is returned to user.

                
        config ESP32_BNO08X_SH2_HAL_SERVICE_TASK_SZ
            int "sh2 HAL service task size (sh2_HAL_service_task())"
            range 1024 20480
            default 4096
            help
                Stack size of task responsible for calling shtp_service() when HINT is asserted,
                to dispatch any sh2 HAL lib callbacks.

        config ESP32_BNO08X_CB_TASK_AFFINITY
            int "Callback task core affinity"
            range -1 1
            default -1
            help
            Core to which the callback task is pinned.
            -1 = No specific core (tskNO_AFFINITY)
            0 = Core 0
            1 = Core 1

        config ESP32_BNO08X_CB_TASK_PRIORITY
            int "Callback task priority"
            range 0 25
            default 5
            help
            Priority of the callback task.
            0 is lowest priority, 25 is highest priority.

        config ESP32_BNO08X_DATA_PROC_TASK_AFFINITY
            int "Data processing task core affinity"
            range -1 1
            default -1
            help
            Core to which the data processing task is pinned.
            -1 = No specific core (tskNO_AFFINITY)
            0 = Core 0
            1 = Core 1

        config ESP32_BNO08X_DATA_PROC_TASK_PRIORITY
            int "Data processing task priority"
            range 0 25
            default 6
            help
            Priority of the data processing task.
            0 is lowest priority, 25 is highest priority.

        config ESP32_BNO08X_SH2_HAL_SERVICE_TASK_AFFINITY
            int "SH2 HAL service task core affinity"
            range -1 1
            default -1
            help
            Core to which the SH2 HAL service task is pinned.
            -1 = No specific core (tskNO_AFFINITY)
            0 = Core 0
            1 = Core 1

        config ESP32_BNO08X_SH2_HAL_SERVICE_TASK_PRIORITY
            int "SH2 HAL service task priority"
            range 0 25
            default 7
            help
            Priority of the SH2 HAL service task.
            0 is lowest priority, 25 is highest priority.



    endmenu #Tasks

    menu "Callbacks"

        config ESP32_BNO08X_CB_MAX
            int "Maxmium amount of callbacks that can be registered."
            range 1 200
            default 10
            help
                Maximum amount of callbacks that can be registered.

        config ESP32_BNO08X_CB_QUEUE_SZ
            int "Callback queue size."
            range 1 200
            default 16
            help
                Amount of callback invocation requests that can be in the air/pending at any given time. 

    endmenu #Callbacks

    menu "Timeouts"

        config ESP32_BNO08X_HINT_TIMEOUT_MS
            int "HINT TIMEOUT (ms)" 
            range 100 10000
            default 500
            help
                Max wait between HINT being asserted by BNO08x before transaction is considered failed. (in miliseconds).
                
        config ESP32_BNO08X_DATA_AVAILABLE_TIMEOUT_MS
            int "DATA AVAILABLE TIMEOUT (ms)" 
            range 100 10000
            default 3000
            help
                Max wait between data_available() being called and no new data/report being detected. (in miliseconds).

        config ESP32_BNO08X_HARD_RESET_DELAY_MS
            int "HARD RESET DELAY (ms)" 
            range 100 10000
            default 100
            help
                How long RST pin is held low during hard reset (min 10ns according to datasheet, 
                but should be longer for stable operation). Not recommended to lower below 100ms. 

    endmenu #Timeouts


    menu "Logging"

        config ESP32_BNO08x_LOG_STATEMENTS
            bool "Print regular log statements statements (default enabled)."
            default "y"
            help
                Print error statements and info on boot, disable for production code where no log statements are desired. (default enabled)

        config ESP32_BNO08x_DEBUG_STATEMENTS
            bool "Print debug statements (default disabled)."
            default "n"
            help
                Print the various debug statements scattered throughout the code when running.
                
    endmenu #Logging 

endmenu