iLLD_TC27xC  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_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_Scu_Std Standard Driver
26  * \ingroup IfxLld_Scu
27  * \defgroup IfxLld_Scu_Std_Enum ERU: Enumerations
28  * \ingroup IfxLld_Scu_Std
29  * \defgroup IfxLld_Scu_Std_External_Request_Selection ERU: External Request Selection
30  * \ingroup IfxLld_Scu_Std
31  * \defgroup IfxLld_Scu_Std_Event_Trigger_Logic ERU: Event Trigger Logic
32  * \ingroup IfxLld_Scu_Std
33  * \defgroup IfxLld_Scu_Std_Connecting_Matrix ERU: Connecting Matrix
34  * \ingroup IfxLld_Scu_Std
35  * \defgroup IfxLld_Scu_Std_Output_Gating_Unit ERU: Output Gating Unit
36  * \ingroup IfxLld_Scu_Std
37  * \defgroup IfxLld_Scu_Std_Data_Structures ERU: Data Structures
38  * \ingroup IfxLld_Scu_Std
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_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 /******************************************************************************/
127 /*-----------------------------Data Structures--------------------------------*/
128 /******************************************************************************/
129 
130 /** \addtogroup IfxLld_Scu_Std_Data_Structures
131  * \{ */
132 /** \brief Structure for external request input selection
133  */
134 typedef struct
135 {
136  IfxScuEru_InputChannel inputChannel; /**< \brief Input channel number */
138 } IfxScuEru_ERS;
139 
140 /** \} */
141 
142 /** \addtogroup IfxLld_Scu_Std_External_Request_Selection
143  * \{ */
144 
145 /******************************************************************************/
146 /*-------------------------Inline Function Prototypes-------------------------*/
147 /******************************************************************************/
148 
149 /** \brief Initialises the External request Pin
150  * \param req External request pin
151  * \param inputMode Port Input mode
152  * \return None
153  */
155 
156 /******************************************************************************/
157 /*-------------------------Global Function Prototypes-------------------------*/
158 /******************************************************************************/
159 
160 /** \brief Determines which input line is selcted for input channel x
161  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
162  * \param inputSignal Input line selection for input channel
163  * \return None
164  */
166 
167 /** \brief Gets the channel number and input selection information from request Id
168  * \param requestId Request Id number
169  * \param ers Structure for external request input selection to be filled
170  * \return None
171  */
173 
174 /** \} */
175 
176 /** \addtogroup IfxLld_Scu_Std_Event_Trigger_Logic
177  * \{ */
178 
179 /******************************************************************************/
180 /*-------------------------Global Function Prototypes-------------------------*/
181 /******************************************************************************/
182 
183 /** \brief Clears the external event flag of input channel x (INTFx)
184  * \return None
185  */
187 
188 /** \brief Clears the external event flag of input channel x (INTFx)
189  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
190  * \return None
191  */
193 
194 /** \brief Clears all the configuration for the given input channel x
195  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
196  * \return None
197  */
199 
200 /** \brief Disables the automatic clearing of INTFx when the edge of input channel which has not been selected, is detected
201  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
202  * \return None
203  */
205 
206 /** \brief Disables the falling edge of input channel to set the bit INTF x
207  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
208  * \return None
209  */
211 
212 /** \brief Disables the rising edge of input channel to set the bit INTF x
213  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
214  * \return None
215  */
217 
218 /** \brief Enables the automatic clearing of INTFx when the edge of input channel which has not been selected, is detected
219  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
220  * \return None
221  */
223 
224 /** \brief Enables the falling edge of input channel to set the bit INTF x
225  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
226  * \return None
227  */
229 
230 /** \brief Enables the rising edge of input channel to set the bit INTF x
231  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
232  * \return None
233  */
235 
236 /** \brief Returns the status of the flags of all input channels
237  * \return All flags Status
238  */
240 
241 /** \brief Returns the status of the external event flag of input channel x (INTFx)
242  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
243  * \return Status (TRUE / FALSE)
244  */
246 
247 /** \brief Returns all the configuration for the given input channel x
248  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
249  * \return Input channel configuration
250  */
252 
253 /** \brief Sets the external event flag of input channel x (INTFx)
254  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
255  * \return None
256  */
258 
259 /** \} */
260 
261 /** \addtogroup IfxLld_Scu_Std_Connecting_Matrix
262  * \{ */
263 
264 /******************************************************************************/
265 /*-------------------------Global Function Prototypes-------------------------*/
266 /******************************************************************************/
267 
268 /** \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).
269  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
270  * \param triggerSelect Trigger event selection
271  * \return None
272  */
274 
275 /** \brief Disables the generation of a trigger event for input channel x when the selected edge is detected
276  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
277  * \return None
278  */
280 
281 /** \brief Enables the generation of a trigger event for input channel x when the selected edge is detected
282  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
283  * \return None
284  */
286 
287 /** \brief Enables the flag INTFx to take part in the pattern detection for output gating
288  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
289  * \param inputChannel Input channel for input selection and conditioning of trigger or gating functions
290  * \param state FALSE: the bit INTFx does not take part in the pattern detection IPENjy = 0\n
291  * TRUE : the bit INTFx is taken into consideration for the pattern detection IPENjy = 1
292  * \return None
293  */
294 IFX_EXTERN void IfxScuEru_setFlagPatternDetection(IfxScuEru_OutputChannel outputChannel, IfxScuEru_InputChannel inputChannel, boolean state);
295 
296 /** \} */
297 
298 /** \addtogroup IfxLld_Scu_Std_Output_Gating_Unit
299  * \{ */
300 
301 /******************************************************************************/
302 /*-------------------------Global Function Prototypes-------------------------*/
303 /******************************************************************************/
304 
305 /** \brief Clears all the configuration for the given input channel y
306  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
307  * \return None
308  */
310 
311 /** \brief Disables the generation of a trigger event for output channel y when the result of the pattern detection changes
312  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
313  * \return None
314  */
316 
317 /** \brief Enables the generation of a trigger event for output channel y when the result of the pattern detection changes
318  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
319  * \return None
320  */
322 
323 /** \brief Clears all the configuration for the given input channel y
324  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
325  * \return Output channel configuration
326  */
328 
329 /** \brief Returns the status of the pattern detection result of output channel y (PDRy)
330  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
331  * \return Status (TRUE / FALSE)
332  */
334 
335 /** \brief Returns the whole pattern detection result of all the selcted output channels
336  * \return Detected pattern
337  */
339 
340 /** \brief Sets the gating pattern of a ouput channel y to determine how the pattern detection influences the output lines GOUT and IOUT
341  * \param outputChannel Output channel for combination of events, definition of their effects and distribution to the system (interrupt generation, ...)
342  * \param gatingPattern Interrupt gating pattern to determine how the pattern detection influences the ouput lines GOUT and IOUT
343  * \return None
344  */
346 
347 /** \} */
348 
349 /******************************************************************************/
350 /*---------------------Inline Function Implementations------------------------*/
351 /******************************************************************************/
352 
354 {
355  IfxPort_setPinModeInput(req->pin.port, req->pin.pinIndex, inputMode);
356 
357  IfxScuEru_ERS ers;
360 }
361 
362 
363 #endif /* IFXSCUERU_H */