MAX32650 Peripheral Driver API
Peripheral Driver API for the MAX32650
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
RTC

Modules

 RTC_Registers
 

Enumerations

enum  mxc_rtc_freq_sel_t
 
enum  mxc_rtc_int_en_t
 
enum  mxc_rtc_int_fl_t
 

Functions

int MXC_RTC_SetTimeofdayAlarm (uint32_t ras)
 
int MXC_RTC_SetSubsecondAlarm (uint32_t rssa)
 
int MXC_RTC_Start (void)
 
int MXC_RTC_Stop (void)
 
int MXC_RTC_Init (uint32_t sec, uint8_t ssec)
 
int MXC_RTC_SquareWaveStart (mxc_rtc_freq_sel_t fq)
 
int MXC_RTC_SquareWaveStop (void)
 
int MXC_RTC_EnableInt (uint32_t mask)
 
int MXC_RTC_DisableInt (uint32_t mask)
 
int MXC_RTC_GetFlags (void)
 
int MXC_RTC_ClearFlags (int flags)
 
int MXC_RTC_GetSubSecond (void)
 
int MXC_RTC_GetSubSeconds (uint32_t *ssec)
 
int MXC_RTC_GetSecond (void)
 
int MXC_RTC_GetSeconds (uint32_t *sec)
 
int MXC_RTC_GetTime (uint32_t *sec, uint32_t *subsec)
 
int MXC_RTC_GetBusyFlag (void)
 

Detailed Description

Enumeration Type Documentation

◆ mxc_rtc_freq_sel_t

Bitmasks for each of the RTC's Frequency.

Enumerator
MXC_RTC_F_1HZ 

1Hz (Compensated)

MXC_RTC_F_512HZ 

512Hz (Compensated)

MXC_RTC_F_4KHZ 

4Khz

MXC_RTC_F_32KHZ 

32Khz

◆ mxc_rtc_int_en_t

Bitmasks for each of the RTC's interrupt enables.

Enumerator
MXC_RTC_INT_EN_LONG 

Long-interval alarm interrupt enable.

MXC_RTC_INT_EN_SHORT 

Short-interval alarm interrupt enable.

MXC_RTC_INT_EN_READY 

Timer ready interrupt enable.

◆ mxc_rtc_int_fl_t

Bitmasks for each of the RTC's interrupt flags.

Enumerator
MXC_RTC_INT_FL_LONG 

Long-interval alarm interrupt flag.

MXC_RTC_INT_FL_SHORT 

Short-interval alarm interrupt flag.

MXC_RTC_INT_FL_READY 

Timer ready interrupt flag.

Function Documentation

◆ MXC_RTC_ClearFlags()

int MXC_RTC_ClearFlags ( int  flags)

Clear interrupt flags.

Parameters
flagsthe flags to be cleared See mxc_rtc_int_fl_t for the list of possible flags.
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_DisableInt()

int MXC_RTC_DisableInt ( uint32_t  mask)

Disable Interurpts (Blocking function)

Parameters
maskThe mask of interrupts to disable. See mxc_rtc_int_en_t for available choices.
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_EnableInt()

int MXC_RTC_EnableInt ( uint32_t  mask)

Enable Interurpts (Blocking function)

Parameters
maskThe bitwise OR of interrupts to enable. See mxc_rtc_int_en_t for available choices.
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_GetBusyFlag()

int MXC_RTC_GetBusyFlag ( void  )

Get RTC busy flag.

Return values
returnsSuccess or E_BUSY, see /ref MXC_ERROR_CODES

◆ MXC_RTC_GetFlags()

int MXC_RTC_GetFlags ( void  )

Gets Interrupt flags.

Returns
Interrupts flags that have not been cleared

◆ MXC_RTC_GetSecond()

int MXC_RTC_GetSecond ( void  )

Get Second or E_BUSY, see /ref MXC_ERROR_CODES.

Return values
returnssecond value

◆ MXC_RTC_GetSeconds()

int MXC_RTC_GetSeconds ( uint32_t *  sec)

This function stores the current value of the seconds counter into a pointer if the RTC is not busy. If the RTC is busy, an error is returned.

Parameters
secPointer to the variable to store the current seconds value.
Return values
E_NO_ERRORif successful, otherwise an error code (see /ref MXC_ERROR_CODES).

◆ MXC_RTC_GetSubSecond()

int MXC_RTC_GetSubSecond ( void  )

Get SubSecond or E_BUSY, see /ref MXC_ERROR_CODES.

Return values
Returnssubsecond value

◆ MXC_RTC_GetSubSeconds()

int MXC_RTC_GetSubSeconds ( uint32_t *  ssec)

This function stores the current value of the sub-seconds counter into a pointer if the RTC is not busy. If the RTC is busy, an error is returned.

Parameters
ssecPointer to the variable to store the current sub-seconds value.
Return values
E_NO_ERRORif successful, otherwise an error code (see /ref MXC_ERROR_CODES).

◆ MXC_RTC_GetTime()

int MXC_RTC_GetTime ( uint32_t *  sec,
uint32_t *  subsec 
)

Get the current second and sub-second counts.

Parameters
secpointer to store seconds value
subsecpointer to store subseconds value
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_Init()

int MXC_RTC_Init ( uint32_t  sec,
uint8_t  ssec 
)

Initialize the sec and ssec registers and enable RTC (Blocking function)

Parameters
secset the RTC Sec counter (32-bit)
ssecset the RTC Sub-second counter (8-bit)
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_SetSubsecondAlarm()

int MXC_RTC_SetSubsecondAlarm ( uint32_t  rssa)

Set Sub-Second alarm value, this is to be called.

after the init_rtc() function

Parameters
rssa32-bit value 0-0xFFFFFFFF
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_SetTimeofdayAlarm()

int MXC_RTC_SetTimeofdayAlarm ( uint32_t  ras)

Set Time-of-Day alarm value.

Parameters
ras20-bit value 0-0xFFFFF
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_SquareWaveStart()

int MXC_RTC_SquareWaveStart ( mxc_rtc_freq_sel_t  fq)

Allow generation of Square Wave on the SQW pin (Blocking function)

Parameters
fqFrequency output selection
Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_SquareWaveStop()

int MXC_RTC_SquareWaveStop ( void  )

Stop the generation of square wave (Blocking function)

Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_Start()

int MXC_RTC_Start ( void  )

Start the Real Time Clock (Blocking function)

Return values
returnsSuccess or Fail, see Error Codes

◆ MXC_RTC_Stop()

int MXC_RTC_Stop ( void  )

Stop the Real Time Clock (Blocking function)

Return values
returnsSuccess or Fail, see Error Codes