RTClib
Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
RTC_I2C Class Reference

A generic I2C RTC base class. DO NOT USE DIRECTLY. More...

#include <RTClib.h>

Inheritance diagram for RTC_I2C:
RTC_DS1307 RTC_DS3231 RTC_PCF8523 RTC_PCF8563

Protected Member Functions

uint8_t read_register (uint8_t reg)
 Read value from register. More...
 
void write_register (uint8_t reg, uint8_t val)
 Write value to register. More...
 

Static Protected Member Functions

static uint8_t bcd2bin (uint8_t val)
 Convert a binary coded decimal value to binary. RTC stores time/date values as BCD. More...
 
static uint8_t bin2bcd (uint8_t val)
 Convert a binary value to BCD format for the RTC registers. More...
 

Protected Attributes

Adafruit_I2CDevice * i2c_dev = NULL
 Pointer to I2C bus interface.
 

Detailed Description

A generic I2C RTC base class. DO NOT USE DIRECTLY.

Member Function Documentation

◆ bcd2bin()

static uint8_t RTC_I2C::bcd2bin ( uint8_t  val)
inlinestaticprotected

Convert a binary coded decimal value to binary. RTC stores time/date values as BCD.

Parameters
valBCD value
Returns
Binary value

◆ bin2bcd()

static uint8_t RTC_I2C::bin2bcd ( uint8_t  val)
inlinestaticprotected

Convert a binary value to BCD format for the RTC registers.

Parameters
valBinary value
Returns
BCD value

◆ read_register()

uint8_t RTC_I2C::read_register ( uint8_t  reg)
protected

Read value from register.

Parameters
regregister address
Returns
value of register

◆ write_register()

void RTC_I2C::write_register ( uint8_t  reg,
uint8_t  val 
)
protected

Write value to register.

Parameters
regregister address
valvalue to write

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