Explorar o código

[driver][adc]Fix adc1 can't open bug.

Rbb666 hai 1 ano
pai
achega
54d1426476
Modificáronse 28 ficheiros con 52 adicións e 1734 borrados
  1. 0 41
      libraries/HAL_Drivers/config/ra2l1/adc_config.h
  2. 0 48
      libraries/HAL_Drivers/config/ra2l1/can_config.h
  3. 0 41
      libraries/HAL_Drivers/config/ra2l1/dac_config.h
  4. 0 68
      libraries/HAL_Drivers/config/ra2l1/pwm_config.h
  5. 0 80
      libraries/HAL_Drivers/config/ra2l1/uart_config.h
  6. 0 41
      libraries/HAL_Drivers/config/ra4m2/adc_config.h
  7. 0 48
      libraries/HAL_Drivers/config/ra4m2/can_config.h
  8. 0 41
      libraries/HAL_Drivers/config/ra4m2/dac_config.h
  9. 0 68
      libraries/HAL_Drivers/config/ra4m2/pwm_config.h
  10. 0 136
      libraries/HAL_Drivers/config/ra4m2/uart_config.h
  11. 0 41
      libraries/HAL_Drivers/config/ra6m3/adc_config.h
  12. 0 48
      libraries/HAL_Drivers/config/ra6m3/can_config.h
  13. 0 41
      libraries/HAL_Drivers/config/ra6m3/dac_config.h
  14. 0 68
      libraries/HAL_Drivers/config/ra6m3/pwm_config.h
  15. 0 67
      libraries/HAL_Drivers/config/ra6m3/timer_config.h
  16. 0 136
      libraries/HAL_Drivers/config/ra6m3/uart_config.h
  17. 0 41
      libraries/HAL_Drivers/config/ra6m4/adc_config.h
  18. 0 48
      libraries/HAL_Drivers/config/ra6m4/can_config.h
  19. 0 41
      libraries/HAL_Drivers/config/ra6m4/dac_config.h
  20. 0 68
      libraries/HAL_Drivers/config/ra6m4/pwm_config.h
  21. 0 136
      libraries/HAL_Drivers/config/ra6m4/uart_config.h
  22. 0 41
      libraries/HAL_Drivers/config/ra6m5/adc_config.h
  23. 0 48
      libraries/HAL_Drivers/config/ra6m5/can_config.h
  24. 0 41
      libraries/HAL_Drivers/config/ra6m5/dac_config.h
  25. 0 68
      libraries/HAL_Drivers/config/ra6m5/pwm_config.h
  26. 0 136
      libraries/HAL_Drivers/config/ra6m5/uart_config.h
  27. 10 9
      libraries/HAL_Drivers/config/ra8/adc_config.h
  28. 42 44
      libraries/HAL_Drivers/drv_adc.c

+ 0 - 41
libraries/HAL_Drivers/config/ra2l1/adc_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __ADC_CONFIG_H__
-#define __ADC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
-struct ra_adc_map
-{
-    char name;
-    const adc_cfg_t *g_cfg;
-    const adc_instance_ctrl_t *g_ctrl;
-    const adc_channel_cfg_t   *g_channel_cfg;
-};
-
-struct ra_dev
-{
-    rt_adc_device_t     ra_adc_device_t;
-    struct ra_adc_map  *ra_adc_dev;
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 48
libraries/HAL_Drivers/config/ra2l1/can_config.h

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-29     mazhiyuan         first version
- */
-
-#ifndef __CAN_CONFIG_H__
-#define __CAN_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_CAN0)
-#ifndef CAN0_CONFIG
-#define CAN0_CONFIG                                                 \
-    {                                                               \
-        .name = "can0",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can0,             \
-        .p_api_ctrl = &g_can0_ctrl,                                \
-        .p_cfg = &g_can0_cfg,                                      \
-    }
-#endif /* CAN0_CONFIG */
-#endif /* BSP_USING_CAN0 */
-
-#if defined(BSP_USING_CAN1)
-#ifndef CAN1_CONFIG
-#define CAN1_CONFIG                                                 \
-    {                                                               \
-        .name = "can1",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can1,             \
-        .p_api_ctrl = &g_can1_ctrl,                                \
-        .p_cfg = &g_can1_cfg,                                      \
-    }
-#endif /* CAN1_CONFIG */
-#endif /* BSP_USING_CAN1 */
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra2l1/dac_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __DAC_CONFIG_H__
-#define __DAC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef BSP_USING_DAC
-struct ra_dac_map
-{
-    char name;
-    const struct st_dac_cfg *g_cfg;
-    const struct st_dac_instance_ctrl *g_ctrl;
-};
-
-struct ra_dac_dev
-{
-    rt_dac_device_t       ra_dac_device_t;
-    struct ra_dac_map    *ra_dac_map_dev;
-};
-#endif
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 68
libraries/HAL_Drivers/config/ra2l1/pwm_config.h

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-26     KevinXu           first version
- */
-#ifndef __PWM_CONFIG_H__
-#define __PWM_CONFIG_H__
-
-#include <rtthread.h>
-#include <drv_config.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum
-{
-#ifdef BSP_USING_PWM0
-    BSP_PWM0_INDEX,
-#endif
-#ifdef BSP_USING_PWM1
-    BSP_PWM1_INDEX,
-#endif
-#ifdef BSP_USING_PWM2
-    BSP_PWM2_INDEX,
-#endif
-#ifdef BSP_USING_PWM3
-    BSP_PWM3_INDEX,
-#endif
-#ifdef BSP_USING_PWM4
-    BSP_PWM4_INDEX,
-#endif
-#ifdef BSP_USING_PWM5
-    BSP_PWM5_INDEX,
-#endif
-#ifdef BSP_USING_PWM6
-    BSP_PWM6_INDEX,
-#endif
-#ifdef BSP_USING_PWM7
-    BSP_PWM7_INDEX,
-#endif
-#ifdef BSP_USING_PWM8
-    BSP_PWM8_INDEX,
-#endif
-#ifdef BSP_USING_PWM9
-    BSP_PWM9_INDEX,
-#endif
-    BSP_PWMS_NUM
-};
-
-#define PWM_DRV_INITIALIZER(num)        \
-    {                                   \
-        .name = "pwm"#num ,             \
-        .g_cfg = &g_timer##num##_cfg,   \
-        .g_ctrl = &g_timer##num##_ctrl, \
-        .g_timer = &g_timer##num,       \
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __PWM_CONFIG_H__ */

+ 0 - 80
libraries/HAL_Drivers/config/ra2l1/uart_config.h

@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-07-29     KyleChan          first version
- */
-
-#ifndef __UART_CONFIG_H__
-#define __UART_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_UART0)
-#ifndef UART0_CONFIG
-#define UART0_CONFIG                                                \
-    {                                                               \
-        .name = "uart0",                                            \
-        .p_api_ctrl = &g_uart0_ctrl,                                \
-        .p_cfg = &g_uart0_cfg,                                      \
-    }
-#endif /* UART0_CONFIG */
-#endif /* BSP_USING_UART0 */
-
-#if defined(BSP_USING_UART1)
-#ifndef UART1_CONFIG
-#define UART1_CONFIG                                                \
-    {                                                               \
-        .name = "uart1",                                            \
-        .p_api_ctrl = &g_uart1_ctrl,                                \
-        .p_cfg = &g_uart1_cfg,                                      \
-    }
-#endif /* UART1_CONFIG */
-#endif /* BSP_USING_UART1 */
-
-#if defined(BSP_USING_UART2)
-#ifndef UART2_CONFIG
-#define UART2_CONFIG                                                \
-    {                                                               \
-        .name = "uart2",                                            \
-        .p_api_ctrl = &g_uart2_ctrl,                                \
-        .p_cfg = &g_uart2_cfg,                                      \
-    }
-#endif /* UART2_CONFIG */
-#endif /* BSP_USING_UART2 */
-
-#if defined(BSP_USING_UART3)
-#ifndef UART3_CONFIG
-#define UART3_CONFIG                                                \
-    {                                                               \
-        .name = "uart3",                                            \
-        .p_api_ctrl = &g_uart3_ctrl,                                \
-        .p_cfg = &g_uart3_cfg,                                      \
-    }
-#endif /* UART3_CONFIG */
-#endif /* BSP_USING_UART3 */
-
-#if defined(BSP_USING_UART9)
-#ifndef UART9_CONFIG
-#define UART9_CONFIG                                                \
-    {                                                               \
-        .name = "uart9",                                            \
-        .p_api_ctrl = &g_uart9_ctrl,                                \
-        .p_cfg = &g_uart9_cfg,                                      \
-    }
-#endif /* UART9_CONFIG */
-#endif /* BSP_USING_UART9 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra4m2/adc_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __ADC_CONFIG_H__
-#define __ADC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
-struct ra_adc_map
-{
-    char name;
-    const adc_cfg_t *g_cfg;
-    const adc_instance_ctrl_t *g_ctrl;
-    const adc_channel_cfg_t   *g_channel_cfg;
-};
-
-struct ra_dev
-{
-    rt_adc_device_t     ra_adc_device_t;
-    struct ra_adc_map  *ra_adc_dev;
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 48
libraries/HAL_Drivers/config/ra4m2/can_config.h

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-29     mazhiyuan         first version
- */
-
-#ifndef __CAN_CONFIG_H__
-#define __CAN_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_CAN0)
-#ifndef CAN0_CONFIG
-#define CAN0_CONFIG                                                 \
-    {                                                               \
-        .name = "can0",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can0,             \
-        .p_api_ctrl = &g_can0_ctrl,                                \
-        .p_cfg = &g_can0_cfg,                                      \
-    }
-#endif /* CAN0_CONFIG */
-#endif /* BSP_USING_CAN0 */
-
-#if defined(BSP_USING_CAN1)
-#ifndef CAN1_CONFIG
-#define CAN1_CONFIG                                                 \
-    {                                                               \
-        .name = "can1",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can1,             \
-        .p_api_ctrl = &g_can1_ctrl,                                \
-        .p_cfg = &g_can1_cfg,                                      \
-    }
-#endif /* CAN1_CONFIG */
-#endif /* BSP_USING_CAN1 */
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra4m2/dac_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __DAC_CONFIG_H__
-#define __DAC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef BSP_USING_DAC
-struct ra_dac_map
-{
-    char name;
-    const struct st_dac_cfg *g_cfg;
-    const struct st_dac_instance_ctrl *g_ctrl;
-};
-
-struct ra_dac_dev
-{
-    rt_dac_device_t       ra_dac_device_t;
-    struct ra_dac_map    *ra_dac_map_dev;
-};
-#endif
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 68
libraries/HAL_Drivers/config/ra4m2/pwm_config.h

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-26     KevinXu           first version
- */
-#ifndef __PWM_CONFIG_H__
-#define __PWM_CONFIG_H__
-
-#include <rtthread.h>
-#include <drv_config.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum
-{
-#ifdef BSP_USING_PWM0
-    BSP_PWM0_INDEX,
-#endif
-#ifdef BSP_USING_PWM1
-    BSP_PWM1_INDEX,
-#endif
-#ifdef BSP_USING_PWM2
-    BSP_PWM2_INDEX,
-#endif
-#ifdef BSP_USING_PWM3
-    BSP_PWM3_INDEX,
-#endif
-#ifdef BSP_USING_PWM4
-    BSP_PWM4_INDEX,
-#endif
-#ifdef BSP_USING_PWM5
-    BSP_PWM5_INDEX,
-#endif
-#ifdef BSP_USING_PWM6
-    BSP_PWM6_INDEX,
-#endif
-#ifdef BSP_USING_PWM7
-    BSP_PWM7_INDEX,
-#endif
-#ifdef BSP_USING_PWM8
-    BSP_PWM8_INDEX,
-#endif
-#ifdef BSP_USING_PWM9
-    BSP_PWM9_INDEX,
-#endif
-    BSP_PWMS_NUM
-};
-
-#define PWM_DRV_INITIALIZER(num)        \
-    {                                   \
-        .name = "pwm"#num ,             \
-        .g_cfg = &g_timer##num##_cfg,   \
-        .g_ctrl = &g_timer##num##_ctrl, \
-        .g_timer = &g_timer##num,       \
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __PWM_CONFIG_H__ */

+ 0 - 136
libraries/HAL_Drivers/config/ra4m2/uart_config.h

@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-07-29     KyleChan          first version
- */
-
-#ifndef __UART_CONFIG_H__
-#define __UART_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_UART0)
-#ifndef UART0_CONFIG
-#define UART0_CONFIG                                                \
-    {                                                               \
-        .name = "uart0",                                            \
-        .p_api_ctrl = &g_uart0_ctrl,                                \
-        .p_cfg = &g_uart0_cfg,                                      \
-    }
-#endif /* UART0_CONFIG */
-#endif /* BSP_USING_UART0 */
-
-#if defined(BSP_USING_UART1)
-#ifndef UART1_CONFIG
-#define UART1_CONFIG                                                \
-    {                                                               \
-        .name = "uart1",                                            \
-        .p_api_ctrl = &g_uart1_ctrl,                                \
-        .p_cfg = &g_uart1_cfg,                                      \
-    }
-#endif /* UART1_CONFIG */
-#endif /* BSP_USING_UART1 */
-
-#if defined(BSP_USING_UART2)
-#ifndef UART2_CONFIG
-#define UART2_CONFIG                                                \
-    {                                                               \
-        .name = "uart2",                                            \
-        .p_api_ctrl = &g_uart2_ctrl,                                \
-        .p_cfg = &g_uart2_cfg,                                      \
-    }
-#endif /* UART2_CONFIG */
-#endif /* BSP_USING_UART2 */
-
-#if defined(BSP_USING_UART3)
-#ifndef UART3_CONFIG
-#define UART3_CONFIG                                                \
-    {                                                               \
-        .name = "uart3",                                            \
-        .p_api_ctrl = &g_uart3_ctrl,                                \
-        .p_cfg = &g_uart3_cfg,                                      \
-    }
-#endif /* UART3_CONFIG */
-#endif /* BSP_USING_UART3 */
-
-#if defined(BSP_USING_UART4)
-#ifndef UART4_CONFIG
-#define UART4_CONFIG                                                \
-    {                                                               \
-        .name = "uart4",                                            \
-        .p_api_ctrl = &g_uart4_ctrl,                                \
-        .p_cfg = &g_uart4_cfg,                                      \
-    }
-#endif /* UART4_CONFIG */
-#endif /* BSP_USING_UART4 */
-
-#if defined(BSP_USING_UART5)
-#ifndef UART5_CONFIG
-#define UART5_CONFIG                                                \
-    {                                                               \
-        .name = "uart5",                                            \
-        .p_api_ctrl = &g_uart5_ctrl,                                \
-        .p_cfg = &g_uart5_cfg,                                      \
-    }
-#endif /* UART5_CONFIG */
-#endif /* BSP_USING_UART5 */
-
-
-#if defined(BSP_USING_UART6)
-#ifndef UART6_CONFIG
-#define UART6_CONFIG                                                \
-    {                                                               \
-        .name = "uart6",                                            \
-        .p_api_ctrl = &g_uart6_ctrl,                                \
-        .p_cfg = &g_uart6_cfg,                                      \
-    }
-#endif /* UART6_CONFIG */
-#endif /* BSP_USING_UART6 */
-
-#if defined(BSP_USING_UART7)
-#ifndef UART7_CONFIG
-#define UART7_CONFIG                                                \
-    {                                                               \
-        .name = "uart7",                                            \
-        .p_api_ctrl = &g_uart7_ctrl,                                \
-        .p_cfg = &g_uart7_cfg,                                      \
-    }
-#endif /* UART7_CONFIG */
-#endif /* BSP_USING_UART7 */
-
-#if defined(BSP_USING_UART8)
-#ifndef UART8_CONFIG
-#define UART8_CONFIG                                                \
-    {                                                               \
-        .name = "uart8",                                            \
-        .p_api_ctrl = &g_uart8_ctrl,                                \
-        .p_cfg = &g_uart8_cfg,                                      \
-    }
-#endif /* UART8_CONFIG */
-#endif /* BSP_USING_UART8 */
-
-#if defined(BSP_USING_UART9)
-#ifndef UART9_CONFIG
-#define UART9_CONFIG                                                \
-    {                                                               \
-        .name = "uart9",                                            \
-        .p_api_ctrl = &g_uart9_ctrl,                                \
-        .p_cfg = &g_uart9_cfg,                                      \
-    }
-#endif /* UART9_CONFIG */
-#endif /* BSP_USING_UART9 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra6m3/adc_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __ADC_CONFIG_H__
-#define __ADC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
-struct ra_adc_map
-{
-    char name;
-    const adc_cfg_t *g_cfg;
-    const adc_instance_ctrl_t *g_ctrl;
-    const adc_channel_cfg_t   *g_channel_cfg;
-};
-
-struct ra_dev
-{
-    rt_adc_device_t     ra_adc_device_t;
-    struct ra_adc_map  *ra_adc_dev;
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 48
libraries/HAL_Drivers/config/ra6m3/can_config.h

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-29     mazhiyuan         first version
- */
-
-#ifndef __CAN_CONFIG_H__
-#define __CAN_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_CAN0)
-#ifndef CAN0_CONFIG
-#define CAN0_CONFIG                                                 \
-    {                                                               \
-        .name = "can0",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can0,             \
-        .p_api_ctrl = &g_can0_ctrl,                                \
-        .p_cfg = &g_can0_cfg,                                      \
-    }
-#endif /* CAN0_CONFIG */
-#endif /* BSP_USING_CAN0 */
-
-#if defined(BSP_USING_CAN1)
-#ifndef CAN1_CONFIG
-#define CAN1_CONFIG                                                 \
-    {                                                               \
-        .name = "can1",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can1,             \
-        .p_api_ctrl = &g_can1_ctrl,                                \
-        .p_cfg = &g_can1_cfg,                                      \
-    }
-#endif /* CAN1_CONFIG */
-#endif /* BSP_USING_CAN1 */
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra6m3/dac_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __DAC_CONFIG_H__
-#define __DAC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef BSP_USING_DAC
-struct ra_dac_map
-{
-    char name;
-    const struct st_dac_cfg *g_cfg;
-    const struct st_dac_instance_ctrl *g_ctrl;
-};
-
-struct ra_dac_dev
-{
-    rt_dac_device_t       ra_dac_device_t;
-    struct ra_dac_map    *ra_dac_map_dev;
-};
-#endif
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 68
libraries/HAL_Drivers/config/ra6m3/pwm_config.h

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-26     KevinXu           first version
- */
-#ifndef __PWM_CONFIG_H__
-#define __PWM_CONFIG_H__
-
-#include <rtthread.h>
-#include <drv_config.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum
-{
-#ifdef BSP_USING_PWM0
-    BSP_PWM0_INDEX,
-#endif
-#ifdef BSP_USING_PWM1
-    BSP_PWM1_INDEX,
-#endif
-#ifdef BSP_USING_PWM2
-    BSP_PWM2_INDEX,
-#endif
-#ifdef BSP_USING_PWM3
-    BSP_PWM3_INDEX,
-#endif
-#ifdef BSP_USING_PWM4
-    BSP_PWM4_INDEX,
-#endif
-#ifdef BSP_USING_PWM5
-    BSP_PWM5_INDEX,
-#endif
-#ifdef BSP_USING_PWM6
-    BSP_PWM6_INDEX,
-#endif
-#ifdef BSP_USING_PWM7
-    BSP_PWM7_INDEX,
-#endif
-#ifdef BSP_USING_PWM8
-    BSP_PWM8_INDEX,
-#endif
-#ifdef BSP_USING_PWM9
-    BSP_PWM9_INDEX,
-#endif
-    BSP_PWMS_NUM
-};
-
-#define PWM_DRV_INITIALIZER(num)        \
-    {                                   \
-        .name = "pwm"#num ,             \
-        .g_cfg = &g_timer##num##_cfg,   \
-        .g_ctrl = &g_timer##num##_ctrl, \
-        .g_timer = &g_timer##num,       \
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __PWM_CONFIG_H__ */

+ 0 - 67
libraries/HAL_Drivers/config/ra6m3/timer_config.h

@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2023-09-04     Rbb666       first version
- */
-
-#ifndef __TIMER_CONFIG_H__
-#define __TIMER_CONFIG_H__
-
-#include <rtthread.h>
-#include <drv_config.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define PLCKD_PRESCALER_MAX_SELECT     7
-
-/* RA6M3: Frequency ratio: PCLKA:PCLKD = 1:N (N = 1/2/4/8/16/32/64) */
-#define PLCKD_PRESCALER_120M           (BSP_FEATURE_GPT_ODC_FREQ_MAX)
-#define PLCKD_PRESCALER_60M            (BSP_FEATURE_GPT_ODC_FREQ_MAX / 2)
-#define PLCKD_PRESCALER_30M            (BSP_FEATURE_GPT_ODC_FREQ_MAX / 4)
-#define PLCKD_PRESCALER_15M            (BSP_FEATURE_GPT_ODC_FREQ_MAX / 8)
-#define PLCKD_PRESCALER_7_5M           (BSP_FEATURE_GPT_ODC_FREQ_MAX / 16)
-#define PLCKD_PRESCALER_3_75M          (BSP_FEATURE_GPT_ODC_FREQ_MAX / 32)
-#define PLCKD_PRESCALER_1_875M         (BSP_FEATURE_GPT_ODC_FREQ_MAX / 64)
-
-#ifndef TMR_DEV_INFO_CONFIG
-#define TMR_DEV_INFO_CONFIG                     \
-    {                                           \
-        .maxfreq = 120000000,                   \
-        .minfreq = 1875000,                     \
-        .maxcnt  = 0XFFFFFFFF,                  \
-        .cntmode = HWTIMER_CNTMODE_UP,          \
-    }
-#endif /* TIM_DEV_INFO_CONFIG */
-
-enum
-{
-#ifdef BSP_USING_TIM0
-    BSP_TIMER0_INDEX,
-#endif
-#ifdef BSP_USING_TIM1
-    BSP_TIMER1_INDEX,
-#endif
-    BSP_TIMERS_NUM
-};
-
-#define TIMER_DRV_INITIALIZER(num)      \
-    {                                   \
-        .name = "timer" #num,           \
-        .g_cfg = &g_timer##num##_cfg,   \
-        .g_ctrl = &g_timer##num##_ctrl, \
-        .g_timer = &g_timer##num,       \
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIMER_CONFIG_H__ */

+ 0 - 136
libraries/HAL_Drivers/config/ra6m3/uart_config.h

@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-07-29     KyleChan          first version
- */
-
-#ifndef __UART_CONFIG_H__
-#define __UART_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_UART0)
-#ifndef UART0_CONFIG
-#define UART0_CONFIG                                                \
-    {                                                               \
-        .name = "uart0",                                            \
-        .p_api_ctrl = &g_uart0_ctrl,                                \
-        .p_cfg = &g_uart0_cfg,                                      \
-    }
-#endif /* UART0_CONFIG */
-#endif /* BSP_USING_UART0 */
-
-#if defined(BSP_USING_UART1)
-#ifndef UART1_CONFIG
-#define UART1_CONFIG                                                \
-    {                                                               \
-        .name = "uart1",                                            \
-        .p_api_ctrl = &g_uart1_ctrl,                                \
-        .p_cfg = &g_uart1_cfg,                                      \
-    }
-#endif /* UART1_CONFIG */
-#endif /* BSP_USING_UART1 */
-
-#if defined(BSP_USING_UART2)
-#ifndef UART2_CONFIG
-#define UART2_CONFIG                                                \
-    {                                                               \
-        .name = "uart2",                                            \
-        .p_api_ctrl = &g_uart2_ctrl,                                \
-        .p_cfg = &g_uart2_cfg,                                      \
-    }
-#endif /* UART2_CONFIG */
-#endif /* BSP_USING_UART2 */
-
-#if defined(BSP_USING_UART3)
-#ifndef UART3_CONFIG
-#define UART3_CONFIG                                                \
-    {                                                               \
-        .name = "uart3",                                            \
-        .p_api_ctrl = &g_uart3_ctrl,                                \
-        .p_cfg = &g_uart3_cfg,                                      \
-    }
-#endif /* UART3_CONFIG */
-#endif /* BSP_USING_UART3 */
-
-#if defined(BSP_USING_UART4)
-#ifndef UART4_CONFIG
-#define UART4_CONFIG                                                \
-    {                                                               \
-        .name = "uart4",                                            \
-        .p_api_ctrl = &g_uart4_ctrl,                                \
-        .p_cfg = &g_uart4_cfg,                                      \
-    }
-#endif /* UART4_CONFIG */
-#endif /* BSP_USING_UART4 */
-
-#if defined(BSP_USING_UART5)
-#ifndef UART5_CONFIG
-#define UART5_CONFIG                                                \
-    {                                                               \
-        .name = "uart5",                                            \
-        .p_api_ctrl = &g_uart5_ctrl,                                \
-        .p_cfg = &g_uart5_cfg,                                      \
-    }
-#endif /* UART5_CONFIG */
-#endif /* BSP_USING_UART5 */
-
-
-#if defined(BSP_USING_UART6)
-#ifndef UART6_CONFIG
-#define UART6_CONFIG                                                \
-    {                                                               \
-        .name = "uart6",                                            \
-        .p_api_ctrl = &g_uart6_ctrl,                                \
-        .p_cfg = &g_uart6_cfg,                                      \
-    }
-#endif /* UART6_CONFIG */
-#endif /* BSP_USING_UART6 */
-
-#if defined(BSP_USING_UART7)
-#ifndef UART7_CONFIG
-#define UART7_CONFIG                                                \
-    {                                                               \
-        .name = "uart7",                                            \
-        .p_api_ctrl = &g_uart7_ctrl,                                \
-        .p_cfg = &g_uart7_cfg,                                      \
-    }
-#endif /* UART7_CONFIG */
-#endif /* BSP_USING_UART7 */
-
-#if defined(BSP_USING_UART8)
-#ifndef UART8_CONFIG
-#define UART8_CONFIG                                                \
-    {                                                               \
-        .name = "uart8",                                            \
-        .p_api_ctrl = &g_uart8_ctrl,                                \
-        .p_cfg = &g_uart8_cfg,                                      \
-    }
-#endif /* UART8_CONFIG */
-#endif /* BSP_USING_UART8 */
-
-#if defined(BSP_USING_UART9)
-#ifndef UART9_CONFIG
-#define UART9_CONFIG                                                \
-    {                                                               \
-        .name = "uart9",                                            \
-        .p_api_ctrl = &g_uart9_ctrl,                                \
-        .p_cfg = &g_uart9_cfg,                                      \
-    }
-#endif /* UART9_CONFIG */
-#endif /* BSP_USING_UART9 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra6m4/adc_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __ADC_CONFIG_H__
-#define __ADC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
-struct ra_adc_map
-{
-    char name;
-    const adc_cfg_t *g_cfg;
-    const adc_instance_ctrl_t *g_ctrl;
-    const adc_channel_cfg_t   *g_channel_cfg;
-};
-
-struct ra_dev
-{
-    rt_adc_device_t     ra_adc_device_t;
-    struct ra_adc_map  *ra_adc_dev;
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 48
libraries/HAL_Drivers/config/ra6m4/can_config.h

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-29     mazhiyuan         first version
- */
-
-#ifndef __CAN_CONFIG_H__
-#define __CAN_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_CAN0)
-#ifndef CAN0_CONFIG
-#define CAN0_CONFIG                                                 \
-    {                                                               \
-        .name = "can0",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can0,             \
-        .p_api_ctrl = &g_can0_ctrl,                                \
-        .p_cfg = &g_can0_cfg,                                      \
-    }
-#endif /* CAN0_CONFIG */
-#endif /* BSP_USING_CAN0 */
-
-#if defined(BSP_USING_CAN1)
-#ifndef CAN1_CONFIG
-#define CAN1_CONFIG                                                 \
-    {                                                               \
-        .name = "can1",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can1,             \
-        .p_api_ctrl = &g_can1_ctrl,                                \
-        .p_cfg = &g_can1_cfg,                                      \
-    }
-#endif /* CAN1_CONFIG */
-#endif /* BSP_USING_CAN1 */
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra6m4/dac_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __DAC_CONFIG_H__
-#define __DAC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef BSP_USING_DAC
-struct ra_dac_map
-{
-    char name;
-    const struct st_dac_cfg *g_cfg;
-    const struct st_dac_instance_ctrl *g_ctrl;
-};
-
-struct ra_dac_dev
-{
-    rt_dac_device_t       ra_dac_device_t;
-    struct ra_dac_map    *ra_dac_map_dev;
-};
-#endif
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 68
libraries/HAL_Drivers/config/ra6m4/pwm_config.h

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-26     KevinXu           first version
- */
-#ifndef __PWM_CONFIG_H__
-#define __PWM_CONFIG_H__
-
-#include <rtthread.h>
-#include <drv_config.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum
-{
-#ifdef BSP_USING_PWM0
-    BSP_PWM0_INDEX,
-#endif
-#ifdef BSP_USING_PWM1
-    BSP_PWM1_INDEX,
-#endif
-#ifdef BSP_USING_PWM2
-    BSP_PWM2_INDEX,
-#endif
-#ifdef BSP_USING_PWM3
-    BSP_PWM3_INDEX,
-#endif
-#ifdef BSP_USING_PWM4
-    BSP_PWM4_INDEX,
-#endif
-#ifdef BSP_USING_PWM5
-    BSP_PWM5_INDEX,
-#endif
-#ifdef BSP_USING_PWM6
-    BSP_PWM6_INDEX,
-#endif
-#ifdef BSP_USING_PWM7
-    BSP_PWM7_INDEX,
-#endif
-#ifdef BSP_USING_PWM8
-    BSP_PWM8_INDEX,
-#endif
-#ifdef BSP_USING_PWM9
-    BSP_PWM9_INDEX,
-#endif
-    BSP_PWMS_NUM
-};
-
-#define PWM_DRV_INITIALIZER(num)        \
-    {                                   \
-        .name = "pwm"#num ,             \
-        .g_cfg = &g_timer##num##_cfg,   \
-        .g_ctrl = &g_timer##num##_ctrl, \
-        .g_timer = &g_timer##num,       \
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __PWM_CONFIG_H__ */

+ 0 - 136
libraries/HAL_Drivers/config/ra6m4/uart_config.h

@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-07-29     KyleChan          first version
- */
-
-#ifndef __UART_CONFIG_H__
-#define __UART_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_UART0)
-#ifndef UART0_CONFIG
-#define UART0_CONFIG                                                \
-    {                                                               \
-        .name = "uart0",                                            \
-        .p_api_ctrl = &g_uart0_ctrl,                                \
-        .p_cfg = &g_uart0_cfg,                                      \
-    }
-#endif /* UART0_CONFIG */
-#endif /* BSP_USING_UART0 */
-
-#if defined(BSP_USING_UART1)
-#ifndef UART1_CONFIG
-#define UART1_CONFIG                                                \
-    {                                                               \
-        .name = "uart1",                                            \
-        .p_api_ctrl = &g_uart1_ctrl,                                \
-        .p_cfg = &g_uart1_cfg,                                      \
-    }
-#endif /* UART1_CONFIG */
-#endif /* BSP_USING_UART1 */
-
-#if defined(BSP_USING_UART2)
-#ifndef UART2_CONFIG
-#define UART2_CONFIG                                                \
-    {                                                               \
-        .name = "uart2",                                            \
-        .p_api_ctrl = &g_uart2_ctrl,                                \
-        .p_cfg = &g_uart2_cfg,                                      \
-    }
-#endif /* UART2_CONFIG */
-#endif /* BSP_USING_UART2 */
-
-#if defined(BSP_USING_UART3)
-#ifndef UART3_CONFIG
-#define UART3_CONFIG                                                \
-    {                                                               \
-        .name = "uart3",                                            \
-        .p_api_ctrl = &g_uart3_ctrl,                                \
-        .p_cfg = &g_uart3_cfg,                                      \
-    }
-#endif /* UART3_CONFIG */
-#endif /* BSP_USING_UART3 */
-
-#if defined(BSP_USING_UART4)
-#ifndef UART4_CONFIG
-#define UART4_CONFIG                                                \
-    {                                                               \
-        .name = "uart4",                                            \
-        .p_api_ctrl = &g_uart4_ctrl,                                \
-        .p_cfg = &g_uart4_cfg,                                      \
-    }
-#endif /* UART4_CONFIG */
-#endif /* BSP_USING_UART4 */
-
-#if defined(BSP_USING_UART5)
-#ifndef UART5_CONFIG
-#define UART5_CONFIG                                                \
-    {                                                               \
-        .name = "uart5",                                            \
-        .p_api_ctrl = &g_uart5_ctrl,                                \
-        .p_cfg = &g_uart5_cfg,                                      \
-    }
-#endif /* UART5_CONFIG */
-#endif /* BSP_USING_UART5 */
-
-
-#if defined(BSP_USING_UART6)
-#ifndef UART6_CONFIG
-#define UART6_CONFIG                                                \
-    {                                                               \
-        .name = "uart6",                                            \
-        .p_api_ctrl = &g_uart6_ctrl,                                \
-        .p_cfg = &g_uart6_cfg,                                      \
-    }
-#endif /* UART6_CONFIG */
-#endif /* BSP_USING_UART6 */
-
-#if defined(BSP_USING_UART7)
-#ifndef UART7_CONFIG
-#define UART7_CONFIG                                                \
-    {                                                               \
-        .name = "uart7",                                            \
-        .p_api_ctrl = &g_uart7_ctrl,                                \
-        .p_cfg = &g_uart7_cfg,                                      \
-    }
-#endif /* UART7_CONFIG */
-#endif /* BSP_USING_UART7 */
-
-#if defined(BSP_USING_UART8)
-#ifndef UART8_CONFIG
-#define UART8_CONFIG                                                \
-    {                                                               \
-        .name = "uart8",                                            \
-        .p_api_ctrl = &g_uart8_ctrl,                                \
-        .p_cfg = &g_uart8_cfg,                                      \
-    }
-#endif /* UART8_CONFIG */
-#endif /* BSP_USING_UART8 */
-
-#if defined(BSP_USING_UART9)
-#ifndef UART9_CONFIG
-#define UART9_CONFIG                                                \
-    {                                                               \
-        .name = "uart9",                                            \
-        .p_api_ctrl = &g_uart9_ctrl,                                \
-        .p_cfg = &g_uart9_cfg,                                      \
-    }
-#endif /* UART9_CONFIG */
-#endif /* BSP_USING_UART9 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra6m5/adc_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __ADC_CONFIG_H__
-#define __ADC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
-struct ra_adc_map
-{
-    char name;
-    const adc_cfg_t *g_cfg;
-    const adc_instance_ctrl_t *g_ctrl;
-    const adc_channel_cfg_t   *g_channel_cfg;
-};
-
-struct ra_dev
-{
-    rt_adc_device_t     ra_adc_device_t;
-    struct ra_adc_map  *ra_adc_dev;
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 48
libraries/HAL_Drivers/config/ra6m5/can_config.h

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-29     mazhiyuan         first version
- */
-
-#ifndef __CAN_CONFIG_H__
-#define __CAN_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_CAN0)
-#ifndef CAN0_CONFIG
-#define CAN0_CONFIG                                                 \
-    {                                                               \
-        .name = "can0",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can0,             \
-        .p_api_ctrl = &g_can0_ctrl,                                \
-        .p_cfg = &g_can0_cfg,                                      \
-    }
-#endif /* CAN0_CONFIG */
-#endif /* BSP_USING_CAN0 */
-
-#if defined(BSP_USING_CAN1)
-#ifndef CAN1_CONFIG
-#define CAN1_CONFIG                                                 \
-    {                                                               \
-        .name = "can1",                                            \
-        .num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can1,             \
-        .p_api_ctrl = &g_can1_ctrl,                                \
-        .p_cfg = &g_can1_cfg,                                      \
-    }
-#endif /* CAN1_CONFIG */
-#endif /* BSP_USING_CAN1 */
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 41
libraries/HAL_Drivers/config/ra6m5/dac_config.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2021-08-19     Mr.Tiger     first version
- */
-
-#ifndef __DAC_CONFIG_H__
-#define __DAC_CONFIG_H__
-
-#include <rtthread.h>
-#include <rtdevice.h>
-#include "hal_data.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef BSP_USING_DAC
-struct ra_dac_map
-{
-    char name;
-    const struct st_dac_cfg *g_cfg;
-    const struct st_dac_instance_ctrl *g_ctrl;
-};
-
-struct ra_dac_dev
-{
-    rt_dac_device_t       ra_dac_device_t;
-    struct ra_dac_map    *ra_dac_map_dev;
-};
-#endif
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-

+ 0 - 68
libraries/HAL_Drivers/config/ra6m5/pwm_config.h

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-10-26     KevinXu           first version
- */
-#ifndef __PWM_CONFIG_H__
-#define __PWM_CONFIG_H__
-
-#include <rtthread.h>
-#include <drv_config.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum
-{
-#ifdef BSP_USING_PWM0
-    BSP_PWM0_INDEX,
-#endif
-#ifdef BSP_USING_PWM1
-    BSP_PWM1_INDEX,
-#endif
-#ifdef BSP_USING_PWM2
-    BSP_PWM2_INDEX,
-#endif
-#ifdef BSP_USING_PWM3
-    BSP_PWM3_INDEX,
-#endif
-#ifdef BSP_USING_PWM4
-    BSP_PWM4_INDEX,
-#endif
-#ifdef BSP_USING_PWM5
-    BSP_PWM5_INDEX,
-#endif
-#ifdef BSP_USING_PWM6
-    BSP_PWM6_INDEX,
-#endif
-#ifdef BSP_USING_PWM7
-    BSP_PWM7_INDEX,
-#endif
-#ifdef BSP_USING_PWM8
-    BSP_PWM8_INDEX,
-#endif
-#ifdef BSP_USING_PWM9
-    BSP_PWM9_INDEX,
-#endif
-    BSP_PWMS_NUM
-};
-
-#define PWM_DRV_INITIALIZER(num)        \
-    {                                   \
-        .name = "pwm"#num ,             \
-        .g_cfg = &g_timer##num##_cfg,   \
-        .g_ctrl = &g_timer##num##_ctrl, \
-        .g_timer = &g_timer##num,       \
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __PWM_CONFIG_H__ */

+ 0 - 136
libraries/HAL_Drivers/config/ra6m5/uart_config.h

@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author            Notes
- * 2021-07-29     KyleChan          first version
- */
-
-#ifndef __UART_CONFIG_H__
-#define __UART_CONFIG_H__
-
-#include <rtthread.h>
-#include "hal_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(BSP_USING_UART0)
-#ifndef UART0_CONFIG
-#define UART0_CONFIG                                                \
-    {                                                               \
-        .name = "uart0",                                            \
-        .p_api_ctrl = &g_uart0_ctrl,                                \
-        .p_cfg = &g_uart0_cfg,                                      \
-    }
-#endif /* UART0_CONFIG */
-#endif /* BSP_USING_UART0 */
-
-#if defined(BSP_USING_UART1)
-#ifndef UART1_CONFIG
-#define UART1_CONFIG                                                \
-    {                                                               \
-        .name = "uart1",                                            \
-        .p_api_ctrl = &g_uart1_ctrl,                                \
-        .p_cfg = &g_uart1_cfg,                                      \
-    }
-#endif /* UART1_CONFIG */
-#endif /* BSP_USING_UART1 */
-
-#if defined(BSP_USING_UART2)
-#ifndef UART2_CONFIG
-#define UART2_CONFIG                                                \
-    {                                                               \
-        .name = "uart2",                                            \
-        .p_api_ctrl = &g_uart2_ctrl,                                \
-        .p_cfg = &g_uart2_cfg,                                      \
-    }
-#endif /* UART2_CONFIG */
-#endif /* BSP_USING_UART2 */
-
-#if defined(BSP_USING_UART3)
-#ifndef UART3_CONFIG
-#define UART3_CONFIG                                                \
-    {                                                               \
-        .name = "uart3",                                            \
-        .p_api_ctrl = &g_uart3_ctrl,                                \
-        .p_cfg = &g_uart3_cfg,                                      \
-    }
-#endif /* UART3_CONFIG */
-#endif /* BSP_USING_UART3 */
-
-#if defined(BSP_USING_UART4)
-#ifndef UART4_CONFIG
-#define UART4_CONFIG                                                \
-    {                                                               \
-        .name = "uart4",                                            \
-        .p_api_ctrl = &g_uart4_ctrl,                                \
-        .p_cfg = &g_uart4_cfg,                                      \
-    }
-#endif /* UART4_CONFIG */
-#endif /* BSP_USING_UART4 */
-
-#if defined(BSP_USING_UART5)
-#ifndef UART5_CONFIG
-#define UART5_CONFIG                                                \
-    {                                                               \
-        .name = "uart5",                                            \
-        .p_api_ctrl = &g_uart5_ctrl,                                \
-        .p_cfg = &g_uart5_cfg,                                      \
-    }
-#endif /* UART5_CONFIG */
-#endif /* BSP_USING_UART5 */
-
-
-#if defined(BSP_USING_UART6)
-#ifndef UART6_CONFIG
-#define UART6_CONFIG                                                \
-    {                                                               \
-        .name = "uart6",                                            \
-        .p_api_ctrl = &g_uart6_ctrl,                                \
-        .p_cfg = &g_uart6_cfg,                                      \
-    }
-#endif /* UART6_CONFIG */
-#endif /* BSP_USING_UART6 */
-
-#if defined(BSP_USING_UART7)
-#ifndef UART7_CONFIG
-#define UART7_CONFIG                                                \
-    {                                                               \
-        .name = "uart7",                                            \
-        .p_api_ctrl = &g_uart7_ctrl,                                \
-        .p_cfg = &g_uart7_cfg,                                      \
-    }
-#endif /* UART7_CONFIG */
-#endif /* BSP_USING_UART7 */
-
-#if defined(BSP_USING_UART8)
-#ifndef UART8_CONFIG
-#define UART8_CONFIG                                                \
-    {                                                               \
-        .name = "uart8",                                            \
-        .p_api_ctrl = &g_uart8_ctrl,                                \
-        .p_cfg = &g_uart8_cfg,                                      \
-    }
-#endif /* UART8_CONFIG */
-#endif /* BSP_USING_UART8 */
-
-#if defined(BSP_USING_UART9)
-#ifndef UART9_CONFIG
-#define UART9_CONFIG                                                \
-    {                                                               \
-        .name = "uart9",                                            \
-        .p_api_ctrl = &g_uart9_ctrl,                                \
-        .p_cfg = &g_uart9_cfg,                                      \
-    }
-#endif /* UART9_CONFIG */
-#endif /* BSP_USING_UART9 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 10 - 9
libraries/HAL_Drivers/config/ra8/adc_config.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006-2023, RT-Thread Development Team
+ * Copyright (c) 2006-2024, RT-Thread Development Team
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -19,18 +19,19 @@ extern "C" {
 #endif
 
 #if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
-struct ra_adc_map
+
+struct rt_adc_dev
 {
-    char name;
-    const adc_cfg_t *g_cfg;
-    const adc_instance_ctrl_t *g_ctrl;
-    const adc_channel_cfg_t   *g_channel_cfg;
+    struct rt_adc_ops ops;
+    struct rt_adc_device adc_device;
 };
 
-struct ra_dev
+struct ra_adc_map
 {
-    rt_adc_device_t     ra_adc_device_t;
-    struct ra_adc_map  *ra_adc_dev;
+    const char *device_name;
+    const adc_cfg_t *g_cfg;
+    const adc_ctrl_t *g_ctrl;
+    const adc_channel_cfg_t   *g_channel_cfg;
 };
 #endif
 #endif

+ 42 - 44
libraries/HAL_Drivers/drv_adc.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006-2021, RT-Thread Development Team
+ * Copyright (c) 2006-2024, RT-Thread Development Team
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -11,7 +11,7 @@
 #include "drv_config.h"
 #ifdef RT_USING_ADC
 
-// #define DRV_DEBUG
+#define DRV_DEBUG
 #define DBG_TAG              "drv.adc"
 #ifdef DRV_DEBUG
     #define DBG_LVL               DBG_LOG
@@ -22,24 +22,25 @@
 
 struct ra_adc_map ra_adc[] =
 {
-#if defined(BSP_USING_ADC0)
-    {'0', &g_adc0_cfg, &g_adc0_ctrl, &g_adc0_channel_cfg},
+#ifdef BSP_USING_ADC0
+    {
+      .device_name = "adc0",
+      .g_cfg = &g_adc0_cfg,
+      .g_ctrl = &g_adc0_ctrl,
+      .g_channel_cfg = &g_adc0_channel_cfg,
+    },
 #endif
-
-#if defined(BSP_USING_ADC1)
-    {'1', &g_adc1_cfg, &g_adc1_ctrl, &g_adc1_channel_cfg},
+#ifdef BSP_USING_ADC1
+    {
+      .device_name = "adc1",
+      .g_cfg = &g_adc1_cfg,
+      .g_ctrl = &g_adc1_ctrl,
+      .g_channel_cfg = &g_adc1_channel_cfg,
+    },
 #endif
 };
 
-#if defined(BSP_USING_ADC0)
-struct rt_adc_device adc0_device;
-struct ra_dev _ra_adc0_device = {.ra_adc_device_t = &adc0_device, .ra_adc_dev = &ra_adc[0]};
-#endif
-
-#if defined(BSP_USING_ADC1)
-struct rt_adc_device adc1_device;
-struct ra_dev _ra_adc1_device = {.ra_adc_device_t = &adc1_device, .ra_adc_dev = &ra_adc[1]};
-#endif
+static struct rt_adc_dev adc_obj[sizeof(ra_adc) / sizeof(ra_adc[0])] = {0};
 
 static rt_err_t ra_adc_enabled(struct rt_adc_device *device, rt_int8_t channel, rt_bool_t enabled)
 {
@@ -50,7 +51,7 @@ static rt_err_t ra_adc_enabled(struct rt_adc_device *device, rt_int8_t channel,
     {
         if (FSP_SUCCESS != R_ADC_ScanStart((adc_ctrl_t *)adc->g_ctrl))
         {
-            LOG_E("start adc%c failed.", adc->name);
+            LOG_E("start %s failed.", adc->device_name);
             return -RT_ERROR;
         }
     }
@@ -59,7 +60,7 @@ static rt_err_t ra_adc_enabled(struct rt_adc_device *device, rt_int8_t channel,
         /**< stop adc*/
         if (FSP_SUCCESS != R_ADC_ScanStop((adc_ctrl_t *)adc->g_ctrl))
         {
-            LOG_E("stop adc%c failed.", adc->name);
+            LOG_E("stop %s failed.", adc->device_name);
             return -RT_ERROR;
         }
     }
@@ -69,10 +70,10 @@ static rt_err_t ra_adc_enabled(struct rt_adc_device *device, rt_int8_t channel,
 rt_err_t ra_adc_close(struct rt_adc_device *device)
 {
     RT_ASSERT(device != RT_NULL);
-    struct ra_adc_map *adc = (struct ra_adc_map *)(struct ra_adc_map *)device->parent.user_data;
+    struct ra_adc_map *adc = (struct ra_adc_map *)device->parent.user_data;
     if (FSP_SUCCESS != R_ADC_Close((adc_ctrl_t *)adc->g_ctrl))
     {
-        LOG_E("close adc%c failed.", adc->name);
+        LOG_E("close %s failed.", adc->device_name);
         return -RT_ERROR;
     }
     return RT_EOK;
@@ -98,35 +99,32 @@ static const struct rt_adc_ops ra_adc_ops =
 
 static int ra_adc_init(void)
 {
-#if defined(BSP_USING_ADC0)
-    R_ADC_Open((adc_ctrl_t *)_ra_adc0_device.ra_adc_dev->g_ctrl,
-               (adc_cfg_t const * const)_ra_adc0_device.ra_adc_dev->g_cfg);
-
-    R_ADC_ScanCfg((adc_ctrl_t *)_ra_adc0_device.ra_adc_dev->g_ctrl,
-                  (adc_cfg_t const * const)_ra_adc0_device.ra_adc_dev->g_channel_cfg);
+    rt_err_t result = 0;
+    rt_size_t obj_num = sizeof(adc_obj) / sizeof(struct rt_adc_dev);
 
-    if (RT_EOK != rt_hw_adc_register(_ra_adc0_device.ra_adc_device_t, "adc0", &ra_adc_ops, (void *)_ra_adc0_device.ra_adc_dev))
+    for (int i = 0; i < obj_num; i++)
     {
-        LOG_E("adc0 register failed");
-        return -RT_ERROR;
-    }
-#endif
-
-#if defined(BSP_USING_ADC1)
-    R_ADC_Open((adc_ctrl_t *)_ra_adc1_device.ra_adc_dev->g_ctrl,
-               (adc_cfg_t const * const)_ra_adc1_device.ra_adc_dev->g_cfg);
+        /* init ADC object */
+        result = R_ADC_Open((adc_ctrl_t *)ra_adc[i].g_ctrl, ra_adc[i].g_cfg);
 
-    R_ADC_ScanCfg((adc_ctrl_t *)_ra_adc1_device.ra_adc_dev->g_ctrl,
-                  (adc_cfg_t const * const)_ra_adc1_device.ra_adc_dev->g_channel_cfg);
+        result = R_ADC_ScanCfg((adc_ctrl_t *)ra_adc[i].g_ctrl, ra_adc[i].g_channel_cfg);
 
-    if (RT_EOK != rt_hw_adc_register(_ra_adc1_device.ra_adc_device_t, "adc1", &ra_adc_ops, (void *)_ra_adc1_device.ra_adc_dev))
-    {
-        LOG_E("adc1 register failed");
-        return -RT_ERROR;
+        /* register ADC device */
+        if(rt_hw_adc_register(&adc_obj[i].adc_device,
+                                       ra_adc[i].device_name,
+                                       &ra_adc_ops,
+                                       &ra_adc[i]) == RT_EOK)
+        {
+            LOG_D("%s init success", ra_adc[i].device_name);
+        }
+        else
+        {
+            LOG_E("%s register failed", ra_adc[i].device_name);
+            result = -RT_ERROR;
+        }
+        RT_ASSERT(result == RT_EOK);
     }
-#endif
-
     return RT_EOK;
 }
-INIT_BOARD_EXPORT(ra_adc_init);
+INIT_DEVICE_EXPORT(ra_adc_init);
 #endif