1menu "Example Configuration" 2 3 menu "I2C Master" 4 config I2C_MASTER_SCL 5 int "SCL GPIO Num" 6 default 6 if IDF_TARGET_ESP32C3 7 default 2 if IDF_TARGET_ESP32S3 8 default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 9 help 10 GPIO number for I2C Master clock line. 11 12 config I2C_MASTER_SDA 13 int "SDA GPIO Num" 14 default 5 if IDF_TARGET_ESP32C3 15 default 1 if IDF_TARGET_ESP32S3 16 default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 17 help 18 GPIO number for I2C Master data line. 19 20 config I2C_MASTER_PORT_NUM 21 int "Port Number" 22 default 1 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 23 default 0 if IDF_TARGET_ESP32C3 24 help 25 Port number for I2C Master device. 26 27 config I2C_MASTER_FREQUENCY 28 int "Master Frequency" 29 default 100000 30 help 31 I2C Speed of Master device. 32 endmenu 33 34 menu "I2C Slave" 35 config I2C_SLAVE_SCL 36 int "SCL GPIO Num" 37 default 5 38 help 39 GPIO number for I2C Slave clock line. 40 41 config I2C_SLAVE_SDA 42 int "SDA GPIO Num" 43 default 4 44 help 45 GPIO number for I2C Slave data line. 46 47 config I2C_SLAVE_PORT_NUM 48 int "Port Number" 49 default 0 50 help 51 Port number for I2C Slave device. 52 53 config I2C_SLAVE_ADDRESS 54 hex "ESP Slave Address" 55 default 0x28 56 help 57 Hardware Address of I2C Slave Port. 58 endmenu 59 60 menu "BH1750 Sensor" 61 choice BH1750_ADDR 62 prompt "BH1750 I2C Address" 63 default BH1750_I2C_ADDRESS_LOW 64 help 65 Hardware address of BH1750, which is 2 types, and determined by ADDR terminal. 66 67 config BH1750_I2C_ADDRESS_LOW 68 bool "BH1750 I2C Address(ADDR=0)" 69 help 70 I2C Address of BH1750 Sensor according to your schemetic configuration. 71 72 config BH1750_I2C_ADDRESS_High 73 bool "BH1750 I2C Address(ADDR=1)" 74 help 75 I2C Address of BH1750 Sensor according to your schemetic configuration. 76 endchoice 77 78 config BH1750_ADDR 79 hex 80 default 0x5C if BH1750_I2C_ADDRESS_High 81 default 0x23 if BH1750_I2C_ADDRESS_LOW 82 83 choice BH1750_MODE 84 prompt "BH1750 Operation Mode" 85 default BH1750_ONETIME_L_RESOLUTION 86 help 87 Operation Mode of BH1750. 88 Different mode means different resolution and measurement time. 89 config BH1750_CONTINU_H_RESOLUTION 90 bool "Continuously H-Resolution Mode" 91 help 92 Resolution is 1lx, measurement time is typically 120ms. 93 config BH1750_CONTINU_H_RESOLUTION2 94 bool "Continuously H-Resolution Mode2" 95 help 96 Resolution is 0.5lx, measurement time is typically 120ms. 97 config BH1750_CONTINU_L_RESOLUTION 98 bool "Continuously L-Resolution Mode" 99 help 100 Resolution is 4lx, measurement time is typically 16ms. 101 config BH1750_ONETIME_H_RESOLUTION 102 bool "One Time H-Resolution Mode" 103 help 104 Resolution is 1lx, measurement time is typically 120ms. 105 It is automatically set to Power Down mode after measurement. 106 config BH1750_ONETIME_H_RESOLUTION2 107 bool "One Time H-Resolution Mode2" 108 help 109 Resolution is 0.5lx, measurement time is typically 120ms. 110 It is automatically set to Power Down mode after measurement. 111 config BH1750_ONETIME_L_RESOLUTION 112 bool "One Time L-Resolution Mode" 113 help 114 Resolution is 4lx, measurement time is typically 16ms. 115 It is automatically set to Power Down mode after measurement. 116 endchoice 117 118 config BH1750_OPMODE 119 hex 120 default 0x10 if BH1750_CONTINU_H_RESOLUTION 121 default 0x11 if BH1750_CONTINU_H_RESOLUTION2 122 default 0x13 if BH1750_CONTINU_L_RESOLUTION 123 default 0x20 if BH1750_ONETIME_H_RESOLUTION 124 default 0x21 if BH1750_ONETIME_H_RESOLUTION2 125 default 0x23 if BH1750_ONETIME_L_RESOLUTION 126 127 endmenu 128 129endmenu 130