Core2 for AWS IoT EduKit BSP 1.5.1
Data Structures | Functions
bm8563.h File Reference

Functions for the BM8563 Real-Time Clock (RTC). More...

#include "esp_log.h"

Go to the source code of this file.

Data Structures

struct  rtc_date_t
 The member defintions of the BM8563 RTC date. More...
 

Functions

void BM8563_Init ()
 Initializes the BM8563 real-time clock over i2c. More...
 
void BM8563_SetTime (rtc_date_t *data)
 Sets the date and time on the BM8563. More...
 
void BM8563_GetTime (rtc_date_t *data)
 Retrieves the date and time on the BM8563. More...
 
void BM8563_SetAlarmIRQ (int8_t minute, int8_t hour, int8_t day, int8_t week)
 Sets the date and time "alarm" IRQ with the BM8563. More...
 
int16_t BM8563_SetTimerIRQ (int16_t value)
 Sets the "timer" IRQ on the BM8563. More...
 
int16_t BM8563_GetTimerTime ()
 Retrieve the time left in the set timer. More...
 
uint8_t BM8563_GetIRQ ()
 Retrieve the IRQ status from timer/alarm. More...
 
void BM8563_ClearIRQ ()
 Clear the IRQ status from timer/alarm. More...
 

Detailed Description

Functions for the BM8563 Real-Time Clock (RTC).

Function Documentation

◆ BM8563_Init()

void BM8563_Init ( )

Initializes the BM8563 real-time clock over i2c.

Note
The Core2ForAWS_Init() calls this function when the hardware feature is enabled.

◆ BM8563_SetTime()

void BM8563_SetTime ( rtc_date_t *  data)

Sets the date and time on the BM8563.

Example:

Set the date and time to September 30, 2020 13:40:10.

date.year = 2020;
date.month = 9;
date.day = 30;
date.hour = 13;
date.minute = 40;
date.second = 10;
void BM8563_SetTime(rtc_date_t *data)
Sets the date and time on the BM8563.
Definition: bm8563.c:42
The member defintions of the BM8563 RTC date.
Definition: bm8563.h:13
uint16_t year
Date year.
Definition: bm8563.h:15
uint8_t second
Time second.
Definition: bm8563.h:20
uint8_t minute
Time minute.
Definition: bm8563.h:19
uint8_t day
Date day.
Definition: bm8563.h:17
uint8_t hour
Time hour.
Definition: bm8563.h:18
uint8_t month
Date month.
Definition: bm8563.h:16
Parameters
[in]dataDesired date and time.

◆ BM8563_GetTime()

void BM8563_GetTime ( rtc_date_t *  data)

Retrieves the date and time on the BM8563.

Example:

Get the current date and time and print it out.

printf("Date: %d-%02d-%02d Time: %02d:%02d:%02d",
date.year, date.month, date.day, date.hour, date.minute, date.second)
void BM8563_GetTime(rtc_date_t *data)
Retrieves the date and time on the BM8563.
Definition: bm8563.c:56
Parameters
[out]dataThe current date and time.

◆ BM8563_SetAlarmIRQ()

void BM8563_SetAlarmIRQ ( int8_t  minute,
int8_t  hour,
int8_t  day,
int8_t  week 
)

Sets the date and time "alarm" IRQ with the BM8563.

Parameters
[in]minuteThe minute to trigger the IRQ.
[in]hourThe hour to trigger the IRQ.
[in]dayThe day to trigger the IRQ.
[in]weekThe week to trigger the IRQ.

◆ BM8563_SetTimerIRQ()

int16_t BM8563_SetTimerIRQ ( int16_t  value)

Sets the "timer" IRQ on the BM8563.

Parameters
[in]valueDesired countdown time to trigger the IRQ. The maximum countdown time is 255 * 60 seconds.

◆ BM8563_GetTimerTime()

int16_t BM8563_GetTimerTime ( )

Retrieve the time left in the set timer.

◆ BM8563_GetIRQ()

uint8_t BM8563_GetIRQ ( )

Retrieve the IRQ status from timer/alarm.

◆ BM8563_ClearIRQ()

void BM8563_ClearIRQ ( )

Clear the IRQ status from timer/alarm.