A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/FRASTM/STM32RTC below:

FRASTM/STM32RTC: Arduino RTC library for STM32.

A RTC library for STM32.

This library is based on the Arduino RTCZero library. The library allows to take control of the internal RTC of the STM32 boards.

Singleton design pattern is used to ensure that only one STM32RTC instance is instantiated:

/* Get the rtc object */
STM32RTC& rtc = STM32RTC::getInstance();

The following functions are not supported:

The following functions have been added to support specific STM32 RTC features:

RTC hours mode (12 or 24)

RTC clock source

RTC Asynchronous and Synchronous prescaler

SubSeconds management

Hour format (AM or PM)

Week day configuration

Time and date configuration (added for convenience)

Since STM32RTC version higher than 1.0.3

SubSeconds alarm management

Important note:

Library version management

STM32 RTC library version is based on Semantic Versioning 2.0.0 (https://semver.org/)

This will ease some dependencies:

* `STM32_RTC_VERSION_MAJOR` -> major version
* `STM32_RTC_VERSION_MINOR` -> minor version
* `STM32_RTC_VERSION_PATCH` -> patch version
* `STM32_RTC_VERSION_EXTRA` -> Extra label
 with:
  - 0: official release
  - [1-9]: release candidate
  - F[0-9]: development

* `STM32_RTC_VERSION` --> Full version number

STM32_RTC_VERSION can de used to handle some API change:

#if defined(STM32_RTC_VERSION) && (STM32_RTC_VERSION  >= 0x01010000)
  rtc.setAlarmTime(alarmHours, alarmMinutes, alarmSeconds, 123);
#else
  rtc.setAlarmTime(alarmHours, alarmMinutes, alarmSeconds);
#endif
Since STM32 Core version > 1.5.0

Reset time management

By default, if a time is set it will not be reset after a reboot.

Using begin(true) or begin(true, HOUR_24) will reset the RTC registers.

To know if a time has already been set use:

  if (!rtc.isTimeSet()) {
    // Set the time
    rtc.setHours(hours);
    rtc.setMinutes(minutes);
    rtc.setSeconds(seconds);
  }

Refer to the Arduino RTC documentation for the other functions
http://arduino.cc/en/Reference/RTC

Source files available at:
https://github.com/stm32duino/STM32RTC


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4