iLLD_TC29x  1.0
IfxCcu6.h
Go to the documentation of this file.
1 /**
2  * \file IfxCcu6.h
3  * \brief CCU6 basic functionality
4  * \ingroup IfxLld_Ccu6
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_Ccu6_Std_Enum Enumerations
26  * \ingroup IfxLld_Ccu6_Std
27  * \defgroup IfxLld_Ccu6_Std_Operative Operative Functions
28  * \ingroup IfxLld_Ccu6_Std
29  * \defgroup IfxLld_Ccu6_Std_Utility Utility Functions
30  * \ingroup IfxLld_Ccu6_Std
31  * \defgroup IfxLld_Ccu6_Std_Configuration Configuration Functions
32  * \ingroup IfxLld_Ccu6_Std
33  * \defgroup IfxLld_Ccu6_Std_IO IO Pin Configuration Functions
34  * \ingroup IfxLld_Ccu6_Std
35  */
36 
37 #ifndef IFXCCU6_H
38 #define IFXCCU6_H 1
39 
40 /******************************************************************************/
41 /*----------------------------------Includes----------------------------------*/
42 /******************************************************************************/
43 
44 #include "_Impl/IfxCcu6_cfg.h"
45 #include "Src/Std/IfxSrc.h"
47 #include "Scu/Std/IfxScuWdt.h"
48 #include "Scu/Std/IfxScuCcu.h"
49 #include "_Utilities/Ifx_Assert.h"
50 #include "_PinMap/IfxCcu6_PinMap.h"
51 
52 /******************************************************************************/
53 /*--------------------------------Enumerations--------------------------------*/
54 /******************************************************************************/
55 
56 /** \addtogroup IfxLld_Ccu6_Std_Enum
57  * \{ */
58 /** \brief Input selection, ( CC6x capture input / CTRAP input / CCPOSx input )\n
59  * Definition in Ifx_CCU.PISEL0
60  */
61 typedef enum
62 {
63  IfxCcu6_CaptureCompareInput_cC60 = IFX_CCU6_PISEL0_ISCC60_OFF, /**< \brief CC60 capture input */
64  IfxCcu6_CaptureCompareInput_cC61 = IFX_CCU6_PISEL0_ISCC61_OFF, /**< \brief CC61 capture input */
65  IfxCcu6_CaptureCompareInput_cC62 = IFX_CCU6_PISEL0_ISCC62_OFF, /**< \brief CC62 capture input */
66  IfxCcu6_CaptureCompareInput_cTRAP = IFX_CCU6_PISEL0_ISTRP_OFF, /**< \brief CTRAP input */
67  IfxCcu6_CaptureCompareInput_cCPOS0 = IFX_CCU6_PISEL0_ISPOS0_OFF, /**< \brief CCPOS0 input */
68  IfxCcu6_CaptureCompareInput_cCPOS1 = IFX_CCU6_PISEL0_ISPOS1_OFF, /**< \brief CCPOS1 input */
69  IfxCcu6_CaptureCompareInput_cCPOS2 = IFX_CCU6_PISEL0_ISPOS2_OFF /**< \brief CCPOS2 input */
71 
72 /** \brief Selection of actual input signal for the capture compare inputs
73  */
74 typedef enum
75 {
76  IfxCcu6_CaptureCompareInputSignal_a = 0, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
77  IfxCcu6_CaptureCompareInputSignal_b = 1, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
78  IfxCcu6_CaptureCompareInputSignal_c = 2, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
79  IfxCcu6_CaptureCompareInputSignal_d = 3 /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
81 
82 /** \brief capture/compare state to set / clear the CC6xST-bits
83  */
84 typedef enum
85 {
86  IfxCcu6_CaptureCompareState_set = 0, /**< \brief Bit CC6xST is set */
87  IfxCcu6_CaptureCompareState_clear = 1, /**< \brief Bit CC6xST is cleared */
88  IfxCcu6_CaptureCompareState_toggle = 2 /**< \brief Bit CC6xST is toggled */
90 
91 /** \brief Capture compare output pins
92  */
93 typedef enum
94 {
95  IfxCcu6_ChannelOut_cc0 = 0, /**< \brief CC60 compare output CC0 */
96  IfxCcu6_ChannelOut_cout0 = 1, /**< \brief CC60 compare output COUT0 */
97  IfxCcu6_ChannelOut_cc1 = 2, /**< \brief CC61 compare output CC1 */
98  IfxCcu6_ChannelOut_cout1 = 3, /**< \brief CC61 compare output COUT1 */
99  IfxCcu6_ChannelOut_cc2 = 4, /**< \brief CC62 compare output CC2 */
100  IfxCcu6_ChannelOut_cout2 = 5, /**< \brief CC62 compare output COUT2 */
101  IfxCcu6_ChannelOut_cout3 = 6 /**< \brief CC63 compare output COUT3 */
103 
104 /** \brief Defines the input event leading to a counting action of the timer (T12 / T13)\n
105  * Definition in Ifx_CCU.PISEL2.B.ISCNT12 / Ifx_CCU.PISEL2.B.ISCNT13
106  */
107 typedef enum
108 {
109  IfxCcu6_CountingInputMode_internal = 0, /**< \brief The T1x prescaler generates the counting events,
110  * Bit TCTR4.T1xCNT is not taken into account. */
111  IfxCcu6_CountingInputMode_manual = 1, /**< \brief Bit TCTR4.T1xCNT written with 1 is a counting
112  * event. The T1x prescaler is not taken into account */
113  IfxCcu6_CountingInputMode_externalRising = 2, /**< \brief The timer T1x is counting each rising edge
114  * detected in the selected T1xHR signal */
115  IfxCcu6_CountingInputMode_externalFalling = 3 /**< \brief The timer T1x is counting each falling edge
116  * detected in the selected T1xHR signal */
118 
119 /** \brief Controls whether the source signal for the sampling of the Hall input pattern (selected by HSYNC) is delayed by the Dead-Time Counter 0\n
120  * Definition in Ifx_CCU.T12MSEL.B.DBYP
121  */
122 typedef enum
123 {
124  IfxCcu6_DelayBypass_notActive = 0, /**< \brief Dead-Time Counter 0 is generating a delay after
125  * the source signal becomes active */
126  IfxCcu6_DelayBypass_active = 1 /**< \brief Dead-Time Counter 0 is not used for a delay */
128 
129 /** \brief Defines the event of signal T1xHR that can set the run bit T1xR by HW\n
130  * Definition in Ifx_CCU.TCTR2.B.T12RSEL / IIfx_CCU.TCTR2.B.T13RSEL
131  */
132 typedef enum
133 {
134  IfxCcu6_ExternalTriggerMode_disable = 0, /**< \brief The external setting of T1xR is disabled */
135  IfxCcu6_ExternalTriggerMode_risingEdge = 1, /**< \brief Bit T1xR is set if a rising edge of signal T1xHR is
136  * detected. */
137  IfxCcu6_ExternalTriggerMode_fallingEdge = 2, /**< \brief Bit T1xR is set if a falling edge of signal T1xHR is
138  * detected. */
139  IfxCcu6_ExternalTriggerMode_anyEdge = 3 /**< \brief Bit T1xR is set if an edge of signal T1xHR is
140  * detected */
142 
143 /** \brief Defines the source for the sampling of the Hall input pattern and the comparison to the current and the expected Hall pattern bit fields\n
144  * Definition in Ifx_CCU.T12MSEL.HSYNC
145  */
146 typedef enum
147 {
148  IfxCcu6_HallSensorTriggerMode_permanentCheck = 0, /**< \brief Any edge at any of the inputs CCPOSx, independent from any PWM
149  * signal */
150  IfxCcu6_HallSensorTriggerMode_cM63 = 1, /**< \brief A T13 Compare-Match */
151  IfxCcu6_HallSensorTriggerMode_t13PM = 2, /**< \brief A T13 Period-Match */
152  IfxCcu6_HallSensorTriggerMode_off = 3, /**< \brief Hall sampling triggered by HW sources is switched off */
153  IfxCcu6_HallSensorTriggerMode_t12PMCountingUp = 4, /**< \brief A T12 Period-Match while counting up (T12_PM and CDIR = 0) */
154  IfxCcu6_HallSensorTriggerMode_t12OMCountingDown = 5, /**< \brief A T12 One-Match while counting down (T12_PM and CDIR = 1) */
155  IfxCcu6_HallSensorTriggerMode_cM61CountingUp = 6, /**< \brief A T12 Compare-Match of compare channel CC61 while counting up (CM_61 and CDIR = 0) */
156  IfxCcu6_HallSensorTriggerMode_cM61CountingDown = 7 /**< \brief A T12 Compare-Match of compare channel CC61 while counting down (CM_61 and CDIR = 1) */
158 
159 /** \brief Interrupt source selection
160  * Description in Ifx_CCU.IEN
161  */
162 typedef enum
163 {
164  IfxCcu6_InterruptSource_cc60RisingEdge = IFX_CCU6_IS_ICC60R_OFF, /**< \brief Capture compare match rising edge interrupt
165  * enable for channel CC60 */
166  IfxCcu6_InterruptSource_cc60FallingEdge = IFX_CCU6_IS_ICC60F_OFF, /**< \brief Capture compare match falling edge interrupt
167  * enable for channel CC60 */
168  IfxCcu6_InterruptSource_cc61RisingEdge = IFX_CCU6_IS_ICC61R_OFF, /**< \brief Capture compare match rising edge interrupt
169  * enable for channel CC61 */
170  IfxCcu6_InterruptSource_cc61FallingEdge = IFX_CCU6_IS_ICC61F_OFF, /**< \brief Capture compare match falling edge interrupt
171  * enable for channel CC61 */
172  IfxCcu6_InterruptSource_cc62RisingEdge = IFX_CCU6_IS_ICC62R_OFF, /**< \brief Capture compare match rising edge interrupt
173  * enable for channel CC62 */
174  IfxCcu6_InterruptSource_cc62FallingEdge = IFX_CCU6_IS_ICC62F_OFF, /**< \brief Capture compare match falling edge interrupt
175  * enable for channel CC62 */
176  IfxCcu6_InterruptSource_t12OneMatch = IFX_CCU6_IS_T12OM_OFF, /**< \brief Interrupt enable for T12 one-match */
177  IfxCcu6_InterruptSource_t12PeriodMatch = IFX_CCU6_IS_T12PM_OFF, /**< \brief Interrupt enable for T12 period-match */
178  IfxCcu6_InterruptSource_t13CompareMatch = IFX_CCU6_IS_T13CM_OFF, /**< \brief Interrupt enable for T13 compare-match */
179  IfxCcu6_InterruptSource_t13PeriodMatch = IFX_CCU6_IS_T13PM_OFF, /**< \brief Interrupt enable for T13 period-match */
180  IfxCcu6_InterruptSource_trap = IFX_CCU6_IS_TRPF_OFF, /**< \brief Interrupt enable for trap flag */
181  IfxCcu6_InterruptSource_correctHallEvent = IFX_CCU6_IS_CHE_OFF, /**< \brief Interrupt enable for correct hall event */
182  IfxCcu6_InterruptSource_wrongHallEvent = IFX_CCU6_IS_WHE_OFF /**< \brief Interrupt enable for wrong hall event */
184 
185 /** \brief Selection of the trigger request source (next multi-channel event) for the shadow transfer MCM_ST from MCMPS to MCMP\n
186  * Definition in Ifx_CCU.MCMCTR.B.SWSEL
187  */
188 typedef enum
189 {
190  IfxCcu6_MultiChannelSwitchingSelect_noEvent = 0, /**< \brief No trigger request will be generated */
191  IfxCcu6_MultiChannelSwitchingSelect_correctHallEvent = 1, /**< \brief Correct Hall pattern detected (CM_CHE) */
192  IfxCcu6_MultiChannelSwitchingSelect_t13PeriodMatch = 2, /**< \brief T13 period-match detected (while counting up) */
193  IfxCcu6_MultiChannelSwitchingSelect_t12OneMatch = 3, /**< \brief T12 one-match (while counting down) */
194  IfxCcu6_MultiChannelSwitchingSelect_t12Channel1CompareMatch = 4, /**< \brief T12 channel 1 compare-match detected (phase
195  * delay function) */
196  IfxCcu6_MultiChannelSwitchingSelect_t12PeriodMatch = 5 /**< \brief T12 period match detected (while counting up) */
198 
199 /** \brief Selection of the synchronization mechanism for the shadow transfer event MCM_ST\n
200  * Definition in Ifx_CCU.MCMCTR.B.SWSYN
201  */
202 typedef enum
203 {
204  IfxCcu6_MultiChannelSwitchingSync_direct = 0, /**< \brief Direct, the trigger event immediately leads to the
205  * shadow transfer */
206  IfxCcu6_MultiChannelSwitchingSync_t13ZeroMatch = 1, /**< \brief A T13 zero-match triggers the shadow transfer */
207  IfxCcu6_MultiChannelSwitchingSync_t12ZeroMatch = 2 /**< \brief A T12 zero-match (while counting up) triggers the
208  * shadow transfer */
210 
211 /** \brief Selection of service request outputs
212  */
213 typedef enum
214 {
215  IfxCcu6_ServiceRequest_0 = 0, /**< \brief Service request output SR0 */
216  IfxCcu6_ServiceRequest_1, /**< \brief Service request output SR1 */
217  IfxCcu6_ServiceRequest_2, /**< \brief Service request output SR2 */
218  IfxCcu6_ServiceRequest_3 /**< \brief Service request output SR3 */
220 
221 /** \brief Enable/disable the sensitivity of the module to sleep signal\n
222  * Definition in Ifx_CCU6.CLC.B.EDIS
223  */
224 typedef enum
225 {
226  IfxCcu6_SleepMode_enable = 0, /**< \brief enables sleep mode */
227  IfxCcu6_SleepMode_disable = 1 /**< \brief disables sleep mode */
229 
230 /** \brief Capture compare channel of Timer12
231  */
232 typedef enum
233 {
234  IfxCcu6_T12Channel_0 = 0, /**< \brief T12 channel CC60 */
235  IfxCcu6_T12Channel_1, /**< \brief T12 channel CC61 */
236  IfxCcu6_T12Channel_2 /**< \brief T12 channel CC62 */
238 
239 /** \brief The operating mode for the T12 channels are defined by the bit fields Ifx_CCU.T12MSEL.MSEL6x.
240  */
241 typedef enum
242 {
243  IfxCcu6_T12ChannelMode_off = 0, /**< \brief Capture/Compare modes switched off */
244  IfxCcu6_T12ChannelMode_compareMode = 1, /**< \brief Compare mode */
245  IfxCcu6_T12ChannelMode_doubleRegisterCaptureRisingAndFalling = 4, /**< \brief CC6xIN rising edge: T12 stored in CC6xR, falling edge: T12 stored in CC6xSR */
246  IfxCcu6_T12ChannelMode_doubleRegisterCaptureRising = 5, /**< \brief CC6xIN rising edge: CC6nSR stored in CC6xR, falling edge: T12 stored in CC6xSR */
247  IfxCcu6_T12ChannelMode_doubleRegisterCaptureFalling = 6, /**< \brief CC6xIN rising edge: CC6nSR stored in CC6xR, falling edge: T12 stored in CC6xSR */
248  IfxCcu6_T12ChannelMode_doubleRegisterCaptureAny = 7, /**< \brief CC6xIN any active edge: CC6nSR stored in CC6xR, any active edge: T12 stored in CC6xSR */
249  IfxCcu6_T12ChannelMode_hallSensor = 8, /**< \brief Hall Sensor Mode, In order to properly enable this mode, all three MSEL6x fields have to be
250  * programmed to Hall Sensor mode */
251  IfxCcu6_T12ChannelMode_hysteresisLikecompare = 9, /**< \brief Hysteresis-like compare mode */
252  IfxCcu6_T12ChannelMode_multiInputCaptureRisingAndFalling = 10, /**< \brief CC6xIN rising edge: T12 stored in CC6xR, CCPOSx falling edge: T12 stored in CC6xSR */
253  IfxCcu6_T12ChannelMode_multiInputCaptureFallingAndRising = 11, /**< \brief CC6xIN falling edge: T12 stored in CC6xR, CCPOSx rising edge: T12 stored in CC6xSR */
254  IfxCcu6_T12ChannelMode_multiInputCaptureBothRising = 12, /**< \brief CC6xIN rising edge: T12 stored in CC6xR, CCPOSx rising edge: T12 stored in CC6xSR */
255  IfxCcu6_T12ChannelMode_multiInputCaptureBothFalling = 13, /**< \brief CC6xIN falling edge: T12 stored in CC6xR, CCPOSx falling edge: T12 stored in CC6xSR */
256  IfxCcu6_T12ChannelMode_multiInputCaptureAny = 14 /**< \brief CC6xIN any active edge : T12 stored in CC6xR, CCPOSx any active edge: T12 stored in CC6xSR */
258 
259 /** \brief Counting direction of Timer12\n
260  * Definition in Ifx_CCU.TCTR0.B.CDIR
261  */
262 typedef enum
263 {
264  IfxCcu6_T12CountDirection_up = 0, /**< \brief Counting up */
265  IfxCcu6_T12CountDirection_down = 1 /**< \brief Counting down */
267 
268 /** \brief Operating mode of Timer 12\n
269  * Definition in Ifx_CCU.TCTR0.B.CTM
270  */
271 typedef enum
272 {
273  IfxCcu6_T12CountMode_edgeAligned = 0, /**< \brief T12 always counts up and continues counting
274  * from zero after reaching the period value. */
275  IfxCcu6_T12CountMode_centerAligned = 1 /**< \brief T12 counts down after detecting a period-match
276  * and counts up after detecting a one-match. */
278 
279 /** \brief Delivers additional information to control the automatic set of bit T13R in the case that the trigger action defined by T13 trigger event control (T13TEC) is detected.\n
280  * Definition in Ifx_CCU.TCTR2.B.T13TED
281  */
282 typedef enum
283 {
284  IfxCcu6_T13TriggerDirection_noAction = 0, /**< \brief no action */
285  IfxCcu6_T13TriggerDirection_onT12CountingUp = 1, /**< \brief while T12 is counting up */
286  IfxCcu6_T13TriggerDirection_onT12CountingDown = 2, /**< \brief while T12 is counting down */
287  IfxCcu6_T13TriggerDirection_anyT12 = 3 /**< \brief independent on the count direction of T12 */
289 
290 /** \brief Selects the trigger event to start T13 (automatic set of T13R for synchronization to T12 compare signals)\n
291  * Definition in Ifx_CCU.TCTR2.B.T13TEC
292  */
293 typedef enum
294 {
295  IfxCcu6_T13TriggerEvent_noAction = 0, /**< \brief no action */
296  IfxCcu6_T13TriggerEvent_onCC60RCompare = 1, /**< \brief set T13R on a T12 compare event on channel 0 */
297  IfxCcu6_T13TriggerEvent_onCC61RCompare = 2, /**< \brief set T13R on a T12 compare event on channel 1 */
298  IfxCcu6_T13TriggerEvent_onCC62RCompare = 3, /**< \brief set T13R on a T12 compare event on channel 2 */
299  IfxCcu6_T13TriggerEvent_onAnyT12Compare = 4, /**< \brief set T13R on any T12 compare event (ch. 0, 1, 2) */
300  IfxCcu6_T13TriggerEvent_onT12Period = 5, /**< \brief set T13R upon a period-match of T12 */
301  IfxCcu6_T13TriggerEvent_onT12Zero = 6, /**< \brief set T13R upon a zero-match of T12 (while
302  * counting up) */
303  IfxCcu6_T13TriggerEvent_onCCPOSxEdge = 7 /**< \brief set T13R on any edge of inputs CCPOSx */
305 
306 /** \brief Timer number ( T12 / T13 )
307  */
308 typedef enum
309 {
310  IfxCcu6_TimerId_t12 = 0, /**< \brief Timer 12 */
311  IfxCcu6_TimerId_t13 = 1 /**< \brief Timer 13 */
313 
314 /** \brief Selects the input clock for timers (T12 or T13) that is derived from the peripheral clock according to the equation\n
315  * Definition in Ifx_CCU.TCTR0.B.T12CLK / Ifx_CCU.TCTR0.B.T13CLK
316  */
317 typedef enum
318 {
319  IfxCcu6_TimerInputClock_fcc6 = 0, /**< \brief fcc6 */
320  IfxCcu6_TimerInputClock_fcc6By2 = 1, /**< \brief fcc6 / 2 */
321  IfxCcu6_TimerInputClock_fcc6By4 = 2, /**< \brief fcc6 / 4 */
322  IfxCcu6_TimerInputClock_fcc6By8 = 3, /**< \brief fcc6 / 8 */
323  IfxCcu6_TimerInputClock_fcc6By16 = 4, /**< \brief fcc6 / 16 */
324  IfxCcu6_TimerInputClock_fcc6By32 = 5, /**< \brief fcc6 / 32 */
325  IfxCcu6_TimerInputClock_fcc6By64 = 6, /**< \brief fcc6 / 64 */
326  IfxCcu6_TimerInputClock_fcc6By128 = 7 /**< \brief fcc6 / 128 */
328 
329 /** \brief Selection of actual input signal for the timer inputs
330  */
331 typedef enum
332 {
333  IfxCcu6_TimerInputSignal_a = 0, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
334  IfxCcu6_TimerInputSignal_b = 1, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
335  IfxCcu6_TimerInputSignal_c = 2, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
336  IfxCcu6_TimerInputSignal_d = 3, /**< \brief defines the input signal used as CC6x / CTRAP / CCPOSx / T1xHR input. */
337  IfxCcu6_TimerInputSignal_e = 0, /**< \brief defines the input signal used as T1xHR input. */
338  IfxCcu6_TimerInputSignal_f = 1, /**< \brief defines the input signal used as T1xHR input. */
339  IfxCcu6_TimerInputSignal_g = 2, /**< \brief defines the input signal used as T1xHR input. */
340  IfxCcu6_TimerInputSignal_h = 3 /**< \brief defines the input signal used as T1xHR input. */
342 
343 /** \brief Timer (T12 / T13) run status\n
344  * Definition in Ifx_CCU.TCTR0.B.T12R and Ifx_CCU.TCTR0.B.T13R
345  */
346 typedef enum
347 {
348  IfxCcu6_TimerRunStatus_stopped = 0, /**< \brief Timer T1x is stopped. */
349  IfxCcu6_TimerRunStatus_running = 1 /**< \brief Timer T1x is running. */
351 
352 /** \brief Defines how the trap flag TRPF can be cleared after the trap input condition is no longer valid (either by CTRAP = 1 or by TRPPEN = 0)\n
353  * Definition in Ifx_CCU.TRPCTR.B.TRPM2
354  */
355 typedef enum
356 {
357  IfxCcu6_TrapMode_automatic = 0, /**< \brief Bit TRPF is cleared by HW */
358  IfxCcu6_TrapMode_manual = 1 /**< \brief Bit TRPF stays 0, It has to be cleared by SW by writing
359  * ISR.RTRPF = 1 */
361 
362 /** \brief Defines the behavior of the selected outputs when leaving the trap state, after the trap condition has become inactive again\n
363  * Definition in Ifx_CCU.TRPCTR.B.TRPMx (x = 0, 1)
364  */
365 typedef enum
366 {
367  IfxCcu6_TrapState_t12Sync = 0, /**< \brief The trap state is left when a zero-match
368  * of T12 (while counting up) is detected */
369  IfxCcu6_TrapState_t13Sync = 1, /**< \brief The trap state is left when a zeromatch
370  * of T13 is detected */
371  IfxCcu6_TrapState_immediate = 3 /**< \brief The trap state is left immediately without any synchronization to T12 or T13 */
373 
374 /** \} */
375 
376 /** \addtogroup IfxLld_Ccu6_Std_Operative
377  * \{ */
378 
379 /******************************************************************************/
380 /*-------------------------Inline Function Prototypes-------------------------*/
381 /******************************************************************************/
382 
383 /** \brief Clears the counters of the Timers (T12, T13 individually or together based on the selection)
384  * \param ccu6 Pointer to the base of CCU6 registers
385  * \param t12 Timer12 choice (enable / disable)
386  * \param t13 Timer13 choice (enable / disable)
387  * \return None
388  */
389 IFX_INLINE void IfxCcu6_clearCounter(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
390 
391 /** \brief Clears all the three dead-time counter channels to zero.
392  * \param ccu6 Pointer to the base of CCU6 registers
393  * \return None
394  */
395 IFX_INLINE void IfxCcu6_clearDeadTimeCounters(Ifx_CCU6 *ccu6);
396 
397 /** \brief Clears the selected interrupt flag
398  * \param ccu6 Pointer to the base of CCU6 registers
399  * \param source Interrupt source selection
400  * \return None
401  */
403 
404 /** \brief Clears the T12 One notification
405  * \param ccu6 Pointer to the base of CCU6 registers
406  * \return None
407  */
408 IFX_INLINE void IfxCcu6_clearT12OneNotification(Ifx_CCU6 *ccu6);
409 
410 /** \brief Clears the T12 period notification
411  * \param ccu6 Pointer to the base of CCU6 registers
412  * \return None
413  */
415 
416 /** \brief Clears the T13 compare notification
417  * \param ccu6 Pointer to the base of CCU6 registers
418  * \return None
419  */
421 
422 /** \brief Returns the Timer pointer
423  * \param ccu6 Pointer to the base of CCU6 registers
424  * \return Timer pointer
425  */
426 IFX_INLINE volatile uint32 *IfxCcu6_getT12TimerPointer(Ifx_CCU6 *ccu6);
427 
428 /** \brief Returns the status of module enabled or disabled
429  * \param ccu6 Pointer to the base of CCU6 registers
430  * \return Status (TRUE / FALSE)
431  */
432 IFX_INLINE boolean IfxCcu6_isModuleEnabled(Ifx_CCU6 *ccu6);
433 
434 /** \brief Returns the status of T12 one notification
435  * \param ccu6 Pointer to the base of CCU6 registers
436  * \return Status (TRUE / FALSE)
437  */
438 IFX_INLINE boolean IfxCcu6_isT12OneNotification(Ifx_CCU6 *ccu6);
439 
440 /** \brief Returns the status of T12 period notification
441  * \param ccu6 Pointer to the base of CCU6 registers
442  * \return Status (TRUE / FALSE)
443  */
444 IFX_INLINE boolean IfxCcu6_isT12PeriodNotification(Ifx_CCU6 *ccu6);
445 
446 /** \brief Returns the status of T13 compare notification
447  * \param ccu6 Pointer to the base of CCU6 registers
448  * \return Status (TRUE / FALSE)
449  */
450 IFX_INLINE boolean IfxCcu6_isT13CompareNotification(Ifx_CCU6 *ccu6);
451 
452 /** \brief Sets the input event leading to a counting action of Timers (T12 / T13).
453  * \param ccu6 Pointer to the base of CCU6 registers
454  * \param timer Timer selection, ( Timer12 / Timer13 )
455  * \param mode Input event leading to a counting action of the timer (T12 / T13)
456  * \return None
457  */
459 
460 /** \brief Sets the current hall pattern for the multichannel mode (writes into shadow register)
461  * \param ccu6 Pointer to the base of CCU6 registers
462  * \param pattern Current hall pattern
463  * \return None
464  */
465 IFX_INLINE void IfxCcu6_setCurrentHallPattern(Ifx_CCU6 *ccu6, uint8 pattern);
466 
467 /** \brief Sets the delay between switching from the passive state to the active state of the selected outputs (dead time)
468  * \param ccu6 Pointer to the base of CCU6 registers
469  * \param value Value of the dead time to be induced
470  * \return None
471  */
472 IFX_INLINE void IfxCcu6_setDeadTimeValue(Ifx_CCU6 *ccu6, uint8 value);
473 
474 /** \brief Sets the expected hall pattern for the multichannel mode (writes into shadow register)
475  * \param ccu6 Pointer to the base of CCU6 registers
476  * \param pattern Expected hall pattern
477  * \return None
478  */
479 IFX_INLINE void IfxCcu6_setExpectedHallPattern(Ifx_CCU6 *ccu6, uint8 pattern);
480 
481 /** \brief Sets the event of signal T1xHR that can set the run bit T1xR by HW
482  * \param ccu6 Pointer to the base of CCU6 registers
483  * \param timer Timer selection, ( Timer12 / Timer13 )
484  * \param mode External trigger mode
485  * \return None
486  */
488 
489 /** \brief Sets source for the sampling of the Hall input pattern and the comparison to the current and the expected Hall pattern bit fields
490  * \param ccu6 Pointer to the base of CCU6 registers
491  * \param mode Hall sensor input trigger event
492  * \return None
493  */
495 
496 /** \brief Sets the input clock for timers (T12 or T13)
497  * \param ccu6 Pointer to the base of CCU6 registers
498  * \param timer Timer selection, ( Timer12 / Timer13 )
499  * \param frequency Input clock for timers (T12 or T13)
500  * \return None
501  */
503 
504 /** \brief Sets the selected interrupt flag
505  * \param ccu6 Pointer to the base of CCU6 registers
506  * \param source Interrupt source selection
507  * \return None
508  */
510 
511 /** \brief Sets the output pattern for the multichannel mode (writes into shadow register)
512  * \param ccu6 Pointer to the base of CCU6 registers
513  * \param pattern Output pattern for the multichannel mode.
514  * \return None
515  */
516 IFX_INLINE void IfxCcu6_setMultiChannelPwmPattern(Ifx_CCU6 *ccu6, uint8 pattern);
517 
518 /** \brief Sets the trigger request source (next multi-channel event) for the shadow transfer MCM_ST from MCMPS to MCMP
519  * \param ccu6 Pointer to the base of CCU6 registers
520  * \param mode Trigger request source (next multi-channel event) for the shadow transfer MCM_ST
521  * \return None
522  */
524 
525 /** \brief Sets the synchronization mechanism of the shadow transfer event MCM_ST\n
526  * if it has been requested before (flag R set by an event selected by SWSEL) and if MCMEN = 1
527  * \param ccu6 Pointer to the base of CCU6 registers
528  * \param sync Synchronization mechanism of the shadow transfer event MCM_ST
529  * \return None
530  */
532 
533 /** \brief Sets the state of the corresponding compare channel, that is considered to be the passive state
534  * \param ccu6 Pointer to the base of CCU6 registers
535  * \param channelOut Capture compare output selection
536  * \param state FALSE: passive state when CC6xST == 0\n
537  * TRUE : passive state when CC6xST == 1
538  * \return None
539  */
540 IFX_INLINE void IfxCcu6_setOutputPassiveState(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut, boolean state);
541 
542 /** \brief Enables / Disables the single shot mode of Timers (T12, T13 individually or together based on the selection)
543  * \param ccu6 Pointer to the base of CCU6 registers
544  * \param t12 Timer12 choice (enable / disable)
545  * \param t13 Timer13 choice (enable / disable)
546  * \return None
547  */
548 IFX_INLINE void IfxCcu6_setSingleShotModeEnable(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
549 
550 /** \brief Sets the operating mode of the Timer12 capture/compare channels
551  * \param ccu6 Pointer to the base of CCU6 registers
552  * \param channel Timer12 Capture compare channel number
553  * \param mode The operating mode for the T12 channels
554  * \return None
555  */
557 
558 /**
559  * \param ccu6 Pointer to the base of CCU6 registers
560  * \param mode Operating mode of Timer 12
561  * \return None
562  */
563 IFX_INLINE void IfxCcu6_setT12CountMode(Ifx_CCU6 *ccu6, IfxCcu6_T12CountMode mode);
564 
565 /** \brief Sets the 16-bit counter value of Timer12
566  * \param ccu6 Pointer to the base of CCU6 registers
567  * \param value Counter value
568  * \return None
569  */
570 IFX_INLINE void IfxCcu6_setT12CounterValue(Ifx_CCU6 *ccu6, uint16 value);
571 
572 /** \brief Sets the period value that leads Timer12 counter value to a period-match
573  * \param ccu6 Pointer to the base of CCU6 registers
574  * \param value Period value
575  * \return None
576  */
577 IFX_INLINE void IfxCcu6_setT12PeriodValue(Ifx_CCU6 *ccu6, uint16 value);
578 
579 /** \brief Sets the 16-bit compare value of Timer13 (writes into shadow register)
580  * \param ccu6 Pointer to the base of CCU6 registers
581  * \param value Compare value
582  * \return None
583  */
584 IFX_INLINE void IfxCcu6_setT13CompareValue(Ifx_CCU6 *ccu6, uint16 value);
585 
586 /** \brief Sets the 16-bit counter value of Timer13
587  * \param ccu6 Pointer to the base of CCU6 registers
588  * \param value counter value
589  * \return None
590  */
591 IFX_INLINE void IfxCcu6_setT13CounterValue(Ifx_CCU6 *ccu6, uint16 value);
592 
593 /** \brief Sets the period value that leads Timer13 counter value to a period-match
594  * \param ccu6 Pointer to the base of CCU6 registers
595  * \param value period value
596  * \return None
597  */
598 IFX_INLINE void IfxCcu6_setT13PeriodValue(Ifx_CCU6 *ccu6, uint16 value);
599 
600 /** \brief Sets the Timer13 trigger event direction
601  * \param ccu6 Pointer to the base of CCU6 registers
602  * \param direction T13 trigger event direction
603  * \return None
604  */
606 
607 /** \brief Sets the trigger event to start Timer13 (automatic set of T13R for synchronization to Timer12 compare signals)
608  * \param ccu6 Pointer to the base of CCU6 registers
609  * \param mode The trigger event to start T13
610  * \return None
611  */
613 
614 /** \brief Sets the mode of clearing the trap flag TRPF after the trap input condition is no longer valid
615  * \param ccu6 Pointer to the base of CCU6 registers
616  * \param mode Trap mode selection
617  * \return None
618  */
619 IFX_INLINE void IfxCcu6_setTrapMode(Ifx_CCU6 *ccu6, IfxCcu6_TrapMode mode);
620 
621 /** \brief Sets behaviour of the selected outputs when leaving the trap state after the trap condition has become inactive again.
622  * \param ccu6 Pointer to the base of CCU6 registers
623  * \param state Trap state selection
624  * \return None
625  */
626 IFX_INLINE void IfxCcu6_setTrapState(Ifx_CCU6 *ccu6, IfxCcu6_TrapState state);
627 
628 /** \brief starts the timers (T12, T13 individually or together based on the selection)
629  * \param ccu6 Pointer to the base of CCU6 registers
630  * \param t12 Timer12 start choice (enable / disable)
631  * \param t13 Timer13 start choice (enable / disable)
632  * \return None
633  */
634 IFX_INLINE void IfxCcu6_startTimer(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
635 
636 /** \brief starts the timers (T12, T13 individually or together based on the selection)
637  * \param ccu6 Pointer to the base of CCU6 registers
638  * \param t12 Timer12 stop choice (enable / disable)
639  * \param t13 Timer13 stop choice (enable / disable)
640  * \return None
641  */
642 IFX_INLINE void IfxCcu6_stopTimer(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
643 
644 /** \brief Updates the hall pattern (current hall, expected hall, moduleation output), in a single write
645  * \param ccu6 Pointer to the base of CCU6 registers
646  * \param currentHall Current hall pattern
647  * \param expectedHall Expected hall pattern
648  * \param output Output pattern for the multichannel mode.
649  * \return None
650  */
651 IFX_INLINE void IfxCcu6_updateHallPattern(Ifx_CCU6 *ccu6, uint8 currentHall, uint8 expectedHall, uint8 output);
652 
653 /******************************************************************************/
654 /*-------------------------Global Function Prototypes-------------------------*/
655 /******************************************************************************/
656 
657 /**
658  * \param ccu6 Specifies Ccu6 module
659  * \param outputLine Output Line
660  * \param selectedTrigger Trigger selection
661  * \return None
662  */
663 IFX_EXTERN void IfxCcu6_connectTrigger(Ifx_CCU6 *ccu6, IfxCcu6_TrigOut outputLine, IfxCcu6_TrigSel selectedTrigger);
664 
665 /** \brief Routes the interrupt node pointer to the selected service requests
666  * \param ccu6 Pointer to the base of CCU6 registers
667  * \param source Interrupt source selection
668  * \param serviceRequest Selection of service request outputs
669  * \return None
670  */
671 IFX_EXTERN void IfxCcu6_routeInterruptNode(Ifx_CCU6 *ccu6, IfxCcu6_InterruptSource source, IfxCcu6_ServiceRequest serviceRequest);
672 
673 /** \brief Sets the passive state level of the PWM outputs of the module
674  * \param ccu6 Pointer to the base of CCU6 registers
675  * \param channelOut Capture compare output selection
676  * \param state FALSE: The passive level is 0.
677  * TRUE : The passive level is 1.
678  * \return None
679  */
680 IFX_EXTERN void IfxCcu6_setOutputPassiveLevel(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut, boolean state);
681 
682 /** \brief Sets software-control (independent set and clear conditions) for the Timer12 channel state bits CC6xST (x=0,1,2)
683  * \param ccu6 Pointer to the base of CCU6 registers
684  * \param channel Timer12 Capture compare channel number
685  * \param state capture/compare state selection (set / clear / toggle)
686  * \return None
687  */
689 
690 /** \brief Sets the 16-bit compare value of Timer12 (writes into shadow registers)
691  * \param ccu6 Pointer to the base of CCU6 registers
692  * \param channel Timer12 Capture compare channel number
693  * \param value Compare value
694  * \return None
695  */
696 IFX_EXTERN void IfxCcu6_setT12CompareValue(Ifx_CCU6 *ccu6, IfxCcu6_T12Channel channel, uint16 value);
697 
698 /** \brief Sets the frequency and clock input of the Timer 12
699  * \param ccu6 Pointer to the base of CCU6 registers
700  * \param frequency Requested timer frequency in Hz
701  * \param resolution Pointer to requested minimum timer resolution in ticks
702  * \param countMode Counting mode of Timer12
703  * \return Zero, if the function failed to fulfill requested frequency and resolution\n
704  * Positive, if the function can find settings close to the requested frequency and resolution above the requested
705  */
706 IFX_EXTERN float32 IfxCcu6_setT12Frequency(Ifx_CCU6 *ccu6, float32 frequency, Ifx_TimerValue resolution, IfxCcu6_T12CountMode countMode);
707 
708 /** \brief selects the actual input signal for the timer inputs.
709  * \param ccu6 Pointer to the base of CCU6 registers
710  * \param extInput External input signal for the Timer 12
711  * \return None
712  */
713 IFX_EXTERN void IfxCcu6_setT12InputSignal(Ifx_CCU6 *ccu6, IfxCcu6_T12hr_In *extInput);
714 
715 /** \brief Sets software-control (independent set and clear conditions) for the Timer13 channel state bits CC63ST
716  * \param ccu6 Pointer to the base of CCU6 registers
717  * \param state capture/compare state selection (set / clear / toggle)
718  * \return None
719  */
721 
722 /** \brief Sets the frequency and clock input of the Timer 13
723  * \param ccu6 Pointer to the base of CCU6 registers
724  * \param frequency Requested timer frequency in Hz
725  * \param resolution Pointer to requested minimum timer resolution in ticks
726  * \return Zero, if the function failed to fulfill requested frequency and resolution\n
727  * Positive, if the function can find settings close to the requested frequency and resolution above the requested
728  */
729 IFX_EXTERN float32 IfxCcu6_setT13Frequency(Ifx_CCU6 *ccu6, float32 frequency, Ifx_TimerValue resolution);
730 
731 /** \brief selects the actual input signal for the timer inputs.
732  * \param ccu6 Pointer to the base of CCU6 registers
733  * \param extInput External input signal for the Timer 13
734  * \return None
735  */
736 IFX_EXTERN void IfxCcu6_setT13InputSignal(Ifx_CCU6 *ccu6, IfxCcu6_T13hr_In *extInput);
737 
738 /** \} */
739 
740 /** \addtogroup IfxLld_Ccu6_Std_Utility
741  * \{ */
742 
743 /******************************************************************************/
744 /*-------------------------Inline Function Prototypes-------------------------*/
745 /******************************************************************************/
746 
747 /** \brief Indicate the status of the dead time generation for each compare channel (0, 1, 2) of timer T12
748  * \param ccu6 Pointer to the base of CCU6 registers
749  * \param channel Timer12 Capture compare channel number
750  * \return Status TRUE or FALSE
751  */
752 IFX_INLINE boolean IfxCcu6_getDeadTimeStatus(Ifx_CCU6 *ccu6, IfxCcu6_T12Channel channel);
753 
754 /** \brief Returns the value of the input Hall pattern of the Timer12 capture/compare channels CC6POS6x (x = 0, 1, 2)\n
755  * that has been compared to the current and expected value
756  * \param ccu6 Pointer to the base of CCU6 registers
757  * \param channel Timer12 Capture compare channel number
758  * \return Status\n
759  * TRUE : The input CCPOSx has been sampled as 0\n
760  * FALSE : The input CCPOSx has been sampled as 1
761  */
762 IFX_INLINE boolean IfxCcu6_getHallPatternSampleState(Ifx_CCU6 *ccu6, IfxCcu6_T12Channel channel);
763 
764 /** \brief Gets the status of the selected interrupt flag
765  * \param ccu6 Pointer to the base of CCU6 registers
766  * \param source Interrupt source selection
767  * \return Status (TRUE / FALSE)
768  */
770 
771 /** \brief indicates if the multi-channel mode functionality is available
772  * \param ccu6 Pointer to the base of CCU6 registers
773  * \return Status (TRUE / FALSE)
774  */
776 
777 /** \brief Gets the status of the shadow transfer request from MCMPS to MCMP
778  * \param ccu6 Pointer to the base of CCU6 registers
779  * \return Status\n
780  * FALSE: A shadow transfer MCM_ST is not requested\n
781  * TRUE: A shadow transfer MCM_ST is requested, but has not yet been executed
782  */
784 
785 /** \brief Returns the Timer (T12 / T13) shadow transfer enable status
786  * \param ccu6 Pointer to the base of CCU6 registers
787  * \param timer Timer selection, ( Timer12 / Timer13 )
788  * \return Status (TRUE: enable / FALSE: disable)
789  */
790 IFX_INLINE boolean IfxCcu6_getShadowTransferStatus(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
791 
792 /** \brief Returns the state of the Timer12 capture/compare channels CC6xST (x = 0, 1, 2)
793  * \param ccu6 Pointer to the base of CCU6 registers
794  * \param channel Timer12 Capture compare channel number
795  * \return Status TRUE or FALSE
796  */
797 IFX_INLINE boolean IfxCcu6_getT12CaptureCompareState(Ifx_CCU6 *ccu6, IfxCcu6_T12Channel channel);
798 
799 /** \brief Returns the current counting direction of Timer12
800  * \param ccu6 Pointer to the base of CCU6 registers
801  * \return direction (up / down)
802  */
804 
805 /** \brief Returns the state of the Timer13 capture/compare channel CC63ST
806  * \param ccu6 Pointer to the base of CCU6 registers
807  * \return Status TRUE or FALSE
808  */
809 IFX_INLINE boolean IfxCcu6_getT13CaptureCompareState(Ifx_CCU6 *ccu6);
810 
811 /** \brief indicates the Timer blocks (T12 / T13) availability
812  * \param ccu6 Pointer to the base of CCU6 registers
813  * \param timer Timer selection, ( Timer12 / Timer13 )
814  * \return Status (TRUE / FALSE)
815  */
816 IFX_INLINE boolean IfxCcu6_getTimerAvailabilityStatus(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
817 
818 /** \brief Returns the Timer (T12 / T13) run status
819  * \param ccu6 Pointer to the base of CCU6 registers
820  * \param timer Timer selection, ( Timer12 / Timer13 )
821  * \return Status (stopped / running)
822  */
824 
825 /******************************************************************************/
826 /*-------------------------Global Function Prototypes-------------------------*/
827 /******************************************************************************/
828 
829 /** \brief Returns the capture register value of the selected channel
830  * \param ccu6 Pointer to the base of CCU6 registers
831  * \param channel Timer12 Capture compare channel number
832  * \return current value of the capture register of a selected channel
833  */
835 
836 /** \brief Returns the capture shadow register value of the selected channel
837  * \param ccu6 Pointer to the base of CCU6 registers
838  * \param channel Timer12 Capture compare channel number
839  * \return current value of the capture shadow register of a selected channel
840  */
842 
843 /** \brief Returns CCU6 index
844  * \param ccu6 Specifies Ccu6 module
845  * \return Returns index. returns -1 in case of unknown index
846  */
847 IFX_EXTERN sint32 IfxCcu6_getIndex(Ifx_CCU6 *ccu6);
848 
849 /** \brief Returns the service request register
850  * \param ccu6 Specifies Ccu6 module
851  * \param serviceRequest Selection of service request outputs
852  * \return The service request register
853  */
854 IFX_EXTERN volatile Ifx_SRC_SRCR *IfxCcu6_getSrcAddress(Ifx_CCU6 *ccu6, IfxCcu6_ServiceRequest serviceRequest);
855 
856 /** \brief Returns the current value of the timer register
857  * \param ccu6 Pointer to the base of CCU6 registers
858  * \param timer Timer selection, ( Timer12 / Timer13 )
859  * \return current value of the timer register
860  */
861 IFX_EXTERN uint32 IfxCcu6_readTimer(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
862 
863 /** \} */
864 
865 /** \addtogroup IfxLld_Ccu6_Std_Configuration
866  * \{ */
867 
868 /******************************************************************************/
869 /*-------------------------Inline Function Prototypes-------------------------*/
870 /******************************************************************************/
871 
872 /** \brief Disables the additional prescaler of 1/256 can be enabled for the prescaler of T12 or T13 to support higher clock frequencies
873  * \param ccu6 Pointer to the base of CCU6 registers
874  * \param timer Timer selection, ( Timer12 / Timer13 )
875  * \return None
876  */
878 
879 /** \brief Disables the dead time generation for each compare channel (0, 1, 2) of Timer12
880  * \param ccu6 Pointer to the base of CCU6 registers
881  * \param channel Timer12 Capture compare channel number
882  * \return None
883  */
884 IFX_INLINE void IfxCcu6_disableDeadTime(Ifx_CCU6 *ccu6, IfxCcu6_T12Channel channel);
885 
886 /** \brief Disables the delay of the source signal for the sampling of the Hall input pattern (selected by HSYNC)
887  * \param ccu6 Pointer to the base of CCU6 registers
888  * \return None
889  */
890 IFX_INLINE void IfxCcu6_disableDelayBypass(Ifx_CCU6 *ccu6);
891 
892 /** \brief Disables the selected interrupt
893  * \param ccu6 Pointer to the base of CCU6 registers
894  * \param source Interrupt source selection
895  * \return None
896  */
897 IFX_INLINE void IfxCcu6_disableInterrupt(Ifx_CCU6 *ccu6, IfxCcu6_InterruptSource source);
898 
899 /** \brief Sets multi channel mode unavailable, A write access to MCMOUTS is ignored
900  * \param ccu6 Pointer to the base of CCU6 registers
901  * \return None
902  */
903 IFX_INLINE void IfxCcu6_disableMultiChannelMode(Ifx_CCU6 *ccu6);
904 
905 /** \brief Disables shadow transfers of the timers (T12, T13 individually or together based on the selection)
906  * \param ccu6 Pointer to the base of CCU6 registers
907  * \param t12 Timer12 choice (enable / disable)
908  * \param t13 Timer13 choice (enable / disable)
909  * \return None
910  */
911 IFX_INLINE void IfxCcu6_disableShadowTransfer(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
912 
913 /** \brief Disables the single shot-mode of Timers (T12 T13).
914  * \param ccu6 Pointer to the base of CCU6 registers
915  * \param timer Timer selection, ( Timer12 / Timer13 )
916  * \return None
917  */
918 IFX_INLINE void IfxCcu6_disableSingleShotMode(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
919 
920 /** \brief Disables the Inversion of T13 signal for the modulation of the CC6x and COUT6x (x = 0, 1, 2) signals\n
921  * T13 output CC63_O is equal to CC63ST
922  * \param ccu6 Pointer to the base of CCU6 registers
923  * \return None
924  */
926 
927 /** \brief Sets Timer12 block unavailable, A write access to T12PR is ignored
928  * \param ccu6 Pointer to the base of CCU6 registers
929  * \param timer Timer selection, ( Timer12 / Timer13 )
930  * \return None
931  */
932 IFX_INLINE void IfxCcu6_disableTimer(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
933 
934 /** \brief Disables the trap functionality for the corresponding output signals
935  * \param ccu6 Pointer to the base of CCU6 registers
936  * \param channelOut Capture compare output selection
937  * \return None
938  */
939 IFX_INLINE void IfxCcu6_disableTrap(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut);
940 
941 /** \brief Disables the input (pin) function for the trap generation
942  * \param ccu6 Pointer to the base of CCU6 registers
943  * \return None
944  */
945 IFX_INLINE void IfxCcu6_disableTrapPin(Ifx_CCU6 *ccu6);
946 
947 /** \brief Enables the additional prescaler of 1/256 can be enabled for the prescaler of T12 or T13 to support higher clock frequencies
948  * \param ccu6 Pointer to the base of CCU6 registers
949  * \param timer Timer selection, ( Timer12 / Timer13 )
950  * \return None
951  */
953 
954 /** \brief Sets the single shot-mode of Timers (T12, T13).
955  * \param ccu6 Pointer to the base of CCU6 registers
956  * \param t12 Timer12 choice (enable / disable)
957  * \param t13 Timer13 choice (enable / disable)
958  * \return None
959  */
960 IFX_INLINE void IfxCcu6_enableCountEvent(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
961 
962 /** \brief Enables the dead time generation for each compare channel (0, 1, 2) of Timer12
963  * \param ccu6 Pointer to the base of CCU6 registers
964  * \param channel Timer12 Capture compare channel number
965  * \return None
966  */
967 IFX_INLINE void IfxCcu6_enableDeadTime(Ifx_CCU6 *ccu6, IfxCcu6_T12Channel channel);
968 
969 /** \brief Enables the delay of the source signal for the sampling of the Hall input pattern (selected by HSYNC) by the Dead-Time Counter 0
970  * \param ccu6 Pointer to the base of CCU6 registers
971  * \return None
972  */
973 IFX_INLINE void IfxCcu6_enableDelayBypass(Ifx_CCU6 *ccu6);
974 
975 /** \brief Sets HP_ST immediately to update bit fields EXPH and CURH by EXPHS and CURHS
976  * \param ccu6 Pointer to the base of CCU6 registers
977  * \return None
978  */
980 
981 /** \brief Enables the selected interrupt
982  * \param ccu6 Pointer to the base of CCU6 registers
983  * \param source Interrupt source selection
984  * \return None
985  */
986 IFX_INLINE void IfxCcu6_enableInterrupt(Ifx_CCU6 *ccu6, IfxCcu6_InterruptSource source);
987 
988 /** \brief Sets multi channel mode available, A write access to MCMOUTS is executed
989  * \param ccu6 Pointer to the base of CCU6 registers
990  * \return None
991  */
992 IFX_INLINE void IfxCcu6_enableMultiChannelMode(Ifx_CCU6 *ccu6);
993 
994 /** \brief Sets MCM_ST immediately to update bit field MCMP by the value of MCMPS.
995  * \param ccu6 Pointer to the base of CCU6 registers
996  * \return None
997  */
999 
1000 /** \brief Enables the shadow transfer T12_ST if flag MCMOUT.R is set or\n
1001  * becomes set while a T12 one match is detected while counting down
1002  * \param ccu6 Pointer to the base of CCU6 registers
1003  * \return None
1004  */
1006 
1007 /** \brief Enables the shadow transfer T12_ST if flag MCMOUT.R is set or\n
1008  * becomes set while a T12 period match is detected while counting up
1009  * \param ccu6 Pointer to the base of CCU6 registers
1010  * \return None
1011  */
1013 
1014 /** \brief Enables the shadow transfer T13_ST if flag MCMOUT.R is set or\n
1015  * becomes set while a T13 period match is detected
1016  * \param ccu6 Pointer to the base of CCU6 registers
1017  * \return None
1018  */
1020 
1021 /** \brief Enables shadow transfers of the timers (T12, T13 individually or together based on the selection)
1022  * \param ccu6 Pointer to the base of CCU6 registers
1023  * \param t12 Timer12 choice (enable / disable)
1024  * \param t13 Timer13 choice (enable / disable)
1025  * \return None
1026  */
1027 IFX_INLINE void IfxCcu6_enableShadowTransfer(Ifx_CCU6 *ccu6, boolean t12, boolean t13);
1028 
1029 /** \brief Enables the single shot-mode of Timers (T12 T13).
1030  * \param ccu6 Pointer to the base of CCU6 registers
1031  * \param timer Timer selection, ( Timer12 / Timer13 )
1032  * \return None
1033  */
1034 IFX_INLINE void IfxCcu6_enableSingleShotMode(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
1035 
1036 /** \brief Enables the Inversion of T13 signal for the modulation of the CC6x and COUT6x (x = 0, 1, 2) signals\n
1037  * T13 output CC63_O is equal to CC63ST.
1038  * \param ccu6 Pointer to the base of CCU6 registers
1039  * \return None
1040  */
1041 IFX_INLINE void IfxCcu6_enableT13InvertedModulation(Ifx_CCU6 *ccu6);
1042 
1043 /** \brief Sets Timer12 block available, A write access to T12PR is executed
1044  * \param ccu6 Pointer to the base of CCU6 registers
1045  * \param timer Timer selection, ( Timer12 / Timer13 )
1046  * \return None
1047  */
1048 IFX_INLINE void IfxCcu6_enableTimer(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer);
1049 
1050 /** \brief Enables the trap functionality for the corresponding output signals
1051  * \param ccu6 Pointer to the base of CCU6 registers
1052  * \param channelOut Capture compare output selection
1053  * \return None
1054  */
1055 IFX_INLINE void IfxCcu6_enableTrap(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut);
1056 
1057 /** \brief Enables the input (pin) function for the trap generation
1058  * \param ccu6 Pointer to the base of CCU6 registers
1059  * \return None
1060  */
1061 IFX_INLINE void IfxCcu6_enableTrapPin(Ifx_CCU6 *ccu6);
1062 
1063 /** \brief selects the actual input signal for the capture compare inputs.
1064  * \param ccu6 Pointer to the base of CCU6 registers
1065  * \param input Input selection, ( CC6x capture input / CTRAP input / CCPOSx input )
1066  * \param signal selection of actual input signal for the module inputs
1067  * \return None
1068  */
1070 
1071 /******************************************************************************/
1072 /*-------------------------Global Function Prototypes-------------------------*/
1073 /******************************************************************************/
1074 
1075 /** \brief Disables the modulation of the corresponding output signal by PWM pattern generated by the timers T12 and T13.
1076  * \param ccu6 Pointer to the base of CCU6 registers
1077  * \param timer Timer selection, ( Timer12 / Timer13 )
1078  * \param channelOut Capture compare output selection
1079  * \return None
1080  */
1081 IFX_EXTERN void IfxCcu6_disableModulationOutput(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer, IfxCcu6_ChannelOut channelOut);
1082 
1083 /** \brief Enables the modulation of the corresponding output signal by PWM pattern generated by the timers T12 and T13.
1084  * \param ccu6 Pointer to the base of CCU6 registers
1085  * \param timer Timer selection, ( Timer12 / Timer13 )
1086  * \param channelOut Capture compare output selection
1087  * \return None
1088  */
1089 IFX_EXTERN void IfxCcu6_enableModulationOutput(Ifx_CCU6 *ccu6, IfxCcu6_TimerId timer, IfxCcu6_ChannelOut channelOut);
1090 
1091 /** \brief Enables the selected CCU6 kernel
1092  * \param ccu6 Pointer to the base of CCU6 registers
1093  * \return None
1094  */
1095 IFX_EXTERN void IfxCcu6_enableModule(Ifx_CCU6 *ccu6);
1096 
1097 /** \} */
1098 
1099 /** \addtogroup IfxLld_Ccu6_Std_IO
1100  * \{ */
1101 
1102 /******************************************************************************/
1103 /*-------------------------Inline Function Prototypes-------------------------*/
1104 /******************************************************************************/
1105 
1106 /** \brief Initialises a CC60 input pin
1107  * \param cc60In CC60 capture input CC60IN
1108  * \param inputMode The pin input mode which should be configured
1109  * \return None
1110  */
1112 
1113 /** \brief Initialises a CC60 output pin
1114  * \param cc60Out CC60 compare output CC0
1115  * \param outputMode The pin output mode which should be configured
1116  * \param padDriver The pad driver mode which should be configured
1117  * \return None
1118  */
1119 IFX_INLINE void IfxCcu6_initCc60OutPin(const IfxCcu6_Cc60_Out *cc60Out, IfxPort_OutputMode outputMode, IfxPort_PadDriver padDriver);
1120 
1121 /** \brief Initialises a CC61 input pin
1122  * \param cc61In CC61 capture input CC61IN
1123  * \param inputMode The pin input mode which should be configured
1124  * \return None
1125  */
1127 
1128 /** \brief Initialises a CC61 output pin
1129  * \param cc61Out CC61 compare output CC1
1130  * \param outputMode The pin output mode which should be configured
1131  * \param padDriver The pad driver mode which should be configured
1132  * \return None
1133  */
1134 IFX_INLINE void IfxCcu6_initCc61OutPin(const IfxCcu6_Cc61_Out *cc61Out, IfxPort_OutputMode outputMode, IfxPort_PadDriver padDriver);
1135 
1136 /** \brief Initialises a CC62 input pin
1137  * \param cc62In CC62 capture input CC62IN
1138  * \param inputMode The pin input mode which should be configured
1139  * \return None
1140  */
1142 
1143 /** \brief Initialises a CC62 output pin
1144  * \param cc62Out CC62 compare output CC2
1145  * \param outputMode The pin output mode which should be configured
1146  * \param padDriver The pad driver mode which should be configured
1147  * \return None
1148  */
1149 IFX_INLINE void IfxCcu6_initCc62OutPin(const IfxCcu6_Cc62_Out *cc62Out, IfxPort_OutputMode outputMode, IfxPort_PadDriver padDriver);
1150 
1151 /** \brief Initialises a CCPOS0 input pin
1152  * \param ccpos0 CC60 capture input CCPOS0
1153  * \param inputMode The pin input mode which should be configured
1154  * \return None
1155  */
1157 
1158 /** \brief Initialises a CCPOS1 input pin
1159  * \param ccpos1 CC61 capture input CCPOS1
1160  * \param inputMode The pin input mode which should be configured
1161  * \return None
1162  */
1164 
1165 /** \brief Initialises a CCPOS0 input pin
1166  * \param ccpos2 CC62 capture input CCPOS2
1167  * \param inputMode The pin input mode which should be configured
1168  * \return None
1169  */
1171 
1172 /** \brief Initialises a COUT60 output pin
1173  * \param cout60 CC60 compare output COUT0
1174  * \param outputMode The pin output mode which should be configured
1175  * \param padDriver The pad driver mode which should be configured
1176  * \return None
1177  */
1179 
1180 /** \brief Initialises a COUT61 output pin
1181  * \param cout61 CC61 compare output COUT1
1182  * \param outputMode The pin output mode which should be configured
1183  * \param padDriver The pad driver mode which should be configured
1184  * \return None
1185  */
1187 
1188 /** \brief Initialises a COUT62 output pin
1189  * \param cout62 CC62 compare output COUT2
1190  * \param outputMode The pin output mode which should be configured
1191  * \param padDriver The pad driver mode which should be configured
1192  * \return None
1193  */
1195 
1196 /** \brief Initialises a COUT63 output pin
1197  * \param cout63 CC63 compare output COUT3
1198  * \param outputMode The pin output mode which should be configured
1199  * \param padDriver The pad driver mode which should be configured
1200  * \return None
1201  */
1203 
1204 /** \brief Initialises a CTRAP input pin
1205  * \param ctrap CTRAP input
1206  * \param inputMode The pin input mode which should be configured
1207  * \return None
1208  */
1210 
1211 /** \brief Initialises a T12HR input pin
1212  * \param t12hrIn Timer 12 HR input T12HR
1213  * \param inputMode The pin input mode which should be configured
1214  * \return None
1215  */
1216 IFX_INLINE void IfxCcu6_initT12hrPin(const IfxCcu6_T12hr_In *t12hrIn, IfxPort_InputMode inputMode);
1217 
1218 /** \brief Initialises a T13HR input pin
1219  * \param t13hrIn Timer 12 HR input T12HR
1220  * \param inputMode The pin input mode which should be configured
1221  * \return None
1222  */
1223 IFX_INLINE void IfxCcu6_initT13hrPin(const IfxCcu6_T13hr_In *t13hrIn, IfxPort_InputMode inputMode);
1224 
1225 /** \} */
1226 
1227 /******************************************************************************/
1228 /*-------------------------Inline Function Prototypes-------------------------*/
1229 /******************************************************************************/
1230 
1231 /** \brief Sets the sensitivity of the module to sleep signal
1232  * \param ccu6 pointer to CCU6 registers
1233  * \param mode mode selection (enable/disable)
1234  * \return None
1235  */
1236 IFX_INLINE void IfxCcu6_setSleepMode(Ifx_CCU6 *ccu6, IfxCcu6_SleepMode mode);
1237 
1238 /******************************************************************************/
1239 /*-------------------------Global Function Prototypes-------------------------*/
1240 /******************************************************************************/
1241 
1242 /**
1243  * \param ccu6 pointer to ccu6 registers
1244  * \return None
1245  */
1246 IFX_EXTERN void IfxCcu6_resetModule(Ifx_CCU6 *ccu6);
1247 
1248 /******************************************************************************/
1249 /*---------------------Inline Function Implementations------------------------*/
1250 /******************************************************************************/
1251 
1252 IFX_INLINE void IfxCcu6_clearCounter(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1253 {
1254  Ifx_CCU6_TCTR4 tctr4;
1255  tctr4.U = 0;
1256  tctr4.B.T12RES = t12;
1257  tctr4.B.T13RES = t13;
1258  ccu6->TCTR4.U = tctr4.U;
1259 }
1260 
1261 
1263 {
1264  ccu6->TCTR4.B.DTRES = TRUE;
1265 }
1266 
1267 
1269 {
1270  uint32 mask = (1U << source);
1271  ccu6->ISR.U = mask;
1272 }
1273 
1274 
1276 {
1277  ccu6->ISR.B.RT12OM = 1;
1278 }
1279 
1280 
1282 {
1283  ccu6->ISR.B.RT12PM = 1;
1284 }
1285 
1286 
1288 {
1289  ccu6->ISR.B.RT13CM = 1;
1290 }
1291 
1292 
1294 {
1295  uint32 shift = ((timer * 8) + 3);
1296  uint32 mask = (1U << shift);
1297  ccu6->TCTR0.U = ccu6->TCTR0.U & ~(mask);
1298 }
1299 
1300 
1302 {
1303  uint32 shift = (8 + channel);
1304  uint32 mask = (1 << shift);
1305  ccu6->T12DTC.U = ccu6->T12DTC.U & ~(mask);
1306 }
1307 
1308 
1310 {
1311  ccu6->T12MSEL.B.DBYP = FALSE;
1312 }
1313 
1314 
1316 {
1317  uint32 mask = (1U << source);
1318  ccu6->IEN.U = ccu6->IEN.U & ~(mask);
1319 }
1320 
1321 
1323 {
1324  ccu6->MODCTR.B.MCMEN = FALSE;
1325 }
1326 
1327 
1328 IFX_INLINE void IfxCcu6_disableShadowTransfer(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1329 {
1330  Ifx_CCU6_TCTR4 tctr4;
1331  tctr4.U = 0;
1332  tctr4.B.T12STD = t12;
1333  tctr4.B.T13STD = t13;
1334  ccu6->TCTR4.U = tctr4.U;
1335 }
1336 
1337 
1339 {
1340  uint32 mask = (1U << timer);
1341  ccu6->TCTR2.U = ccu6->TCTR2.U & ~(mask);
1342 }
1343 
1344 
1346 {
1347  ccu6->CMPSTAT.B.T13IM = FALSE;
1348 }
1349 
1350 
1352 {
1353  uint32 mask = (1U << timer);
1354  ccu6->MCFG.U = ccu6->MCFG.U & ~(mask);
1355 }
1356 
1357 
1358 IFX_INLINE void IfxCcu6_disableTrap(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut)
1359 {
1360  uint32 shift = (8 + channelOut); // offset at location TRPCTR.8 for output CC60
1361  uint32 mask = (1U << shift);
1362  ccu6->TRPCTR.U = ccu6->TRPCTR.U & ~(mask);
1363 }
1364 
1365 
1367 {
1368  ccu6->TRPCTR.B.TRPPEN = FALSE;
1369 }
1370 
1371 
1373 {
1374  uint32 shift = ((timer * 8) + 2);
1375  uint32 mask = (1U << shift);
1376  ccu6->TCTR0.U = ccu6->TCTR0.U | (mask);
1377 }
1378 
1379 
1380 IFX_INLINE void IfxCcu6_enableCountEvent(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1381 {
1382  Ifx_CCU6_TCTR4 tctr4;
1383  tctr4.U = 0;
1384  tctr4.B.T12CNT = t12;
1385  tctr4.B.T13CNT = t13;
1386  ccu6->TCTR4.U = tctr4.U;
1387 }
1388 
1389 
1391 {
1392  uint32 shift = (8 + channel);
1393  uint32 mask = (1 << shift);
1394  ccu6->T12DTC.U = ccu6->T12DTC.U | (mask);
1395 }
1396 
1397 
1399 {
1400  ccu6->T12MSEL.B.DBYP = TRUE;
1401 }
1402 
1403 
1405 {
1406  ccu6->MCMOUTS.B.STRHP = TRUE;
1407 }
1408 
1409 
1411 {
1412  uint32 mask = (1U << source);
1413  ccu6->IEN.U = ccu6->IEN.U | (mask);
1414 }
1415 
1416 
1418 {
1419  ccu6->MODCTR.B.MCMEN = TRUE;
1420 }
1421 
1422 
1424 {
1425  ccu6->MCMOUTS.B.STRMCM = TRUE;
1426 }
1427 
1428 
1430 {
1431  ccu6->MCMCTR.B.STE12D = TRUE;
1432 }
1433 
1434 
1436 {
1437  ccu6->MCMCTR.B.STE12U = TRUE;
1438 }
1439 
1440 
1442 {
1443  ccu6->MCMCTR.B.STE13U = TRUE;
1444 }
1445 
1446 
1447 IFX_INLINE void IfxCcu6_enableShadowTransfer(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1448 {
1449  Ifx_CCU6_TCTR4 tctr4;
1450  tctr4.U = 0;
1451  tctr4.B.T12STR = t12;
1452  tctr4.B.T13STR = t13;
1453  ccu6->TCTR4.U = tctr4.U;
1454 }
1455 
1456 
1458 {
1459  uint32 mask = (1U << timer);
1460  ccu6->TCTR2.U = ccu6->TCTR2.U | (mask);
1461 }
1462 
1463 
1465 {
1466  ccu6->CMPSTAT.B.T13IM = TRUE;
1467 }
1468 
1469 
1471 {
1472  uint32 mask = (1U << timer);
1473  ccu6->MCFG.U = ccu6->MCFG.U | (mask);
1474 }
1475 
1476 
1477 IFX_INLINE void IfxCcu6_enableTrap(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut)
1478 {
1479  uint32 shift = (8 + channelOut); // offset at location TRPCTR.8 for output CC60
1480  uint32 mask = (1U << shift);
1481  ccu6->TRPCTR.U = ccu6->TRPCTR.U | (mask);
1482 }
1483 
1484 
1485 IFX_INLINE void IfxCcu6_enableTrapPin(Ifx_CCU6 *ccu6)
1486 {
1487  ccu6->TRPCTR.B.TRPPEN = TRUE;
1488 }
1489 
1490 
1492 {
1493  uint32 shift = (12 + channel);
1494  uint32 mask = 1 << shift;
1495  return (ccu6->T12DTC.U & mask) ? TRUE : FALSE;
1496 }
1497 
1498 
1500 {
1501  uint32 shift = (channel + 3);
1502  uint32 mask = (1U << shift);
1503  return (ccu6->CMPSTAT.U & mask) ? TRUE : FALSE;
1504 }
1505 
1506 
1508 {
1509  uint32 shift = (1U << source);
1510  return (ccu6->IS.U & shift) ? TRUE : FALSE;
1511 }
1512 
1513 
1515 {
1516  return ccu6->MCFG.B.MCM != 0;
1517 }
1518 
1519 
1521 {
1522  return ccu6->MCMOUT.B.R != 0;
1523 }
1524 
1525 
1527 {
1528  uint32 shift = ((timer * 8) + 5);
1529  uint32 mask = (1U << shift);
1530  return (ccu6->TCTR0.U & mask) ? TRUE : FALSE;
1531 }
1532 
1533 
1535 {
1536  uint32 mask = (1U << channel);
1537  return (ccu6->CMPSTAT.U & mask) ? TRUE : FALSE;
1538 }
1539 
1540 
1542 {
1543  return (IfxCcu6_T12CountDirection)((ccu6->TCTR0.B.CDIR) ? TRUE : FALSE);
1544 }
1545 
1546 
1548 {
1549  return (volatile uint32 *)&ccu6->T12PR;
1550 }
1551 
1552 
1554 {
1555  return ccu6->CMPSTAT.B.CC63ST != 0;
1556 }
1557 
1558 
1560 {
1561  uint32 mask = (1U << timer);
1562  return (ccu6->MCFG.U & mask) ? TRUE : FALSE;
1563 }
1564 
1565 
1567 {
1568  uint32 shift = ((timer * 8) + 4);
1569  uint32 mask = (1U << shift);
1570  return (IfxCcu6_TimerRunStatus)((ccu6->TCTR0.U & mask) ? TRUE : FALSE);
1571 }
1572 
1573 
1575 {
1576  IfxPort_setPinModeInput(cc60In->pin.port, cc60In->pin.pinIndex, inputMode);
1578 }
1579 
1580 
1582 {
1583  IfxPort_setPinModeOutput(cc60Out->pin.port, cc60Out->pin.pinIndex, outputMode, cc60Out->select);
1584  IfxPort_setPinPadDriver(cc60Out->pin.port, cc60Out->pin.pinIndex, padDriver);
1585 }
1586 
1587 
1589 {
1590  IfxPort_setPinModeInput(cc61In->pin.port, cc61In->pin.pinIndex, inputMode);
1592 }
1593 
1594 
1596 {
1597  IfxPort_setPinModeOutput(cc61Out->pin.port, cc61Out->pin.pinIndex, outputMode, cc61Out->select);
1598  IfxPort_setPinPadDriver(cc61Out->pin.port, cc61Out->pin.pinIndex, padDriver);
1599 }
1600 
1601 
1603 {
1604  IfxPort_setPinModeInput(cc62In->pin.port, cc62In->pin.pinIndex, inputMode);
1606 }
1607 
1608 
1610 {
1611  IfxPort_setPinModeOutput(cc62Out->pin.port, cc62Out->pin.pinIndex, outputMode, cc62Out->select);
1612  IfxPort_setPinPadDriver(cc62Out->pin.port, cc62Out->pin.pinIndex, padDriver);
1613 }
1614 
1615 
1617 {
1618  IfxPort_setPinModeInput(ccpos0->pin.port, ccpos0->pin.pinIndex, inputMode);
1620 }
1621 
1622 
1624 {
1625  IfxPort_setPinModeInput(ccpos1->pin.port, ccpos1->pin.pinIndex, inputMode);
1627 }
1628 
1629 
1631 {
1632  IfxPort_setPinModeInput(ccpos2->pin.port, ccpos2->pin.pinIndex, inputMode);
1634 }
1635 
1636 
1638 {
1639  IfxPort_setPinModeOutput(cout60->pin.port, cout60->pin.pinIndex, outputMode, cout60->select);
1640  IfxPort_setPinPadDriver(cout60->pin.port, cout60->pin.pinIndex, padDriver);
1641 }
1642 
1643 
1645 {
1646  IfxPort_setPinModeOutput(cout61->pin.port, cout61->pin.pinIndex, outputMode, cout61->select);
1647  IfxPort_setPinPadDriver(cout61->pin.port, cout61->pin.pinIndex, padDriver);
1648 }
1649 
1650 
1652 {
1653  IfxPort_setPinModeOutput(cout62->pin.port, cout62->pin.pinIndex, outputMode, cout62->select);
1654  IfxPort_setPinPadDriver(cout62->pin.port, cout62->pin.pinIndex, padDriver);
1655 }
1656 
1657 
1659 {
1660  IfxPort_setPinModeOutput(cout63->pin.port, cout63->pin.pinIndex, outputMode, cout63->select);
1661  IfxPort_setPinPadDriver(cout63->pin.port, cout63->pin.pinIndex, padDriver);
1662 }
1663 
1664 
1666 {
1667  IfxPort_setPinModeInput(ctrap->pin.port, ctrap->pin.pinIndex, inputMode);
1669 }
1670 
1671 
1673 {
1674  IfxPort_setPinModeInput(t12hrIn->pin.port, t12hrIn->pin.pinIndex, inputMode);
1675  IfxCcu6_setT12InputSignal(t12hrIn->module, t12hrIn);
1676 }
1677 
1678 
1680 {
1681  IfxPort_setPinModeInput(t13hrIn->pin.port, t13hrIn->pin.pinIndex, inputMode);
1682  IfxCcu6_setT13InputSignal(t13hrIn->module, t13hrIn);
1683 }
1684 
1685 
1686 IFX_INLINE boolean IfxCcu6_isModuleEnabled(Ifx_CCU6 *ccu6)
1687 {
1688  return ccu6->CLC.B.DISS == 0;
1689 }
1690 
1691 
1693 {
1694  return ccu6->IS.B.T12OM != 0;
1695 }
1696 
1697 
1699 {
1700  return ccu6->IS.B.T12PM != 0;
1701 }
1702 
1703 
1705 {
1706  return ccu6->IS.B.T13CM != 0;
1707 }
1708 
1709 
1711 {
1712  uint32 shift = (uint32)input;
1713  uint32 mask = (0x3U << shift);
1714  ccu6->PISEL0.U = (ccu6->PISEL0.U & ~mask) | ((uint32)signal << shift);
1715 }
1716 
1717 
1719 {
1720  uint32 shift = ((timer * 2) + 2);
1721  uint32 mask = (0x3U << shift);
1722  ccu6->PISEL2.U = (ccu6->PISEL2.U & ~mask) | ((uint32)mode << shift);
1723 }
1724 
1725 
1726 IFX_INLINE void IfxCcu6_setCurrentHallPattern(Ifx_CCU6 *ccu6, uint8 pattern)
1727 {
1728  ccu6->MCMOUTS.B.CURHS = pattern;
1729 }
1730 
1731 
1732 IFX_INLINE void IfxCcu6_setDeadTimeValue(Ifx_CCU6 *ccu6, uint8 value)
1733 {
1734  ccu6->T12DTC.B.DTM = value;
1735 }
1736 
1737 
1738 IFX_INLINE void IfxCcu6_setExpectedHallPattern(Ifx_CCU6 *ccu6, uint8 pattern)
1739 {
1740  ccu6->MCMOUTS.B.EXPHS = pattern;
1741 }
1742 
1743 
1745 {
1746  uint32 shift = ((timer * 2) + 8);
1747  uint32 mask = (0x3U << shift);
1748  ccu6->TCTR2.U = (ccu6->TCTR2.U & ~mask) | ((uint32)mode << shift);
1749 }
1750 
1751 
1753 {
1754  uint32 shift = 12;
1755  uint32 mask = (0x7U << shift);
1756  ccu6->T12MSEL.U = (ccu6->T12MSEL.U & ~mask) | ((uint32)mode << shift);
1757 }
1758 
1759 
1761 {
1762  uint32 shift = (timer * 8);
1763  uint32 mask = (0x7U << shift);
1764  ccu6->TCTR0.U = (ccu6->TCTR0.U & ~mask) | ((uint32)frequency << shift);
1765 }
1766 
1767 
1769 {
1770  uint32 mask = (1U << source);
1771  ccu6->ISS.U = ccu6->ISS.U | (mask);
1772 }
1773 
1774 
1776 {
1777  ccu6->MCMOUTS.B.MCMPS = pattern;
1778 }
1779 
1780 
1782 {
1783  ccu6->MCMCTR.B.SWSEL = mode;
1784 }
1785 
1786 
1788 {
1789  ccu6->MCMCTR.B.SWSYN = sync;
1790 }
1791 
1792 
1793 IFX_INLINE void IfxCcu6_setOutputPassiveState(Ifx_CCU6 *ccu6, IfxCcu6_ChannelOut channelOut, boolean state)
1794 {
1795  uint32 shift = (channelOut + 8); // offset at location CC60PS
1796  uint32 mask = (1U << shift);
1797  ccu6->CMPSTAT.U = (ccu6->CMPSTAT.U & ~mask) | ((uint32)state << shift);
1798 }
1799 
1800 
1801 IFX_INLINE void IfxCcu6_setSingleShotModeEnable(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1802 {
1803  Ifx_CCU6_TCTR2 tctr2;
1804  tctr2.U = ccu6->TCTR2.U;
1805  tctr2.B.T12SSC = t12;
1806  tctr2.B.T13SSC = t13;
1807  ccu6->TCTR2.U = tctr2.U;
1808 }
1809 
1810 
1812 {
1814  IfxScuWdt_clearCpuEndinit(passwd);
1815  ccu6->CLC.B.EDIS = mode;
1816  IfxScuWdt_setCpuEndinit(passwd);
1817 }
1818 
1819 
1821 {
1822  uint32 shift = (4 * channel);
1823  uint32 mask = (0xFU << shift);
1824  ccu6->T12MSEL.U = (ccu6->T12MSEL.U & ~mask) | ((uint32)mode << shift);
1825 }
1826 
1827 
1829 {
1830  ccu6->TCTR0.B.CTM = mode;
1831 }
1832 
1833 
1834 IFX_INLINE void IfxCcu6_setT12CounterValue(Ifx_CCU6 *ccu6, uint16 value)
1835 {
1836  ccu6->T12.B.T12CV = value;
1837 }
1838 
1839 
1840 IFX_INLINE void IfxCcu6_setT12PeriodValue(Ifx_CCU6 *ccu6, uint16 value)
1841 {
1842  ccu6->T12PR.B.T12PV = value;
1843 }
1844 
1845 
1846 IFX_INLINE void IfxCcu6_setT13CompareValue(Ifx_CCU6 *ccu6, uint16 value)
1847 {
1848  ccu6->CC63SR.B.CCS = value;
1849 }
1850 
1851 
1852 IFX_INLINE void IfxCcu6_setT13CounterValue(Ifx_CCU6 *ccu6, uint16 value)
1853 {
1854  ccu6->T13.B.T13CV = value;
1855 }
1856 
1857 
1858 IFX_INLINE void IfxCcu6_setT13PeriodValue(Ifx_CCU6 *ccu6, uint16 value)
1859 {
1860  ccu6->T13PR.B.T13PV = value;
1861 }
1862 
1863 
1865 {
1866  ccu6->TCTR2.B.T13TED = direction;
1867 }
1868 
1869 
1871 {
1872  ccu6->TCTR2.B.T13TEC = mode;
1873 }
1874 
1875 
1877 {
1878  ccu6->TRPCTR.B.TRPM2 = mode;
1879 }
1880 
1881 
1883 {
1884  uint32 mask = 0x3U;
1885  ccu6->TRPCTR.U = (ccu6->TRPCTR.U & ~mask) | ((uint32)state);
1886 }
1887 
1888 
1889 IFX_INLINE void IfxCcu6_startTimer(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1890 {
1891  Ifx_CCU6_TCTR4 tctr4;
1892  tctr4.U = 0;
1893  tctr4.B.T12RS = t12;
1894  tctr4.B.T13RS = t13;
1895  ccu6->TCTR4.U = tctr4.U;
1896 }
1897 
1898 
1899 IFX_INLINE void IfxCcu6_stopTimer(Ifx_CCU6 *ccu6, boolean t12, boolean t13)
1900 {
1901  Ifx_CCU6_TCTR4 tctr4;
1902  tctr4.U = 0;
1903  tctr4.B.T12RR = t12;
1904  tctr4.B.T13RR = t13;
1905  ccu6->TCTR4.U = tctr4.U;
1906 }
1907 
1908 
1909 IFX_INLINE void IfxCcu6_updateHallPattern(Ifx_CCU6 *ccu6, uint8 currentHall, uint8 expectedHall, uint8 output)
1910 {
1911  Ifx_CCU6_MCMOUTS mcmouts;
1912  mcmouts.U = ccu6->MCMOUTS.U;
1913 
1914  mcmouts.B.CURHS = currentHall;
1915  mcmouts.B.EXPHS = expectedHall;
1916  mcmouts.B.MCMPS = output;
1917 
1918  ccu6->MCMOUTS.U = mcmouts.U;
1919 }
1920 
1921 
1922 #endif /* IFXCCU6_H */