This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to configure the adc periheral in the Device Tree file *.dts

Hello,

I am trying to figure out a way to configure the adc node using the .dts Device Tree file in a similar way to what is done for other nodes such as &spi and &i2c.
Unfortunately, all the examples I have seen so far only set the status property for the adc node. I would like to add GPIO pin numbers, resolution, etc ...
Any suggestions?
&adc {
status = "okay";
};
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <13>;
mosi-pin = <09>;
miso-pin = <40>;
};
Thank you.
Parents Reply
  • Hi Martin,

    Thank you for your answer. I did go through the Tutorial Part 2 where the ADC is NOT configured  via the .dts file. So, the idea of using io-channels in the .dts file is what I am interested in. I have read some of it and I am not sure I get it. So, I am going to have a go at changing the sample of the light intensity controller in Tutorial 2 and use the .dts file and see if I can get it to work. I will probably need your help at some point to get it to work.

    Thank you for your support.

Children
Related