RTC_NXP_Arduino 1.2.1
RTC driver device operation sample code for Arduino
Loading...
Searching...
No Matches
RTC_NXP Class Referenceabstract

#include <RTC_NXP.h>

Inheritance diagram for RTC_NXP:
ForFutureExtention PCF2131_base PCF85053A PCF85063_base PCF85263A PCF2131_I2C PCF2131_SPI PCF85063A PCF85063TP

Public Types

enum  board { NONE , ARDUINO_SHIELD }
enum  alarm_setting {
  SECOND , MINUTE , HOUR , DAY ,
  WEEKDAY
}

Public Member Functions

 RTC_NXP ()
virtual ~RTC_NXP ()
virtual void begin (void)=0
time_t time (time_t *tp)
virtual void set (struct tm *now_tm)=0
virtual bool oscillator_stop (void)=0
virtual void alarm (alarm_setting digit, int val)=0
virtual void alarm_clear (void)=0
virtual void alarm_disable (void)=0
virtual uint8_t int_clear (void)=0
virtual float set_clock_offset (float ratio)=0

Protected Member Functions

virtual time_t rtc_time (void)=0

Static Protected Member Functions

static uint8_t bcd2dec (uint8_t v)
static uint8_t dec2bcd (uint8_t v)

Detailed Description

RTC operation library for Arduino

Author
Tedd OKANO

Released under the MIT license License RTC_NXP class

RTC_NXP class is a base class for all RTC drivers All actual device class will be derived from this class

Definition at line 26 of file RTC_NXP.h.

Member Enumeration Documentation

◆ alarm_setting

Alarm setting digit selection descriptor

Definition at line 35 of file RTC_NXP.h.

◆ board

Arduino shield board evaluation board selection descriptor

Definition at line 30 of file RTC_NXP.h.

Constructor & Destructor Documentation

◆ RTC_NXP()

RTC_NXP::RTC_NXP ( )

Constructor

Definition at line 3 of file RTC_NXP.cpp.

◆ ~RTC_NXP()

RTC_NXP::~RTC_NXP ( )
virtual

Destructor

Definition at line 7 of file RTC_NXP.cpp.

Member Function Documentation

◆ alarm()

virtual void RTC_NXP::alarm ( alarm_setting digit,
int val )
pure virtual

Alarm setting (pure virtual method)

Parameters
digitto specify which parameter to set: SECOND, MINUTE, HOUR, DAY, WEEKDAY in 'enum alarm_setting'
valSetting value. Set 0x80 to disabling

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, and PCF85263A.

◆ alarm_clear()

virtual void RTC_NXP::alarm_clear ( void )
pure virtual

Alarm clearing (pure virtual method)

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, and PCF85263A.

◆ alarm_disable()

virtual void RTC_NXP::alarm_disable ( void )
pure virtual

Alarm interrupt disable (pure virtual method)

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, and PCF85263A.

◆ bcd2dec()

uint8_t RTC_NXP::bcd2dec ( uint8_t v)
staticprotected

Class method for BCD to int conversion

Parameters
vBCD value
Returns
integer

Definition at line 19 of file RTC_NXP.cpp.

Referenced by PCF2131_base::rtc_time(), PCF85053A::rtc_time(), PCF85063_base::rtc_time(), PCF85263A::rtc_time(), PCF2131_base::timestamp(), and PCF85263A::timestamp().

◆ begin()

virtual void RTC_NXP::begin ( void )
pure virtual

Initializer (pure virtual method)

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, PCF85063TP, and PCF85263A.

◆ dec2bcd()

uint8_t RTC_NXP::dec2bcd ( uint8_t v)
staticprotected

Class method for int to BCD conversion

Parameters
vinteger
Returns
BCD value

Definition at line 24 of file RTC_NXP.cpp.

Referenced by PCF2131_base::alarm(), PCF85053A::alarm(), PCF85063_base::alarm(), PCF2131_base::set(), PCF85053A::set(), PCF85063_base::set(), and PCF85263A::set().

◆ int_clear()

virtual uint8_t RTC_NXP::int_clear ( void )
pure virtual

Interrupt clear (pure virtual method)

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, and PCF85263A.

◆ oscillator_stop()

virtual bool RTC_NXP::oscillator_stop ( void )
pure virtual

Detector for oscillation stop (pure virtual method)

Returns
true, if the OSF (Oscillator Stop Flag) is set

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, PCF85063TP, and PCF85263A.

◆ rtc_time()

virtual time_t RTC_NXP::rtc_time ( void )
protectedpure virtual

rtc_time (pure virtual method)

Returns
time_t returns RTC time in time_t format

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, and PCF85263A.

Referenced by time().

◆ set()

virtual void RTC_NXP::set ( struct tm * now_tm)
pure virtual

set (pure virtual method)

Parameters
now_tmstruct to set calendar and time in RTC

Implemented in ForFutureExtention, PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, PCF85063TP, and PCF85263A.

◆ set_clock_offset()

virtual float RTC_NXP::set_clock_offset ( float ratio)
pure virtual

Clock offset calibration (pure virtual method)

Converts a frequency correction ratio into the device's offset register encoding and applies it. The hardware only supports discrete steps, so the value is rounded to the nearest representable step (and, on parts with multiple correction modes, the mode giving the smallest rounding error is selected automatically).

Parameters
ratiodesired frequency correction as a ratio, e.g. -10 ppm = -10.0e-6 (positive speeds up, negative slows down)
Returns
the ratio actually applied, after rounding to the nearest representable step

Implemented in PCF2131_base, PCF2131_I2C, PCF2131_SPI, PCF85053A, PCF85063_base, PCF85063A, and PCF85263A.

◆ time()

time_t RTC_NXP::time ( time_t * tp)

time

"time()" in "time.h" compatible method for RTC

Parameters
tppointer to time_t variable
Returns
time_t value of current time

Definition at line 11 of file RTC_NXP.cpp.


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