Skip to content

Commit

Permalink
beagleconnect_freedom: Add adc support
Browse files Browse the repository at this point in the history
- Tested analog_input sample

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
  • Loading branch information
Ayush1325 authored and DhruvaG2000 committed Aug 3, 2024
1 parent 9e25da0 commit 4bc1867
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions variants/beagleconnect_freedom/beagleconnect_freedom.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
pwms = <&pwm0 0 255 PWM_POLARITY_NORMAL>,
<&pwm1 0 255 PWM_POLARITY_NORMAL>;

adc-pin-gpios =
<&gpio0 23 GPIO_ACTIVE_HIGH>, /* D15 - MB1 AN - A0 */
<&gpio0 24 GPIO_ACTIVE_HIGH>, /* D16 - MB2 AN - A1 */
<&gpio0 26 GPIO_ACTIVE_HIGH>, /* D11 - MB1/2 SDA - A2 */
<&gpio0 25 GPIO_ACTIVE_HIGH>, /* D12 - MB1/2 SCL - A3 */
<&gpio0 27 GPIO_ACTIVE_HIGH>, /* D7 - MB2 CS - A4 */
<&gpio0 28 GPIO_ACTIVE_HIGH>; /* D3 - MB1 CS - A5 */

io-channels = <&adc0 0x09>, <&adc0 0x0a>, <&adc0 0x0b>, <&adc0 0x0c>, <&adc0 0x0d>, <&adc0 0x0e>;

adc-pin-gpios =
<&gpio0 23 GPIO_ACTIVE_HIGH>, /* D15 - MB1 AN - A0 */
<&gpio0 24 GPIO_ACTIVE_HIGH>, /* D16 - MB2 AN - A1 */
Expand Down Expand Up @@ -87,3 +97,64 @@
pinctrl-0 = <&pwm1_default>;
pinctrl-names = "default";
};

&adc0 {
status = "okay";

#address-cells = <1>;
#size-cells = <0>;

/* MB1 AN */
channel@9 {
reg = <9>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

/* MB2 AN */
channel@a {
reg = <10>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

/* MB1/2 SCL */
channel@b {
reg = <11>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

/* MB1/2 SDA */
channel@c {
reg = <12>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

/* MB2 CS */
channel@d {
reg = <13>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

/* MB1 CS */
channel@e {
reg = <14>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};

0 comments on commit 4bc1867

Please sign in to comment.