PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
mft_adcmp.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2013 Spansion LLC. All Rights Reserved.
3 *
4 * This software is owned and published by:
5 * Spansion LLC, 915 DeGuigne Dr. Sunnyvale, CA 94088-3453 ("Spansion").
6 *
7 * BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
8 * BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
9 *
10 * This software contains source code for use with Spansion
11 * components. This software is licensed by Spansion to be adapted only
12 * for use in systems utilizing Spansion components. Spansion shall not be
13 * responsible for misuse or illegal use of this software for devices not
14 * supported herein. Spansion is providing this software "AS IS" and will
15 * not be responsible for issues arising from incorrect user implementation
16 * of the software.
17 *
18 * SPANSION MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
19 * REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
20 * ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
21 * WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
22 * WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
23 * WARRANTY OF NONINFRINGEMENT.
24 * SPANSION SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
25 * NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
26 * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
27 * LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
28 * INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
30 * SAVINGS OR PROFITS,
31 * EVEN IF SPANSION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 * YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
33 * INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
34 * FROM, THE SOFTWARE.
35 *
36 * This software may be replicated in part or whole for the licensed use,
37 * with the restriction that this Disclaimer and Copyright notice must be
38 * included with each copy of this software, whether used in part or whole,
39 * at all times.
40 */
41 /******************************************************************************/
52 #ifndef __MFT_ADCMP_H__
53 #define __MFT_ADCMP_H__
54 
55 /******************************************************************************/
56 /* Include files */
57 /******************************************************************************/
58 #include "pdl.h"
59 
60 #if (defined(PDL_PERIPHERAL_MFT_ADCMP_ACTIVE))
61 
123 /******************************************************************************/
124 /* Global pre-processor symbols/macros ('#define') */
125 /******************************************************************************/
126 
127 #define MFT_ADCMP_CH0 0
128 #define MFT_ADCMP_CH1 1
129 #define MFT_ADCMP_CH2 2
130 #define MFT_ADCMP_CH3 3
131 #define MFT_ADCMP_CH4 4
132 #define MFT_ADCMP_CH5 5
133 
134 #define MFT_ADCMP_CH10 0
135 #define MFT_ADCMP_CH32 1
136 #define MFT_ADCMP_CH54 2
137 
138 #define MFT_ADCMP_CH_MAX 5
139 #define MFT_ADCMP_CPCH_MAX 2
140 /******************************************************************************
141  * Global type definitions
142  ******************************************************************************/
143 #define stc_mftn_adcmp_t FM4_MFT_ADCMP_TypeDef
144 
145 #define MFT0_ADCMP (*(volatile stc_mftn_adcmp_t *) FM4_MFT0_ADCMP_BASE)
146 #define MFT1_ADCMP (*(volatile stc_mftn_adcmp_t *) FM4_MFT1_ADCMP_BASE)
147 #define MFT2_ADCMP (*(volatile stc_mftn_adcmp_t *) FM4_MFT2_ADCMP_BASE)
148 
153 typedef enum en_adcmp_frt
154 {
160 
162 
167 typedef enum en_adcmp_fm3_frt
168 {
171 
173 
178 typedef enum en_adcmp_buf
179 {
184 
186 
192 {
201 
207 typedef enum en_adcmp_trig_sel
208 {
215 
221 typedef enum en_adcmp_mode
222 {
225 
231 typedef enum en_adcmp_occp_sel
232 {
235 
241 typedef struct stc_mft_adcmp_config
242 {
248 
254 typedef struct stc_mft_adcmp_func
255 {
260 
266 typedef enum en_adcmp_fm3_mode
267 {
272 
279 {
284 
290 /* C binding of definitions if building with C++ compiler */
291 #ifdef __cplusplus
292 extern "C"
293 {
294 #endif
295 
296 /* 1. FM4 */
297 /* Init */
298 en_result_t Mft_Adcmp_Init (volatile stc_mftn_adcmp_t *pstcMftAdcmp,
299  uint8_t u8Ch,
300  stc_mft_adcmp_config_t *pstcConfig);
301 /* Func enable/disable */
303  uint8_t u8Ch,
304  stc_mft_adcmp_func_t* pstcFunc);
306  uint8_t u8Ch,
307  stc_mft_adcmp_func_t* pstcFunc);
308 /* Count write/read */
309 en_result_t Mft_Adcmp_WriteAcmp(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8Ch,
310  uint16_t u16AcmpVal);
311 uint16_t Mft_Adcmp_ReadAcmp(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8Ch);
312 
313 /* 2. FM3 compatible */
314 /* Init */
315 en_result_t Mft_Adcmp_Fm3_Init(volatile stc_mftn_adcmp_t *pstcMftAdcmp,
316  uint8_t u8CoupleCh,
317  stc_mft_adcmp_fm3_config_t *pstcConfig);
318 /* Mode configuration */
319 en_result_t Mft_Adcmp_Fm3_EnableOperation(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8CoupleCh);
320 en_result_t Mft_Adcmp_Fm3_DisableOperation(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8CoupleCh);
321 /* Count write/read */
322 en_result_t Mft_Adcmp_Fm3_WriteAccp(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8CoupleCh, uint16_t u16AccpVal);
323 uint16_t Mft_Adcmp_Fm3_ReadAccp(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8CoupleCh);
324 en_result_t Mft_Adcmp_Fm3_WriteAccpdn(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8CoupleCh, uint16_t u16AccpdnVal);
325 uint16_t Mft_Adcmp_Fm3_ReadAccpdn(volatile stc_mftn_adcmp_t *pstcMftAdcmp, uint8_t u8CoupleCh);
326 #ifdef __cplusplus
327 }
328 #endif
329 
331 
332 #endif
333 
334 #endif
335 
336 
337 
338 
339 /******************************************************************************/
340 /* EOF (not truncated) */
341 /******************************************************************************/