LGPTimerLPF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-2024, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!*****************************************************************************
33  * @file LGPTimerLPF3.h
34  * @brief LGPTimer driver implementation for Low Power F3 devices
35  *
36  * @anchor ti_drivers_LGPTimer_Overview
37  * # Overview #
38  * The LGPTimer driver allows you to measure elapsed time with simple and
39  * portable APIs. It also allows for asynchronous callbacks after a
40  * certain amount of time has elapsed.
41  * In addition the driver supports APIs for both capture and compare of
42  * of IO signals muxable to the three channels of each LGPT peripheral
43  * instance. The channel capture functionality can be used to measure period
44  * and duty cycle of an input signal. The channel compare functionality can
45  * be used for generating PWM signals.
46  *
47  * The LGPTimer driver also handles the general purpose timer resource allocation.
48  * For each driver that requires use of a general purpose timer, it calls
49  * #LGPTimerLPF3_open() to occupy the specified timer, and calls
50  * #LGPTimerLPF3_close() to release the occupied timer resource.
51  *
52  * @anchor ti_drivers_LGPTimer_PeripheralProperties
53  * # LGPT peripheral properties #
54  * The LGPT peripherals support different timer counter widths depending
55  * on the peripheral instance number (LGPT0, LGPT1, ..). The table below
56  * lists supported counter widths for each peripheral instance number on
57  * available device types.
58  * The timer counter clock is sourced from the internal prescaler stage which
59  * has the high frequency clock (CLKSVT) as input.
60  * The prescaler can be configured to divide the input system clock, effectively
61  * extending the maximal time interval for the timer counter while reducing the
62  * timer resolution.
63  *
64  * | Device type | LGPT0 | LGPT1 | LGPT2 | LGPT3 |
65  * |---------------|---------|---------|---------|---------|
66  * | CC2340R2 | 16 bits | 16 bits | N.A | N.A |
67  * | CC2340R5 | 16 bits | 16 bits | 16 bits | 24 bits |
68  * | CC27XX | 16 bits | 16 bits | 16 bits | 32 bits |
69  *
70  * @anchor ti_drivers_LGPTimer_CounterModes
71  * # Counter Modes #
72  * The LGPTimer driver supports the following timer counter modes:
73  * - Oneshot mode counting upwards. When the counter reaches the target value, the
74  * timer is stopped automatically and the TGT interrupt status flag
75  * (#LGPTimerLPF3_INT_TGT) is set.
76  * - Periodic mode counting upwards. When the counter reaches target value it wraps
77  * and restarts counting from 0 again. The TGT interrupt status flag is set each
78  * time the target value is reached. The ZERO interrupt status flag
79  * (#LGPTimerLPF3_INT_ZERO) is set each time the counter restarts from 0.
80  * - Periodic mode counting upwards/downwards. When the counter reaches target value
81  * while counting upwards the TGT interrupt flag is set and it starts counting
82  * downwards to 0. When 0 is reached the ZERO interrupt status flag is set
83  * and the sequence is repeated.
84  *
85  * @anchor ti_drivers_LGPTimer_UnsupportedFeatures
86  * # LGPT peripheral features not supported by the LGPTimer driver #
87  * - Channel input from the event fabric is not supported
88  * - Channel output dead band control present in LGPT1 only, is not supported
89  * - Use of channel input filter is not supported
90  * - DMA usage is not supported
91  * - ADC trigger is not supported
92  * - QDEC mode where the timer functions as a quadrature decoder is not supported
93  * - Timer synchronization is not supported
94  * - IR generation is not supported
95  * - Brushless DC motor control is not supported
96  * - Fault and Park is not supported
97  * - Prescaler counter clock sourced from events is not supported
98  *
99  * @anchor ti_drivers_LGPTimer_PowerManagement
100  * # Power Management #
101  * The power management framework will try to put the device into the most
102  * power efficient mode whenever possible. Please see the technical reference
103  * manual for further details on each power mode.
104  *
105  * The LGPTimer driver will set constraints on disallowed power modes when
106  * needed, removing the need for the application to handle this.
107  * The following statements are valid:
108  * - After #LGPTimerLPF3_open():
109  * The device is still allowed to enter Standby. When the device is
110  * active, the corresponding LGPT peripheral will be enabled and clocked.
111  * Note that a configured counter target and configured channels, will not
112  * be retained when going in and out of Standby.
113  * The counter target is set by the functions
114  * #LGPTimerLPF3_setInitialCounterTarget() and #LGPTimerLPF3_setNextCounterTarget().
115  * - After #LGPTimerLPF3_start():
116  * The device will only go to Idle power mode since the high frequency
117  * clock (CLKSVT) is needed for timer operation.
118  * - After #LGPTimerLPF3_stop():
119  * The device is still allowed to enter Standby. When the device is
120  * active, the corresponding LGPT peripheral will be enabled and clocked.
121  * - After #LGPTimerLPF3_close():
122  * The underlying LGPT peripheral is turned off. The device is allowed to
123  * enter Standby.
124  *
125  * @anchor ti_drivers_LGPTimer_Accuracy
126  * # Accuracy #
127  * The timer clock of the LGPT peripheral is dependent on the high frequency clock (CLKSVT).
128  *
129  * @anchor ti_drivers_LGPTimer_Usage
130  * # Usage #
131  *
132  * This documentation provides some basic @ref ti_drivers_LGPTimer_Examples "examples"
133  * in the form of commented code fragments.
134  *
135  *
136  * <hr>
137  * @anchor ti_drivers_LGPTimer_Examples
138  * # Examples
139  *
140  * @note
141  * <b>The following examples are intended for reference only and are not
142  * intended for application use.</b>
143  *
144  * @li @ref ti_drivers_LGPTimer_Example_periodic "Periodic timer"
145  * @li @ref ti_drivers_LGPTimer_Example_output "Output signal generation"
146  *
147  *
148  * @anchor ti_drivers_LGPTimer_Example_periodic
149  * ## Periodic timer example##
150  * The code example below will generate an interrupt using the LGPTimer every 1 ms.
151  * Note that when a count-up counter mode is used, the number of counter ticks to
152  * reach the target value equals target value + 1.
153  *
154  * @anchor ti_drivers_LGPTimer_Code
155  * @code
156  * #include <ti/drivers/timer/LGPTimerLPF3.h>
157  *
158  * void timerCallback(LGPTimerLPF3_Handle lgptHandle, LGPTimerLPF3_IntMask interruptMask) {
159  * // interrupt callback code goes here. Minimize processing in interrupt.
160  * }
161  *
162  * void* taskFxn(void* arg) {
163  *
164  * LGPTimerLPF3_Handle lgptHandle;
165  * LGPTimerLPF3_Params params;
166  * uint32_t counterTarget;
167  *
168  * // Initialize parameters and assign callback function to be used
169  * LGPTimerLPF3_Params_init(&params);
170  * params.hwiCallbackFxn = timerCallback;
171  *
172  * // Open driver
173  * lgptHandle = LGPTimerLPF3_open(0, &params);
174  *
175  * // Set counter target
176  * counterTarget = 48000 - 1; // 1 ms with a system clock of 48 MHz
177  * LGPTimerLPF3_setInitialCounterTarget(lgptHandle, counterTarget, true);
178  *
179  * // Enable counter target interrupt
180  * LGPTimerLPF3_enableInterrupt(lgptHandle, LGPTimerLPF3_INT_TGT);
181  *
182  * // Start counter in count-up-periodic mode
183  * LGPTimerLPF3_start(lgptHandle, LGPTimerLPF3_CTL_MODE_UP_PER);
184  *
185  * // Generate counter target interrupt every 1 ms forever
186  * while(1);
187  * }
188  * @endcode
189  *
190  *
191  * @anchor ti_drivers_LGPTimer_Example_output
192  * ## Output signal generation example##
193  * The code example below will generate an output signal of 32 kHz with a 50 % duty cycle
194  * on channel 2.
195  * With an up/down counter mode, the counter target value determines the signal period and
196  * the value must be set to half the number of the total counter ticks per signal period.
197  * With a channel action of toggle-on-compare, the channel compare value must be set to
198  * (counter target value)/2 in order to obtain a 50 % duty cycle of the output signal.
199  * The period of a 32 kHz signal equals 1500 counter ticks when the counter has a 48 MHz clock.
200  *
201  *
202  * @code
203  * #include <ti/drivers/timer/LGPTimerLPF3.h>
204  *
205  * void* taskFxn(void* arg) {
206  *
207  * LGPTimerLPF3_Handle lgptHandle;
208  * LGPTimerLPF3_Params params;
209  * uint32_t cntTargetVal = 1500/2;
210  * uint32_t chCompVal = cntTargetVal/2;
211  *
212  * // Configure channel 2 action
213  * LGPTimerLPF3_Params_init(&params);
214  * params.channelProperty[2].action = LGPTimerLPF3_CH_TOGGLE_ON_COMPARE_PERIODIC;
215  *
216  * // Open driver
217  * lgptHandle = LGPTimerLPF3_open(0, &params);
218  *
219  * // Set channel output signal period
220  * LGPTimerLPF3_setInitialCounterTarget(lgptHandle, cntTargetVal, false);
221  *
222  * // Set channel output signal duty cycle
223  * LGPTimerLPF3_setInitialChannelCompVal(lgptHandle, LGPTimerLPF3_CH_NO_2, chCompVal, false);
224  *
225  * // Start the LGPTimer in up-down-periodic mode
226  * LGPTimerLPF3_start(lgptHandle, LGPTimerLPF3_CTL_MODE_UPDWN_PER);
227  *
228  * // Output signal forever
229  * while(1);
230  * }
231  * @endcode
232  *
233  *
234  * ## Opening the LGPTimerLPF3 Driver #
235  *
236  * Opening a LGPTimerLPF3 requires four steps:
237  * 1. Create and initialize a #LGPTimerLPF3_Params structure.
238  * 2. Set non-default parameter values.
239  * 3. Call #LGPTimerLPF3_open(), passing the index of the timer in the
240  * #LGPTimerLPF3_Config structure, and the address of the #LGPTimerLPF3_Params
241  * structure. The timer instance is specified by the index in the
242  * #LGPTimerLPF3_Config structure.
243  * 4. Verify that the timer handle returned by #LGPTimerLPF3_open() is non-NULL.
244  * The handle will be used to operate the timer driver instance you just opened.
245  *
246  * <hr>
247  * @anchor ti_drivers_LGPT_Configuration
248  * # Configuration
249  *
250  * Refer to the @ref driver_configuration "Driver's Configuration" section
251  * for driver configuration information.
252  * <hr>
253  *
254  * ============================================================================
255  */
256 
257 #ifndef ti_drivers_timer_LGPTimerLPF3__include
258 #define ti_drivers_timer_LGPTimerLPF3__include
259 
260 #include <stdint.h>
261 #include <stdbool.h>
262 #include <stddef.h>
263 
264 #include <ti/drivers/dpl/HwiP.h>
265 #include <ti/drivers/Power.h>
266 #include <ti/drivers/GPIO.h>
267 
268 #include <ti/devices/DeviceFamily.h>
269 #include DeviceFamily_constructPath(inc/hw_lgpt.h)
270 
271 #ifdef __cplusplus
272 extern "C" {
273 #endif
274 
275 /* Define for number of channels on the LPGPT peripheral */
276 #define NO_OF_LGPT_CHANNELS 3
277 
283 typedef enum
284 {
289 
295 typedef enum
296 {
301 
307 typedef enum
308 {
309  LGPTimerLPF3_CH_LEVEL_LOW = LGPT_OUTCTL_CLROUT0,
310  LGPTimerLPF3_CH_LEVEL_HIGH = LGPT_OUTCTL_SETOUT0,
312 
318 typedef enum
319 {
320  LGPTimerLPF3_CH_EDGE_NONE = LGPT_C0CFG_EDGE_NONE,
321  LGPTimerLPF3_CH_EDGE_RISE = LGPT_C0CFG_EDGE_RISE,
322  LGPTimerLPF3_CH_EDGE_FALL = LGPT_C0CFG_EDGE_FALL,
323  LGPTimerLPF3_CH_EDGE_BOTH = LGPT_C0CFG_EDGE_BOTH,
325 
335 typedef enum
336 {
338  LGPTimerLPF3_CTL_MODE_DIS = LGPT_CTL_MODE_DIS,
342  LGPTimerLPF3_CTL_MODE_UP_ONCE = LGPT_CTL_MODE_UP_ONCE,
344  LGPTimerLPF3_CTL_MODE_UP_PER = LGPT_CTL_MODE_UP_PER,
346  LGPTimerLPF3_CTL_MODE_UPDWN_PER = LGPT_CTL_MODE_UPDWN_PER,
348 
354 typedef enum
355 {
357  LGPTimerLPF3_INT_TGT = 1 << LGPT_RIS_TGT_S,
359  LGPTimerLPF3_INT_ZERO = 1 << LGPT_RIS_ZERO_S,
361  LGPTimerLPF3_INT_COUNTER_CHANGE = 1 << LGPT_RIS_CNTRCHNG_S,
363  LGPTimerLPF3_INT_DIR_CHANGE = 1 << LGPT_RIS_DIRCHNG_S,
365  LGPTimerLPF3_INT_CH0_CC = 1 << LGPT_RIS_C0CC_S,
367  LGPTimerLPF3_INT_CH1_CC = 1 << LGPT_RIS_C1CC_S,
369  LGPTimerLPF3_INT_CH2_CC = 1 << LGPT_RIS_C2CC_S,
371 
376 typedef enum
377 {
379  LGPTimerLPF3_DEBUG_STALL_OFF = LGPT_EMU_HALT_DIS,
381  LGPTimerLPF3_DEBUG_STALL_IMMEDIATE = (LGPT_EMU_HALT_EN | LGPT_EMU_CTL_IMMEDIATE),
383  LGPTimerLPF3_DEBUG_STALL_ON_ZERO = (LGPT_EMU_HALT_EN | LGPT_EMU_CTL_ZERCOND),
385 
391 typedef enum
392 {
400 
406 typedef enum
407 {
409  LGPTimerLPF3_CH_DISABLE = LGPT_C1CFG_CCACT_DIS,
410 
411  /*************************************************************************************
412  * Channel compare actions. *
413  * *
414  * The following list of channel compare actions will force the channel to be *
415  * configured as an output. *
416  ************************************************************************************/
422  LGPTimerLPF3_CH_TOGGLE_ON_COMPARE_PERIODIC = LGPT_C0CFG_CCACT_TGL_ON_CMP,
423 
429  LGPTimerLPF3_CH_TOGGLE_ON_COMPARE_ONCE = LGPT_C0CFG_CCACT_TGL_ON_CMP_DIS,
430 
436  LGPTimerLPF3_CH_SET_ON_COMPARE_PERIODIC = LGPT_C0CFG_CCACT_SET_ON_CMP,
437 
443  LGPTimerLPF3_CH_SET_ON_COMPARE_ONCE = LGPT_C0CFG_CCACT_SET_ON_CMP_DIS,
444 
450  LGPTimerLPF3_CH_CLEAR_ON_COMPARE_PERIODIC = LGPT_C0CFG_CCACT_CLR_ON_CMP,
451 
457  LGPTimerLPF3_CH_CLEAR_ON_COMPARE_ONCE = LGPT_C0CFG_CCACT_CLR_ON_CMP_DIS,
458 
465  LGPTimerLPF3_CH_SET_ON_0_TOGGLE_ON_CMP_PERIODIC = LGPT_C0CFG_CCACT_SET_ON_0_TGL_ON_CMP,
466 
473  LGPTimerLPF3_CH_SET_ON_0_TOGGLE_ON_COMPARE_ONCE = LGPT_C0CFG_CCACT_SET_ON_0_TGL_ON_CMP_DIS,
474 
481  LGPTimerLPF3_CH_CLR_ON_0_TOGGLE_ON_COMPARE_PERIODIC = LGPT_C0CFG_CCACT_CLR_ON_0_TGL_ON_CMP,
482 
489  LGPTimerLPF3_CH_CLR_ON_0_TOGGLE_ON_COMPARE_ONCE = LGPT_C0CFG_CCACT_CLR_ON_0_TGL_ON_CMP_DIS,
490 
497  LGPTimerLPF3_CH_PULSE_ON_COMPARE_PERIODIC = LGPT_C0CFG_CCACT_PULSE_ON_CMP,
498 
505  LGPTimerLPF3_CH_PULSE_ON_COMPARE_ONCE = LGPT_C0CFG_CCACT_PULSE_ON_CMP_DIS,
506 
507  /*************************************************************************************
508  * Channel capture actions. *
509  * *
510  * The following list of channel actions will force the channel to be configured as *
511  * an input. *
512  * The counter value will be captured and the captured value can be read by the *
513  * #LGPTimerLPF3_getChCompareVal() and #LGPTimerLPF3_getNextChCompareVal() *
514  * functions. *
515  ************************************************************************************/
523  LGPTimerLPF3_CH_SET_ON_CAPTURE_PERIODIC = LGPT_C0CFG_CCACT_SET_ON_CAPT,
524 
532  LGPTimerLPF3_CH_SET_ON_CAPTURE_ONCE = LGPT_C0CFG_CCACT_SET_ON_CAPT_DIS,
533 
566  LGPTimerLPF3_CH_PULSE_WIDTH_MEASURE = LGPT_C0CFG_CCACT_PER_PULSE_WIDTH_MEAS,
568 
569 /* Forward declaration of LGPTimer configuration */
571 
572 /* LGPTimer handle is pointer to configuration structure */
574 
575 /* Interrupt bit vector. See LGPTimerLPF3_Interrupt for available interrupts */
576 typedef uint16_t LGPTimerLPF3_IntMask;
577 
586 typedef void (*LGPTimerLPF3_HwiFxn)(LGPTimerLPF3_Handle handle, LGPTimerLPF3_IntMask interruptMask);
587 
595 {
597  LGPTimerLPF3_ChannelAction action;
599  LGPTimerLPF3_ChannelInputEdge inputEdge;
601 
638 typedef struct LGPTimerLPF3_Params
639 {
646  uint8_t prescalerDiv;
650  LGPTimerLPF3_ChannelCmpDir counterDirChCompare;
654 
662 {
664  uint8_t pin;
666  uint8_t pinMux;
668  uint8_t nPin;
670  uint8_t nPinMux;
672 
710 typedef struct LGPTimerLPF3_HWAttrs
711 {
713  uint32_t baseAddr;
715  PowerLPF3_Resource powerID;
719  uint8_t intNum;
721  uint8_t intPriority;
723 
738 typedef struct LGPTimerLPF3_Object
739 {
743  uint32_t arg;
744  bool isOpen;
746  uint8_t prescalerDiv;
748  LGPTimerLPF3_ChannelCmpDir counterDirChCompare;
751 
768 {
771 };
772 
795 
812 extern LGPTimerLPF3_Handle LGPTimerLPF3_open(uint_least8_t index, const LGPTimerLPF3_Params *params);
813 
828 extern void LGPTimerLPF3_close(LGPTimerLPF3_Handle handle);
829 
850 extern void LGPTimerLPF3_start(LGPTimerLPF3_Handle handle, LGPTimerLPF3_Mode mode);
851 
862 extern void LGPTimerLPF3_stop(LGPTimerLPF3_Handle handle);
863 
888 extern void LGPTimerLPF3_setInitialCounterTarget(LGPTimerLPF3_Handle handle, uint32_t value, bool intFlagClr);
889 
920 extern void LGPTimerLPF3_setNextCounterTarget(LGPTimerLPF3_Handle handle, uint32_t value, bool intFlagClr);
921 
933 extern uint32_t LGPTimerLPF3_getCounter(LGPTimerLPF3_Handle handle);
934 
948 extern uint32_t LGPTimerLPF3_getArg(LGPTimerLPF3_Handle handle);
949 
961 extern void LGPTimerLPF3_setArg(LGPTimerLPF3_Handle handle, void *arg);
962 
972 void LGPTimerLPF3_enableInterrupt(LGPTimerLPF3_Handle handle, LGPTimerLPF3_IntMask intMask);
973 
984 void LGPTimerLPF3_disableInterrupt(LGPTimerLPF3_Handle handle, LGPTimerLPF3_IntMask intMask);
985 
1010 void LGPTimerLPF3_setInitialChannelCompVal(LGPTimerLPF3_Handle handle,
1012  uint32_t value,
1013  bool intFlagClr);
1014 
1042 void LGPTimerLPF3_setNextChannelCompVal(LGPTimerLPF3_Handle handle,
1044  uint32_t value,
1045  bool intFlagClr);
1046 
1063 void LGPTimerLPF3_setChannelOutputLevel(LGPTimerLPF3_Handle handle,
1065  LGPTimerLPF3_ChannelLevel level);
1066 
1091 uint32_t LGPTimerLPF3_getChCompareVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo);
1092 
1117 uint32_t LGPTimerLPF3_getChCaptureVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo);
1118 
1145 uint32_t LGPTimerLPF3_getNextChCompareVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo);
1146 
1173 uint32_t LGPTimerLPF3_getNextChCaptureVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo);
1174 
1186 uint32_t LGPTimerLPF3_getCounterWidth(LGPTimerLPF3_Handle handle);
1187 
1188 #ifdef __cplusplus
1189 }
1190 #endif
1191 #endif /* ti_drivers_timer_LGPTimerLPF3__include */
PowerLPF3_Resource powerID
Definition: LGPTimerLPF3.h:715
uint32_t LGPTimerLPF3_getNextChCaptureVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo)
Function to get the channel compare value for the next counter cycle or the channel-updated capture v...
LGPTimerLPF3_ChannelInputEdge
Definitions for supported LGPTimer channel input edge.
Definition: LGPTimerLPF3.h:318
LGPTimerLPF3_ChannelInputEdge inputEdge
Definition: LGPTimerLPF3.h:599
ADC_Params params
Definition: Driver_Init.h:11
LGPTimer Global configuration.
Definition: LGPTimerLPF3.h:767
HwiP_Struct hwi
Definition: LGPTimerLPF3.h:740
uint32_t LGPTimerLPF3_getCounterWidth(LGPTimerLPF3_Handle handle)
Function to get the width of the timer counter in number of bits.
Definition: LGPTimerLPF3.h:342
LGPTimerLPF3_DebugMode
Definitions for controlling timer debug stall mode.
Definition: LGPTimerLPF3.h:376
Definition: LGPTimerLPF3.h:298
Definition: LGPTimerLPF3.h:409
HwiP structure.
Definition: HwiP.h:78
struct LGPTimerLPF3_Object LGPTimerLPF3_Object
LGPTimerLPF3 Object.
LGPTimerLPF3_Object * object
Definition: LGPTimerLPF3.h:769
Definition: LGPTimerLPF3.h:365
Definition: LGPTimerLPF3.h:532
uint32_t LGPTimerLPF3_getCounter(LGPTimerLPF3_Handle handle)
Function that returns the current timer counter value.
Definition: LGPTimerLPF3.h:338
uint32_t LGPTimerLPF3_getChCaptureVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo)
Function to get the channel compare value or channel-updated capture value. Dependent on the selected...
Definition: LGPTimerLPF3.h:344
LGPTimerLPF3_Mode
Definitions for supported LGPTimer counting modes.
Definition: LGPTimerLPF3.h:335
void LGPTimerLPF3_enableInterrupt(LGPTimerLPF3_Handle handle, LGPTimerLPF3_IntMask intMask)
Enable interrupt source for the LGPTimer handle.
Definition: LGPTimerLPF3.h:357
Definition: LGPTimerLPF3.h:457
struct LGPTimerLPF3_Params LGPTimerLPF3_Params
LGPTimerLPF3 Parameters.
LGPTimerLPF3_Config * LGPTimerLPF3_Handle
Definition: LGPTimerLPF3.h:573
void LGPTimerLPF3_setArg(LGPTimerLPF3_Handle handle, void *arg)
Function to set a custom argument.
uint32_t arg
Definition: LGPTimerLPF3.h:743
Power Manager.
LGPTimerLPF3_ChannelCmpDir counterDirChCompare
Definition: LGPTimerLPF3.h:650
Definition: LGPTimerLPF3.h:422
LGPTimerLPF3_Interrupt
Definitions for supported LGPTimer interrupts. LGPTimerLPF3_IntMask arguments should be a bit vector ...
Definition: LGPTimerLPF3.h:354
Definition: LGPTimerLPF3.h:450
uint32_t LGPTimerLPF3_getArg(LGPTimerLPF3_Handle handle)
Function to get a custom argument.
void LGPTimerLPF3_setInitialChannelCompVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo, uint32_t value, bool intFlagClr)
Function that sets the initial channel compare value on the specified LGPTimer and channel...
uint32_t baseAddr
Definition: LGPTimerLPF3.h:713
bool intPhaseLate
Definition: LGPTimerLPF3.h:745
Definition: LGPTimerLPF3.h:287
LGPTimerLPF3_ChannelAction action
Definition: LGPTimerLPF3.h:597
uint8_t prescalerDiv
Definition: LGPTimerLPF3.h:646
LGPTimerLPF3_ChannelAction
Definitions for supported LGPTimer channel actions.
Definition: LGPTimerLPF3.h:406
Definition: LGPTimerLPF3.h:523
Definition: LGPTimerLPF3.h:396
uint32_t LGPTimerLPF3_getChCompareVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo)
Function to get the channel compare value or channel-updated capture value. Dependent on the selected...
uint8_t pin
Definition: LGPTimerLPF3.h:664
LGPTimerLPF3 Parameters.
Definition: LGPTimerLPF3.h:638
Definition: LGPTimerLPF3.h:379
Definition: LGPTimerLPF3.h:297
void LGPTimerLPF3_start(LGPTimerLPF3_Handle handle, LGPTimerLPF3_Mode mode)
Function that starts the timer counter of the specified LGPTimer handle with current settings and spe...
#define NO_OF_LGPT_CHANNELS
Definition: LGPTimerLPF3.h:276
LGPTimerLPF3 Object.
Definition: LGPTimerLPF3.h:738
Definition: LGPTimerLPF3.h:436
uint8_t nPin
Definition: LGPTimerLPF3.h:668
uint8_t intPriority
Definition: LGPTimerLPF3.h:721
LGPTimerLPF3 Hardware attributes.
Definition: LGPTimerLPF3.h:710
void(* LGPTimerLPF3_HwiFxn)(LGPTimerLPF3_Handle handle, LGPTimerLPF3_IntMask interruptMask)
The definition of a callback function used by the LGPTimer driver.
Definition: LGPTimerLPF3.h:586
Definition: LGPTimerLPF3.h:346
Power_NotifyObj postNotify
Definition: LGPTimerLPF3.h:742
Definition: LGPTimerLPF3.h:286
LGPTimerLPF3 channel dependent pin configuration struct.
Definition: LGPTimerLPF3.h:661
uint8_t prescalerDiv
Definition: LGPTimerLPF3.h:746
Definition: LGPTimerLPF3.h:367
Definition: LGPTimerLPF3.h:359
struct LGPTimerLPF3_ChannelProp LGPTimerLPF3_ChannelProp
LGPTimerLPF3 channel dependent properties struct.
void LGPTimerLPF3_Params_init(LGPTimerLPF3_Params *params)
Function that initializes the LGPTimerLPF3_Params struct to its default values.
LGPTimerLPF3 channel dependent properties struct.
Definition: LGPTimerLPF3.h:594
uint8_t intNum
Definition: LGPTimerLPF3.h:719
Definition: LGPTimerLPF3.h:398
Definition: LGPTimerLPF3.h:369
Definition: LGPTimerLPF3.h:566
const LGPTimerLPF3_HWAttrs * hwAttrs
Definition: LGPTimerLPF3.h:770
Power notify object structure.
Definition: Power.h:441
struct LGPTimerLPF3_HWAttrs LGPTimerLPF3_HWAttrs
LGPTimerLPF3 Hardware attributes.
uint8_t nPinMux
Definition: LGPTimerLPF3.h:670
LGPTimerLPF3_ChannelDir
Definitions for supported LGPTimer channel direction.
Definition: LGPTimerLPF3.h:295
Definition: LGPTimerLPF3.h:505
Definition: LGPTimerLPF3.h:363
Definition: LGPTimerLPF3.h:381
LGPTimerLPF3_DebugMode debugStallMode
Definition: LGPTimerLPF3.h:747
LGPTimerLPF3_HwiFxn hwiCallbackFxn
Definition: LGPTimerLPF3.h:642
Definition: LGPTimerLPF3.h:322
void LGPTimerLPF3_setNextCounterTarget(LGPTimerLPF3_Handle handle, uint32_t value, bool intFlagClr)
Function that sets the timer counter target for the next counter period on the specified LGPTimer...
Definition: LGPTimerLPF3.h:497
LGPTimerLPF3_Handle LGPTimerLPF3_open(uint_least8_t index, const LGPTimerLPF3_Params *params)
Function that opens a driver for the given LGPT peripheral. Will set power dependency on timer and co...
Definition: LGPTimerLPF3.h:394
LGPTimerLPF3_ChannelNo
Definitions for supported LGPTimer channel numbers.
Definition: LGPTimerLPF3.h:283
LGPTimerLPF3_ChannelCmpDir counterDirChCompare
Definition: LGPTimerLPF3.h:748
LGPTimerLPF3_DebugMode debugStallMode
Definition: LGPTimerLPF3.h:648
LGPTimerLPF3_ChannelLevel
Definitions for supported LGPTimer channel output levels.
Definition: LGPTimerLPF3.h:307
bool isOpen
Definition: LGPTimerLPF3.h:744
void LGPTimerLPF3_disableInterrupt(LGPTimerLPF3_Handle handle, LGPTimerLPF3_IntMask intMask)
Disable interrupt source for the LGPTimer handle.
General Purpose I/O driver interface.
Definition: LGPTimerLPF3.h:443
Definition: LGPTimerLPF3.h:309
Definition: LGPTimerLPF3.h:321
uint32_t LGPTimerLPF3_getNextChCompareVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo)
Function to get the channel compare value for the next counter cycle or the channel-updated capture v...
void LGPTimerLPF3_setInitialCounterTarget(LGPTimerLPF3_Handle handle, uint32_t value, bool intFlagClr)
Function that sets the initial timer counter target on the specified LGPTimer. This function must be ...
LGPTimerLPF3_HwiFxn hwiCallbackFxn
Definition: LGPTimerLPF3.h:741
Definition: LGPTimerLPF3.h:323
void LGPTimerLPF3_setNextChannelCompVal(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo, uint32_t value, bool intFlagClr)
Function that sets the channel compare value on the specified LGPTimer for the next cycle of the alre...
struct LGPTimerLPF3_ChannelConf LGPTimerLPF3_ChannelConf
LGPTimerLPF3 channel dependent pin configuration struct.
Definition: LGPTimerLPF3.h:361
uint8_t pinMux
Definition: LGPTimerLPF3.h:666
LGPTimerLPF3_ChannelCmpDir
Definitions for which direction the timer counter must have in order to set channel compare interrupt...
Definition: LGPTimerLPF3.h:391
Hardware Interrupt module for the RTOS Porting Interface.
Definition: LGPTimerLPF3.h:429
Definition: LGPTimerLPF3.h:310
void LGPTimerLPF3_stop(LGPTimerLPF3_Handle handle)
Function that stops the timer counter of the specified LGPTimer driver.
uint16_t LGPTimerLPF3_IntMask
Definition: LGPTimerLPF3.h:576
void LGPTimerLPF3_close(LGPTimerLPF3_Handle handle)
Function that closes a LGPTimer driver specified by the LGPTimer handle. Closing LGPTimer driver will...
bool intPhaseLate
Definition: LGPTimerLPF3.h:644
void LGPTimerLPF3_setChannelOutputLevel(LGPTimerLPF3_Handle handle, LGPTimerLPF3_ChannelNo chNo, LGPTimerLPF3_ChannelLevel level)
Function that manually sets the current channel output level high or low. Manual update of a channel ...
Definition: LGPTimerLPF3.h:320
Definition: LGPTimerLPF3.h:285
Definition: LGPTimerLPF3.h:383
Definition: LGPTimerLPF3.h:299
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale