Contiki 2.5
Functions
system-timer.c File Reference

STM32W108 System Timer HAL functions. More...

#include "error.h"
#include "hal/micro/micro-common.h"
#include "hal/micro/cortexm3/micro-common.h"
#include "micro/system-timer.h"

Go to the source code of this file.

Functions

int16u halCommonGetInt16uMillisecondTick (void)
 Return a 16 bit real time clock value. More...
 
int16u halCommonGetInt16uQuarterSecondTick (void)
 Returns the current system time in quarter second ticks, as a 16-bit value. More...
 
int32u halCommonGetInt32uMillisecondTick (void)
 Return a 32 bit real time clock value. More...
 
StStatus halSleepForQsWithOptions (int32u *duration, int32u gpioWakeBitMask)
 Uses the system timer to enter ::SLEEPMODE_WAKETIMER for approximately the specified amount of time (provided in quarter seconds), the GPIO wake sources can be provided at runtime. More...
 

Detailed Description

STM32W108 System Timer HAL functions.

NOTE: The Sleep Timer count and compare registers are only 16 bits, but the counter and comparators themselves are actually 32bits. To deal with this, there are High ("H") and Low ("L") registers. The High register is the "action" register. When working with SLEEPTMR_CNT, reading the "H" register will return the upper 16 bits and simultaneously trigger the capture of the lower 16bits in the "L" register. The "L" register may then be read. When working with the SLEEPTMR_CMP registers, writing "L" will set a shadow register. Writing "H" will cause the value from the "H" write and the "L" shadow register to be combined and simultaneously loaded into the true 32bit comparator.

Definition in file system-timer.c.