pcf85063: Add stop_timer method

This commit is contained in:
Odd Stråbø 2023-09-12 22:48:20 +00:00
parent dca13dd292
commit ec8acc051c
2 changed files with 8 additions and 0 deletions

View file

@ -135,6 +135,13 @@ bool PCF85063Component::clear_timer_flag() {
return true; return true;
} }
bool PCF85063Component::stop_timer() {
PCF85063_READ_REG(0x11, 1);
this->pcf85063_.reg.timer_enable = false;
PCF85063_WRITE_REG(0x11, 1);
return true;
}
bool PCF85063Component::clear_alarm_flag() { bool PCF85063Component::clear_alarm_flag() {
PCF85063_READ_REG(0x01, 1); PCF85063_READ_REG(0x01, 1);
this->pcf85063_.reg.alarm_flag = 0; this->pcf85063_.reg.alarm_flag = 0;

View file

@ -34,6 +34,7 @@ class PCF85063Component : public time::RealTimeClock, public i2c::I2CDevice {
bool write_timer_interval(uint16_t interval); bool write_timer_interval(uint16_t interval);
bool clear_timer_flag(); bool clear_timer_flag();
bool clear_alarm_flag(); bool clear_alarm_flag();
bool stop_timer();
bool write_clockout_frequency(uint8_t freq); bool write_clockout_frequency(uint8_t freq);
void set_timer_interrupt_enable_(bool state); void set_timer_interrupt_enable_(bool state);
void set_timer_interrupt_mode_(PCF85063ATimerInterruptMode_t mode); void set_timer_interrupt_mode_(PCF85063ATimerInterruptMode_t mode);