iLLD_TC27xC  1.0
IfxIom.h
Go to the documentation of this file.
1 /**
2  * \file IfxIom.h
3  * \brief IOM basic functionality
4  * \ingroup IfxLld_Iom
5  *
6  * \version iLLD_0_1_0_10
7  * \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
8  *
9  *
10  * IMPORTANT NOTICE
11  *
12  *
13  * Infineon Technologies AG (Infineon) is supplying this file for use
14  * exclusively with Infineon's microcontroller products. This file can be freely
15  * distributed within development tools that are supporting such microcontroller
16  * products.
17  *
18  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21  * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
22  * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
23  *
24  *
25  * \defgroup IfxLld_Iom IOM
26  * \ingroup IfxLld
27  * \defgroup IfxLld_Iom_Std Standard Driver
28  * \ingroup IfxLld_Iom
29  * \defgroup IfxLld_Iom_Std_Enumerations Enumerations
30  * \ingroup IfxLld_Iom_Std
31  * \defgroup IfxLld_Iom_Std_Module Module Functions
32  * \ingroup IfxLld_Iom_Std
33  */
34 
35 #ifndef IFXIOM_H
36 #define IFXIOM_H 1
37 
38 /******************************************************************************/
39 /*----------------------------------Includes----------------------------------*/
40 /******************************************************************************/
41 
42 #include "_Impl/IfxIom_cfg.h"
43 
44 /******************************************************************************/
45 /*--------------------------------Enumerations--------------------------------*/
46 /******************************************************************************/
47 
48 /** \addtogroup IfxLld_Iom_Std_Enumerations
49  * \{ */
50 /** \brief Specifies the edge type which need to be cleared.
51  */
52 typedef enum
53 {
54  IfxIom_EdgeClearType_rising = 0, /**< \brief Specifies rising edge to be cleared. */
55  IfxIom_EdgeClearType_falling = 1, /**< \brief Specifies falling edge to be cleared. */
56  IfxIom_EdgeClearType_risingFalling = 2 /**< \brief Specifies both rising falling edge to be cleared. */
58 
59 /** \brief LAMCFG[lamId].EDS, Specifies which active edges of the monitor and reference signals are used for the event window generation.
60  */
61 typedef enum
62 {
63  IfxIom_EventActiveEdgeSelection_neitherGateNeitherClear = 0, /**< \brief neither edge used to gate event generation and neither edge used to clear event windowcounter. */
64  IfxIom_EventActiveEdgeSelection_neitherGatePositiveClear = 1, /**< \brief neither edge used to gate event generation and positive edge used to clear event windowcounter. */
65  IfxIom_EventActiveEdgeSelection_neitherGateNegativeClear = 2, /**< \brief neither edge used to gate event generation and negative edge used to clear event windowcounter. */
66  IfxIom_EventActiveEdgeSelection_neitherGateEitherClear = 3, /**< \brief neither edge used to gate event generation and either edge used to clear event windowcounter. */
67  IfxIom_EventActiveEdgeSelection_positiveGateNeitherClear = 4, /**< \brief positive edge used to gate event generation and neither edge used to clear event windowcounter. */
68  IfxIom_EventActiveEdgeSelection_positiveGatePositiveClear = 5, /**< \brief positive edge used to gate event generation and positive edge used to clear event windowcounter. */
69  IfxIom_EventActiveEdgeSelection_positiveGateNegativeClear = 6, /**< \brief positive edge used to gate event generation and negative edge used to clear event windowcounter. */
70  IfxIom_EventActiveEdgeSelection_positiveGateEitherClear = 7, /**< \brief positive edge used to gate event generation and negative edge used to clear event windowcounter. */
71  IfxIom_EventActiveEdgeSelection_negativeGateNeitherClear = 8, /**< \brief negative edge used to gate event generation and neither edge used to clear event windowcounter. */
72  IfxIom_EventActiveEdgeSelection_negativeGatePositiveClear = 9, /**< \brief negative edge used to gate event generation and positive edge used to clear event windowcounter. */
73  IfxIom_EventActiveEdgeSelection_negativeGateNegativeClear = 10, /**< \brief negative edge used to gate event generation and negative edge used to clear event windowcounter. */
74  IfxIom_EventActiveEdgeSelection_negativeGateEitherClear = 11, /**< \brief negative edge used to gate event generation and either edge used to clear event windowcounter. */
75  IfxIom_EventActiveEdgeSelection_eitherGateNeitherClear = 12, /**< \brief either edge used to gate event generation and neither edge used to clear event windowcounter. */
76  IfxIom_EventActiveEdgeSelection_eitherGatePositiveClear = 13, /**< \brief either edge used to gate event generation and positive edge used to clear event windowcounter. */
77  IfxIom_EventActiveEdgeSelection_eitherGateNegativeClear = 14, /**< \brief either edge used to gate event generation and negative edge used to clear event windowcounter. */
78  IfxIom_EventActiveEdgeSelection_eitherGateEitherClear = 15 /**< \brief either edge used to gate event generation and either edge used to clear event windowcounter. */
80 
81 /** \brief ECMCCFG.SELCx(x= 0,1,2,3), Specifies which channel event output is to be routed to counterCn.
82  */
83 typedef enum
84 {
85  IfxIom_EventCounterChannel_0 = 0, /**< \brief channel 0 event output to be routed to event counter */
86  IfxIom_EventCounterChannel_1, /**< \brief channel 1 event output to be routed to event counter */
87  IfxIom_EventCounterChannel_2, /**< \brief channel 2 event output to be routed to event counter */
88  IfxIom_EventCounterChannel_3, /**< \brief channel 3 event output to be routed to event counter */
89  IfxIom_EventCounterChannel_4, /**< \brief channel 4 event output to be routed to event counter */
90  IfxIom_EventCounterChannel_5, /**< \brief channel 5 event output to be routed to event counter */
91  IfxIom_EventCounterChannel_6, /**< \brief channel 6 event output to be routed to event counter */
92  IfxIom_EventCounterChannel_7, /**< \brief channel 7 event output to be routed to event counter */
93  IfxIom_EventCounterChannel_8, /**< \brief channel 8 event output to be routed to event counter */
94  IfxIom_EventCounterChannel_9, /**< \brief channel 9 event output to be routed to event counter */
95  IfxIom_EventCounterChannel_10, /**< \brief channel 10 event output to be routed to event counter */
96  IfxIom_EventCounterChannel_11, /**< \brief channel 11 event output to be routed to event counter */
97  IfxIom_EventCounterChannel_12, /**< \brief channel 12 event output to be routed to event counter */
98  IfxIom_EventCounterChannel_13, /**< \brief channel 13 event output to be routed to event counter */
99  IfxIom_EventCounterChannel_14, /**< \brief channel 14 event output to be routed to event counter */
100  IfxIom_EventCounterChannel_15, /**< \brief channel 15 event output to be routed to event counter */
102 
103 /** \brief ECMCCFG.THRCx(x= 0,1,2,3), Specifies the threshold count value. Upon the counter meeting the threshold, the counter event output becomes active high
104  */
105 typedef enum
106 {
107  IfxIom_EventCounterThreshold_disable = 0, /**< \brief Specifies counter event output set to
108  * inactive */
109  IfxIom_EventCounterThreshold_1 = 1, /**< \brief Specifies threshold count value 1 */
110  IfxIom_EventCounterThreshold_2, /**< \brief Specifies threshold count value 2 */
111  IfxIom_EventCounterThreshold_3, /**< \brief Specifies threshold count value 3 */
112  IfxIom_EventCounterThreshold_4, /**< \brief Specifies threshold count value 4 */
113  IfxIom_EventCounterThreshold_5, /**< \brief Specifies threshold count value 5 */
114  IfxIom_EventCounterThreshold_6, /**< \brief Specifies threshold count value 6 */
115  IfxIom_EventCounterThreshold_7, /**< \brief Specifies threshold count value 7 */
116  IfxIom_EventCounterThreshold_8, /**< \brief Specifies threshold count value 8 */
117  IfxIom_EventCounterThreshold_9, /**< \brief Specifies threshold count value 9 */
118  IfxIom_EventCounterThreshold_10, /**< \brief Specifies threshold count value 10 */
119  IfxIom_EventCounterThreshold_11, /**< \brief Specifies threshold count value 11 */
120  IfxIom_EventCounterThreshold_12, /**< \brief Specifies threshold count value 12 */
121  IfxIom_EventCounterThreshold_13, /**< \brief Specifies threshold count value 13 */
122  IfxIom_EventCounterThreshold_14, /**< \brief Specifies threshold count value 14 */
123  IfxIom_EventCounterThreshold_15, /**< \brief Specifies threshold count value 15 */
125 
126 /** \brief LAMCFG[lamId].EWS, Specifies whether the event window generation is from the monitor or reference signal.
127  */
128 typedef enum
129 {
130  IfxIom_EventSource_reference = 0, /**< \brief Specifies the event window generation is from the reference signal. */
131  IfxIom_EventSource_monitor = 1 /**< \brief Specifies the event window generation is from the monitor signal. */
133 
134 /** \brief FPCCTR[channelId].MOD, Specifies the Filter & Prescaler Cell mode
135  */
136 typedef enum
137 {
138  IfxIom_FilterMode_delayedDebounce = 0, /**< \brief Specifies Delayed Debounce filter mode */
139  IfxIom_FilterMode_immediateDebounce = 1, /**< \brief Specifies Immediate Debounce filter mode */
140  IfxIom_FilterMode_risingEdgeImmediateDebounce = 2, /**< \brief Specifies Rising Edge Immediate Debounce filter mode */
141  IfxIom_FilterMode_fallingEdgeImmediateDebounce = 3, /**< \brief Specifies Falling Edge Immediate Debounce filter mode */
142  IfxIom_FilterMode_risingEdgeDelayedFallingEdgeImmediateDebounce = 4, /**< \brief Specifies RisingEdge Delayed FallingEdge Immediate Debounce filter mode */
143  IfxIom_FilterMode_fallingEdgeDelayedRisingEdgeImmediateDebounce = 5, /**< \brief Specifies FallingEdge Delayed RisingEdge Immediate Debounce filter mode */
144  IfxIom_FilterMode_risingEdgePrescaler = 6, /**< \brief Specifies RisingEdge Prescaler filter mode */
145  IfxIom_FilterMode_FallingEdgePrescaler = 7 /**< \brief Specifies FallingEdge Prescaler filter mode */
147 
148 /** \brief Specifies the number of Filter & Prescaler Cell channel Id
149  */
150 typedef enum
151 {
152  IfxIom_FpcChannelId_0 = 0, /**< \brief Specifies the FPC channel 0 */
153  IfxIom_FpcChannelId_1, /**< \brief Specifies the FPC channel 1 */
154  IfxIom_FpcChannelId_2, /**< \brief Specifies the FPC channel 2 */
155  IfxIom_FpcChannelId_3, /**< \brief Specifies the FPC channel 3 */
156  IfxIom_FpcChannelId_4, /**< \brief Specifies the FPC channel 4 */
157  IfxIom_FpcChannelId_5, /**< \brief Specifies the FPC channel 5 */
158  IfxIom_FpcChannelId_6, /**< \brief Specifies the FPC channel 6 */
159  IfxIom_FpcChannelId_7, /**< \brief Specifies the FPC channel 7 */
160  IfxIom_FpcChannelId_8, /**< \brief Specifies the FPC channel 8 */
161  IfxIom_FpcChannelId_9, /**< \brief Specifies the FPC channel 9 */
162  IfxIom_FpcChannelId_10, /**< \brief Specifies the FPC channel 10 */
163  IfxIom_FpcChannelId_11, /**< \brief Specifies the FPC channel 11 */
164  IfxIom_FpcChannelId_12, /**< \brief Specifies the FPC channel 12 */
165  IfxIom_FpcChannelId_13, /**< \brief Specifies the FPC channel 13 */
166  IfxIom_FpcChannelId_14, /**< \brief Specifies the FPC channel 14 */
167  IfxIom_FpcChannelId_15, /**< \brief Specifies the FPC channel 15 */
169 
170 /** \brief LAMCFG[lamId].MCS, Specifies which FPC/mux block monitor output signal is to be used for LAM block
171  */
172 typedef enum
173 {
174  IfxIom_LamMonitorInputChannel_0 = 0, /**< \brief Specifies 0 FPC/mux block monitor output signal is to be used for LAM block */
175  IfxIom_LamMonitorInputChannel_1, /**< \brief Specifies 1 FPC/mux block monitor output signal is to be used for LAM block */
176  IfxIom_LamMonitorInputChannel_2, /**< \brief Specifies 2 FPC/mux block monitor output signal is to be used for LAM block */
177  IfxIom_LamMonitorInputChannel_3, /**< \brief Specifies 3 FPC/mux block monitor output signal is to be used for LAM block */
178  IfxIom_LamMonitorInputChannel_4, /**< \brief Specifies 4 FPC/mux block monitor output signal is to be used for LAM block */
179  IfxIom_LamMonitorInputChannel_5, /**< \brief Specifies 5 FPC/mux block monitor output signal is to be used for LAM block */
180  IfxIom_LamMonitorInputChannel_6, /**< \brief Specifies 6 FPC/mux block monitor output signal is to be used for LAM block */
181  IfxIom_LamMonitorInputChannel_7, /**< \brief Specifies 7 FPC/mux block monitor output signal is to be used for LAM block */
182  IfxIom_LamMonitorInputChannel_8, /**< \brief Specifies 8 FPC/mux block monitor output signal is to be used for LAM block */
183  IfxIom_LamMonitorInputChannel_9, /**< \brief Specifies 9 FPC/mux block monitor output signal is to be used for LAM block */
184  IfxIom_LamMonitorInputChannel_10, /**< \brief Specifies 10 FPC/mux block monitor output signal is to be used for LAM block */
185  IfxIom_LamMonitorInputChannel_11, /**< \brief Specifies 11 FPC/mux block monitor output signal is to be used for LAM block */
186  IfxIom_LamMonitorInputChannel_12, /**< \brief Specifies 12 FPC/mux block monitor output signal is to be used for LAM block */
187  IfxIom_LamMonitorInputChannel_13, /**< \brief Specifies 13 FPC/mux block monitor output signal is to be used for LAM block */
188  IfxIom_LamMonitorInputChannel_14, /**< \brief Specifies 14 FPC/mux block monitor output signal is to be used for LAM block */
189  IfxIom_LamMonitorInputChannel_15, /**< \brief Specifies 15 FPC/mux block monitor output signal is to be used for LAM block */
191 
192 /** \brief LAMCFG[lamId].MOS, Specifies whether the monitor signal from the FPC monitor channel is sourced directly or compared with the reference signal from the FPC reference channel for the event compare.
193  */
194 typedef enum
195 {
196  IfxIom_LamMonitorSource_directFpcMonitor = 0, /**< \brief Monitor signal is sourced directly from FPC monitor channel. */
197  IfxIom_LamMonitorSource_exoredFpcMonitor = 1 /**< \brief Monitor signal is EXORed with FPC reference channel. */
199 
200 /** \brief LAMCFG[lamId].RCS, Specifies which FPC/mux block reference output signal is to be used for LAM block
201  */
202 typedef enum
203 {
204  IfxIom_LamReferenceInputChannel_0 = 0, /**< \brief Specifies 0 FPC/mux block reference output signal is to be used for LAM block */
205  IfxIom_LamReferenceInputChannel_1, /**< \brief Specifies 1 FPC/mux block reference output signal is to be used for LAM block */
206  IfxIom_LamReferenceInputChannel_2, /**< \brief Specifies 2 FPC/mux block reference output signal is to be used for LAM block */
207  IfxIom_LamReferenceInputChannel_3, /**< \brief Specifies 3 FPC/mux block reference output signal is to be used for LAM block */
208  IfxIom_LamReferenceInputChannel_4, /**< \brief Specifies 4 FPC/mux block reference output signal is to be used for LAM block */
209  IfxIom_LamReferenceInputChannel_5, /**< \brief Specifies 5 FPC/mux block reference output signal is to be used for LAM block */
210  IfxIom_LamReferenceInputChannel_6, /**< \brief Specifies 6 FPC/mux block reference output signal is to be used for LAM block */
211  IfxIom_LamReferenceInputChannel_7, /**< \brief Specifies 7 FPC/mux block reference output signal is to be used for LAM block */
212  IfxIom_LamReferenceInputChannel_8, /**< \brief Specifies 8 FPC/mux block reference output signal is to be used for LAM block */
213  IfxIom_LamReferenceInputChannel_9, /**< \brief Specifies 9 FPC/mux block reference output signal is to be used for LAM block */
214  IfxIom_LamReferenceInputChannel_10, /**< \brief Specifies 10 FPC/mux block reference output signal is to be used for LAM block */
215  IfxIom_LamReferenceInputChannel_11, /**< \brief Specifies 11 FPC/mux block reference output signal is to be used for LAM block */
216  IfxIom_LamReferenceInputChannel_12, /**< \brief Specifies 12 FPC/mux block reference output signal is to be used for LAM block */
217  IfxIom_LamReferenceInputChannel_13, /**< \brief Specifies 13 FPC/mux block reference output signal is to be used for LAM block */
218  IfxIom_LamReferenceInputChannel_14, /**< \brief Specifies 14 FPC/mux block reference output signal is to be used for LAM block */
219  IfxIom_LamReferenceInputChannel_15, /**< \brief Specifies 15 FPC/mux block reference output signal is to be used for LAM block */
221 
222 /** \brief LAMCFG[lamId].RMS, Specifies whether the event window generation is free-running or gated with the monitor or reference.
223  */
224 typedef enum
225 {
226  IfxIom_LamRunMode_freeRunning = 0, /**< \brief Specifies event window generation is free-running. */
227  IfxIom_LamRunMode_gated = 1 /**< \brief Specifies event window generation is gated with the monitor or
228  * reference signal. */
230 
231 /** \brief FPCCTR[channelId].ISM, Specifies the monitor signal input for Filter & Prescaler cell
232  */
233 typedef enum
234 {
235  IfxIom_MonitorSignal_portLogic = 0, /**< \brief Specifies the specific pad pins as monitor signal */
236  IfxIom_MonitorSignal_0 = 1, /**< \brief Specifies the monitor signal 0 */
237  IfxIom_MonitorSignal_1, /**< \brief Specifies the monitor signal 1 */
238  IfxIom_MonitorSignal_2, /**< \brief Specifies the monitor signal 2 */
240 
241 /** \brief FPCCTR[channelId].ISR,Specifies the reference signal input for Filter & Prescaler cell
242  */
243 typedef enum
244 {
245  IfxIom_ReferenceSignal_portLogic = 0, /**< \brief Specifies the specific pad pins as reference signal */
246  IfxIom_ReferenceSignal_0 = 1, /**< \brief Specifies the reference signal 0 */
247  IfxIom_ReferenceSignal_1, /**< \brief Specifies the reference signal 1 */
248  IfxIom_ReferenceSignal_2, /**< \brief Specifies the reference signal 2 */
249  IfxIom_ReferenceSignal_gtmEXORCombiner = 4 /**< \brief Specifies the GTM EXOR Combiner pins */
251 
252 /** \} */
253 
254 /** \brief Specifies the Logic Module Analyser Module Number
255  */
256 typedef enum
257 {
258  IfxIom_LamId_0 = 0, /**< \brief Specifies the LAM Id 0 */
259  IfxIom_LamId_1, /**< \brief Specifies the LAM Id 1 */
260  IfxIom_LamId_2, /**< \brief Specifies the LAM Id 2 */
261  IfxIom_LamId_3, /**< \brief Specifies the LAM Id 3 */
262  IfxIom_LamId_4, /**< \brief Specifies the LAM Id 4 */
263  IfxIom_LamId_5, /**< \brief Specifies the LAM Id 5 */
264  IfxIom_LamId_6, /**< \brief Specifies the LAM Id 6 */
265  IfxIom_LamId_7, /**< \brief Specifies the LAM Id 7 */
266  IfxIom_LamId_8, /**< \brief Specifies the LAM Id 8 */
267  IfxIom_LamId_9, /**< \brief Specifies the LAM Id 9 */
268  IfxIom_LamId_10, /**< \brief Specifies the LAM Id 10 */
269  IfxIom_LamId_11, /**< \brief Specifies the LAM Id 11 */
270  IfxIom_LamId_12, /**< \brief Specifies the LAM Id 12 */
271  IfxIom_LamId_13, /**< \brief Specifies the LAM Id 13 */
272  IfxIom_LamId_14, /**< \brief Specifies the LAM Id 14 */
273  IfxIom_LamId_15, /**< \brief Specifies the LAM Id 15 */
274 } IfxIom_LamId;
275 
276 /** \addtogroup IfxLld_Iom_Std_Module
277  * \{ */
278 
279 /******************************************************************************/
280 /*-------------------------Inline Function Prototypes-------------------------*/
281 /******************************************************************************/
282 
283 /** \brief Enable the IOM module control
284  * \param iom pointer to IOM module registers
285  * \return None
286  */
287 IFX_INLINE void IfxIom_enableModule(Ifx_IOM *iom);
288 
289 /******************************************************************************/
290 /*-------------------------Global Function Prototypes-------------------------*/
291 /******************************************************************************/
292 
293 /** \brief Reset the IOM module
294  * \param iom pointer to IOM module registers
295  * \return None
296  */
297 IFX_EXTERN void IfxIom_resetModule(Ifx_IOM *iom);
298 
299 /** \} */
300 
301 /******************************************************************************/
302 /*---------------------Inline Function Implementations------------------------*/
303 /******************************************************************************/
304 
305 IFX_INLINE void IfxIom_enableModule(Ifx_IOM *iom)
306 {
307  iom->CLC.B.DISR = 0;
308 }
309 
310 
311 #endif /* IFXIOM_H */