We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-08-26
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: RTC
Downloaded: 2733 times
Not followed.
License: MIT license
RTC 7 Click is a real time clock module which has an extremely low power consumption, allowing it to be used with a single button cell battery or a super capacitor, for an extended period of time.
Do you want to subscribe in order to receive notifications regarding "RTC 7 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "RTC 7 click" changes.
Do you want to report abuse regarding "RTC 7 click".
Library Description
Library is used to get gmt time and local time by calculating data from data registers. Library communicates with the device via I2C driver and driver functions. Library offers a choice to get time data in two formats, 12 hours format and 24 hours format. For more details check documentation.
Key functions:
uint8_t rtc7_writeReg( uint8_t register_address, uint8_t transfer_data )
- Function writes one byte data to the register.uint8_t rtc7_readReg( uint8_t register_address, uint8_t nBytes, uint8_t *dataOut )
- Function reads the desired number of bytes from the register/s.void rtc7_getGmtTime( rtc7_time_t *gmt_time )
- Function gets the gmt time data in both time formats.void rtc7_getLocalTime( rtc7_time_t *local_time )
- Function gets the local time data including the determined time zone in calculations.Examples description
The application is composed of three sections :
void applicationTask()
{
rtc7_getLocalTime( &timeDate );
if (checkYear == 0)
{
mikrobus_logWrite( "Wait...", _LOG_LINE );
while ((timeDate.year != timeSet.year) && (timeDate.year != (timeSet.year + 1)) && (timeDate.year != (timeSet.year - 1)))
{
rtc7_getLocalTime( &timeDate );
}
mikrobus_logWrite( "", _LOG_LINE );
checkYear = 1;
}
if (checkChange != timeDate.seconds)
{
rtc7_displayResults();
checkChange = timeDate.seconds;
}
}
Additional Functions :
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.