USTIMER
[EM_Drivers]

USTIMER Microsecond delay timer module, see USTIMER Microsecond delay timer module page for detailed documentation. More...

Collaboration diagram for USTIMER:

Defines

#define ECODE_EMDRV_USTIMER_OK   ( ECODE_OK )
 Success return value.
#define USTIMER_TIMER   USTIMER_TIMER0
 USTIMER configuration option. Use this define to select a TIMER resource.

Functions

Ecode_t USTIMER_Init (void)
 Activate and initialize the hardware timer used to pace the 1 microsecond delay functions.
Ecode_t USTIMER_DeInit (void)
 Deinitialize USTIMER driver.
Ecode_t USTIMER_Delay (uint32_t usec)
 Delay a given number of microseconds.
Ecode_t USTIMER_DelayIntSafe (uint32_t usec)
 Delay a given number of microseconds.

Detailed Description

USTIMER Microsecond delay timer module, see USTIMER Microsecond delay timer module page for detailed documentation.


Define Documentation

#define ECODE_EMDRV_USTIMER_OK   ( ECODE_OK )

Success return value.

Definition at line 38 of file ustimer.h.

Referenced by USTIMER_DeInit(), USTIMER_Delay(), USTIMER_DelayIntSafe(), and USTIMER_Init().

#define USTIMER_TIMER   USTIMER_TIMER0

USTIMER configuration option. Use this define to select a TIMER resource.

Definition at line 29 of file ustimer_config.h.


Function Documentation

Ecode_t USTIMER_DeInit ( void   ) 

Deinitialize USTIMER driver.

Will disable interrupts and turn off the clock to the underlying hardware timer.

Returns:
ECODE_EMDRV_USTIMER_OK.

Definition at line 132 of file ustimer.c.

References ECODE_EMDRV_USTIMER_OK.

Referenced by ezradio_reset().

Here is the caller graph for this function:

Ecode_t USTIMER_Delay ( uint32_t  usec  ) 

Delay a given number of microseconds.

The mcu is put in EM1 during the delay.

Note:
This function assumes that the timer interrupt needed to wake the mcu up from EM1 is not blocked. This function is not thread safe.
Parameters:
[in] usec Number of microseconds to delay.
Returns:
ECODE_EMDRV_USTIMER_OK.

Definition at line 163 of file ustimer.c.

References ECODE_EMDRV_USTIMER_OK.

Referenced by ezradio_reset().

Here is the caller graph for this function:

Ecode_t USTIMER_DelayIntSafe ( uint32_t  usec  ) 

Delay a given number of microseconds.

This is a busy wait delay not using energy modes to conserve power.

Note:
This function can be used in any context (interrupts can be disabled). This function is thread safe.
Parameters:
[in] usec Number of microseconds to delay.
Returns:
ECODE_EMDRV_USTIMER_OK.

Definition at line 198 of file ustimer.c.

References ECODE_EMDRV_USTIMER_OK.

Ecode_t USTIMER_Init ( void   ) 

Activate and initialize the hardware timer used to pace the 1 microsecond delay functions.

Note:
Call this function whenever the HFPERCLK and/or HFCORECLK frequency is changed.
Returns:
ECODE_EMDRV_USTIMER_OK.

Definition at line 81 of file ustimer.c.

References ECODE_EMDRV_USTIMER_OK.

Referenced by ezradio_reset().

Here is the caller graph for this function: