# Copyright 2020 Daniel Friesel
#
# SPDX-License-Identifier: CC0-1.0

config meta_driver_adc
bool
config meta_driver_counter
bool
config meta_driver_dmx
bool
config meta_driver_hardware_i2c
bool
config meta_driver_i2c
bool
config meta_driver_neopixel
bool
config meta_driver_spi
bool
config meta_driver_stdin
bool
config meta_driver_timer
bool
config meta_driver_uptime
bool

menu "Drivers"

config driver_am2320
bool "AM2320 TH Sensor"
depends on meta_driver_i2c

config driver_bme280
bool "BME280 TPH Sensor"
depends on meta_driver_i2c

config driver_bme680
bool "BME680 TPH+IAQ Sensor"
depends on meta_driver_i2c && !driver_bme280

config driver_bme680_bsec
bool "with BSEC (proprietary library for IAQ calculation)"
depends on driver_bme680 && arch_posix
# incompatible with avr-gcc 5:
# /usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: avr:6 architecture of input file `...' is incompatible with avr:5 output

config driver_bme680_bsec_path
string "BSEC library path"
default "bme680-bsec-lite" if arch_arduino_nano
default "bme680-bsec" if arch_msp430fr5994lp
default "bme680-bsec-armv6" if arch_posix
depends on driver_bme680_bsec

config driver_bme680_bsec_save_state
bool "Save and Load library state (requires stdio)"
depends on driver_bme680_bsec

config driver_bme680_bsec_state_path
string "BSEC state path"
default "/boot/bme680-bsec.state" if arch_posix
depends on driver_bme680_bsec_save_state

config driver_ccs811
bool "CCS811 VOC Sensor"
depends on meta_driver_i2c

config driver_ds2482
bool "DS2482-100 Single-Channel 1-Wire Master"
depends on meta_driver_i2c

# dummy is AEMR-specific and not included in Kconfig

config driver_eeprom24lc64
bool "24LC64 EEPROM"
depends on meta_driver_i2c

config driver_hdc1080
bool "HDC1080 TH Sensor with Heated Plate"
depends on meta_driver_i2c

config driver_lm75
bool "LM75 Temperature Sensor"
depends on meta_driver_i2c

config driver_max44006
bool "MAX44006 RGB + IR Sensor"
depends on meta_driver_i2c

config driver_max44009
bool "MAX44009 Ambient Light Sensor"
depends on meta_driver_i2c

config driver_mmsimple
bool "MicroMoody simple"
depends on meta_driver_i2c

config driver_mmsubstate
bool "MicroMoody with Sub-States"
depends on meta_driver_i2c && !driver_mmsimple

config driver_mpu9250
bool "MPU9250 Accelerometer/Gyroscope/Magnetometer"
depends on meta_driver_i2c

config driver_nrf24l01
bool "nRF24L01+ 2.4GHz Radio"
depends on meta_driver_spi

config driver_pervasive_aurora_mb
bool "Pervasive Aurora Mb"
depends on ( arch_msp430fr5969lp || arch_msp430fr5994lp ) && meta_driver_spi

# resistive_load is AEMR-specific and not included in Kconfig

config driver_s5851a
bool "S5851 Temperature Sensor"
depends on meta_driver_i2c

config driver_scd4x
bool "Sensirion SCD4x CO2 Sensor"
depends on meta_driver_i2c

config driver_sen5x
bool "Sensirion SEN5x PM Sensor"
depends on meta_driver_i2c

config driver_veml6075
bool "VEML6075 UV Sensor"
depends on meta_driver_i2c

config driver_sharp96
bool "sharp LS013B4DN 96x96px Transflective LC Display"
depends on ( arch_msp430fr5969lp || arch_msp430fr5994lp ) && meta_driver_spi

config driver_ssd1306
bool "SSD1306 I2C OLED display"
depends on meta_driver_i2c

config driver_ssd1306_width
int "Display width"
default 128
depends on driver_ssd1306

config driver_ssd1306_height
int "Display height"
default 64
depends on driver_ssd1306

choice driver_ssd1306_mode
bool "Addressing Mode"
depends on driver_ssd1306

config driver_ssd1306_mode_vertical
bool "Vertical"

config driver_ssd1306_mode_horizontal
bool "Horizontal bytes, Vertical bits"

endchoice

config driver_softi2c
bool "Software I2C"
#depends on !driver_i2c
select meta_driver_i2c

endmenu

menu "SoftI2C Configuration"
depends on driver_softi2c

config driver_softi2c_scl
string "SCL Pin"
default "pc5" if arch_arduino_nano
default "p1_7" if arch_msp430fr5969lp
default "p5_1" if arch_msp430fr5994lp
default "px01" if arch_posix
default "pb8" if arch_stm32f446re_nucleo

config driver_softi2c_sda
string "SDA Pin"
default "pc4" if arch_arduino_nano
default "p1_6" if arch_msp430fr5969lp
default "p5_0" if arch_msp430fr5994lp
default "px00" if arch_posix
default "pb9" if arch_stm32f446re_nucleo

choice driver_softi2c_pullup

bool "SoftI2C Pull-Up Configuration"
depends on driver_softi2c

config driver_softi2c_pullup_none
bool "No Pull-Up Handling"

config driver_softi2c_pullup_dynamic_internal
bool "Internal Dynamic Pull-Up"
help
    Internal Pull-Up, disabled when transmitting LOW

endchoice

endmenu
