DIY Logging Volt/Ampmeter
|
RTC functionality for high-precision logging voltage/current meter. More...
#include "rtc.h"
#include <stdint.h>
#include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_rcc.h"
#include "stm32f1xx_ll_pwr.h"
#include "stm32f1xx_ll_rtc.h"
#include "stm32f1xx_ll_exti.h"
#include "stm32f1xx_ll_cortex.h"
#include "util.h"
Go to the source code of this file.
Macros | |
#define | RTC_TIMEOUT_MS ((uint32_t)1000) |
#define | RTC_ASYNCH_PREDIV ((uint32_t)0x7FFF) |
Functions | |
static void | RTCcounter_to_dateTime (uint32_t counter) |
Function to convert the RTC counter value to date-time values in the struct. More... | |
static uint32_t | dateTime_to_RTCcounter (void) |
Function to convert the date-time values in the struct to a corresponding RTC counter value. More... | |
void | RTC_Init (void) |
Function to initialize the Real Time Clock. More... | |
void | readFromRTC (void) |
Function to update the RTC data in the struct. More... | |
void | writeToRTC (void) |
Function to update the RTC values according to the data in the struct. More... | |
Variables | |
static uint32_t | Timeout = 0 |
RTC functionality for high-precision logging voltage/current meter.
RTC_dateTime_t
struct somewhere?rtc.wday
somewhere?Copyright (C) 2021 - 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 also use code obtained from examples from STMicroelectronics.
Copyright (c) 2020 STMicroelectronics. All rights reserved.
These sections are licensed by ST under BSD 3-Clause license, the "License"; One may not use these example files except in compliance with the License. One may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
Some methods also use code obtained from https://github.com/mkdxdx/stm32f103_logger
These seem to be heavily based on https://github.com/LonelyWolf/stm32/blob/master/stm32l-dosfs/RTC.c
Definition in file rtc.c.
#define RTC_ASYNCH_PREDIV ((uint32_t)0x7FFF) |
#define RTC_TIMEOUT_MS ((uint32_t)1000) |
|
static |
Function to convert the date-time values in the struct to a corresponding RTC counter value.
uint32_t
) Definition at line 255 of file rtc.c.
void readFromRTC | ( | void | ) |
Function to update the RTC data in the struct.
void RTC_Init | ( | void | ) |
|
static |
void writeToRTC | ( | void | ) |
Function to update the RTC values according to the data in the struct.