1 /*
2  * Copyright (c) 2006-2024 RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author                 Notes
8  * 2022-07-28     rtthread qiu       first version
9  */
10 #ifndef __DRV__DAC_H__
11 #define __DRV__DAC_H__
12 #include "rtconfig.h"
13 #include "cycfg.h"
14 #include <rtthread.h>
15 #include "cy_csdidac.h"
16 #include "cycfg_peripherals.h"
17 
18 static const cy_stc_csdidac_pin_t CSDIDAC_csdidac_a_pin =
19 {
20     .ioPcPtr = GPIO_PRT10,
21     .pin = 0u,
22 };
23 static const cy_stc_csdidac_pin_t CSDIDAC_csdidac_b_pin =
24 {
25     .ioPcPtr = GPIO_PRT10,
26     .pin = 0u,
27 };
28 
29 const cy_stc_csdidac_config_t CSDIDAC_csdidac_config =
30 {
31     .base = CSD0,
32     .csdCxtPtr = &cy_csd_0_context,
33     .configA = CY_CSDIDAC_GPIO,
34     .configB = CY_CSDIDAC_GPIO,
35     .ptrPinA = (const cy_stc_csdidac_pin_t *)&CSDIDAC_csdidac_a_pin,
36     .ptrPinB = (const cy_stc_csdidac_pin_t *)&CSDIDAC_csdidac_b_pin,
37     .cpuClk = 100000000u,
38     .csdInitTime = 25u,
39 };
40 
41 #ifdef BSP_USING_DAC1
42 #ifndef DAC1_CONFIG
43 #define DAC1_CONFIG     \
44     {                   \
45         .name = "dac1", \
46     }
47 #endif /* DAC1_CONFIG */
48 #endif /*BSP_USING_DAC2*/
49 
50 #ifdef BSP_USING_DAC2
51 #ifndef DAC2_CONFIG
52 #define DAC2_CONFIG     \
53     {                   \
54         .name = "dac2", \
55     }
56 #endif /* DAC2_CONFIG */
57 #endif /*BSP_USING_DAC2*/
58 
59 #endif /*__DRV__DAC_H__*/
60