Structs used by the driver.
- Note
- This is example show how to instantiate RTC with rtc_instance_t, rtc_api_t and rtc_data_t.
#define I2C_CTRL_HZ SYSTEM_CLINT_HZ
#define I2C_CTRL (i2c_hwreg_t *)SYSTEM_I2C_1_IO_CTRL
#define I2C_FREQ 100000
#define RTC_CTRL RTC_DS3231_ADDR
#define RTC_DRIVER ds3231_driver
.hwreg = I2C_CTRL,
.samplingClockDivider = 3,
.timeout = I2C_CTRL_HZ/1000,
.tsuDat = I2C_CTRL_HZ/(I2C_FREQ*5),
.tLow = I2C_CTRL_HZ/(I2C_FREQ*2),
.tHigh = I2C_CTRL_HZ/(I2C_FREQ*2),
.tBuf = I2C_CTRL_HZ/(I2C_FREQ),
},
};
#define RTC_CTRL
I2C Address for the currently selected RTC (PCF8523).
#define RTC_DRIVER
Driver Interface Table for the currently selected RTC (PCF8523).
struct rtc_instance rtc_instance_t
Forward declaration of RTC instance.
I2C instance. Holds the software registers and hardware pointer.
u8 hours
Hours (0-23 or 1-12) */.
u8 minutes
Minutes (0-59) */.
u8 seconds
Seconds (0-59) */.
u8 PM
PM Indicator for 12-hour format (0 = AM, 1 = PM) */.
rtc_data_t current_time
Current time data */.