rtc8  2.0.0.0
Functions
Public function

Functions

void rtc8_cfg_setup (rtc8_cfg_t *cfg)
 Config Object Initialization function. More...
 
RTC8_RETVAL rtc8_init (rtc8_t *ctx, rtc8_cfg_t *cfg)
 Initialization function. More...
 
void rtc8_default_cfg (rtc8_t *ctx)
 Click Default Configuration function. More...
 
void rtc8_generic_write (rtc8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void rtc8_generic_read (rtc8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint8_t rtc8_write_data_bcd_format (rtc8_t *ctx, uint8_t reg, uint8_t _data)
 Write data ( Convert and send data in BCD format ) More...
 
uint8_t rtc8_read_data_bcd_format (rtc8_t *ctx, uint8_t reg)
 Read one byte data from register in DEC format. More...
 
uint32_t rtc8_get_uinx_time (rtc8_t *ctx)
 Get current UNIX time. More...
 
void rtc8_set_unix_time (rtc8_t *ctx, int32_t unix_time)
 Set UNIX time. More...
 
uint8_t rtc8_set_time (rtc8_t *ctx, rtc8_time_t *time_s)
 Set new time - 24 hour format. More...
 
uint8_t rtc8_set_date (rtc8_t *ctx, rtc8_date_t *date_s)
 Set new date. More...
 
uint8_t rtc8_set_alarm (rtc8_t *ctx, rtc8_alarm_t *alarm_s)
 Set Alarm. More...
 
uint8_t rtc8_get_interrupt_state (rtc8_t *ctx)
 Get interrupt state. More...
 
void rtc8_set_external_event_input (rtc8_t *ctx, uint8_t state)
 Set EVI(External Event Input) pin. More...
 
void rtx8_get_time_and_date (rtc8_t *ctx, rtc8_time_t *time_s, rtc8_date_t *date_s)
 Get RTC data ( Time and Data ) More...
 
void rtc8_reset_alarm_flag (rtc8_t *ctx)
 Reset alarm. More...
 
uint8_t rtc8_get_status (rtc8_t *ctx)
 Get status. More...
 
uint8_t rtc8_get_alarm_flag (rtc8_t *ctx)
 Get Alarm flag. More...
 

Detailed Description

Function Documentation

◆ rtc8_cfg_setup()

void rtc8_cfg_setup ( rtc8_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ rtc8_default_cfg()

void rtc8_default_cfg ( rtc8_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for RTC 8 click.

◆ rtc8_generic_read()

void rtc8_generic_read ( rtc8_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ rtc8_generic_write()

void rtc8_generic_write ( rtc8_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ rtc8_get_alarm_flag()

uint8_t rtc8_get_alarm_flag ( rtc8_t ctx)

Get Alarm flag.

Parameters
ctxClick object.
Returns
Alarm flage ( ALARM IS ACTIVE or ALARM ISN'T ACTIVE)

◆ rtc8_get_interrupt_state()

uint8_t rtc8_get_interrupt_state ( rtc8_t ctx)

Get interrupt state.

Parameters
ctxClick object.
Returns
Interrupt pin state

◆ rtc8_get_status()

uint8_t rtc8_get_status ( rtc8_t ctx)

Get status.

Parameters
ctxClick object.
Returns
Status register data

◆ rtc8_get_uinx_time()

uint32_t rtc8_get_uinx_time ( rtc8_t ctx)

Get current UNIX time.

Parameters
ctxClick object.
Returns
UNIX time

◆ rtc8_init()

RTC8_RETVAL rtc8_init ( rtc8_t ctx,
rtc8_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ rtc8_read_data_bcd_format()

uint8_t rtc8_read_data_bcd_format ( rtc8_t ctx,
uint8_t  reg 
)

Read one byte data from register in DEC format.

Parameters
ctxClick object.
regRegister Address
Returns
One byte data
Note
Use this function when you need to read the register with converting data from BCD format to DEC format.

◆ rtc8_reset_alarm_flag()

void rtc8_reset_alarm_flag ( rtc8_t ctx)

Reset alarm.

Parameters
ctxClick object.

◆ rtc8_set_alarm()

uint8_t rtc8_set_alarm ( rtc8_t ctx,
rtc8_alarm_t alarm_s 
)

Set Alarm.

Parameters
ctxClick object.
alarm_sAlarm Structure ( weekdays, hours, minutes )
Note
Set the time at which the alarm active

◆ rtc8_set_date()

uint8_t rtc8_set_date ( rtc8_t ctx,
rtc8_date_t date_s 
)

Set new date.

Parameters
ctxClick object.
date_sDate Structure ( New Hours (0 - 31), New minutes (1 - 12), New secconds (0 - 99) 2000 year ... 2099 year)
Note
If no new date is set - RTC continues to count where it stopped.

◆ rtc8_set_external_event_input()

void rtc8_set_external_event_input ( rtc8_t ctx,
uint8_t  state 
)

Set EVI(External Event Input) pin.

Parameters
ctxClick object.
state- EVI state

◆ rtc8_set_time()

uint8_t rtc8_set_time ( rtc8_t ctx,
rtc8_time_t time_s 
)

Set new time - 24 hour format.

Parameters
ctxClick object.
time_sTime Structure ( New Hours (0 - 23), New minutes (0 - 59), New secconds (0 - 59) )
Note
If no new time is set - RTC continues to count where it stopped.

◆ rtc8_set_unix_time()

void rtc8_set_unix_time ( rtc8_t ctx,
int32_t  unix_time 
)

Set UNIX time.

Parameters
ctxClick object.
unix_time4 byte unix time

◆ rtc8_write_data_bcd_format()

uint8_t rtc8_write_data_bcd_format ( rtc8_t ctx,
uint8_t  reg,
uint8_t  _data 
)

Write data ( Convert and send data in BCD format )

Parameters
ctxClick object.
regRegister Address
_dataData
Returns
Error status - Checks if the data that is being written into the register is valid. E.g. if one attempts to write 35 into the Month register error status will be set to 1, if the written data is valid error status will be 0.
Note
Use this function when you need to written the data in the register and make a BCD format conversion before the write data.

◆ rtx8_get_time_and_date()

void rtx8_get_time_and_date ( rtc8_t ctx,
rtc8_time_t time_s,
rtc8_date_t date_s 
)

Get RTC data ( Time and Data )

Parameters
ctxClick object.
time_sTime Structure ( New Hours (0 - 23), New minutes (0 - 59), New secconds (0 - 59) )
date_sDate Structure ( New Hours (0 - 31), New minutes (1 - 12), New secconds (0 - 99) 2000 year ... 2099 year)