This is the chip specific include file for T32CM11 RTC Driver note that there is a common include file for this HAL module that contains the APIs (such as the init function) that should be used by the application. More...
#include "tr_hal_platform.h"Go to the source code of this file.
Data Structures | |
| struct | tr_hal_rtc_date |
| convenience structs for use when passing around dates, times, or both More... | |
| struct | tr_hal_rtc_time |
| struct | tr_hal_rtc_date_time |
| struct | RTC_REGISTERS_T |
| the struct we use so we can address registers using field names More... | |
| struct | tr_hal_rtc_settings_t |
Macros | |
| #define | TR_HAL_RTC_YEAR_MINIMUM 2000 |
| min and max values for the six units of time/date | |
| #define | TR_HAL_RTC_YEAR_MAXIMUM 2099 |
| #define | TR_HAL_RTC_MONTH_MINIMUM 1 |
| #define | TR_HAL_RTC_MONTH_MAXIMUM 12 |
| #define | TR_HAL_RTC_DAY_MINIMUM 1 |
| #define | TR_HAL_RTC_DAY_MAXIMUM 31 |
| #define | TR_HAL_RTC_SHORT_MONTH_DAY_MAXIMUM 30 |
| #define | TR_HAL_RTC_FEB_DAY_MAXIMUM 28 |
| #define | TR_HAL_RTC_FEB_LEAP_YEAR_DAY_MAXIMUM 29 |
| #define | TR_HAL_RTC_HOUR_MINIMUM 0 |
| #define | TR_HAL_RTC_HOUR_MAXIMUM 23 |
| #define | TR_HAL_RTC_MINUTE_MINIMUM 0 |
| #define | TR_HAL_RTC_MINUTE_MAXIMUM 59 |
| #define | TR_HAL_RTC_SECOND_MINIMUM 0 |
| #define | TR_HAL_RTC_SECOND_MAXIMUM 59 |
| #define | TR_HAL_MONTH_JANUARY 1 |
| #define | TR_HAL_MONTH_FEBRUARY 2 |
| #define | TR_HAL_MONTH_MARCH 3 |
| #define | TR_HAL_MONTH_APRIL 4 |
| #define | TR_HAL_MONTH_MAY 5 |
| #define | TR_HAL_MONTH_JUNE 6 |
| #define | TR_HAL_MONTH_JULY 7 |
| #define | TR_HAL_MONTH_AUGUST 8 |
| #define | TR_HAL_MONTH_SEPTEMBER 9 |
| #define | TR_HAL_MONTH_OCTOBER 10 |
| #define | TR_HAL_MONTH_NOVEMBER 11 |
| #define | TR_HAL_MONTH_DECEMBER 12 |
| #define | TR_HAL_INVALID_DATE_TIME_VALUE 255 |
| special invalid value for any of the 6 time units: this define is used for the COMBO EVENT. If the caller does not want to use one or more of the time units, then the value of those time units should be set to this value | |
| #define | CHIP_MEMORY_MAP_RTC_BASE (0x40600000UL) |
| chip register addresses section 3.1 of the data sheet explains the Memory map. this gives the base address for how to write the chip registers the chip registers are how the software interacts and configures the SPI peripherals. We create a struct below that addresses the individual registers. This makes it so we can use this base address and a struct field to read or write a chip register | |
| #define | TR_HAL_DEFAULT_CLOCK_DIVISOR 39999 |
| #define | TR_HAL_REG_SETTING_EVENT_OFF 0x0000 |
| #define | TR_HAL_REG_SETTING_EVENT_ON_CHANGE 0x0100 |
| #define | TR_HAL_REG_SETTING_EVENT_ON_VALUE 0x0000 |
| #define | TR_HAL_REG_SETTING_COMBO_EVENT 0x0200 |
| #define | TR_HAL_RTC_INTERRUPT_NONE (uint32_t)0x00 |
| #define | TR_HAL_RTC_INTERRUPT_SECONDS (uint32_t)0x01 |
| #define | TR_HAL_RTC_INTERRUPT_MINUTES (uint32_t)0x02 |
| #define | TR_HAL_RTC_INTERRUPT_HOURS (uint32_t)0x04 |
| #define | TR_HAL_RTC_INTERRUPT_DAYS (uint32_t)0x08 |
| #define | TR_HAL_RTC_INTERRUPT_MONTHS (uint32_t)0x10 |
| #define | TR_HAL_RTC_INTERRUPT_YEARS (uint32_t)0x20 |
| #define | TR_HAL_RTC_INTERRUPT_COMBINED_EVENT (uint32_t)0x40 |
| #define | TR_HAL_RTC_INTERRUPT_ALL (uint32_t)0x7F |
| #define | TR_HAL_RTC_UPDATE_TIME_VALUES 0x01 |
| #define | TR_HAL_RTC_UPDATE_EVENT_TRIGGER 0x02 |
| #define | TR_HAL_RTC_UPDATE_CLOCK_DIVISOR 0x04 |
| #define | RTC_REGISTERS ((RTC_REGISTERS_T *) CHIP_MEMORY_MAP_RTC_BASE) |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_SECONDS 0x00000001 |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_MINUTES 0x00000002 |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_HOURS 0x00000004 |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_DAYS 0x00000008 |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_MONTHS 0x00000010 |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_YEARS 0x00000020 |
| #define | TR_HAL_RTC_EVENT_TRIGGERED_COMBINED_EVENT 0x00000040 |
| #define | DEFAULT_RTC_CONFIG |
Typedefs | |
| typedef void(* | tr_hal_rtc_event_callback_t) (uint32_t event_bitmask, tr_hal_rtc_date_time current_date_time) |
Functions | |
| RTC_REGISTERS_T * | tr_hal_rtc_get_register_address (void) |
| tr_hal_status_t | tr_hal_rtc_speedup_for_testing (tr_hal_rtc_speedup_unit_t speedup_unit) |
| uint32_t | convert_bcd_to_int (uint32_t register_value) |
| uint32_t | convert_int_to_bcd (uint32_t int_value) |
This is the chip specific include file for T32CM11 RTC Driver note that there is a common include file for this HAL module that contains the APIs (such as the init function) that should be used by the application.
the RTC module keeps track of 6 time units: seconds, minutes, hours, days, months, and years.
The RTC module also supports events (interrupts) triggered on time units There are 3 types of events (interrupts) that can be set for these time units:
SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2025 Trident IoT, LLC https://www.tridentiot.com