MAX78000 Peripheral Driver API
Peripheral Driver API for the MAX78000
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Wakeup Timer (WUT)

Modules

 WUT_Registers
 

Data Structures

struct  mxc_wut_cfg_t
 

Typedefs

typedef void(* mxc_wut_complete_cb_t) (int result)
 

Enumerations

enum  mxc_wut_pres_t
 
enum  mxc_wut_mode_t
 
enum  mxc_wut_unit_t
 

Functions

void MXC_WUT_Init (mxc_wut_pres_t pres)
 
void MXC_WUT_Shutdown (void)
 
void MXC_WUT_Enable (void)
 
void MXC_WUT_Disable (void)
 
void MXC_WUT_Config (const mxc_wut_cfg_t *cfg)
 
uint32_t MXC_WUT_GetCompare (void)
 
uint32_t MXC_WUT_GetCount (void)
 
void MXC_WUT_IntClear (void)
 
uint32_t MXC_WUT_IntStatus (void)
 
void MXC_WUT_SetCompare (uint32_t cmp_cnt)
 
void MXC_WUT_SetCount (uint32_t cnt)
 
int MXC_WUT_GetTicks (uint32_t time, mxc_wut_unit_t units, uint32_t *ticks)
 
int MXC_WUT_GetTime (uint32_t ticks, uint32_t *time, mxc_wut_unit_t *units)
 
void MXC_WUT_Edge (void)
 
void MXC_WUT_Store (void)
 
void MXC_WUT_RestoreBBClock (uint32_t dbbFreq)
 
uint32_t MXC_WUT_GetSleepTicks (void)
 
void MXC_WUT_Delay_MS (uint32_t waitMs)
 

Detailed Description


Data Structure Documentation

◆ mxc_wut_cfg_t

struct mxc_wut_cfg_t

Wakeup Timer Configuration.

Data Fields

uint32_t cmp_cnt
 

Typedef Documentation

◆ mxc_wut_complete_cb_t

typedef void(* mxc_wut_complete_cb_t) (int result)

The callback routine used by the MXC_WUT_TrimCrystalAsync() function to indicate the transaction has completed.

Parameters
resultError code.

Enumeration Type Documentation

◆ mxc_wut_mode_t

Wakeup Timer modes.

Enumerator
MXC_WUT_MODE_CONTINUOUS 

Wakeup Timer Mode ONESHOT.

MXC_WUT_MODE_COUNTER 

Wakeup Timer Mode CONTINUOUS.

MXC_WUT_MODE_CAPTURE 

Wakeup Timer Mode COUNTER.

MXC_WUT_MODE_COMPARE 

Wakeup Timer Mode CAPTURE.

MXC_WUT_MODE_GATED 

Wakeup Timer Mode COMPARE.

MXC_WUT_MODE_CAPTURE_COMPARE 

Wakeup Timer Mode GATED.

◆ mxc_wut_pres_t

Wakeup Timer prescaler values.

Enumerator
MXC_WUT_PRES_2 

Divide input clock by 1.

MXC_WUT_PRES_4 

Divide input clock by 2.

MXC_WUT_PRES_8 

Divide input clock by 4.

MXC_WUT_PRES_16 

Divide input clock by 8.

MXC_WUT_PRES_32 

Divide input clock by 16.

MXC_WUT_PRES_64 

Divide input clock by 32.

MXC_WUT_PRES_128 

Divide input clock by 64.

MXC_WUT_PRES_256 

Divide input clock by 128.

MXC_WUT_PRES_512 

Divide input clock by 256.

MXC_WUT_PRES_1024 

Divide input clock by 512.

MXC_WUT_PRES_2048 

Divide input clock by 1024.

MXC_WUT_PRES_4096 

Divide input clock by 2048.

◆ mxc_wut_unit_t

Wakeup Timer units of time enumeration.

Enumerator
MXC_WUT_UNIT_NANOSEC 

Nanosecond Unit Indicator.

MXC_WUT_UNIT_MICROSEC 

Microsecond Unit Indicator.

MXC_WUT_UNIT_MILLISEC 

Millisecond Unit Indicator.

MXC_WUT_UNIT_SEC 

Second Unit Indicator.

Function Documentation

◆ MXC_WUT_Config()

void MXC_WUT_Config ( const mxc_wut_cfg_t cfg)

Configure the timer.

Parameters
cfgPointer to timer configuration struct.

◆ MXC_WUT_Delay_MS()

void MXC_WUT_Delay_MS ( uint32_t  waitMs)

Delays for the given number of milliseconds.

Parameters
waitMsNumber of milliseconds to wait.

◆ MXC_WUT_GetCompare()

uint32_t MXC_WUT_GetCompare ( void  )

Get the timer compare count.

Returns
Returns the current compare count.

◆ MXC_WUT_GetCount()

uint32_t MXC_WUT_GetCount ( void  )

Get the timer count.

Returns
Returns the current count.

◆ MXC_WUT_GetSleepTicks()

uint32_t MXC_WUT_GetSleepTicks ( void  )

Get the difference between the stored counter value and the current counter value.

Returns
Returns the current counter value - stored counter value.

◆ MXC_WUT_GetTicks()

int MXC_WUT_GetTicks ( uint32_t  time,
mxc_wut_unit_t  units,
uint32_t *  ticks 
)

Convert real time to timer ticks.

Parameters
timeNumber of units of time.
unitsWhich units of time you want to convert.
ticksPointer to store the number of ticks calculated.
Returns
E_NO_ERROR If everything is successful.
Error Codes If function is unsuccessful.

◆ MXC_WUT_GetTime()

int MXC_WUT_GetTime ( uint32_t  ticks,
uint32_t *  time,
mxc_wut_unit_t units 
)

Convert timer ticks to real time.

Parameters
ticksNumber of ticks.
timePointer to store number of units of time.
unitsPointer to store the units that time represents.
Returns
E_NO_ERROR If everything is successful.
Error Codes If function is unsuccessful.

◆ MXC_WUT_Init()

void MXC_WUT_Init ( mxc_wut_pres_t  pres)

Initialize timer module clock.

Parameters
presPrescaler value.

◆ MXC_WUT_IntStatus()

uint32_t MXC_WUT_IntStatus ( void  )

Get the timer interrupt status.

Returns
Returns the interrupt status. 1 if interrupt has occurred.

◆ MXC_WUT_RestoreBBClock()

void MXC_WUT_RestoreBBClock ( uint32_t  dbbFreq)

Restore the DBB clock with the stored count and snapshot values.

Parameters
dbbFreqFrequency of DBB clock.

◆ MXC_WUT_SetCompare()

void MXC_WUT_SetCompare ( uint32_t  cmp_cnt)

Set the timer compare count.

Parameters
cmp_cntNew compare count.
Note
This function does not protect against output glitches in PWM mode. Use MXC_WUT_PWMSetPeriod when in PWM mode.

◆ MXC_WUT_SetCount()

void MXC_WUT_SetCount ( uint32_t  cnt)

Set the timer count.

Parameters
cntNew count.