Contiki-NG
lpm.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 /*---------------------------------------------------------------------------*/
31 /**
32  * \addtogroup cc26xx-lpm
33  * @{
34  *
35  * Implementation of CC13xx/CC26xx low-power operation functionality
36  *
37  * @{
38  *
39  * \file
40  * Driver for CC13xx/CC26xx low-power operation
41  */
42 /*---------------------------------------------------------------------------*/
43 #include "prcm.h"
44 #include "contiki.h"
45 #include "ti-lib.h"
46 #include "lpm.h"
47 #include "sys/energest.h"
48 #include "lib/list.h"
49 #include "dev/aux-ctrl.h"
50 #include "dev/leds.h"
51 #include "dev/watchdog.h"
52 #include "dev/soc-rtc.h"
53 #include "dev/oscillators.h"
54 
55 #include <stdint.h>
56 #include <string.h>
57 #include <stdbool.h>
58 /*---------------------------------------------------------------------------*/
59 LIST(modules_list);
60 /*---------------------------------------------------------------------------*/
61 /* PDs that may stay on in deep sleep */
62 #define LOCKABLE_DOMAINS ((uint32_t)(PRCM_DOMAIN_SERIAL | PRCM_DOMAIN_PERIPH))
63 /*---------------------------------------------------------------------------*/
64 /*
65  * Don't consider standby mode if the next AON RTC event is scheduled to fire
66  * in less than STANDBY_MIN_DURATION rtimer ticks
67  */
68 #define STANDBY_MIN_DURATION (RTIMER_SECOND / 100) /* 10.0 ms */
69 
70 /* Wake up this much time earlier before the next rtimer */
71 #define SLEEP_GUARD_TIME (RTIMER_SECOND / 1000) /* 1.0 ms */
72 
73 #define MAX_SLEEP_TIME RTIMER_SECOND
74 #define MIN_SAFE_SCHEDULE 8u
75 /*---------------------------------------------------------------------------*/
76 /* Prototype of a function in clock.c. Called every time we come out of DS */
77 void clock_update(void);
78 /*---------------------------------------------------------------------------*/
79 void
80 lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on)
81 {
82  lpm_registered_module_t *module;
83  int i;
84  uint32_t io_cfg = (IOC_STD_INPUT & ~IOC_IOPULL_M) | io_pull | wake_on;
85  aux_consumer_module_t aux = { .clocks = AUX_WUC_OSCCTRL_CLOCK };
86 
87  /* This procedure may not be interrupted */
88  ti_lib_int_master_disable();
89 
90  /* Disable the RTC */
91  ti_lib_aon_rtc_disable();
92  ti_lib_aon_rtc_event_clear(AON_RTC_CH0);
93  ti_lib_aon_rtc_event_clear(AON_RTC_CH1);
94  ti_lib_aon_rtc_event_clear(AON_RTC_CH2);
95 
96  /* Reset AON even fabric to default wakeup sources */
97  for(i = AON_EVENT_MCU_WU0; i <= AON_EVENT_MCU_WU3; i++) {
98  ti_lib_aon_event_mcu_wake_up_set(i, AON_EVENT_NONE);
99  }
100  for(i = AON_EVENT_AUX_WU0; i <= AON_EVENT_AUX_WU2; i++) {
101  ti_lib_aon_event_aux_wake_up_set(i, AON_EVENT_NONE);
102  }
103 
104  ti_lib_sys_ctrl_aon_sync();
105 
107 
108  /* Notify all modules that we're shutting down */
109  for(module = list_head(modules_list); module != NULL;
110  module = module->next) {
111  if(module->shutdown) {
112  module->shutdown(LPM_MODE_SHUTDOWN);
113  }
114  }
115 
116  /* Configure the wakeup trigger */
117  if(wakeup_pin != IOID_UNUSED) {
118  ti_lib_gpio_set_output_enable_dio(wakeup_pin, GPIO_OUTPUT_DISABLE);
119  ti_lib_ioc_port_configure_set(wakeup_pin, IOC_PORT_GPIO, io_cfg);
120  }
121 
122  /* Freeze I/O latches in AON */
123  ti_lib_aon_ioc_freeze_enable();
124 
125  /* Turn off RFCORE, SERIAL and PERIPH PDs. This will happen immediately */
126  ti_lib_prcm_power_domain_off(PRCM_DOMAIN_RFCORE | PRCM_DOMAIN_SERIAL |
127  PRCM_DOMAIN_PERIPH);
128 
129  /* Register an aux-ctrl consumer to avoid powercycling AUX twice in a row */
133 
134  /* Configure clock sources for MCU: No clock */
135  ti_lib_aon_wuc_mcu_power_down_config(AONWUC_NO_CLOCK);
136 
137  /* Disable SRAM retention */
138  ti_lib_aon_wuc_mcu_sram_config(0);
139 
140  /*
141  * Request CPU, SYSBYS and VIMS PD off.
142  * This will only happen when the CM3 enters deep sleep
143  */
144  ti_lib_prcm_power_domain_off(PRCM_DOMAIN_CPU | PRCM_DOMAIN_VIMS |
145  PRCM_DOMAIN_SYSBUS);
146 
147  /* Request JTAG domain power off */
148  ti_lib_aon_wuc_jtag_power_off();
149 
150  /* Turn off AUX */
151  aux_ctrl_power_down(true);
152  ti_lib_aon_wuc_domain_power_down_enable();
153 
154  /*
155  * Request MCU VD power off.
156  * This will only happen when the CM3 enters deep sleep
157  */
158  ti_lib_prcm_mcu_power_off();
159 
160  /* Set MCU wakeup to immediate and disable virtual power off */
161  ti_lib_aon_wuc_mcu_wake_up_config(MCU_IMM_WAKE_UP);
162  ti_lib_aon_wuc_mcu_power_off_config(MCU_VIRT_PWOFF_DISABLE);
163 
164  /* Latch the IOs in the padring and enable I/O pad sleep mode */
165  ti_lib_pwr_ctrl_io_freeze_enable();
166 
167  /* Turn off VIMS cache, CRAM and TRAM - possibly not required */
168  ti_lib_prcm_cache_retention_disable();
169  ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_OFF);
170 
171  /* Enable shutdown and sync AON */
172  ti_lib_aon_wuc_shut_down_enable();
173  ti_lib_sys_ctrl_aon_sync();
174 
175  /* Deep Sleep */
176  ti_lib_prcm_deep_sleep();
177 }
178 /*---------------------------------------------------------------------------*/
179 /*
180  * Notify all modules that we're back on and rely on them to restore clocks
181  * and power domains as required.
182  */
183 static void
184 wake_up(void)
185 {
186  lpm_registered_module_t *module;
187 
188  ENERGEST_SWITCH(ENERGEST_TYPE_DEEP_LPM, ENERGEST_TYPE_CPU);
189 
190  /* Sync so that we get the latest values before adjusting recharge settings */
191  ti_lib_sys_ctrl_aon_sync();
192 
193  /* Adjust recharge settings */
194  ti_lib_sys_ctrl_adjust_recharge_after_power_down();
195 
196  /*
197  * Release the request to the uLDO
198  * This is likely not required, since the switch to GLDO/DCDC is automatic
199  * when coming back from deep sleep
200  */
201  ti_lib_prcm_mcu_uldo_configure(false);
202 
203  /* Turn on cache again */
204  ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
205  ti_lib_prcm_cache_retention_enable();
206 
207  ti_lib_aon_ioc_freeze_disable();
208  ti_lib_sys_ctrl_aon_sync();
209 
210  /* Check operating conditions, optimally choose DCDC versus GLDO */
211  ti_lib_sys_ctrl_dcdc_voltage_conditional_control();
212 
213  /* Fire up AUX is the user has requested this */
215 
216  /*
217  * We may or may not have been woken up by an AON RTC tick. If not, we need
218  * to adjust our software tick counter
219  */
220  clock_update();
221 
223 
224  /* Notify all registered modules that we've just woken up */
225  for(module = list_head(modules_list); module != NULL;
226  module = module->next) {
227  if(module->wakeup) {
228  module->wakeup();
229  }
230  }
231 
232 #if CC2650_FAST_RADIO_STARTUP
233  /*
234  * Trigger a switch to the XOSC, so that we can subsequently use the RF FS
235  */
237 #endif
238 }
239 /*---------------------------------------------------------------------------*/
240 static uint8_t
241 check_next_rtimer(rtimer_clock_t now, rtimer_clock_t *next_rtimer, bool *next_rtimer_set)
242 {
243  uint8_t max_pm = LPM_MODE_MAX_SUPPORTED;
244 
245  if(ti_lib_aon_rtc_channel_active(AON_RTC_CH0)) {
246  *next_rtimer_set = true;
247 
248  /* find out the timer of the next rtimer interrupt */
249  *next_rtimer = ti_lib_aon_rtc_compare_value_get(AON_RTC_CH0);
250 
251  if(RTIMER_CLOCK_LT(*next_rtimer, now + 2)) {
252  max_pm = MIN(max_pm, LPM_MODE_AWAKE);
253  } else if(RTIMER_CLOCK_LT(*next_rtimer, now + STANDBY_MIN_DURATION)) {
254  max_pm = MIN(max_pm, LPM_MODE_SLEEP);
255  }
256  } else {
257  *next_rtimer_set = false;
258  }
259 
260  return max_pm;
261 }
262 /*---------------------------------------------------------------------------*/
263 static uint8_t
264 check_next_etimer(rtimer_clock_t now, rtimer_clock_t *next_etimer, bool *next_etimer_set)
265 {
266  uint8_t max_pm = LPM_MODE_MAX_SUPPORTED;
267 
268  *next_etimer_set = false;
269 
270  /* Find out the time of the next etimer */
271  if(etimer_pending()) {
272  int32_t until_next_etimer = (int32_t)etimer_next_expiration_time() - (int32_t)clock_time();
273  if(until_next_etimer < 1) {
274  max_pm = MIN(max_pm, LPM_MODE_AWAKE);
275  } else {
276  *next_etimer_set = true;
277  *next_etimer = soc_rtc_last_isr_time() + (until_next_etimer * (RTIMER_SECOND / CLOCK_SECOND));
278  if(RTIMER_CLOCK_LT(*next_etimer, now + STANDBY_MIN_DURATION)) {
279  max_pm = MIN(max_pm, LPM_MODE_SLEEP);
280  }
281  }
282  }
283 
284  return max_pm;
285 }
286 /*---------------------------------------------------------------------------*/
287 static uint8_t
288 setup_sleep_mode(void)
289 {
290  lpm_registered_module_t *module;
291  uint8_t max_pm = LPM_MODE_MAX_SUPPORTED;
292  uint8_t pm;
293 
294  rtimer_clock_t now;
295  rtimer_clock_t next_rtimer = 0;
296  rtimer_clock_t next_etimer = 0;
297  bool next_rtimer_set = false;
298  bool next_etimer_set = false;
299 
300  /* Check if any events fired before we turned interrupts off. If so, abort */
301  if(LPM_MODE_MAX_SUPPORTED == LPM_MODE_AWAKE || process_nevents()) {
302  return LPM_MODE_AWAKE;
303  }
304 
305  /* Collect max allowed PM permission from interested modules */
306  for(module = list_head(modules_list); module != NULL;
307  module = module->next) {
308  if(module->request_max_pm) {
309  uint8_t module_pm = module->request_max_pm();
310  if(module_pm < max_pm) {
311  max_pm = module_pm;
312  }
313  }
314  }
315 
316  now = RTIMER_NOW();
317 
318  pm = check_next_rtimer(now, &next_rtimer, &next_rtimer_set);
319  if(pm < max_pm) {
320  max_pm = pm;
321  }
322  pm = check_next_etimer(now, &next_etimer, &next_etimer_set);
323  if(pm < max_pm) {
324  max_pm = pm;
325  }
326 
327  if(max_pm == LPM_MODE_SLEEP) {
328  if(next_etimer_set) {
329  /* Schedule the next system wakeup due to etimer */
330  if(RTIMER_CLOCK_LT(next_etimer, now + MIN_SAFE_SCHEDULE)) {
331  /* Too soon in future, use this minimal interval instead */
332  next_etimer = now + MIN_SAFE_SCHEDULE;
333  } else if(RTIMER_CLOCK_LT(now + MAX_SLEEP_TIME, next_etimer)) {
334  /* Too far in future, use MAX_SLEEP_TIME instead */
335  next_etimer = now + MAX_SLEEP_TIME;
336  }
337  soc_rtc_schedule_one_shot(AON_RTC_CH1, next_etimer);
338  } else {
339  /* No etimers set. Since by default the CH1 RTC fires once every clock tick,
340  * need to explicitly schedule a wakeup in the future to save energy.
341  * But do not stay in this mode for too long, otherwise watchdog will be trigerred. */
342  soc_rtc_schedule_one_shot(AON_RTC_CH1, now + MAX_SLEEP_TIME);
343  }
344 
345  } else if(max_pm == LPM_MODE_DEEP_SLEEP) {
346  /* Watchdog is not enabled, so deep sleep can continue an arbitrary long time.
347  * On the other hand, if `CC2650_FAST_RADIO_STARTUP` is defined,
348  * early wakeup before the next rtimer should be scheduled. */
349 
350 #if CC2650_FAST_RADIO_STARTUP
351  if(next_rtimer_set) {
352  if(!next_etimer_set || RTIMER_CLOCK_LT(next_rtimer - SLEEP_GUARD_TIME, next_etimer)) {
353  /* schedule a wakeup briefly before the next rtimer to wake up the system */
354  soc_rtc_schedule_one_shot(AON_RTC_CH2, next_rtimer - SLEEP_GUARD_TIME);
355  }
356  }
357 #endif
358 
359  if(next_etimer_set) {
360  /* Schedule the next system wakeup due to etimer.
361  * No need to compare the `next_etimer` to `now` here as this branch
362  * is only entered when there's sufficient time for deep sleeping. */
363  soc_rtc_schedule_one_shot(AON_RTC_CH1, next_etimer);
364  } else {
365  /* Use the farthest possible wakeup time */
366  soc_rtc_schedule_one_shot(AON_RTC_CH1, now - 1);
367  }
368  }
369 
370  return max_pm;
371 }
372 /*---------------------------------------------------------------------------*/
373 void
375 {
376  ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
377 
378  /* Just to be on the safe side, explicitly disable Deep Sleep */
379  HWREG(NVIC_SYS_CTRL) &= ~(NVIC_SYS_CTRL_SLEEPDEEP);
380 
381  ti_lib_prcm_sleep();
382 
383  ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
384 }
385 /*---------------------------------------------------------------------------*/
386 static void
387 deep_sleep(void)
388 {
389  uint32_t domains = LOCKABLE_DOMAINS;
390  lpm_registered_module_t *module;
391 
392  /*
393  * Notify all registered modules that we are dropping to mode X. We do not
394  * need to do this for simple sleep.
395  *
396  * This is a chance for modules to delay us a little bit until an ongoing
397  * operation has finished (e.g. uart TX) or to configure themselves for
398  * deep sleep.
399  *
400  * At this stage, we also collect power domain locks, if any.
401  * The argument to PRCMPowerDomainOff() is a bitwise OR, so every time
402  * we encounter a lock we just clear the respective bits in the 'domains'
403  * variable as required by the lock. In the end the domains variable will
404  * just hold whatever has not been cleared
405  */
406  for(module = list_head(modules_list); module != NULL;
407  module = module->next) {
408  if(module->shutdown) {
409  module->shutdown(LPM_MODE_DEEP_SLEEP);
410  }
411 
412  /* Clear the bits specified in the lock */
413  domains &= ~module->domain_lock;
414  }
415 
416  /* Pat the dog: We don't want it to shout right after we wake up */
418 
419  /* Clear unacceptable bits, just in case a lock provided a bad value */
420  domains &= LOCKABLE_DOMAINS;
421 
422  /*
423  * Freeze the IOs on the boundary between MCU and AON. We only do this if
424  * PERIPH is not needed
425  */
426  if(domains & PRCM_DOMAIN_PERIPH) {
427  ti_lib_aon_ioc_freeze_enable();
428  }
429 
430  /*
431  * Among LOCKABLE_DOMAINS, turn off those that are not locked
432  *
433  * If domains is != 0, pass it as-is
434  */
435  if(domains) {
436  ti_lib_prcm_power_domain_off(domains);
437  }
438 
439  /*
440  * Before entering Deep Sleep, we must switch off the HF XOSC. The HF XOSC
441  * is predominantly controlled by the RF driver. In a build with radio
442  * cycling (e.g. ContikiMAC), the RF driver will request the XOSC before
443  * using the Freq. Synth, and switch back to the RC when it is about to
444  * turn back off.
445  *
446  * If the radio is on, we won't even reach here, and if it's off the HF
447  * clock source should already be the HF RC, unless CC2650_FAST_RADIO_STARTUP
448  * is defined.
449  *
450  * Nevertheless, request the switch to the HF RC explicitly here.
451  */
453 
454  /* Shut Down the AUX if the user application is not using it */
455  aux_ctrl_power_down(false);
456 
457  /* Configure clock sources for MCU: No clock */
458  ti_lib_aon_wuc_mcu_power_down_config(AONWUC_NO_CLOCK);
459 
460  /* Full RAM retention. */
461  ti_lib_aon_wuc_mcu_sram_config(MCU_RAM0_RETENTION | MCU_RAM1_RETENTION |
462  MCU_RAM2_RETENTION | MCU_RAM3_RETENTION);
463 
464  /*
465  * Always turn off RFCORE, CPU, SYSBUS and VIMS. RFCORE should be off
466  * already
467  */
468  ti_lib_prcm_power_domain_off(PRCM_DOMAIN_RFCORE | PRCM_DOMAIN_CPU |
469  PRCM_DOMAIN_VIMS | PRCM_DOMAIN_SYSBUS);
470 
471  /* Request JTAG domain power off */
472  ti_lib_aon_wuc_jtag_power_off();
473 
474  /* Allow MCU and AUX powerdown */
475  ti_lib_aon_wuc_domain_power_down_enable();
476 
477  /* Configure the recharge controller */
478  ti_lib_sys_ctrl_set_recharge_before_power_down(XOSC_IN_HIGH_POWER_MODE);
479 
480  /*
481  * If both PERIPH and SERIAL PDs are off, request the uLDO as the power
482  * source while in deep sleep.
483  */
484  if(domains == LOCKABLE_DOMAINS) {
485  ti_lib_pwr_ctrl_source_set(PWRCTRL_PWRSRC_ULDO);
486  }
487 
488  ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_DEEP_LPM);
489 
490  /* Sync the AON interface to ensure all writes have gone through. */
491  ti_lib_sys_ctrl_aon_sync();
492 
493  /*
494  * Explicitly turn off VIMS cache, CRAM and TRAM. Needed because of
495  * retention mismatch between VIMS logic and cache. We wait to do this
496  * until right before deep sleep to be able to use the cache for as long
497  * as possible.
498  */
499  ti_lib_prcm_cache_retention_disable();
500  ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_OFF);
501 
502  /* Deep Sleep */
503  ti_lib_prcm_deep_sleep();
504 
505  /*
506  * When we reach here, some interrupt woke us up. The global interrupt
507  * flag is off, hence we have a chance to run things here. We will wake up
508  * the chip properly, and then we will enable the global interrupt without
509  * unpending events so the handlers can fire
510  */
511  wake_up();
512 
513  ti_lib_int_master_enable();
514 }
515 /*---------------------------------------------------------------------------*/
516 void
518 {
519  uint8_t max_pm;
520 
521  /* Critical. Don't get interrupted! */
522  ti_lib_int_master_disable();
523 
524  max_pm = setup_sleep_mode();
525 
526  /* Drop */
527  if(max_pm == LPM_MODE_SLEEP) {
528  lpm_sleep();
529  } else if(max_pm == LPM_MODE_DEEP_SLEEP) {
530  deep_sleep();
531  }
532 
533  ti_lib_int_master_enable();
534 }
535 /*---------------------------------------------------------------------------*/
536 void
537 lpm_register_module(lpm_registered_module_t *module)
538 {
539  list_add(modules_list, module);
540 }
541 /*---------------------------------------------------------------------------*/
542 void
543 lpm_unregister_module(lpm_registered_module_t *module)
544 {
545  list_remove(modules_list, module);
546 }
547 /*---------------------------------------------------------------------------*/
548 void
550 {
551  list_init(modules_list);
552 
553  /* Always wake up on any DIO edge detection */
554  ti_lib_aon_event_mcu_wake_up_set(AON_EVENT_MCU_WU3, AON_EVENT_IO);
555 }
556 /*---------------------------------------------------------------------------*/
557 void
559 {
560  if(ioid == IOID_UNUSED) {
561  return;
562  }
563 
564  ti_lib_ioc_port_configure_set(ioid, IOC_PORT_GPIO, IOC_STD_OUTPUT);
565  ti_lib_gpio_set_output_enable_dio(ioid, GPIO_OUTPUT_DISABLE);
566 }
567 /*---------------------------------------------------------------------------*/
568 /**
569  * @}
570  * @}
571  */
void oscillators_request_hf_xosc(void)
Requests the HF XOSC as the source for the HF clock, but does not perform the actual switch...
Definition: oscillators.c:94
void soc_rtc_schedule_one_shot(uint32_t channel, uint32_t ticks)
Schedule an AON RTC channel 0 one-shot compare event.
Definition: soc-rtc.c:125
void lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on)
Put the chip in shutdown power mode.
Definition: lpm.c:80
Header file with macros which rename TI CC26xxware functions.
Header file for the energy estimation mechanism
Header file for the management of CC13xx/CC26xx low-power operation.
void lpm_sleep(void)
Enter sleep mode.
Definition: lpm.c:374
clock_time_t etimer_next_expiration_time(void)
Get next event timer expiration time.
Definition: etimer.c:237
#define RTIMER_NOW()
Get the current clock time.
Definition: rtimer.h:158
Header file for the CC13xx/CC26xx oscillator control.
void lpm_drop()
Drop the cortex to sleep / deep sleep and shut down peripherals.
Definition: lpm.c:517
void oscillators_switch_to_hf_rc(void)
Switches MF and HF clock source to be the HF RC OSC.
Definition: oscillators.c:134
#define CLOCK_SECOND
A second, measured in system clock time.
Definition: clock.h:82
Linked list manipulation routines.
void * list_head(list_t list)
Get a pointer to the first element of a list.
Definition: list.c:82
int etimer_pending(void)
Check if there are any non-expired event timers.
Definition: etimer.c:231
clock_time_t clock_time(void)
Get the current clock time.
Definition: clock.c:118
Header file for the management of the CC13xx/CC26xx AUX domain.
void list_add(list_t list, void *item)
Add an item at the end of a list.
Definition: list.c:142
void aux_ctrl_register_consumer(aux_consumer_module_t *consumer)
Register a module that no longer requires access to the AUX power domain.
Definition: aux-ctrl.c:44
void list_init(list_t list)
Initialize a list.
Definition: list.c:65
int process_nevents(void)
Number of events waiting to be processed.
Definition: process.c:316
#define LIST(name)
Declare a linked list.
Definition: list.h:88
void aux_ctrl_power_up()
Power-up the AUX power domain.
Definition: aux-ctrl.c:75
void aux_ctrl_power_down(bool force)
Power down the AUX power domain.
Definition: aux-ctrl.c:87
void lpm_init()
Initialise the low-power mode management module.
Definition: lpm.c:549
The data structure to be used for modules that require access to AUX.
Definition: aux-ctrl.h:62
void lpm_pin_set_default_state(uint32_t ioid)
Sets an IOID to a default state.
Definition: lpm.c:558
void watchdog_periodic(void)
Writes the WDT clear sequence.
Definition: watchdog.c:85
Header file for the CC13xx/CC26xx AON RTC driver.
Header file for the LED HAL.
void list_remove(list_t list, void *item)
Remove a specific element from a list.
Definition: list.c:237
void lpm_unregister_module(lpm_registered_module_t *module)
Unregister a module from LPM notifications.
Definition: lpm.c:543
void lpm_register_module(lpm_registered_module_t *module)
Register a module for LPM notifications.
Definition: lpm.c:537
void oscillators_select_lf_rcosc(void)
Set the LF clock source to be the LF RCOSC.
Definition: oscillators.c:73