Add additional registers for PCF85063A
This commit is contained in:
parent
c1e5cbec6e
commit
10efb46153
1 changed files with 51 additions and 1 deletions
|
@ -7,6 +7,18 @@
|
|||
namespace esphome {
|
||||
namespace pcf85063 {
|
||||
|
||||
enum PCF85063ATimerInterruptMode_t : bool {
|
||||
TIMER_INTERRUPT_MODE_FLAG = 0,
|
||||
TIMER_INTERRUPT_MODE_PULSE = 1,
|
||||
};
|
||||
|
||||
enum PCF85063ATimerClockFrequency_t : uint8_t {
|
||||
TIMER_CLOCK_4096HZ = 0,
|
||||
TIMER_CLOCK_64HZ = 1,
|
||||
TIMER_CLOCK_SECOND = 2,
|
||||
TIMER_CLOCK_MINUTE = 3,
|
||||
};
|
||||
|
||||
class PCF85063Component : public time::RealTimeClock, public i2c::I2CDevice {
|
||||
public:
|
||||
void setup() override;
|
||||
|
@ -68,7 +80,7 @@ class PCF85063Component : public time::RealTimeClock, public i2c::I2CDevice {
|
|||
|
||||
// Weekdays register
|
||||
uint8_t weekday : 3;
|
||||
uint8_t unused_3 : 5;
|
||||
uint8_t : 5;
|
||||
|
||||
// Months register
|
||||
uint8_t month : 4;
|
||||
|
@ -78,6 +90,44 @@ class PCF85063Component : public time::RealTimeClock, public i2c::I2CDevice {
|
|||
// Years register
|
||||
uint8_t year : 4;
|
||||
uint8_t year_10 : 4;
|
||||
|
||||
// PCF85063A Additional registers
|
||||
// Second alarm
|
||||
uint8_t alarm_second : 4;
|
||||
uint8_t alarm_second_10 : 3;
|
||||
bool alarm_second_enabled : 1;
|
||||
|
||||
// Minute alarm
|
||||
uint8_t alarm_minute : 4;
|
||||
uint8_t alarm_minute_10 : 3;
|
||||
bool alarm_minute_enabled : 1;
|
||||
|
||||
// Hour alarm
|
||||
uint8_t alarm_hour : 4;
|
||||
uint8_t alarm_hour_10 : 2;
|
||||
uint8_t : 1;
|
||||
bool alarm_hour_enabled : 1;
|
||||
|
||||
// Day alarm
|
||||
uint8_t alarm_day : 4;
|
||||
uint8_t alarm_day_10 : 2;
|
||||
uint8_t : 1;
|
||||
bool alarm_day_enabled : 1;
|
||||
|
||||
// Weekday alarm
|
||||
uint8_t alarm_weekday : 3;
|
||||
uint8_t : 4;
|
||||
bool alarm_weekday_enabled : 1;
|
||||
|
||||
// Timer value
|
||||
uint8_t timer_value : 8;
|
||||
|
||||
// Timer mode
|
||||
PCF85063ATimerInterruptMode_t timer_interrupt_mode : 1;
|
||||
bool timer_interrupt_enable : 1;
|
||||
bool timer_enable : 1;
|
||||
PCF85063ATimerClockFrequency_t timer_clock_frequency : 2;
|
||||
uint8_t : 3;
|
||||
} reg;
|
||||
mutable uint8_t raw[sizeof(reg)];
|
||||
} pcf85063_;
|
||||
|
|
Loading…
Reference in a new issue