10#ifndef SEMF_HARDWAREABSTRACTION_STM32_STM32RTC_H_
11#define SEMF_HARDWAREABSTRACTION_STM32_STM32RTC_H_
15#if defined(STM32) && defined(HAL_RTC_MODULE_ENABLED)
28 SetMillisecond_HalError = 0,
29 SetMillisecond_HalBusy,
30 SetMillisecond_HalTimeout,
61 explicit Stm32Rtc(RTC_HandleTypeDef& hrtc);
73 uint8_t
second()
const override;
81 uint8_t
minute()
const override;
89 uint8_t
hour()
const override;
97 uint8_t
day()
const override;
105 uint8_t
month()
const override;
113 uint16_t
year()
const override;
124 RTC_HandleTypeDef* m_hrtc;
132 RTC_TimeTypeDef halTime()
const;
140 RTC_DateTypeDef halDate()
const;
142 static constexpr Error::ClassID kSemfClassId = Error::ClassID::Stm32Rtc;
Interface for the real time clock.
Rtc implementation for STM32.
void setYear(uint16_t year) override
For set a new date.
virtual ~Stm32Rtc()=default
uint16_t year() const override
Get the current year.
uint16_t millisecond() override
Get the milliseconds from the current time.
void setDay(uint8_t day) override
For set a new date.
uint8_t second() const override
Get the seconds from the current time.
void setHour(uint8_t hour) override
For set a new time.
uint8_t month() const override
Get the current month.
uint8_t day() const override
void setMonth(uint8_t month) override
For set a new date.
Stm32Rtc(const Stm32Rtc &other)=delete
Stm32Rtc(RTC_HandleTypeDef &hrtc)
Constructor.
uint8_t hour() const override
Get the hours from the current time.
void setMinute(uint8_t minute) override
For set a new time.
void setMillisecond(uint16_t millisecond) override
For set a new time.
void setSecond(uint8_t second) override
For set a new time.
uint8_t minute() const override
Get the minutes from the current time.