Master Thesis
V1.0
Research and Design of Sensor Node for NMSD Treatment
|
Delay functionality. More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | SYSTICKDELAY 1 |
#define | ULFRCO 0 |
Functions | |
void | delay (uint32_t msDelay) |
Wait for a certain amount of milliseconds in EM2/3. More... | |
void | sleep (uint32_t sSleep) |
Sleep for a certain amount of seconds in EM2/3. More... | |
bool | RTC_checkWakeup (void) |
Method to check if the wakeup was caused by the RTC. More... | |
void | RTC_clearWakeup (void) |
Method to clear RTC_sleep_wakeup . More... | |
uint32_t | RTC_getPassedSleeptime (void) |
Method to get the time spend sleeping (in seconds) in the case of GPIO wake-up. More... | |
Delay functionality.
Copyright (C) 2019 - Brecht Van Eeckhoudt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A copy of the GNU General Public License can be found in the LICENSE
file along with this source code.
Some methods use code obtained from examples from Silicon Labs' GitHub. These sections are licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.
Definition in file delay.h.
#define SYSTICKDELAY 1 |
#define ULFRCO 0 |
Public definition to select the use of the crystal or the oscillator
0
- Use the low-frequency crystal oscillator (LFXO), EM2 sleep is used. 1
- Use the ultra low-frequency RC oscillator (ULFRCO), EM3 sleep is used but delays are less precise timing-wise. ** EM3: All unwanted oscillators are disabled, they don't need to manually disabled before EMU_EnterEM3
.** void delay | ( | uint32_t | msDelay | ) |
Wait for a certain amount of milliseconds in EM2/3.
This method also initializes SysTick/RTC if necessary.
[in] | msDelay | The delay time in milliseconds. |
Definition at line 116 of file delay.c.
References dbinfo(), and SysTick_initialized.
Referenced by blink(), ICM_20948_accelGyroCalibrate(), ICM_20948_gyroCalibrate(), ICM_20948_Init(), ICM_20948_Init2(), ICM_20948_lowPowerModeEnter(), ICM_20948_reset(), ICM_20948_reset_mag(), ICM_20948_wakeOnMotionITEnable(), measure_send(), and waitForSlave4().
bool RTC_checkWakeup | ( | void | ) |
void RTC_clearWakeup | ( | void | ) |
uint32_t RTC_getPassedSleeptime | ( | void | ) |
Method to get the time spend sleeping (in seconds) in the case of GPIO wake-up.
Definition at line 420 of file delay.c.
References LFXOFREQ, and ULFRCOFREQ.
void sleep | ( | uint32_t | sSleep | ) |
Sleep for a certain amount of seconds in EM2/3.
This method also initializes the RTC if necessary.
[in] | sSleep | The sleep time in seconds. |
Definition at line 268 of file delay.c.
References RTC_initialized.