M5Unified
m5::RTC8563_Class Class Reference

#include <RTC8563_Class.hpp>

Inheritance diagram for m5::RTC8563_Class:
Collaboration diagram for m5::RTC8563_Class:

Public Member Functions

 RTC8563_Class (std::uint8_t i2c_addr=DEFAULT_ADDRESS, std::uint32_t freq=400000, I2C_Class *i2c=&In_I2C)
 
bool begin (I2C_Class *i2c=nullptr)
 
bool getVoltLow (void)
 
bool getTime (rtc_time_t *time) const
 
bool getDate (rtc_date_t *date) const
 
bool getDateTime (rtc_datetime_t *datetime) const
 
void setTime (const rtc_time_t &time)
 
void setTime (const rtc_time_t *const time)
 
void setDate (const rtc_date_t &date)
 
void setDate (const rtc_date_t *const date)
 
void setDateTime (const rtc_datetime_t &datetime)
 
void setDateTime (const rtc_datetime_t *const datetime)
 
void setDateTime (const tm *const datetime)
 
int setAlarmIRQ (int afterSeconds)
 
int setAlarmIRQ (const rtc_time_t &time)
 Set alarm by time. More...
 
int setAlarmIRQ (const rtc_date_t &date, const rtc_time_t &time)
 
void setSystemTimeFromRtc (struct timezone *tz=nullptr)
 
bool getIRQstatus (void)
 
void clearIRQ (void)
 
void disableIRQ (void)
 
rtc_time_t getTime (void) const
 
rtc_date_t getDate (void) const
 
rtc_datetime_t getDateTime (void) const
 
- Public Member Functions inherited from m5::I2C_Device
 I2C_Device (std::uint8_t i2c_addr, std::uint32_t freq, I2C_Class *i2c=&In_I2C)
 
void setPort (I2C_Class *i2c)
 
bool writeRegister8 (std::uint8_t reg, std::uint8_t data) const
 
std::uint8_t readRegister8 (std::uint8_t reg) const
 
bool writeRegister8Array (const std::uint8_t *reg_data_array, std::size_t length) const
 
bool writeRegister (std::uint8_t reg, const std::uint8_t *data, std::size_t length) const
 
bool readRegister (std::uint8_t reg, std::uint8_t *result, std::size_t length) const
 
bool bitOn (std::uint8_t reg, std::uint8_t bit) const
 
bool bitOff (std::uint8_t reg, std::uint8_t bit) const
 
bool isEnabled (void) const
 

Static Public Attributes

static constexpr std::uint8_t DEFAULT_ADDRESS = 0x51
 

Additional Inherited Members

- Protected Attributes inherited from m5::I2C_Device
I2C_Class_i2c
 
std::uint32_t _freq
 
std::uint8_t _addr
 
bool _init
 

Detailed Description

Definition at line 80 of file RTC8563_Class.hpp.

Constructor & Destructor Documentation

◆ RTC8563_Class()

m5::RTC8563_Class::RTC8563_Class ( std::uint8_t  i2c_addr = DEFAULT_ADDRESS,
std::uint32_t  freq = 400000,
I2C_Class i2c = &In_I2C 
)
inline

Definition at line 85 of file RTC8563_Class.hpp.

Member Function Documentation

◆ begin()

bool m5::RTC8563_Class::begin ( I2C_Class i2c = nullptr)

TimerCameraの内蔵RTCが初期化に失敗することがあったため、最初に空打ちする;

Definition at line 43 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ clearIRQ()

void m5::RTC8563_Class::clearIRQ ( void  )

Definition at line 258 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ disableIRQ()

void m5::RTC8563_Class::disableIRQ ( void  )

Definition at line 264 of file RTC8563_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDate() [1/2]

bool m5::RTC8563_Class::getDate ( rtc_date_t *  date) const

Definition at line 102 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ getDate() [2/2]

rtc_date_t m5::RTC8563_Class::getDate ( void  ) const
inline

Definition at line 136 of file RTC8563_Class.hpp.

◆ getDateTime() [1/2]

bool m5::RTC8563_Class::getDateTime ( rtc_datetime_t *  datetime) const

Definition at line 61 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ getDateTime() [2/2]

rtc_datetime_t m5::RTC8563_Class::getDateTime ( void  ) const
inline

Definition at line 143 of file RTC8563_Class.hpp.

Here is the caller graph for this function:

◆ getIRQstatus()

bool m5::RTC8563_Class::getIRQstatus ( void  )

Definition at line 253 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ getTime() [1/2]

bool m5::RTC8563_Class::getTime ( rtc_time_t *  time) const

Definition at line 80 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ getTime() [2/2]

rtc_time_t m5::RTC8563_Class::getTime ( void  ) const
inline

Definition at line 129 of file RTC8563_Class.hpp.

◆ getVoltLow()

bool m5::RTC8563_Class::getVoltLow ( void  )

Definition at line 56 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ setAlarmIRQ() [1/3]

int m5::RTC8563_Class::setAlarmIRQ ( const rtc_date_t &  date,
const rtc_time_t &  time 
)

Definition at line 206 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ setAlarmIRQ() [2/3]

int m5::RTC8563_Class::setAlarmIRQ ( const rtc_time_t &  time)

Set alarm by time.

Definition at line 173 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ setAlarmIRQ() [3/3]

int m5::RTC8563_Class::setAlarmIRQ ( int  afterSeconds)

Set timer IRQ

Parameters
afterSeconds1 - 15,300. If 256 or more, 1-minute cycle. (max 255 minute.)
Returns
the set number of seconds.

Definition at line 141 of file RTC8563_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDate() [1/2]

void m5::RTC8563_Class::setDate ( const rtc_date_t &  date)

weekDay auto adjust

Definition at line 116 of file RTC8563_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDate() [2/2]

void m5::RTC8563_Class::setDate ( const rtc_date_t *const  date)
inline

Definition at line 101 of file RTC8563_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDateTime() [1/3]

void m5::RTC8563_Class::setDateTime ( const rtc_datetime_t &  datetime)
inline

Definition at line 103 of file RTC8563_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDateTime() [2/3]

void m5::RTC8563_Class::setDateTime ( const rtc_datetime_t *const  datetime)
inline

Definition at line 104 of file RTC8563_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDateTime() [3/3]

void m5::RTC8563_Class::setDateTime ( const tm *const  datetime)
inline

Definition at line 105 of file RTC8563_Class.hpp.

Here is the call graph for this function:

◆ setSystemTimeFromRtc()

void m5::RTC8563_Class::setSystemTimeFromRtc ( struct timezone tz = nullptr)

Definition at line 278 of file RTC8563_Class.cpp.

Here is the call graph for this function:

◆ setTime() [1/2]

void m5::RTC8563_Class::setTime ( const rtc_time_t &  time)

Definition at line 92 of file RTC8563_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTime() [2/2]

void m5::RTC8563_Class::setTime ( const rtc_time_t *const  time)
inline

Definition at line 98 of file RTC8563_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ DEFAULT_ADDRESS

constexpr std::uint8_t m5::RTC8563_Class::DEFAULT_ADDRESS = 0x51
staticconstexpr

Definition at line 83 of file RTC8563_Class.hpp.


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