iLLD_TC27xD  1.0
IfxScuEru.h
Go to the documentation of this file.
1 /**
2  * \file IfxScuEru.h
3  * \brief SCU basic functionality
4  * \ingroup IfxLld_Scu
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_Scu_Std_Eru Eru Basic Functionality
26  * \ingroup IfxLld_Scu_Std
27  * \defgroup IfxLld_Scu_Std_Eru_Enum ERU: Enumerations
28  * \ingroup IfxLld_Scu_Std_Eru
29  * \defgroup IfxLld_Scu_Std_Eru_External_Request_Selection ERU: External Request Selection
30  * \ingroup IfxLld_Scu_Std_Eru
31  * \defgroup IfxLld_Scu_Std_Eru_Event_Trigger_Logic ERU: Event Trigger Logic
32  * \ingroup IfxLld_Scu_Std_Eru
33  * \defgroup IfxLld_Scu_Std_Eru_Connecting_Matrix ERU: Connecting Matrix
34  * \ingroup IfxLld_Scu_Std_Eru
35  * \defgroup IfxLld_Scu_Std_Eru_Output_Gating_Unit ERU: Output Gating Unit
36  * \ingroup IfxLld_Scu_Std_Eru
37  * \defgroup IfxLld_Scu_Std_Eru_Data_Structures ERU: Data Structures
38  * \ingroup IfxLld_Scu_Std_Eru
39  */
40 
41 #ifndef IFXSCUERU_H
42 #define IFXSCUERU_H 1
43 
44 /******************************************************************************/
45 /*----------------------------------Includes----------------------------------*/
46 /******************************************************************************/
47 
48 #include "_Impl/IfxScu_cfg.h"
49 #include "IfxScu_reg.h"
50 #include "Cpu/Std/IfxCpu.h"
51 #include "_PinMap/IfxScu_PinMap.h"
52 
53 /******************************************************************************/
54 /*--------------------------------Enumerations--------------------------------*/
55 /******************************************************************************/
56 
57 /** \addtogroup IfxLld_Scu_Std_Eru_Enum
58  * \{ */
59 /** \brief Input line selection for input channel\n
60  * Definition in Ifx_SCU.EICR[i].B.EXIS(j) (i = 0,1,2,3 and j = 0,1)
61  */
62 typedef enum
63 {
64  IfxScuEru_ExternalInputSelection_0 = 0, /**< \brief External input 0 is selected */
65  IfxScuEru_ExternalInputSelection_1, /**< \brief External input 1 is selected */
66  IfxScuEru_ExternalInputSelection_2, /**< \brief External input 2 is selected */
67  IfxScuEru_ExternalInputSelection_3 /**< \brief External input 3 is selected */
69 
70 /** \brief Input channel for input selection and conditioning of trigger or gating functions
71  */
72 typedef enum
73 {
74  IfxScuEru_InputChannel_0 = 0, /**< \brief External Input channel 0 */
75  IfxScuEru_InputChannel_1, /**< \brief External Input channel 1 */
76  IfxScuEru_InputChannel_2, /**< \brief External Input channel 2 */
77  IfxScuEru_InputChannel_3, /**< \brief External Input channel 3 */
78  IfxScuEru_InputChannel_4, /**< \brief External Input channel 4 */
79  IfxScuEru_InputChannel_5, /**< \brief External Input channel 5 */
80  IfxScuEru_InputChannel_6, /**< \brief External Input channel 6 */
81  IfxScuEru_InputChannel_7 /**< \brief External Input channel 7 */
83 
84 /** \brief Determines the destination (output channel) for trigger event (if enabled by Ifx_SCU.EICR[i].B.EIEN(j)).\n
85  * Definition in Ifx_SCU.EICR[i].B.INP(j) (i = 0,1,2,3 and j = 0,1)
86  */
87 typedef enum
88 {
89  IfxScuEru_InputNodePointer_0 = 0, /**< \brief Event from input ETLx triggers output OGU0 (signal TRx0) */
90  IfxScuEru_InputNodePointer_1, /**< \brief Event from input ETLx triggers output OGU1 (signal TRx1) */
91  IfxScuEru_InputNodePointer_2, /**< \brief Event from input ETLx triggers output OGU2 (signal TRx2) */
92  IfxScuEru_InputNodePointer_3, /**< \brief Event from input ETLx triggers output OGU3 (signal TRx3) */
93  IfxScuEru_InputNodePointer_4, /**< \brief Event from input ETLx triggers output OGU4 (signal TRx4) */
94  IfxScuEru_InputNodePointer_5, /**< \brief Event from input ETLx triggers output OGU5 (signal TRx5) */
95  IfxScuEru_InputNodePointer_6, /**< \brief Event from input ETLx triggers output OGU6 (signal TRx6) */
96  IfxScuEru_InputNodePointer_7 /**< \brief Event from input ETLx triggers output OGU7 (signal TRx7) */
98 
99 /** \brief Determines the pattern detection influence on the ouput lines ERU_GOUTy and ERU_IOUTy\n
100  * Definition in Ifx_SCU.IGCR[i].B.IGP(j) (i = 0,1,2,3 and j = 0,1)
101  */
102 typedef enum
103 {
104  IfxScuEru_InterruptGatingPattern_none = 0, /**< \brief IOUTy is inactive, (the pattern is not considered) */
105  IfxScuEru_InterruptGatingPattern_alwaysActive = 1, /**< \brief IOUTy is activated in response to a trigger event, (the pattern is not considered) */
106  IfxScuEru_InterruptGatingPattern_patternMatch = 2, /**< \brief IOUTy is activated if a trigger event occures while the pattern is present, (the pattern is considered) */
107  IfxScuEru_InterruptGatingPattern_patternMiss = 3 /**< \brief IOUTy is activated if a trigger event occures while the pattern is not present, (the pattern is not considered) */
109 
110 /** \brief Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
111  */
112 typedef enum
113 {
114  IfxScuEru_OutputChannel_0 = 0, /**< \brief Output channel 0 */
115  IfxScuEru_OutputChannel_1, /**< \brief Output channel 1 */
116  IfxScuEru_OutputChannel_2, /**< \brief Output channel 2 */
117  IfxScuEru_OutputChannel_3, /**< \brief Output channel 3 */
118  IfxScuEru_OutputChannel_4, /**< \brief Output channel 4 */
119  IfxScuEru_OutputChannel_5, /**< \brief Output channel 5 */
120  IfxScuEru_OutputChannel_6, /**< \brief Output channel 6 */
121  IfxScuEru_OutputChannel_7 /**< \brief Output channel 7 */
123 
124 /** \} */
125 
126 /** \addtogroup IfxLld_Scu_Std_Eru_External_Request_Selection
127  * \{ */
128 
129 /******************************************************************************/
130 /*-------------------------Inline Function Prototypes-------------------------*/
131 /******************************************************************************/
132 
133 /** \brief Initialises the External request Pin
134  * \param req External request pin
135  * \param inputMode Port Input mode
136  * \return None
137  */
139 
140 /******************************************************************************/
141 /*-------------------------Global Function Prototypes-------------------------*/
142 /******************************************************************************/
143 
144 /** \brief Determines which input line is selcted for input channel x
145  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
146  * \param inputSignal Input line selection for input channel
147  * \return None
148  */
150 
151 /** \} */
152 
153 /** \addtogroup IfxLld_Scu_Std_Eru_Event_Trigger_Logic
154  * \{ */
155 
156 /******************************************************************************/
157 /*-------------------------Global Function Prototypes-------------------------*/
158 /******************************************************************************/
159 
160 /** \brief Clears the external event flag of input channel x (INTFx)
161  * \return None
162  */
164 
165 /** \brief Clears the external event flag of input channel x (INTFx)
166  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
167  * \return None
168  */
170 
171 /** \brief Clears all the configuration for the given input channel x
172  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
173  * \return None
174  */
176 
177 /** \brief Disables the automatic clearing of INTFx when the edge of input channel which has not been selected, is detected
178  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
179  * \return None
180  */
182 
183 /** \brief Disables the falling edge of input channel to set the bit INTF x
184  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
185  * \return None
186  */
188 
189 /** \brief Disables the rising edge of input channel to set the bit INTF x
190  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
191  * \return None
192  */
194 
195 /** \brief Enables the automatic clearing of INTFx when the edge of input channel which has not been selected, is detected
196  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
197  * \return None
198  */
200 
201 /** \brief Enables the falling edge of input channel to set the bit INTF x
202  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
203  * \return None
204  */
206 
207 /** \brief Enables the rising edge of input channel to set the bit INTF x
208  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
209  * \return None
210  */
212 
213 /** \brief Returns the status of the flags of all input channels
214  * \return All flags Status
215  */
217 
218 /** \brief Returns the status of the external event flag of input channel x (INTFx)
219  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
220  * \return Status (TRUE / FALSE)
221  */
223 
224 /** \brief Returns all the configuration for the given input channel x
225  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
226  * \return Input channel configuration
227  */
229 
230 /** \brief Sets the external event flag of input channel x (INTFx)
231  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
232  * \return None
233  */
235 
236 /** \} */
237 
238 /** \addtogroup IfxLld_Scu_Std_Eru_Connecting_Matrix
239  * \{ */
240 
241 /******************************************************************************/
242 /*-------------------------Global Function Prototypes-------------------------*/
243 /******************************************************************************/
244 
245 /** \brief Determines the destination (output channel) for trigger event (if enabled by Ifx_SCU.EICR[i].B.EIEN(j), i = 0,1,2,3 and j = 0,1).
246  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
247  * \param triggerSelect Trigger event selection
248  * \return None
249  */
251 
252 /** \brief Disables the generation of a trigger event for input channel x when the selected edge is detected
253  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
254  * \return None
255  */
257 
258 /** \brief Enables the generation of a trigger event for input channel x when the selected edge is detected
259  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
260  * \return None
261  */
263 
264 /** \brief Enables the flag INTFx to take part in the pattern detection for output gating
265  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
266  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
267  * \param state FALSE: the bit INTFx does not take part in the pattern detection IPENjy = 0\n
268  * TRUE : the bit INTFx is taken into consideration for the pattern detection IPENjy = 1
269  * \return None
270  */
271 IFX_EXTERN void IfxScuEru_setFlagPatternDetection(IfxScuEru_OutputChannel outputChannel, IfxScuEru_InputChannel inputChannel, boolean state);
272 
273 /** \} */
274 
275 /** \addtogroup IfxLld_Scu_Std_Eru_Output_Gating_Unit
276  * \{ */
277 
278 /******************************************************************************/
279 /*-------------------------Global Function Prototypes-------------------------*/
280 /******************************************************************************/
281 
282 /** \brief Clears all the configuration for the given input channel y
283  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
284  * \return None
285  */
287 
288 /** \brief Disables the generation of a trigger event for output channel y when the result of the pattern detection changes
289  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
290  * \return None
291  */
293 
294 /** \brief Enables the generation of a trigger event for output channel y when the result of the pattern detection changes
295  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
296  * \return None
297  */
299 
300 /** \brief Clears all the configuration for the given input channel y
301  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
302  * \return Output channel configuration
303  */
305 
306 /** \brief Returns the status of the pattern detection result of output channel y (PDRy)
307  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
308  * \return Status (TRUE / FALSE)
309  */
311 
312 /** \brief Returns the whole pattern detection result of all the selcted output channels
313  * \return Detected pattern
314  */
316 
317 /** \brief Sets the gating pattern of a ouput channel y to determine how the pattern detection influences the output lines GOUT and IOUT
318  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
319  * \param gatingPattern Interrupt gating pattern to determine how the pattern detection influences the ouput lines GOUT and IOUT
320  * \return None
321  */
323 
324 /** \} */
325 
326 /******************************************************************************/
327 /*---------------------Inline Function Implementations------------------------*/
328 /******************************************************************************/
329 
331 {
332  IfxPort_setPinModeInput(req->pin.port, req->pin.pinIndex, inputMode);
334 }
335 
336 
337 #endif /* IFXSCUERU_H */