PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
Main Page
Modules
Data Structures
Files
File List
Globals
mft_icu.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
/******************************************************************************/
53
#ifndef __MFT_ICU_H__
54
#define __MFT_ICU_H__
55
56
#include "
pdl.h
"
57
58
#if (defined(PDL_PERIPHERAL_MFT_ICU_ACTIVE))
59
111
/******************************************************************************
112
* Global type definitions
113
******************************************************************************/
114
#define stc_mftn_icu_t FM4_MFT_ICU_TypeDef
115
#define MFT0_ICU (*((volatile stc_mftn_icu_t *) FM4_MFT0_ICU_BASE))
116
#define MFT1_ICU (*((volatile stc_mftn_icu_t *) FM4_MFT1_ICU_BASE))
117
#define MFT2_ICU (*((volatile stc_mftn_icu_t *) FM4_MFT2_ICU_BASE))
118
119
#define MFT_ICU_CH0 0u
120
#define MFT_ICU_CH1 1u
121
#define MFT_ICU_CH2 2u
122
#define MFT_ICU_CH3 3u
123
124
#define MFT_ICU_CHx_MAX 3u
125
126
#define MFT_ICU_INSTANCE_COUNT \
127
(uint8_t)(PDL_PERIPHERAL_ENABLE_MFT0_ICU == PDL_ON) + \
128
(uint8_t)(PDL_PERIPHERAL_ENABLE_MFT1_ICU == PDL_ON) + \
129
(uint8_t)(PDL_PERIPHERAL_ENABLE_MFT2_ICU == PDL_ON)
130
135
typedef
enum
en_icu_instance_index
136
{
137
IcuInstanceIndexIcu0
= 0u,
138
IcuInstanceIndexIcu1
= 1u,
139
IcuInstanceIndexIcu2
= 2u,
140
141
}
en_icu_instance_index_t
;
142
149
typedef
enum
en_mft_icu_frt
150
{
151
Frt0ToIcu
= 0u,
152
Frt1ToIcu
= 1u,
153
Frt2ToIcu
= 2u,
154
IcuFrtToExt0
= 3u,
155
IcuFrtToExt1
= 4u,
156
157
}
en_mft_icu_frt_t
;
164
typedef
enum
en_mft_icu_mode
165
{
166
IcuDisable
= 0u,
167
IcuRisingDetect
= 1u,
168
IcuFallingDetect
= 2u,
169
IcuBothDetect
= 3u,
170
171
}
en_mft_icu_mode_t
;
178
typedef
enum
en_icu_edge
179
{
180
IcuFallingEdge
= 0u,
181
IcuRisingEdge
= 1u,
182
183
}
en_mft_icu_edge_t
;
188
typedef
struct
stc_mft_icu_config
189
{
190
en_mft_icu_frt_t
enFrt
;
191
en_mft_icu_mode_t
enMode
;
192
en_mft_icu_edge_t
enEdge
;
193
194
}
stc_mft_icu_config_t
;
200
typedef
struct
stc_mft_icu_intern_data
201
{
202
func_ptr_t
pfnIcu0Callback
;
203
func_ptr_t
pfnIcu1Callback
;
204
func_ptr_t
pfnIcu2Callback
;
205
func_ptr_t
pfnIcu3Callback
;
206
207
}
stc_mft_icu_intern_data_t
;
212
typedef
struct
stc_mft_icu_instance_data
213
{
214
volatile
stc_mftn_icu_t
*
pstcInstance
;
215
stc_mft_icu_intern_data_t
stcInternData
;
216
217
}
stc_mft_icu_instance_data_t
;
218
/******************************************************************************/
219
/* Global variable definitions ('extern') */
220
/******************************************************************************/
221
223
extern
stc_mft_icu_instance_data_t
m_astcMftIcuInstanceDataLut
[
MFT_ICU_INSTANCE_COUNT
];
224
226
#ifdef __cplusplus
227
extern
"C"
228
{
229
#endif
230
231
en_result_t
Mft_Icu_SelFrt
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch,
en_mft_icu_frt_t
enFrt);
233
en_result_t
Mft_Icu_ConfigDetectMode
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch,
en_mft_icu_mode_t
enMode);
235
#if (PDL_INTERRUPT_ENABLE_MFT0_ICU == PDL_ON) || \
236
(PDL_INTERRUPT_ENABLE_MFT1_ICU == PDL_ON) || \
237
(PDL_INTERRUPT_ENABLE_MFT2_ICU == PDL_ON)
238
en_result_t
Mft_Icu_EnableInt
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch,
func_ptr_t
pfnCallback);
239
en_result_t
Mft_Icu_DisableInt
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch);
240
#endif
241
en_int_flag_t
Mft_Icu_GetIntFlag
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch);
242
en_result_t
Mft_Icu_ClrIntFlag
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch);
244
en_mft_icu_edge_t
Mft_Icu_GetLastEdge
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch);
246
uint16_t
Mft_Icu_GetCaptureData
(
volatile
stc_mftn_icu_t
*pstcMft, uint8_t u8Ch);
248
void
Mft_Icu_IrqHandler
(
volatile
stc_mftn_icu_t
*pstcMft,
stc_mft_icu_intern_data_t
* pstcMftIcuInternData) ;
249
250
#ifdef __cplusplus
251
}
252
#endif
253
255
256
#endif
257
258
#endif
PDL_1_2
library
driver
mft
mft_icu.h
Generated on Wed May 28 2014 09:28:11 for PDL for FM4 by
1.8.3.1