Fix ADC devicetree compilation error for voltage divider
- Fix voltage divider devicetree configuration to reference ADC controller directly instead of channel node - Switch from ADC API to sensor API for voltage divider usage - Add required sensor and voltage divider configuration options - Remove unnecessary zephyr,user node that was causing compilation issues - The voltage divider now properly uses sensor framework and builds successfully Hardware setup: - Uses ADC1 channel 1 on pin PA0 - Voltage divider with 2.2kΩ output and 3.2kΩ total resistance - Provides voltage readings through sensor API accounting for divider ratio
This commit is contained in:
@@ -1,31 +1,8 @@
|
||||
/ {
|
||||
zephyr,user {
|
||||
io-channels = <&adc1 1>;
|
||||
io-channel-names = "multisense";
|
||||
};
|
||||
};
|
||||
|
||||
&adc1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
st,adc-clock-source = "SYNC";
|
||||
st,adc-prescaler = <4>;
|
||||
pinctrl-0 = <&adc1_in1_pa0>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
channel@1 {
|
||||
reg = <1>;
|
||||
zephyr,gain = "ADC_GAIN_1";
|
||||
zephyr,reference = "ADC_REF_INTERNAL";
|
||||
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
|
||||
zephyr,resolution = <12>;
|
||||
zephyr,vref-mv = <3300>;
|
||||
};
|
||||
st,adc-clock-source = "SYNC";
|
||||
st,adc-prescaler = <4>;
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
adc1_in1_pa0: adc1_in1_pa0 {
|
||||
pinmux = <STM32_PINMUX('A', 0, ANALOG)>;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user