#include "chip.h"#include <stdint.h>Go to the source code of this file.
Defines | |
| #define | RTC_HOUR_BIT_LEN_MASK 0x3F |
| #define | RTC_MIN_BIT_LEN_MASK 0x7F |
| #define | RTC_SEC_BIT_LEN_MASK 0x7F |
| #define | RTC_CENT_BIT_LEN_MASK 0x7F |
| #define | RTC_YEAR_BIT_LEN_MASK 0xFF |
| #define | RTC_MONTH_BIT_LEN_MASK 0x1F |
| #define | RTC_DATE_BIT_LEN_MASK 0x3F |
| #define | RTC_WEEK_BIT_LEN_MASK 0x07 |
Functions | |
| void | RTC_SetHourMode (Rtc *pRtc, uint32_t dwMode) |
| Sets the RTC in either 12 or 24 hour mode. | |
| uint32_t | RTC_GetHourMode (Rtc *pRtc) |
| Gets the RTC mode. | |
| void | RTC_EnableIt (Rtc *pRtc, uint32_t dwSources) |
| Enables the selected interrupt sources of the RTC. | |
| void | RTC_DisableIt (Rtc *pRtc, uint32_t dwSources) |
| Disables the selected interrupt sources of the RTC. | |
| int | RTC_SetTime (Rtc *pRtc, uint8_t ucHour, uint8_t ucMinute, uint8_t ucSecond) |
| Sets the current time in the RTC. | |
| void | RTC_GetTime (Rtc *pRtc, uint8_t *pucHour, uint8_t *pucMinute, uint8_t *pucSecond) |
| Retrieves the current time as stored in the RTC in several variables. | |
| int | RTC_SetTimeAlarm (Rtc *pRtc, uint8_t *pucHour, uint8_t *pucMinute, uint8_t *pucSecond) |
| Sets a time alarm on the RTC. The match is performed only on the provided variables; Setting all pointers to 0 disables the time alarm. | |
| void | RTC_GetDate (Rtc *pRtc, uint16_t *pwYear, uint8_t *pucMonth, uint8_t *pucDay, uint8_t *pucWeek) |
| Retrieves the current year, month and day from the RTC. Month, day and week values are numbered starting at 1. | |
| int | RTC_SetDate (Rtc *pRtc, uint16_t wYear, uint8_t ucMonth, uint8_t ucDay, uint8_t ucWeek) |
| Sets the current year, month and day in the RTC. Month, day and week values must be numbered starting from 1. | |
| int | RTC_SetDateAlarm (Rtc *pRtc, uint8_t *pucMonth, uint8_t *pucDay) |
| Sets a date alarm in the RTC. The alarm will match only the provided values; Passing a null-pointer disables the corresponding field match. | |
| void | RTC_ClearSCCR (Rtc *pRtc, uint32_t dwMask) |
| Clear flag bits of status clear command register in the RTC. | |
| uint32_t | RTC_GetSR (Rtc *pRtc, uint32_t dwMask) |
| Get flag bits of status register in the RTC. | |
Interface for Real Time Clock (RTC) controller.
Definition in file rtc.h.
| void RTC_ClearSCCR | ( | Rtc * | pRtc, | |
| uint32_t | dwMask | |||
| ) |
| void RTC_DisableIt | ( | Rtc * | pRtc, | |
| uint32_t | dwSources | |||
| ) |
| void RTC_EnableIt | ( | Rtc * | pRtc, | |
| uint32_t | dwSources | |||
| ) |
| void RTC_GetDate | ( | Rtc * | pRtc, | |
| uint16_t * | pwYear, | |||
| uint8_t * | pucMonth, | |||
| uint8_t * | pucDay, | |||
| uint8_t * | pucWeek | |||
| ) |
Retrieves the current year, month and day from the RTC. Month, day and week values are numbered starting at 1.
| pYwear | Current year (optional). | |
| pucMonth | Current month (optional). | |
| pucDay | Current day (optional). | |
| pucWeek | Current day in current week (optional). |
| uint32_t RTC_GetHourMode | ( | Rtc * | pRtc | ) |
| uint32_t RTC_GetSR | ( | Rtc * | pRtc, | |
| uint32_t | dwMask | |||
| ) |
| void RTC_GetTime | ( | Rtc * | pRtc, | |
| uint8_t * | pucHour, | |||
| uint8_t * | pucMinute, | |||
| uint8_t * | pucSecond | |||
| ) |
Retrieves the current time as stored in the RTC in several variables.
| pucHour | If not null, current hour is stored in this variable. | |
| pucMinute | If not null, current minute is stored in this variable. | |
| pucSecond | If not null, current second is stored in this variable. |
| int RTC_SetDate | ( | Rtc * | pRtc, | |
| uint16_t | wYear, | |||
| uint8_t | ucMonth, | |||
| uint8_t | ucDay, | |||
| uint8_t | ucWeek | |||
| ) |
Sets the current year, month and day in the RTC. Month, day and week values must be numbered starting from 1.
| wYear | Current year. | |
| ucMonth | Current month. | |
| ucDay | Current day. | |
| ucWeek | Day number in current week. |
| int RTC_SetDateAlarm | ( | Rtc * | pRtc, | |
| uint8_t * | pucMonth, | |||
| uint8_t * | pucDay | |||
| ) |
Sets a date alarm in the RTC. The alarm will match only the provided values; Passing a null-pointer disables the corresponding field match.
| pucMonth | If not null, the RTC alarm will month-match this value. | |
| pucDay | If not null, the RTC alarm will day-match this value. |
| void RTC_SetHourMode | ( | Rtc * | pRtc, | |
| uint32_t | dwMode | |||
| ) |
| int RTC_SetTime | ( | Rtc * | pRtc, | |
| uint8_t | ucHour, | |||
| uint8_t | ucMinute, | |||
| uint8_t | ucSecond | |||
| ) |
Sets the current time in the RTC.
| ucHour | Current hour in 12 or 24 hour mode. | |
| ucMinute | Current minute. | |
| ucSecond | Current second. |
| int RTC_SetTimeAlarm | ( | Rtc * | pRtc, | |
| uint8_t * | pucHour, | |||
| uint8_t * | pucMinute, | |||
| uint8_t * | pucSecond | |||
| ) |
Sets a time alarm on the RTC. The match is performed only on the provided variables; Setting all pointers to 0 disables the time alarm.
| pucHour | If not null, the time alarm will hour-match this value. | |
| pucMinute | If not null, the time alarm will minute-match this value. | |
| pucSecond | If not null, the time alarm will second-match this value. |
1.7.1