Skip to content

Commit 1d15380

Browse files
committed
[bsp][renesas] add adc device option to Kconfig, disabled by default
1 parent 736e171 commit 1d15380

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

bsp/renesas/libraries/HAL_Drivers/drivers/config/drv_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ extern "C"
9292
#include "ra2e2/pwm_config.h"
9393
#endif
9494

95+
#ifdef BSP_USING_ADC
96+
#include "ra2e2/adc_config.h"
97+
#endif
98+
9599
#endif /* SOC_SERIES_R7FA2E2 */
96100

97101
#ifdef SOC_SERIES_R7FA2L1
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2006-2025, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2025-08-17 CYFS first version
9+
*/
10+
11+
#ifndef __ADC_CONFIG_H__
12+
#define __ADC_CONFIG_H__
13+
14+
#include <rtthread.h>
15+
#include <rtdevice.h>
16+
#include "hal_data.h"
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#if defined(BSP_USING_ADC0)
22+
23+
struct rt_adc_dev
24+
{
25+
struct rt_adc_ops ops;
26+
struct rt_adc_device adc_device;
27+
};
28+
29+
struct ra_adc_map
30+
{
31+
const char *device_name;
32+
const adc_cfg_t *g_cfg;
33+
const adc_ctrl_t *g_ctrl;
34+
const adc_channel_cfg_t *g_channel_cfg;
35+
};
36+
#endif
37+
#endif
38+
39+
#ifdef __cplusplus
40+
}
41+
#endif
42+

bsp/renesas/ra2e2-ek/board/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ menu "Hardware Drivers Config"
9393
default n
9494

9595
endif
96+
97+
menuconfig BSP_USING_ADC
98+
bool "Enable ADC"
99+
default n
100+
select RT_USING_ADC
101+
if BSP_USING_ADC
102+
config BSP_USING_ADC0
103+
bool "Enable ADC0"
104+
default n
105+
endif
96106

97107
endmenu
98108

0 commit comments

Comments
 (0)