Skip to content

devcoons/stm32-drv-rtc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

RTC DRIVER

Real Time Clock driver reausable in different platforms.

Supported Hardware

  • NUCLEO-H745ZI-Q

Functions Guide

  • rtc_initialize : function used to initialize the peripheral.
  • rtc_deinitialize : function used to deinitialize the peripheral.
  • rtc_get_time_data : function used to store in the main structure time and date.
  • rtc_set_time : function used to store the new time in the MCU.
  • rtc_set_date : function used to store the new date in the MCU.
  • rtc_deactivateWakeupTimer : function used for deactivate wake up timer.
  • rtc_setWakeUpTimer : function used to activate wake up timer. MUST fill the "WakeUpCounter" in a main structure.

How to use

  • Enable the RTC timer in the .ioc file.
  • Include the header file drv_rtc.h.
  • Create the rtc_t instance. The following members of the structure must be defined:
    • instance.handler : handler assigned by hardware.
    • instance.mx_init : init function generated by the configuration tool.

Example

rtc_t rtc = {
    .handler = MX_RTC_Init,
    .mx_init = &hrtc
};

rtc_initialize(&rtc);
rtc_get_time_data(&rtc);

uint8_t hours;
uint8_t minutes;
uint8_t seconds;

rtc_set_time(hours, minutes, seconds);

uint8_t weekday;
uint8_t month;
uint8_t date;
uint8_t year:

rtc_set_date(weekday, month, date, year);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages