Master Thesis
V1.0
Research and Design of Sensor Node for NMSD Treatment
|
Delay functionality. More...
#include <stdint.h>
#include <stdbool.h>
#include "em_device.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "em_gpio.h"
#include "em_rtc.h"
#include "delay.h"
#include "debug_dbprint.h"
Go to the source code of this file.
Macros | |
#define | ULFRCOFREQ 1000 |
#define | ULFRCOFREQ_MS 1.000 |
#define | LFXOFREQ 32768 |
#define | LFXOFREQ_MS 32.768 |
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... | |
void | SysTick_Handler (void) |
Interrupt Service Routine for system tick counter. More... | |
Variables | |
bool | sleeping = false |
bool | RTC_initialized = false |
bool | SysTick_initialized = false |
Delay functionality.
util.c
to this file. \ n \ r
fixes. delay
method. Renamed sleep method. error
function, added functionality to exit methods after error
call and updated version number. static
before some local variables (not necessary). msTicks
variable and systick handler in #if
check.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.c.
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.
void SysTick_Handler | ( | void | ) |