2018-10-08 04:50:26 -04:00
|
|
|
menu "Example Configuration"
|
|
|
|
|
2019-01-25 11:10:53 -05:00
|
|
|
menu "I2C Master"
|
|
|
|
config I2C_MASTER_SCL
|
|
|
|
int "SCL GPIO Num"
|
2022-01-04 06:48:12 -05:00
|
|
|
default 6 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H2
|
2021-06-16 03:19:55 -04:00
|
|
|
default 2 if IDF_TARGET_ESP32S3
|
|
|
|
default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
|
|
|
GPIO number for I2C Master clock line.
|
|
|
|
|
|
|
|
config I2C_MASTER_SDA
|
|
|
|
int "SDA GPIO Num"
|
2022-01-04 06:48:12 -05:00
|
|
|
default 5 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H2
|
2021-06-16 03:19:55 -04:00
|
|
|
default 1 if IDF_TARGET_ESP32S3
|
|
|
|
default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
|
|
|
GPIO number for I2C Master data line.
|
|
|
|
|
|
|
|
config I2C_MASTER_PORT_NUM
|
|
|
|
int "Port Number"
|
2021-02-18 04:45:14 -05:00
|
|
|
default 1 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
2022-01-04 06:48:12 -05:00
|
|
|
default 0 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32H2
|
2019-01-25 11:10:53 -05:00
|
|
|
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"
|
2022-01-04 06:48:12 -05:00
|
|
|
depends on SOC_I2C_NUM > 1
|
2019-01-25 11:10:53 -05:00
|
|
|
config I2C_SLAVE_SCL
|
|
|
|
int "SCL GPIO Num"
|
2019-06-14 04:15:45 -04:00
|
|
|
default 5
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
|
|
|
GPIO number for I2C Slave clock line.
|
|
|
|
|
|
|
|
config I2C_SLAVE_SDA
|
|
|
|
int "SDA GPIO Num"
|
2019-06-14 04:15:45 -04:00
|
|
|
default 4
|
2019-01-25 11:10:53 -05:00
|
|
|
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
|
2018-10-08 04:50:26 -04:00
|
|
|
|
|
|
|
endmenu
|