Embedded System Design 2 - Project
|
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 "pin_mapping.h"
#include "debug_dbprint.h"
#include "util.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 | |
static void | initRTC (void) |
RTC initialization. More... | |
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 | RTC_IRQHandler (void) |
Interrupt Service Routine for the RTC. More... | |
Variables | |
static volatile bool | RTC_sleep_wakeup = false |
bool | sleeping = false |
bool | RTC_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.ULFRCO
for the delay and sleep method separately.documentation.h
if this functionality is changed.//
)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 124 of file delay.c.
|
static |
RTC initialization.
Definition at line 453 of file delay.c.
bool RTC_checkWakeup | ( | void | ) |
void RTC_clearWakeup | ( | void | ) |
uint32_t RTC_getPassedSleeptime | ( | void | ) |
void RTC_IRQHandler | ( | void | ) |
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 276 of file delay.c.