Contiki-NG
|
Files | |
file | clock-arch.c |
Implementation of the clock libary for CC13xx/CC26xx. | |
file | clock-arch.h |
Header file for the CC13xx/CC26xx clock implementation. | |
Functions | |
bool | clock_arch_enter_idle (void) |
Prepare to enter some low-power mode. | |
void | clock_arch_exit_idle (void) |
Cleanup after returning from low-power mode. | |
void | clock_arch_standby_policy (void) |
Called by the Power driver when dropping to some low-power state. | |
void | clock_init (void) |
Initialize the clock library. | |
clock_time_t | clock_time (void) |
Get the current clock time. | |
unsigned long | clock_seconds (void) |
Get the current value of the platform seconds. | |
void | clock_wait (clock_time_t i) |
Wait for a given number of ticks. | |
void | clock_delay_usec (uint16_t usec) |
Delay a given number of microseconds. | |
void | clock_delay (unsigned int i) |
Obsolete delay function but we implement it here since some code still uses it. | |
bool clock_arch_enter_idle | ( | void | ) |
Prepare to enter some low-power mode.
Return value indicates if we are ready or not to enter some low-power mode.
Definition at line 142 of file clock-arch.c.
Referenced by platform_idle().
void clock_delay | ( | unsigned int | i | ) |
Obsolete delay function but we implement it here since some code still uses it.
Obsolete delay function but we implement it here since some code still uses it.
Definition at line 260 of file clock-arch.c.
References clock_delay_usec().
void clock_delay_usec | ( | uint16_t | dt | ) |
Delay a given number of microseconds.
dt | How many microseconds to delay. |
< GPTIMER0
< GPTM Timer A interval load
< GPTIMER0
< GPTM control
< Timer A enable
< GPTIMER0
< GPTM control
< Timer A enable
Definition at line 250 of file clock-arch.c.
void clock_init | ( | void | ) |
Initialize the clock library.
This function initializes the clock library and should be called from the main() function of the system.
Initialize the clock library.
We initialise the SysTick to fire 128 interrupts per second, giving us a value of 128 for CLOCK_SECOND
We also initialise GPT0:Timer A, which is used by clock_delay_usec(). We use 16-bit range (individual), count-down, one-shot, no interrupts. The prescaler is computed according to the system clock in order to get 1 tick per usec.
< GPT[3:0] clocks - active mode
< GPT0 clock enable, CPU running
< GPTIMER0
< GPTM control
< GPTIMER0
< GPTM configuration
< GPTIMER0
< GPTM Timer A mode
< GPTIMER0
< GPTM Timer A prescale
Definition at line 200 of file clock-arch.c.
References CLOCK_SECOND.
unsigned long clock_seconds | ( | void | ) |
Get the current value of the platform seconds.
This could be the number of seconds since startup, or since a standard epoch.
Definition at line 234 of file clock-arch.c.
clock_time_t clock_time | ( | void | ) |
Get the current clock time.
This function returns the current system clock time.
Definition at line 222 of file clock-arch.c.
References CLOCK_SECOND.
void clock_wait | ( | clock_time_t | t | ) |
Wait for a given number of ticks.
t | How many ticks. |
Definition at line 241 of file clock-arch.c.
References clock_delay_usec(), and CLOCK_SECOND.