![]() |
MAX32665 SDK Documentation
0.2
Software Development Kit Overview and API Documentation
|
Modules | |
RTC_Registers | |
Registers, Bit Masks and Bit Positions for the RTC Peripheral Module. | |
Enumerations | |
enum | rtc_sqwave_en_t { SQUARE_WAVE_DISABLED, SQUARE_WAVE_ENABLED } |
enum | rtc_freq_sel_t { F_1HZ = MXC_S_RTC_CTRL_FT_FREQ1HZ, F_512HZ = MXC_S_RTC_CTRL_FT_FREQ512HZ, F_4KHZ = MXC_S_RTC_CTRL_FT_FREQ4KHZ, F_32KHZ = 32 } |
enum | rtc_osc_mode_t { NOISE_IMMUNE_MODE = MXC_S_RTC_CTRL_X32KMD_NOISEIMMUNEMODE, QUIET_MODE = MXC_S_RTC_CTRL_X32KMD_QUIETMODE, QUIET_STOP_WARMUP_MODE = MXC_S_RTC_CTRL_X32KMD_QUIETINSTOPWITHWARMUP, QUIET_STOP_NOWARMUP_MODE = MXC_S_RTC_CTRL_X32KMD_QUIETINSTOPNOWARMUP } |
Functions | |
int | RTC_EnableTimeofdayInterrupt (mxc_rtc_regs_t *rtc) |
Enables Time-of-Day's Alarm Interrupt. More... | |
int | RTC_DisableTimeofdayInterrupt (mxc_rtc_regs_t *rtc) |
Disable Time-of-Day's Alarm Interrupt. More... | |
int | RTC_EnableSubsecondInterrupt (mxc_rtc_regs_t *rtc) |
Enables Sub-Second's Alarm Interrupt. More... | |
int | RTC_DisableSubsecondInterrupt (mxc_rtc_regs_t *rtc) |
Disable Sub-Second's Alarm Interrupt. More... | |
int | RTC_SetTimeofdayAlarm (mxc_rtc_regs_t *rtc, uint32_t ras) |
Set Time-of-Day alarm value and enable Interrupt. More... | |
int | RTC_SetSubsecondAlarm (mxc_rtc_regs_t *rtc, uint32_t rssa) |
Set Sub-Second alarm value and enable interrupt,. More... | |
int | RTC_EnableRTCE (mxc_rtc_regs_t *rtc) |
Enable/Start the Real Time Clock. More... | |
int | RTC_DisableRTCE (mxc_rtc_regs_t *rtc) |
Disable/Stop the Real Time Clock. More... | |
int | RTC_Init (mxc_rtc_regs_t *rtc, uint32_t sec, uint16_t ssec, sys_cfg_rtc_t *sys_cfg) |
Initialize the sec and ssec registers and enable RTC. More... | |
int | RTC_SquareWave (mxc_rtc_regs_t *rtc, rtc_sqwave_en_t sqe, rtc_freq_sel_t ft, rtc_osc_mode_t x32kmd, const sys_cfg_rtc_t *sys_cfg) |
Allow generation of Square Wave on the SQW pin. More... | |
int | RTC_Trim (mxc_rtc_regs_t *rtc, int8_t trm) |
Set Trim register value. More... | |
int | RTC_CheckBusy (void) |
Check if BUSY bit is 0. More... | |
int | RTC_GetFlags (void) |
Gets Interrupt flags. More... | |
int | RTC_ClearFlags (int flags) |
Clear Interrupt flag. More... | |
int | RTC_GetSubSecond (void) |
Get SubSecond. More... | |
int | RTC_GetSecond (void) |
Get Second. More... | |
int | RTC_GetTime (uint32_t *sec, uint32_t *subsec) |
Read seconds, then subseconds, and finally seconds. More... | |
enum rtc_sqwave_en_t |
enum rtc_freq_sel_t |
int RTC_EnableTimeofdayInterrupt | ( | mxc_rtc_regs_t * | rtc | ) |
rtc | pointer to the rtc register structure |
int RTC_DisableTimeofdayInterrupt | ( | mxc_rtc_regs_t * | rtc | ) |
rtc | pointer to the rtc register structure |
int RTC_EnableSubsecondInterrupt | ( | mxc_rtc_regs_t * | rtc | ) |
rtc | pointer to the rtc register structure |
int RTC_DisableSubsecondInterrupt | ( | mxc_rtc_regs_t * | rtc | ) |
rtc | pointer to the rtc register structure |
int RTC_SetTimeofdayAlarm | ( | mxc_rtc_regs_t * | rtc, |
uint32_t | ras | ||
) |
rtc | pointer to the rtc register structure |
ras | 20-bit value 0-0xFFFFF |
int RTC_SetSubsecondAlarm | ( | mxc_rtc_regs_t * | rtc, |
uint32_t | rssa | ||
) |
this is to be called after the init_rtc() function
rtc | pointer to the rtc register structure |
rssa | 32-bit value 0-0xFFFFFFFF |
int RTC_EnableRTCE | ( | mxc_rtc_regs_t * | rtc | ) |
int RTC_DisableRTCE | ( | mxc_rtc_regs_t * | rtc | ) |
int RTC_Init | ( | mxc_rtc_regs_t * | rtc, |
uint32_t | sec, | ||
uint16_t | ssec, | ||
sys_cfg_rtc_t * | sys_cfg | ||
) |
int RTC_SquareWave | ( | mxc_rtc_regs_t * | rtc, |
rtc_sqwave_en_t | sqe, | ||
rtc_freq_sel_t | ft, | ||
rtc_osc_mode_t | x32kmd, | ||
const sys_cfg_rtc_t * | sys_cfg | ||
) |
int RTC_Trim | ( | mxc_rtc_regs_t * | rtc, |
int8_t | trm | ||
) |
int RTC_GetFlags | ( | void | ) |
int RTC_ClearFlags | ( | int | flags | ) |
flags | the flags that need to be cleared |
int RTC_GetSubSecond | ( | void | ) |
int RTC_GetSecond | ( | void | ) |
int RTC_GetTime | ( | uint32_t * | sec, |
uint32_t * | subsec | ||
) |
If RTC ready flag ever gets cleared during this sequence, the RTC is in the middle of updating the counts and the user should come back later and try again. If the first read of the seconds register doesn't match the next read, then a subsecond overflow condition has happened and another attempt to read the counts should be made.
sec | variable that will be changed to hold second value |
subsec | variable that will be changed to hold Subsecond value |