|
1 | 1 | menu "power_measure" |
| 2 | + choice POWER_MEASURE_CHIP_TYPE |
| 3 | + prompt "Power measurement chip type" |
| 4 | + default POWER_MEASURE_CHIP_BL0937 |
| 5 | + help |
| 6 | + Select the power measurement chip type to use |
| 7 | + |
| 8 | + config POWER_MEASURE_CHIP_BL0937 |
| 9 | + bool "BL0937" |
| 10 | + help |
| 11 | + BL0937 is a single-phase power measurement IC with high accuracy |
| 12 | + Features: Voltage, Current, Power, Power Factor, Energy measurement |
| 13 | + Interface: GPIO (CF, CF1, SEL pins) |
| 14 | + |
| 15 | + config POWER_MEASURE_CHIP_INA236 |
| 16 | + bool "INA236" |
| 17 | + help |
| 18 | + INA236 is a precision digital power monitor with I2C interface |
| 19 | + Features: Voltage, Current, Power measurement |
| 20 | + Interface: I2C |
| 21 | + Note: Does not support energy measurement or power factor |
| 22 | + endchoice |
| 23 | + |
2 | 24 | config BL0937_IRAM_OPTIMIZED |
3 | | - bool "Enable IRAM optimization for BL0937" |
4 | | - default n |
5 | | - help |
6 | | - Enable IRAM optimization for BL0937 |
| 25 | + bool "Enable IRAM optimization for BL0937" |
| 26 | + default n |
| 27 | + depends on POWER_MEASURE_CHIP_BL0937 |
| 28 | + help |
| 29 | + Enable IRAM optimization for BL0937 |
| 30 | + |
| 31 | + menu "BL0937 Hardware Configuration" |
| 32 | + config BL0937_VREF_MV |
| 33 | + int "Internal voltage reference (mV)" |
| 34 | + default 1218 |
| 35 | + help |
| 36 | + Internal voltage reference value for BL0937 in millivolts (1218 = 1.218V) |
| 37 | + |
| 38 | + config BL0937_R_CURRENT_MOHM |
| 39 | + int "Current sampling resistor (mOhm)" |
| 40 | + default 1 |
| 41 | + help |
| 42 | + Value of the current sampling resistor in milliohms (1 = 1mOhm for ~30A max measurement) |
| 43 | + |
| 44 | + config BL0937_R_VOLTAGE |
| 45 | + int "Voltage divider resistor (Ohm)" |
| 46 | + default 2010 |
| 47 | + help |
| 48 | + Value of the voltage divider resistor (typically 6x 470K upstream + 1K downstream = 2010) |
| 49 | + |
| 50 | + config BL0937_F_OSC |
| 51 | + int "Internal oscillator frequency (Hz)" |
| 52 | + default 2000000 |
| 53 | + help |
| 54 | + Frequency of the BL0937 internal clock |
| 55 | + |
| 56 | + config BL0937_PULSE_TIMEOUT_US |
| 57 | + int "Pulse timeout (microseconds)" |
| 58 | + default 1000000 |
| 59 | + help |
| 60 | + Timeout for pulse detection. Higher values allow better precision but reduce sampling rate. |
| 61 | + Lower values increase sampling rate but reduce precision. |
| 62 | + Values below 500000 (0.5s) are not recommended. |
| 63 | + endmenu |
| 64 | + |
| 65 | + menu "GPIO Pin Configuration" |
| 66 | + menu "BL0937 GPIO Pins" |
| 67 | + config BL0937_CF_GPIO |
| 68 | + int "CF GPIO pin number" |
| 69 | + default 3 |
| 70 | + help |
| 71 | + GPIO pin connected to BL0937 CF pin (current frequency output) |
| 72 | + |
| 73 | + config BL0937_SEL_GPIO |
| 74 | + int "SEL GPIO pin number" |
| 75 | + default 4 |
| 76 | + help |
| 77 | + GPIO pin connected to BL0937 SEL pin (selection pin) |
| 78 | + |
| 79 | + config BL0937_CF1_GPIO |
| 80 | + int "CF1 GPIO pin number" |
| 81 | + default 7 |
| 82 | + help |
| 83 | + GPIO pin connected to BL0937 CF1 pin (power frequency output) |
| 84 | + endmenu |
| 85 | + |
| 86 | + menu "INA236 I2C GPIO Pins" |
| 87 | + config INA236_I2C_SCL_GPIO |
| 88 | + int "I2C SCL GPIO pin number" |
| 89 | + default 13 |
| 90 | + help |
| 91 | + GPIO pin for I2C clock line |
| 92 | + |
| 93 | + config INA236_I2C_SDA_GPIO |
| 94 | + int "I2C SDA GPIO pin number" |
| 95 | + default 20 |
| 96 | + help |
| 97 | + GPIO pin for I2C data line |
| 98 | + endmenu |
| 99 | + endmenu |
7 | 100 | endmenu |
0 commit comments