Developer World
Spresense Arduino Library v3.2.0-77d75a4
RtcClass Class Reference

This is the interface to the RTC Hardware. More...

#include <RTC.h>

Public Member Functions

 RtcClass ()
 Create RtcClass object.
 
void begin ()
 Initialize the RTC library. More...
 
void end ()
 Finalize the RTC library.
 
void setTime (RtcTime &rtc)
 Set RTC time. More...
 
RtcTime getTime ()
 Get RTC time. More...
 
void setAlarm (RtcTime &rtc)
 Set RTC alarm time. More...
 
void setAlarmSeconds (uint32_t seconds)
 Set RTC alarm time after the specified seconds. More...
 
void cancelAlarm ()
 Cancel RTC alarm time.
 
void attachAlarm (void(*isr)(void))
 Attach the alarm handler. More...
 
void detachAlarm ()
 Detach the alarm handler.
 

Detailed Description

This is the interface to the RTC Hardware.

Member Function Documentation

◆ begin()

void RtcClass::begin ( )

Initialize the RTC library.

When RTC library is used, this API must be called at first. This API will wait until RTC hardware is available.

◆ setTime()

void RtcClass::setTime ( RtcTime rtc)

Set RTC time.

Parameters
[in]rtca object of RtcTime to set

◆ getTime()

RtcTime RtcClass::getTime ( )

Get RTC time.

Returns
a object of the current RtcTime

◆ setAlarm()

void RtcClass::setAlarm ( RtcTime rtc)

Set RTC alarm time.

Parameters
[in]rtca object of RtcTime to set the alarm

◆ setAlarmSeconds()

void RtcClass::setAlarmSeconds ( uint32_t  seconds)

Set RTC alarm time after the specified seconds.

Parameters
[in]secondsto set the alarm

◆ attachAlarm()

void RtcClass::attachAlarm ( void(*)(void)  isr)

Attach the alarm handler.

Parameters
[in]isrthe alarm handler which is executed on the task context.

The documentation for this class was generated from the following file: