iLLD_TC29x  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_1_0_0_11_0
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_Std_Enumerations Enumerations
26  * \ingroup IfxLld_Iom_Std
27  * \defgroup IfxLld_Iom_Std_Module Module Functions
28  * \ingroup IfxLld_Iom_Std
29  */
30 
31 #ifndef IFXIOM_H
32 #define IFXIOM_H 1
33 
34 /******************************************************************************/
35 /*----------------------------------Includes----------------------------------*/
36 /******************************************************************************/
37 
38 #include "_Impl/IfxIom_cfg.h"
39 #include "IfxIom_reg.h"
40 #include "Scu/Std/IfxScuWdt.h"
42 
43 /******************************************************************************/
44 /*--------------------------------Enumerations--------------------------------*/
45 /******************************************************************************/
46 
47 /** \addtogroup IfxLld_Iom_Std_Enumerations
48  * \{ */
49 /** \brief Specifies the edge type which need to be cleared.
50  */
51 typedef enum
52 {
53  IfxIom_EdgeClearType_rising = 0, /**< \brief Specifies rising edge to be cleared. */
54  IfxIom_EdgeClearType_falling = 1, /**< \brief Specifies falling edge to be cleared. */
55  IfxIom_EdgeClearType_risingFalling = 2 /**< \brief Specifies both rising falling edge to be cleared. */
57 
58 /** \brief LAMCFG[lamId].EDS, Specifies which active edges of the monitor and reference signals are used for the event window generation.
59  */
60 typedef enum
61 {
62  IfxIom_EventActiveEdgeSelection_neitherGateNeitherClear = 0, /**< \brief neither edge used to gate event generation and neither edge used to clear event windowcounter. */
63  IfxIom_EventActiveEdgeSelection_neitherGatePositiveClear = 1, /**< \brief neither edge used to gate event generation and positive edge used to clear event windowcounter. */
64  IfxIom_EventActiveEdgeSelection_neitherGateNegativeClear = 2, /**< \brief neither edge used to gate event generation and negative edge used to clear event windowcounter. */
65  IfxIom_EventActiveEdgeSelection_neitherGateEitherClear = 3, /**< \brief neither edge used to gate event generation and either edge used to clear event windowcounter. */
66  IfxIom_EventActiveEdgeSelection_positiveGateNeitherClear = 4, /**< \brief positive edge used to gate event generation and neither edge used to clear event windowcounter. */
67  IfxIom_EventActiveEdgeSelection_positiveGatePositiveClear = 5, /**< \brief positive edge used to gate event generation and positive edge used to clear event windowcounter. */
68  IfxIom_EventActiveEdgeSelection_positiveGateNegativeClear = 6, /**< \brief positive edge used to gate event generation and negative edge used to clear event windowcounter. */
69  IfxIom_EventActiveEdgeSelection_positiveGateEitherClear = 7, /**< \brief positive edge used to gate event generation and negative edge used to clear event windowcounter. */
70  IfxIom_EventActiveEdgeSelection_negativeGateNeitherClear = 8, /**< \brief negative edge used to gate event generation and neither edge used to clear event windowcounter. */
71  IfxIom_EventActiveEdgeSelection_negativeGatePositiveClear = 9, /**< \brief negative edge used to gate event generation and positive edge used to clear event windowcounter. */
72  IfxIom_EventActiveEdgeSelection_negativeGateNegativeClear = 10, /**< \brief negative edge used to gate event generation and negative edge used to clear event windowcounter. */
73  IfxIom_EventActiveEdgeSelection_negativeGateEitherClear = 11, /**< \brief negative edge used to gate event generation and either edge used to clear event windowcounter. */
74  IfxIom_EventActiveEdgeSelection_eitherGateNeitherClear = 12, /**< \brief either edge used to gate event generation and neither edge used to clear event windowcounter. */
75  IfxIom_EventActiveEdgeSelection_eitherGatePositiveClear = 13, /**< \brief either edge used to gate event generation and positive edge used to clear event windowcounter. */
76  IfxIom_EventActiveEdgeSelection_eitherGateNegativeClear = 14, /**< \brief either edge used to gate event generation and negative edge used to clear event windowcounter. */
77  IfxIom_EventActiveEdgeSelection_eitherGateEitherClear = 15 /**< \brief either edge used to gate event generation and either edge used to clear event windowcounter. */
79 
80 /** \brief ECMCCFG.SELCx(x= 0,1,2,3), Specifies which channel event output is to be routed to counterCn.
81  */
82 typedef enum
83 {
84  IfxIom_EventCounterChannel_0 = 0, /**< \brief channel 0 event output to be routed to event counter */
85  IfxIom_EventCounterChannel_1, /**< \brief channel 1 event output to be routed to event counter */
86  IfxIom_EventCounterChannel_2, /**< \brief channel 2 event output to be routed to event counter */
87  IfxIom_EventCounterChannel_3, /**< \brief channel 3 event output to be routed to event counter */
88  IfxIom_EventCounterChannel_4, /**< \brief channel 4 event output to be routed to event counter */
89  IfxIom_EventCounterChannel_5, /**< \brief channel 5 event output to be routed to event counter */
90  IfxIom_EventCounterChannel_6, /**< \brief channel 6 event output to be routed to event counter */
91  IfxIom_EventCounterChannel_7, /**< \brief channel 7 event output to be routed to event counter */
92  IfxIom_EventCounterChannel_8, /**< \brief channel 8 event output to be routed to event counter */
93  IfxIom_EventCounterChannel_9, /**< \brief channel 9 event output to be routed to event counter */
94  IfxIom_EventCounterChannel_10, /**< \brief channel 10 event output to be routed to event counter */
95  IfxIom_EventCounterChannel_11, /**< \brief channel 11 event output to be routed to event counter */
96  IfxIom_EventCounterChannel_12, /**< \brief channel 12 event output to be routed to event counter */
97  IfxIom_EventCounterChannel_13, /**< \brief channel 13 event output to be routed to event counter */
98  IfxIom_EventCounterChannel_14, /**< \brief channel 14 event output to be routed to event counter */
99  IfxIom_EventCounterChannel_15 /**< \brief channel 15 event output to be routed to event counter */
101 
102 /** \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
103  */
104 typedef enum
105 {
106  IfxIom_EventCounterThreshold_disable = 0, /**< \brief Specifies counter event output set to
107  * inactive */
108  IfxIom_EventCounterThreshold_1 = 1, /**< \brief Specifies threshold count value 1 */
109  IfxIom_EventCounterThreshold_2, /**< \brief Specifies threshold count value 2 */
110  IfxIom_EventCounterThreshold_3, /**< \brief Specifies threshold count value 3 */
111  IfxIom_EventCounterThreshold_4, /**< \brief Specifies threshold count value 4 */
112  IfxIom_EventCounterThreshold_5, /**< \brief Specifies threshold count value 5 */
113  IfxIom_EventCounterThreshold_6, /**< \brief Specifies threshold count value 6 */
114  IfxIom_EventCounterThreshold_7, /**< \brief Specifies threshold count value 7 */
115  IfxIom_EventCounterThreshold_8, /**< \brief Specifies threshold count value 8 */
116  IfxIom_EventCounterThreshold_9, /**< \brief Specifies threshold count value 9 */
117  IfxIom_EventCounterThreshold_10, /**< \brief Specifies threshold count value 10 */
118  IfxIom_EventCounterThreshold_11, /**< \brief Specifies threshold count value 11 */
119  IfxIom_EventCounterThreshold_12, /**< \brief Specifies threshold count value 12 */
120  IfxIom_EventCounterThreshold_13, /**< \brief Specifies threshold count value 13 */
121  IfxIom_EventCounterThreshold_14, /**< \brief Specifies threshold count value 14 */
122  IfxIom_EventCounterThreshold_15 /**< \brief Specifies threshold count value 15 */
124 
125 /** \brief LAMCFG[lamId].EWS, Specifies whether the event window generation is from the monitor or reference signal.
126  */
127 typedef enum
128 {
129  IfxIom_EventSource_reference = 0, /**< \brief Specifies the event window generation is from the reference signal. */
130  IfxIom_EventSource_monitor = 1 /**< \brief Specifies the event window generation is from the monitor signal. */
132 
133 /** \brief FPCCTR[channelId].MOD, Specifies the Filter & Prescaler Cell mode
134  */
135 typedef enum
136 {
137  IfxIom_FilterMode_delayedDebounce = 0, /**< \brief Specifies Delayed Debounce filter mode */
138  IfxIom_FilterMode_immediateDebounce = 1, /**< \brief Specifies Immediate Debounce filter mode */
139  IfxIom_FilterMode_risingEdgeImmediateDebounce = 2, /**< \brief Specifies Rising Edge Immediate Debounce filter mode */
140  IfxIom_FilterMode_fallingEdgeImmediateDebounce = 3, /**< \brief Specifies Falling Edge Immediate Debounce filter mode */
141  IfxIom_FilterMode_risingEdgeDelayedFallingEdgeImmediateDebounce = 4, /**< \brief Specifies RisingEdge Delayed FallingEdge Immediate Debounce filter mode */
142  IfxIom_FilterMode_fallingEdgeDelayedRisingEdgeImmediateDebounce = 5, /**< \brief Specifies FallingEdge Delayed RisingEdge Immediate Debounce filter mode */
143  IfxIom_FilterMode_risingEdgePrescaler = 6, /**< \brief Specifies RisingEdge Prescaler filter mode */
144  IfxIom_FilterMode_FallingEdgePrescaler = 7 /**< \brief Specifies FallingEdge Prescaler filter mode */
146 
147 /** \brief Specifies the number of Filter & Prescaler Cell channel Id
148  */
149 typedef enum
150 {
151  IfxIom_FpcChannelId_0 = 0, /**< \brief Specifies the FPC channel 0 */
152  IfxIom_FpcChannelId_1, /**< \brief Specifies the FPC channel 1 */
153  IfxIom_FpcChannelId_2, /**< \brief Specifies the FPC channel 2 */
154  IfxIom_FpcChannelId_3, /**< \brief Specifies the FPC channel 3 */
155  IfxIom_FpcChannelId_4, /**< \brief Specifies the FPC channel 4 */
156  IfxIom_FpcChannelId_5, /**< \brief Specifies the FPC channel 5 */
157  IfxIom_FpcChannelId_6, /**< \brief Specifies the FPC channel 6 */
158  IfxIom_FpcChannelId_7, /**< \brief Specifies the FPC channel 7 */
159  IfxIom_FpcChannelId_8, /**< \brief Specifies the FPC channel 8 */
160  IfxIom_FpcChannelId_9, /**< \brief Specifies the FPC channel 9 */
161  IfxIom_FpcChannelId_10, /**< \brief Specifies the FPC channel 10 */
162  IfxIom_FpcChannelId_11, /**< \brief Specifies the FPC channel 11 */
163  IfxIom_FpcChannelId_12, /**< \brief Specifies the FPC channel 12 */
164  IfxIom_FpcChannelId_13, /**< \brief Specifies the FPC channel 13 */
165  IfxIom_FpcChannelId_14, /**< \brief Specifies the FPC channel 14 */
166  IfxIom_FpcChannelId_15 /**< \brief Specifies the FPC channel 15 */
168 
169 /** \brief LAMCFG[lamId].MCS, Specifies which FPC/mux block monitor output signal is to be used for LAM block
170  */
171 typedef enum
172 {
173  IfxIom_LamMonitorInputChannel_0 = 0, /**< \brief Specifies 0 FPC/mux block monitor output signal is to be used for LAM block */
174  IfxIom_LamMonitorInputChannel_1, /**< \brief Specifies 1 FPC/mux block monitor output signal is to be used for LAM block */
175  IfxIom_LamMonitorInputChannel_2, /**< \brief Specifies 2 FPC/mux block monitor output signal is to be used for LAM block */
176  IfxIom_LamMonitorInputChannel_3, /**< \brief Specifies 3 FPC/mux block monitor output signal is to be used for LAM block */
177  IfxIom_LamMonitorInputChannel_4, /**< \brief Specifies 4 FPC/mux block monitor output signal is to be used for LAM block */
178  IfxIom_LamMonitorInputChannel_5, /**< \brief Specifies 5 FPC/mux block monitor output signal is to be used for LAM block */
179  IfxIom_LamMonitorInputChannel_6, /**< \brief Specifies 6 FPC/mux block monitor output signal is to be used for LAM block */
180  IfxIom_LamMonitorInputChannel_7, /**< \brief Specifies 7 FPC/mux block monitor output signal is to be used for LAM block */
181  IfxIom_LamMonitorInputChannel_8, /**< \brief Specifies 8 FPC/mux block monitor output signal is to be used for LAM block */
182  IfxIom_LamMonitorInputChannel_9, /**< \brief Specifies 9 FPC/mux block monitor output signal is to be used for LAM block */
183  IfxIom_LamMonitorInputChannel_10, /**< \brief Specifies 10 FPC/mux block monitor output signal is to be used for LAM block */
184  IfxIom_LamMonitorInputChannel_11, /**< \brief Specifies 11 FPC/mux block monitor output signal is to be used for LAM block */
185  IfxIom_LamMonitorInputChannel_12, /**< \brief Specifies 12 FPC/mux block monitor output signal is to be used for LAM block */
186  IfxIom_LamMonitorInputChannel_13, /**< \brief Specifies 13 FPC/mux block monitor output signal is to be used for LAM block */
187  IfxIom_LamMonitorInputChannel_14, /**< \brief Specifies 14 FPC/mux block monitor output signal is to be used for LAM block */
188  IfxIom_LamMonitorInputChannel_15 /**< \brief Specifies 15 FPC/mux block monitor output signal is to be used for LAM block */
190 
191 /** \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.
192  */
193 typedef enum
194 {
195  IfxIom_LamMonitorSource_directFpcMonitor = 0, /**< \brief Monitor signal is sourced directly from FPC monitor channel. */
196  IfxIom_LamMonitorSource_exoredFpcMonitor = 1 /**< \brief Monitor signal is EXORed with FPC reference channel. */
198 
199 /** \brief LAMCFG[lamId].RCS, Specifies which FPC/mux block reference output signal is to be used for LAM block
200  */
201 typedef enum
202 {
203  IfxIom_LamReferenceInputChannel_0 = 0, /**< \brief Specifies 0 FPC/mux block reference output signal is to be used for LAM block */
204  IfxIom_LamReferenceInputChannel_1, /**< \brief Specifies 1 FPC/mux block reference output signal is to be used for LAM block */
205  IfxIom_LamReferenceInputChannel_2, /**< \brief Specifies 2 FPC/mux block reference output signal is to be used for LAM block */
206  IfxIom_LamReferenceInputChannel_3, /**< \brief Specifies 3 FPC/mux block reference output signal is to be used for LAM block */
207  IfxIom_LamReferenceInputChannel_4, /**< \brief Specifies 4 FPC/mux block reference output signal is to be used for LAM block */
208  IfxIom_LamReferenceInputChannel_5, /**< \brief Specifies 5 FPC/mux block reference output signal is to be used for LAM block */
209  IfxIom_LamReferenceInputChannel_6, /**< \brief Specifies 6 FPC/mux block reference output signal is to be used for LAM block */
210  IfxIom_LamReferenceInputChannel_7, /**< \brief Specifies 7 FPC/mux block reference output signal is to be used for LAM block */
211  IfxIom_LamReferenceInputChannel_8, /**< \brief Specifies 8 FPC/mux block reference output signal is to be used for LAM block */
212  IfxIom_LamReferenceInputChannel_9, /**< \brief Specifies 9 FPC/mux block reference output signal is to be used for LAM block */
213  IfxIom_LamReferenceInputChannel_10, /**< \brief Specifies 10 FPC/mux block reference output signal is to be used for LAM block */
214  IfxIom_LamReferenceInputChannel_11, /**< \brief Specifies 11 FPC/mux block reference output signal is to be used for LAM block */
215  IfxIom_LamReferenceInputChannel_12, /**< \brief Specifies 12 FPC/mux block reference output signal is to be used for LAM block */
216  IfxIom_LamReferenceInputChannel_13, /**< \brief Specifies 13 FPC/mux block reference output signal is to be used for LAM block */
217  IfxIom_LamReferenceInputChannel_14, /**< \brief Specifies 14 FPC/mux block reference output signal is to be used for LAM block */
218  IfxIom_LamReferenceInputChannel_15 /**< \brief Specifies 15 FPC/mux block reference output signal is to be used for LAM block */
220 
221 /** \brief LAMCFG[lamId].RMS, Specifies whether the event window generation is free-running or gated with the monitor or reference.
222  */
223 typedef enum
224 {
225  IfxIom_LamRunMode_freeRunning = 0, /**< \brief Specifies event window generation is free-running. */
226  IfxIom_LamRunMode_gated = 1 /**< \brief Specifies event window generation is gated with the monitor or
227  * reference signal. */
229 
230 /** \brief FPCCTR[channelId].ISM, Specifies the monitor signal input for Filter & Prescaler cell
231  */
232 typedef enum
233 {
234  IfxIom_MonitorSignal_portLogic = 0, /**< \brief Specifies the specific pad pins as monitor signal */
235  IfxIom_MonitorSignal_0 = 1, /**< \brief Specifies the monitor signal 0 */
236  IfxIom_MonitorSignal_1, /**< \brief Specifies the monitor signal 1 */
237  IfxIom_MonitorSignal_2 /**< \brief Specifies the monitor signal 2 */
239 
240 /** \brief FPCCTR[channelId].ISR,Specifies the reference signal input for Filter & Prescaler cell
241  */
242 typedef enum
243 {
244  IfxIom_ReferenceSignal_portLogic = 0, /**< \brief Specifies the specific pad pins as reference signal */
245  IfxIom_ReferenceSignal_0 = 1, /**< \brief Specifies the reference signal 0 */
246  IfxIom_ReferenceSignal_1, /**< \brief Specifies the reference signal 1 */
247  IfxIom_ReferenceSignal_2, /**< \brief Specifies the reference signal 2 */
248  IfxIom_ReferenceSignal_gtmEXORCombiner = 4 /**< \brief Specifies the GTM EXOR Combiner pins */
250 
251 /** \brief Enable/disable the sensitivity of the module to sleep signal\n
252  * Definition in Ifx_IOM.CLC.B.EDIS
253  */
254 typedef enum
255 {
256  IfxIom_SleepMode_enable = 0, /**< \brief enables sleep mode */
257  IfxIom_SleepMode_disable = 1 /**< \brief disables sleep mode */
259 
260 /** \} */
261 
262 /** \brief Specifies the Logic Module Analyser Module Number
263  */
264 typedef enum
265 {
266  IfxIom_LamId_0 = 0, /**< \brief Specifies the LAM Id 0 */
267  IfxIom_LamId_1, /**< \brief Specifies the LAM Id 1 */
268  IfxIom_LamId_2, /**< \brief Specifies the LAM Id 2 */
269  IfxIom_LamId_3, /**< \brief Specifies the LAM Id 3 */
270  IfxIom_LamId_4, /**< \brief Specifies the LAM Id 4 */
271  IfxIom_LamId_5, /**< \brief Specifies the LAM Id 5 */
272  IfxIom_LamId_6, /**< \brief Specifies the LAM Id 6 */
273  IfxIom_LamId_7, /**< \brief Specifies the LAM Id 7 */
274  IfxIom_LamId_8, /**< \brief Specifies the LAM Id 8 */
275  IfxIom_LamId_9, /**< \brief Specifies the LAM Id 9 */
276  IfxIom_LamId_10, /**< \brief Specifies the LAM Id 10 */
277  IfxIom_LamId_11, /**< \brief Specifies the LAM Id 11 */
278  IfxIom_LamId_12, /**< \brief Specifies the LAM Id 12 */
279  IfxIom_LamId_13, /**< \brief Specifies the LAM Id 13 */
280  IfxIom_LamId_14, /**< \brief Specifies the LAM Id 14 */
281  IfxIom_LamId_15 /**< \brief Specifies the LAM Id 15 */
282 } IfxIom_LamId;
283 
284 /** \addtogroup IfxLld_Iom_Std_Module
285  * \{ */
286 
287 /******************************************************************************/
288 /*-------------------------Inline Function Prototypes-------------------------*/
289 /******************************************************************************/
290 
291 /** \brief Enable the IOM module control
292  * \param iom pointer to IOM module registers
293  * \return None
294  */
295 IFX_INLINE void IfxIom_enableModule(Ifx_IOM *iom);
296 
297 /******************************************************************************/
298 /*-------------------------Global Function Prototypes-------------------------*/
299 /******************************************************************************/
300 
301 /** \brief Reset the IOM module
302  * \param iom pointer to IOM module registers
303  * \return None
304  */
305 IFX_EXTERN void IfxIom_resetModule(Ifx_IOM *iom);
306 
307 /** \} */
308 
309 /******************************************************************************/
310 /*-------------------------Inline Function Prototypes-------------------------*/
311 /******************************************************************************/
312 
313 /** \brief Enable/disable the sensitivity of the module to sleep signal
314  * \param iom pointer to IOM registers
315  * \param mode mode selection (enable/disable)
316  * \return None
317  */
318 IFX_INLINE void IfxIom_setSleepMode(Ifx_IOM *iom, IfxIom_SleepMode mode);
319 
320 /**
321  * \param iom pointer to IOM register space
322  * \return the last generated event
323  */
325 
326 /******************************************************************************/
327 /*---------------------Inline Function Implementations------------------------*/
328 /******************************************************************************/
329 
330 IFX_INLINE void IfxIom_enableModule(Ifx_IOM *iom)
331 {
332  iom->CLC.B.DISR = 0;
333 }
334 
335 
337 {
340  iom->CLC.B.EDIS = mode;
341  IfxScuWdt_setCpuEndinit(passwd);
342 }
343 
344 
346 {
347  uint16 tempECMETH0;
348 
349  tempECMETH0 = (uint16)iom->ECMETH0.U;
350  return tempECMETH0;
351 }
352 
353 
354 #endif /* IFXIOM_H */