Skip to content

Commit 1d2212d

Browse files
author
Cruz Monrreal
authored
Merge pull request #9224 from ThunderSoft123/master
Add platform TT_M4G9
2 parents 5f38878 + 1a19046 commit 1d2212d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+40394
-0
lines changed

targets/TARGET_TT/TARGET_TT_M4G9/Periph_Driver/inc/adc.h

Lines changed: 499 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/**
2+
*******************************************************************************
3+
* @file adc_ch.h
4+
* @brief This file provides all the functions prototypes for ADC driver. \n
5+
* Channel Class.
6+
* @version V1.0.0.0
7+
* $Date:: 2017-09-07 13:52:12 #$
8+
*
9+
* SPDX-License-Identifier: Apache-2.0
10+
*
11+
* (C)Copyright TOSHIBA MICROELECTRONICS CORPORATION 2017 All rights reserved
12+
*******************************************************************************
13+
*/
14+
/*------------------------------------------------------------------------------*/
15+
/* Define to prevent recursive inclusion */
16+
/*------------------------------------------------------------------------------*/
17+
#ifndef __ADC_CH_H
18+
#define __ADC_CH_H
19+
20+
#ifdef __cplusplus
21+
extern "C" {
22+
#endif
23+
24+
/*------------------------------------------------------------------------------*/
25+
/* Includes */
26+
/*------------------------------------------------------------------------------*/
27+
#include "txz_driver_def.h"
28+
29+
/**
30+
* @addtogroup Periph_Driver Peripheral Driver
31+
* @{
32+
*/
33+
34+
/**
35+
* @defgroup ADC ADC
36+
* @brief ADC Driver.
37+
* @{
38+
*/
39+
/*------------------------------------------------------------------------------*/
40+
/* Macro Definition */
41+
/*------------------------------------------------------------------------------*/
42+
/**
43+
* @defgroup ADC_Exported_define ADC Exported Define
44+
* @{
45+
*/
46+
47+
/* no define */
48+
49+
/**
50+
* @}
51+
*/ /* End of group ADC_Exported_define */
52+
53+
/*------------------------------------------------------------------------------*/
54+
/* Enumerated Type Definition */
55+
/*------------------------------------------------------------------------------*/
56+
/**
57+
* @defgroup ADC_Exported_define ADC Exported Define
58+
* @{
59+
*/
60+
61+
/* no define */
62+
63+
/**
64+
* @}
65+
*/ /* End of group ADC_Exported_define */
66+
67+
/*------------------------------------------------------------------------------*/
68+
/* Structure Definition */
69+
/*------------------------------------------------------------------------------*/
70+
/**
71+
* @defgroup ADC_Exported_typedef ADC Exported Typedef
72+
* @{
73+
*/
74+
75+
/*----------------------------------*/
76+
/*! @struct adc_ch_initial_setting_t
77+
* @brief Initialize Setting.
78+
*/
79+
/*----------------------------------*/
80+
typedef struct
81+
{
82+
uint32_t interrupt; /*!< Interrupt Enable/Disable.
83+
: Use @ref adc_dma_int_t. */
84+
uint32_t type; /*!< Conversion Type.
85+
: Use @ref adc_conversion_t. */
86+
uint32_t ain; /*!< AIN. */
87+
} adc_ch_initial_setting_t;
88+
89+
/*----------------------------------*/
90+
/*! @struct adc_ch_t
91+
* @brief ADC handle structure definenition.
92+
*/
93+
/*----------------------------------*/
94+
typedef struct
95+
{
96+
__IO uint32_t *p_tset; /*!< ADxTSETn Address. */
97+
__I uint32_t *p_reg; /*!< ADxREGx Address. */
98+
adc_ch_initial_setting_t init; /*!< Initial setting. */
99+
} adc_ch_t;
100+
101+
/**
102+
* @}
103+
*/ /* End of group ADC_Exported_typedef */
104+
105+
/*------------------------------------------------------------------------------*/
106+
/* Functions */
107+
/*------------------------------------------------------------------------------*/
108+
/**
109+
* @defgroup ADC_Exported_functions ADC Exported Functions
110+
* @{
111+
*/
112+
uint32_t get_conversion_data(uint32_t reg);
113+
TXZ_Result adc_ch_init(adc_ch_t *p_obj);
114+
TXZ_Result adc_ch_deinit(adc_ch_t *p_obj);
115+
TXZ_Result adc_ch_int_enable(adc_ch_t *p_obj);
116+
TXZ_Result adc_ch_int_disable(adc_ch_t *p_obj);
117+
TXZ_Result adc_ch_get_value(adc_ch_t *p_obj, uint32_t *p_value);
118+
/**
119+
* @}
120+
*/ /* End of group ADC_Exported_functions */
121+
122+
/**
123+
* @}
124+
*/ /* End of group ADC */
125+
126+
/**
127+
* @}
128+
*/ /* End of group Periph_Driver */
129+
130+
#ifdef __cplusplus
131+
}
132+
#endif /* __cplusplus */
133+
#endif /* __ADC_CH_H */
134+
135+

0 commit comments

Comments
 (0)