foxBMS
1.6.0
The foxBMS Battery Management System API Documentation
|
Header file of the RTC driver. More...
Go to the source code of this file.
Data Structures | |
struct | RTC_TIME_DATA_s |
Enumerations | |
enum | RTC_INIT_STATES_e { RTC_SET_SYSTEM_TIMER , RTC_SET_BLF , RTC_CLEAR_OTPR , RTC_WAIT_CLEAR_OTPR , RTC_OTPR_CLEARED , RTC_SET_OTPR , RTC_WAIT_SET_OTPR , RTC_INIT_SET_FINISHED } |
Functions | |
RTC_TIME_DATA_s | RTC_GetSystemTimeRtcFormat (void) |
get the RTC system timer. More... | |
void | RTC_IncrementSystemTime (void) |
increment the RTC system timer. More... | |
STD_RETURN_TYPE_e | RTC_Initialize (void) |
initialization of the RTC IC. More... | |
void | RTC_InitializeSystemTimeWithRtc (void) |
initialize system time with RTC time. More... | |
void | RTC_SetSystemTimeRtcFormat (RTC_TIME_DATA_s timeRtcFormat) |
set the RTC system timer. More... | |
void | RTC_Trigger (void) |
trigger function for the RTC driver. More... | |
Header file of the RTC driver.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Uses the NXP PCF2131 RTC over I2C
Definition in file rtc.h.
#define RTC_CTRL3_PWRMNG_DIRECTSWITCH_LOWDETECTIONENABLE_MODE (0x03u) |
enum RTC_INIT_STATES_e |
RTC_TIME_DATA_s RTC_GetSystemTimeRtcFormat | ( | void | ) |
void RTC_IncrementSystemTime | ( | void | ) |
STD_RETURN_TYPE_e RTC_Initialize | ( | void | ) |
void RTC_InitializeSystemTimeWithRtc | ( | void | ) |
initialize system time with RTC time.
This function is called once at the startup of the system. It reads the time from the RTC IC over I2C and sets the RTC system timer with this value. It must be called once the 1ms task is already running, otherwise the RTC system timer will not be incremented and there will be a discrepancy between the RTC IC time and the RTC system timer.
Definition at line 577 of file rtc.c.
void RTC_SetSystemTimeRtcFormat | ( | RTC_TIME_DATA_s | timeRtcFormat | ) |
set the RTC system timer.
This function is used to set the RTC system timer with RTC time data. It is called at startup by RTC_InitializeSystemTimeWithRtc().
timeRtcFormat | time data to set the RTC system timer |
Definition at line 595 of file rtc.c.
void RTC_Trigger | ( | void | ) |
trigger function for the RTC driver.
This function uses RTC_SetOverCanMessage() to check in the RTC queue for requests to set the RTC time. If a request was made, the time of the RTC IC is set over I2C and the RTC system timer is set.
Definition at line 414 of file rtc.c.