The MCUXpresso SDK provides a peripheral driver for the UTICK module of MCUXpresso SDK devices.
UTICK driver is created to help user to operate the UTICK module. The UTICK timer can be used as a low power timer. The APIs can be used to enable the UTICK module, initialize it and set the time. UTICK can be used as a wake up source from low power mode.
Typical use case
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/utick
| typedef void(* utick_callback_t)(void) |
| Enumerator |
|---|
| kUTICK_Onetime |
Trigger once.
|
| kUTICK_Repeat |
Trigger repeatedly.
|
| void UTICK_Init |
( |
UTICK_Type * |
base | ) |
|
| void UTICK_Deinit |
( |
UTICK_Type * |
base | ) |
|
This function shuts down Utick bus clock
- Parameters
-
| base | UTICK peripheral base address. |
| uint32_t UTICK_GetStatusFlags |
( |
UTICK_Type * |
base | ) |
|
This returns the status flag
- Parameters
-
| base | UTICK peripheral base address. |
- Returns
- status register value
| void UTICK_ClearStatusFlags |
( |
UTICK_Type * |
base | ) |
|
This clears intr status flag
- Parameters
-
| base | UTICK peripheral base address. |
- Returns
- none
This function starts a repeat/onetime countdown with an optional callback
- Parameters
-
| base | UTICK peripheral base address. |
| mode | UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) |
| count | UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) |
| cb | UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) |
- Returns
- none
This function handles the interrupt and refers to the callback array in the driver to callback user (as per request in UTICK_SetTick()). if no user callback is scheduled, the interrupt will simply be cleared.
- Parameters
-
| base | UTICK peripheral base address. |
| cb | callback scheduled for this instance of UTICK |
- Returns
- none