semf
|
Rtc
implementation for STM32.
More...
#include <stm32rtc.h>
Public Types | |
enum class | ErrorCode : uint8_t { SetMillisecond_HalError = 0 , SetMillisecond_HalBusy , SetMillisecond_HalTimeout , SetSecond_HalError , SetSecond_HalBusy , SetSecond_HalTimeout , SetMinute_HalError , SetMinute_HalBusy , SetMinute_HalTimeout , SetHour_HalError , SetHour_HalBusy , SetHour_HalTimeout , SetDay_HalError , SetDay_HalBusy , SetDay_HalTimeout , SetMonth_HalError , SetMonth_HalBusy , SetMonth_HalTimeout , SetYear_HalError , SetYear_HalBusy , SetYear_HalTimeout , HalTime_HalError , HalTime_HalBusy , HalTime_HalTimeout , HalDate_HalError , HalDate_HalBusy , HalDate_HalTimeout } |
Public Member Functions | |
Stm32Rtc (RTC_HandleTypeDef &hrtc) | |
Constructor. More... | |
Stm32Rtc (const Stm32Rtc &other)=delete | |
virtual | ~Stm32Rtc ()=default |
uint16_t | millisecond () override |
Get the milliseconds from the current time. More... | |
void | setMillisecond (uint16_t millisecond) override |
For set a new time. More... | |
uint8_t | second () const override |
Get the seconds from the current time. More... | |
void | setSecond (uint8_t second) override |
For set a new time. More... | |
uint8_t | minute () const override |
Get the minutes from the current time. More... | |
void | setMinute (uint8_t minute) override |
For set a new time. More... | |
uint8_t | hour () const override |
Get the hours from the current time. More... | |
void | setHour (uint8_t hour) override |
For set a new time. More... | |
uint8_t | day () const override |
void | setDay (uint8_t day) override |
For set a new date. More... | |
uint8_t | month () const override |
Get the current month. More... | |
void | setMonth (uint8_t month) override |
For set a new date. More... | |
uint16_t | year () const override |
Get the current year. More... | |
void | setYear (uint16_t year) override |
For set a new date. More... | |
Public Member Functions inherited from semf::Rtc | |
virtual | ~Rtc ()=default |
virtual uint16_t | millisecond ()=0 |
Get the milliseconds from the current time. More... | |
virtual void | setMillisecond (uint16_t millisecond)=0 |
For set a new time. More... | |
virtual uint8_t | second () const =0 |
Get the seconds from the current time. More... | |
virtual void | setSecond (uint8_t second)=0 |
For set a new time. More... | |
virtual uint8_t | minute () const =0 |
Get the minutes from the current time. More... | |
virtual void | setMinute (uint8_t minute)=0 |
For set a new time. More... | |
virtual uint8_t | hour () const =0 |
Get the hours from the current time. More... | |
virtual void | setHour (uint8_t hour)=0 |
For set a new time. More... | |
virtual uint8_t | day () const =0 |
virtual void | setDay (uint8_t day)=0 |
For set a new date. More... | |
virtual uint8_t | month () const =0 |
Get the current month. More... | |
virtual void | setMonth (uint8_t month)=0 |
For set a new date. More... | |
virtual uint16_t | year () const =0 |
Get the current year. More... | |
virtual void | setYear (uint16_t year)=0 |
For set a new date. More... | |
Additional Inherited Members | |
Public Attributes inherited from semf::Rtc | |
Signal< Error > | error |
Rtc
implementation for STM32.
Definition at line 22 of file stm32rtc.h.
|
strong |
Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring).
Definition at line 26 of file stm32rtc.h.
|
explicit |
|
explicitdelete |
|
virtualdefault |
|
overridevirtual |
Get the current day.
Implements semf::Rtc.
Definition at line 173 of file stm32rtc.cpp.
|
overridevirtual |
Get the hours from the current time.
Implements semf::Rtc.
Definition at line 137 of file stm32rtc.cpp.
|
overridevirtual |
Get the milliseconds from the current time.
Implements semf::Rtc.
Definition at line 21 of file stm32rtc.cpp.
|
overridevirtual |
Get the minutes from the current time.
Implements semf::Rtc.
Definition at line 101 of file stm32rtc.cpp.
|
overridevirtual |
Get the current month.
Implements semf::Rtc.
Definition at line 205 of file stm32rtc.cpp.
|
overridevirtual |
Get the seconds from the current time.
Implements semf::Rtc.
Definition at line 65 of file stm32rtc.cpp.
|
overridevirtual |
For set a new date.
day | The new day. |
SetDay_HalError | If the ST-HAL returns a hal error. |
SetDay_HalBusy | If the ST-HAL returns a hal busy. |
SetDay_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 178 of file stm32rtc.cpp.
|
overridevirtual |
For set a new time.
hour | The hours for the new time. |
SetHour_HalError | If the ST-HAL returns a hal error. |
SetHour_HalBusy | If the ST-HAL returns a hal busy. |
SetHour_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 142 of file stm32rtc.cpp.
|
overridevirtual |
For set a new time.
millisecond | The milliseconds for the new time. |
SetMillisecond_HalError | If the ST-HAL returns a hal error. |
SetMillisecond_HalBusy | If the ST-HAL returns a hal busy. |
SetMillisecond_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 31 of file stm32rtc.cpp.
|
overridevirtual |
For set a new time.
minute | The minutes for the new time. |
SetMinute_HalError | If the ST-HAL returns a hal error. |
SetMinute_HalBusy | If the ST-HAL returns a hal busy. |
SetMinute_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 106 of file stm32rtc.cpp.
|
overridevirtual |
For set a new date.
month | The new month. |
SetDay_HalError | If the ST-HAL returns a hal error. |
SetDay_HalBusy | If the ST-HAL returns a hal busy. |
SetDay_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 210 of file stm32rtc.cpp.
|
overridevirtual |
For set a new time.
second | The second for the new time. |
SetSecond_HalError | If the ST-HAL returns a hal error. |
SetSecond_HalBusy | If the ST-HAL returns a hal busy. |
SetSecond_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 70 of file stm32rtc.cpp.
|
overridevirtual |
For set a new date.
year | The new year. |
SetYear_HalError | If the ST-HAL returns a hal error. |
SetYear_HalBusy | If the ST-HAL returns a hal busy. |
SetYear_HalTimeout | If the ST-HAL returns a hal timeout. |
Implements semf::Rtc.
Definition at line 242 of file stm32rtc.cpp.
|
overridevirtual |
Get the current year.
Implements semf::Rtc.
Definition at line 237 of file stm32rtc.cpp.