OVMS3-idf/examples/peripherals/i2c/i2c_self_test/main/Kconfig.projbuild
morris 89d7f7bc89 doc/i2c-example: cleanup readme of i2c example
1. Update i2c README to add more detail according to the template.[TW#26530]
2. Move some specific configuration to KConfig
2018-10-12 10:24:39 +08:00

125 lines
3.3 KiB
Plaintext

menu "Example Configuration"
menu "I2C Master"
config I2C_MASTER_SCL
int "SCL GPIO Num"
default 19
help
GPIO number for I2C Master clock line.
config I2C_MASTER_SDA
int "SDA GPIO Num"
default 18
help
GPIO number for I2C Master data line.
config I2C_MASTER_PORT_NUM
int "Port Number"
default 1
help
Port number for I2C Master device.
config I2C_MASTER_FREQUENCY
int "Master Frequency"
default 100000
help
I2C Speed of Master device.
endmenu
menu "I2C Slave"
config I2C_SLAVE_SCL
int "SCL GPIO Num"
default 26
help
GPIO number for I2C Slave clock line.
config I2C_SLAVE_SDA
int "SDA GPIO Num"
default 25
help
GPIO number for I2C Slave data line.
config I2C_SLAVE_PORT_NUM
int "Port Number"
default 0
help
Port number for I2C Slave device.
config I2C_SLAVE_ADDRESS
hex "ESP Slave Address"
default 0x28
help
Hardware Address of I2C Slave Port.
endmenu
menu "BH1750 Sensor"
choice BH1750_ADDR
prompt "BH1750 I2C Address"
default BH1750_I2C_ADDRESS_LOW
help
Hardware address of BH1750, which is 2 types, and determined by ADDR terminal.
config BH1750_I2C_ADDRESS_LOW
bool "BH1750 I2C Address(ADDR=0)"
help
I2C Address of BH1750 Sensor according to your schemetic configuration.
config BH1750_I2C_ADDRESS_High
bool "BH1750 I2C Address(ADDR=1)"
help
I2C Address of BH1750 Sensor according to your schemetic configuration.
endchoice
config BH1750_ADDR
hex
default 0x5C if BH1750_I2C_ADDRESS_High
default 0x23 if BH1750_I2C_ADDRESS_LOW
choice BH1750_MODE
prompt "BH1750 Operation Mode"
default BH1750_ONETIME_L_RESOLUTION
help
Operation Mode of BH1750.
Different mode means different resolution and measurement time.
config BH1750_CONTINU_H_RESOLUTION
bool "Continuously H-Resolution Mode"
help
Resolution is 1lx, measurement time is typically 120ms.
config BH1750_CONTINU_H_RESOLUTION2
bool "Continuously H-Resolution Mode2"
help
Resolution is 0.5lx, measurement time is typically 120ms.
config BH1750_CONTINU_L_RESOLUTION
bool "Continuously L-Resolution Mode"
help
Resolution is 4lx, measurement time is typically 16ms.
config BH1750_ONETIME_H_RESOLUTION
bool "One Time H-Resolution Mode"
help
Resolution is 1lx, measurement time is typically 120ms.
It is automatically set to Power Down mode after measurement.
config BH1750_ONETIME_H_RESOLUTION2
bool "One Time H-Resolution Mode2"
help
Resolution is 0.5lx, measurement time is typically 120ms.
It is automatically set to Power Down mode after measurement.
config BH1750_ONETIME_L_RESOLUTION
bool "One Time L-Resolution Mode"
help
Resolution is 4lx, measurement time is typically 16ms.
It is automatically set to Power Down mode after measurement.
endchoice
config BH1750_OPMODE
hex
default 0x10 if BH1750_CONTINU_H_RESOLUTION
default 0x11 if BH1750_CONTINU_H_RESOLUTION2
default 0x13 if BH1750_CONTINU_L_RESOLUTION
default 0x20 if BH1750_ONETIME_H_RESOLUTION
default 0x21 if BH1750_ONETIME_H_RESOLUTION2
default 0x23 if BH1750_ONETIME_L_RESOLUTION
endmenu
endmenu