drivers: adc: initialize to add ADC driver

Add minimal ADC driver code for EK-RA8M1 board

Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
This commit is contained in:
Thao Luong 2024-08-16 16:20:31 +07:00 committed by Henrik Brix Andersen
commit 4cebe5354f
15 changed files with 557 additions and 1 deletions

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
zephyr,user {
io-channels = <&adc0 0>;
reference_mv = <3300>;
};
};
&adc0{
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
zephyr,vref-mv = <3300>;
};
};

View file

@ -12,8 +12,10 @@ tests:
fixture: dac_adc_loopback
platform_allow:
- frdm_k64f
- ek_ra8m1
drivers.adc.accuracy.ref_volt:
harness_config:
fixture: adc_ref_volt
platform_allow:
- frdm_kl25z
- ek_ra8m1

View file

@ -0,0 +1,48 @@
/*
* Copyright (c) 2024 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
zephyr,user {
io-channels = <&adc1 0>, <&adc1 2>;
};
};
&pinctrl {
adc1_default: adc1_default {
group1 {
/* input */
psels = <RA_PSEL(RA_PSEL_ADC, 0, 0)>;
renesas,analog-enable;
};
};
};
&adc1 {
pinctrl-0 = <&adc1_default>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,resolution = <12>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,vref-mv = <3300>;
};
channel@2 {
reg = <2>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,resolution = <12>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,vref-mv = <3300>;
};
};