AN370
Rev. 1.0
95
7.15. Sleep Timer Module
The sleep timer (SleepTim) module interfaces to the 24 bit hardware decrementing counter driven by the sleep
oscillator. This module assists the main application to enforce the duty cycle requirements of the ETSI
specification.
It also provides a way to set the sleep timer power switch which causes the chip to wake up when the timer
reaches 0. Four tasks are performed by this module:
1. Get the value of the counter
2. Set the value of the counter
3. Check Tx duty cycle enforcement against the counter
4. Add time to the counter.
Calling vSleepTim_AddTxTimeToCounter(0) with input parameter value 0 turns off duty cycle enforcing
The Sleep Timer module uses an internal LWORD variable to store the last read value of the sleep timer. The
variable is set by the function lSleepTim_GetCount() and referenced by the functions
bSleepTim_CheckDutyCycle() and vSleepTim_AddTxTimeToCounter().
Note that there is no automatic duty cycle enforcement implemented. It is up to the user application to use the
Sleep Timer functions to decide whether to transmit or not.
7.15.1. Sleep Timer Module Functions:
lSleepTim_GetCount
Description
: Reads the sleep timer and stores the counter value in the LWORD global
variable and also returns the value. After the current value is read the sleep timer continues
to decrement the counter value.
Inputs
:
None
Outputs
:
Sleep Timer Count: (LWORD) Sleep timer read value.
vSleepTim_SetCount
Description
: Sets the 24 bit sleep timer to specified value. Also configures the sleep timer
power switch to cause the chip to wake once the timer reaches 0.
Inputs
:
liCount
: (LWORD) Bottom 25 bits of will be written to the sleep timer. Bits 23
through 0 are the timer value and bit 24 (bit mask 0x01000000) is the power
switch bit. If the power switch bit is set, the chip will fully power up when the
timer reaches 0. Bits 31 to 25 are unused and should be left as 0.