MCUXpresso SDK API Reference Manual  Rev 2.15.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
UTICK: MictoTick Timer Driver

Overview

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

Files

file  fsl_utick.h
 

Typedefs

typedef enum _utick_mode utick_mode_t
 UTICK timer operational mode. More...
 
typedef void(* utick_callback_t )(void)
 UTICK callback function. More...
 

Enumerations

enum  _utick_mode {
  kUTICK_Onetime = 0x0U,
  kUTICK_Repeat = 0x1U
}
 UTICK timer operational mode. More...
 

Driver version

#define FSL_UTICK_DRIVER_VERSION   (MAKE_VERSION(2, 0, 5))
 UTICK driver version 2.0.5. More...
 

Initialization and deinitialization

void UTICK_Init (UTICK_Type *base)
 Initializes an UTICK by turning its bus clock on. More...
 
void UTICK_Deinit (UTICK_Type *base)
 Deinitializes a UTICK instance. More...
 
uint32_t UTICK_GetStatusFlags (UTICK_Type *base)
 Get Status Flags. More...
 
void UTICK_ClearStatusFlags (UTICK_Type *base)
 Clear Status Interrupt Flags. More...
 
void UTICK_SetTick (UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb)
 Starts UTICK. More...
 
void UTICK_HandleIRQ (UTICK_Type *base, utick_callback_t cb)
 UTICK Interrupt Service Handler. More...
 

Macro Definition Documentation

#define FSL_UTICK_DRIVER_VERSION   (MAKE_VERSION(2, 0, 5))

Typedef Documentation

typedef enum _utick_mode utick_mode_t
typedef void(* utick_callback_t)(void)

Enumeration Type Documentation

Enumerator
kUTICK_Onetime 

Trigger once.

kUTICK_Repeat 

Trigger repeatedly.

Function Documentation

void UTICK_Init ( UTICK_Type *  base)
void UTICK_Deinit ( UTICK_Type *  base)

This function shuts down Utick bus clock

Parameters
baseUTICK peripheral base address.
uint32_t UTICK_GetStatusFlags ( UTICK_Type *  base)

This returns the status flag

Parameters
baseUTICK peripheral base address.
Returns
status register value
void UTICK_ClearStatusFlags ( UTICK_Type *  base)

This clears intr status flag

Parameters
baseUTICK peripheral base address.
Returns
none
void UTICK_SetTick ( UTICK_Type *  base,
utick_mode_t  mode,
uint32_t  count,
utick_callback_t  cb 
)

This function starts a repeat/onetime countdown with an optional callback

Parameters
baseUTICK peripheral base address.
modeUTICK timer mode (ie kUTICK_onetime or kUTICK_repeat)
countUTICK timer mode (ie kUTICK_onetime or kUTICK_repeat)
cbUTICK callback (can be left as NULL if none, otherwise should be a void func(void))
Returns
none
void UTICK_HandleIRQ ( UTICK_Type *  base,
utick_callback_t  cb 
)

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
baseUTICK peripheral base address.
cbcallback scheduled for this instance of UTICK
Returns
none