Hello,
in my device tree there are three nodes/items concerning battery Management:
- One load enable pin
- One measure enable pin
- the required ADC configuration
The following configuration works:
batloaden { compatible = "gpio-keys"; bat_load_en: bat_load { gpios = <&gpio1 12 GPIO_PUSH_PULL>; label = "batLoadEnPin"; }; }; btmeasen { compatible = "gpio-keys"; bt_meas_en: bt_meas { gpios = <&gpio1 14 GPIO_PUSH_PULL>; label = "btMeasEn"; }; }; batmeasure { bat_adc_conf: bat_adc_conf { compatible = "bat-adc-config"; resolution = <12>; gain = <6>; //Numeric value of ADC_GAIN_1 stabilize_time = <3>; }; }
batmeasure { bat_adc_conf: bat_adc_conf { compatible = "bat-adc-config"; resolution = <12>; gain = <6>; //Numeric value of ADC_GAIN_1 reference = <4>; //Numeric value of ADC_REF_INTERNAL aquisition_time = <0x4028>; //Numeric value of ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40) ucal_channel_id = <0>; ubat_channel_id = <1>; ucal_plus_input = <1>; //Numeric value of NRF_SAADC_INPUT_AIN0 ucal_minus_ubat_plus_input = <2>; //Numeric value of NRF_SAADC_INPUT_AIN1 ubat_minus_input = <3>; //Numeric value of NRF_SAADC_INPUT_AIN2 stabilize_time = <3>; }; bat_load_en: bat_load { compatible = "gpio-keys"; gpios = <&gpio1 12 GPIO_PUSH_PULL>; label = "batLoadEnPin"; }; bt_meas_en: bt_meas { compatible = "gpio-keys"; gpios = <&gpio1 14 GPIO_PUSH_PULL>; label = "btMeasEn"; }; };