rtc5 2.0.0.0
Public function

Functions

void rtc5_cfg_setup (rtc5_cfg_t *cfg)
 Config Object Initialization function.
 
RTC5_RETVAL rtc5_init (rtc5_t *ctx, rtc5_cfg_t *cfg)
 Initialization function.
 
void rtc5_default_cfg (rtc5_t *ctx)
 Click Default Configuration function.
 
void rtc5_generic_transfer (rtc5_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void rtc5_generic_write (rtc5_t *ctx, uint8_t reg, uint8_t tx_data)
 Click Default Configuration function.
 
uint8_t rtc5_generic_read (rtc5_t *ctx, uint8_t reg)
 Click Default Configuration function.
 
void rtc5_set_counting (rtc5_t *ctx, uint8_t en_osc)
 Enable counting function.
 
void rtc5_clear (rtc5_t *ctx)
 Clear RTCC and SRAM memory function.
 
void rtc5_set_time_hun_of_sec (rtc5_t *ctx, uint8_t hun_sec)
 Set hundred of seconds function.
 
uint8_t rtc5_get_time_hun_of_sec (rtc5_t *ctx)
 Get hundred of seconds function.
 
void rtc5_set_time_sec (rtc5_t *ctx, uint8_t seconds)
 Set seconds function.
 
uint8_t rtc5_get_time_sec (rtc5_t *ctx)
 Get seconds function.
 
void rtc5_set_time_min (rtc5_t *ctx, uint8_t minutes)
 Set minutes function.
 
uint8_t rtc5_get_time_min (rtc5_t *ctx)
 Get minutes function.
 
void rtc5_set_time_hours (rtc5_t *ctx, uint8_t hours)
 Set hours function.
 
uint8_t rtc5_get_time_hours (rtc5_t *ctx)
 Get hours function.
 
void rtc5_set_day_of_the_week (rtc5_t *ctx, uint8_t w_day)
 Set day of the week function.
 
uint8_t rtc5_get_day_of_the_week (rtc5_t *ctx)
 Get day of the week function.
 
void rtc5_set_date_day (rtc5_t *ctx, uint8_t date_day)
 Set day function.
 
uint8_t rtc5_get_date_day (rtc5_t *ctx)
 Get day function.
 
void rtc5_set_date_month (rtc5_t *ctx, uint8_t date_month)
 Set month function.
 
uint8_t rtc5_get_date_month (rtc5_t *ctx)
 Get month function.
 
uint8_t rtc5_get_leap_year (rtc5_t *ctx)
 Get leap year function.
 
void rtc5_set_date_year (rtc5_t *ctx, uint16_t date_year)
 Set year function.
 
uint8_t rtc5_get_date_year (rtc5_t *ctx)
 Get year function.
 
void rtc5_set_time (rtc5_t *ctx, uint8_t time_hours, uint8_t time_min, uint8_t time_sec)
 Set time hours, minutes and seconds function.
 
void rtc5_set_date (rtc5_t *ctx, uint8_t date_day, uint8_t date_month, uint16_t date_year)
 Set date hours, minutes and seconds function.
 
void rtc5_get_time_and_date (rtc5_t *ctx, rtc5_timedate_t *timedate_data)
 Get time and date function.
 

Detailed Description

Function Documentation

◆ rtc5_cfg_setup()

void rtc5_cfg_setup ( rtc5_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.

◆ rtc5_clear()

void rtc5_clear ( rtc5_t * ctx)

Clear RTCC and SRAM memory function.

Parameters
ctxClick object.

@description This function executes clear RTCC and SRAM memory of MCP79510 chip on RTC 5 Click.

◆ rtc5_default_cfg()

void rtc5_default_cfg ( rtc5_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for RTC5 click.

  • Note

    Set time and date:

        Time : 00:00:00
    
        Date : 01.01.2000.
    
        Day of the week : Saturday
    

◆ rtc5_generic_read()

uint8_t rtc5_generic_read ( rtc5_t * ctx,
uint8_t reg )

Click Default Configuration function.

Parameters
ctxClick object.
regRegister address.
Returns

Read data.

@description This function executes read the 8-bit of data from the target 8-bit register address of MCP79510 chip on RTC 5 Click.

◆ rtc5_generic_transfer()

void rtc5_generic_transfer ( rtc5_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ rtc5_generic_write()

void rtc5_generic_write ( rtc5_t * ctx,
uint8_t reg,
uint8_t tx_data )

Click Default Configuration function.

Parameters
ctxClick object.
regRegister address.
tx_dataData to be written.

@description This function executes write the 8-bit of data to the target 8-bit register address of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_date_day()

uint8_t rtc5_get_date_day ( rtc5_t * ctx)

Get day function.

Parameters
ctxClick object.
Returns
Day [ 1 : 31 ]

@description This function gets day data from the target register address ( 0x05 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_date_month()

uint8_t rtc5_get_date_month ( rtc5_t * ctx)

Get month function.

Parameters
ctxClick object.
Returns
Month [ 1 : 12 ]

@description This function gets month data from the target register address ( 0x06 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_date_year()

uint8_t rtc5_get_date_year ( rtc5_t * ctx)

Get year function.

Parameters
ctxClick object.
Returns
Year [ 00 : 99 ]

@description This function gets year data from the target register address ( 0x07 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_day_of_the_week()

uint8_t rtc5_get_day_of_the_week ( rtc5_t * ctx)

Get day of the week function.

Parameters
ctxClick object.
Returns
Day of the week [ 1 : 7 ]

@description This function gets day of the week data from the target register address ( 0x04 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_leap_year()

uint8_t rtc5_get_leap_year ( rtc5_t * ctx)

Get leap year function.

Parameters
ctxClick object.
Returns
  • 0 : not leap year
  • 1 : leap year

@description This function gets leap year data from the target register address ( 0x06 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_time_and_date()

void rtc5_get_time_and_date ( rtc5_t * ctx,
rtc5_timedate_t * timedate_data )

Get time and date function.

Parameters
ctxClick object.
timedate_datapointer to the memory location where time and date data be stored.

This function gets time ( hours, minutes and seconds ) and date ( day, month and year ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_time_hours()

uint8_t rtc5_get_time_hours ( rtc5_t * ctx)

Get hours function.

Parameters
ctxClick object.
Returns
Time : hours [ 0 sec : 59 sec ]

@description This function gets hours data from the target register address ( 0x03 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_time_hun_of_sec()

uint8_t rtc5_get_time_hun_of_sec ( rtc5_t * ctx)

Get hundred of seconds function.

Parameters
ctxClick object.
Returns
Time : hundred of second [ 0 hs : 59 hs ]

@description This function gets hundred of second data from the target register address ( 0x00 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_time_min()

uint8_t rtc5_get_time_min ( rtc5_t * ctx)

Get minutes function.

Parameters
ctxClick object.
Returns
Time : minutes [ 0 sec : 59 sec ]

@description This function gets minutes data from the target register address ( 0x02 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_get_time_sec()

uint8_t rtc5_get_time_sec ( rtc5_t * ctx)

Get seconds function.

Parameters
ctxClick object.
Returns
Time : seconds [ 0 sec : 59 sec ]

@description This function gets seconds data from the target register address ( 0x01 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_init()

RTC5_RETVAL rtc5_init ( rtc5_t * ctx,
rtc5_cfg_t * cfg )

Initialization function.

Parameters
rtc5Click object.
cfgClick configuration structure.

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

◆ rtc5_set_counting()

void rtc5_set_counting ( rtc5_t * ctx,
uint8_t en_osc )

Enable counting function.

Parameters
ctxClick object.
en_oscEnable oscilator.

@description This function executes enable or disable counting on RTC 5 Click.

◆ rtc5_set_date()

void rtc5_set_date ( rtc5_t * ctx,
uint8_t date_day,
uint8_t date_month,
uint16_t date_year )

Set date hours, minutes and seconds function.

Parameters
ctxClick object.
date_dayDate day data [ 1 : 31 ]
date_monthDate month data [ 1 : 12 ]
date_yearDate year data [ 0 : 99 ]

This function sets date: day, month and year data to the target register address ( 0x04, 0x05, 0x06 & 0x07 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_date_day()

void rtc5_set_date_day ( rtc5_t * ctx,
uint8_t date_day )

Set day function.

Parameters
ctxClick object.
date_dayDate day data [ 1 : 31 ]

@description This function sets day data from the target register address ( 0x05 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_date_month()

void rtc5_set_date_month ( rtc5_t * ctx,
uint8_t date_month )

Set month function.

Parameters
ctxClick object.
date_monthDate month data [ 1 : 31 ]

@description This function sets month data from the target register address ( 0x06 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_date_year()

void rtc5_set_date_year ( rtc5_t * ctx,
uint16_t date_year )

Set year function.

Parameters
ctxClick object.
date_yearDate year data [ 00 : 99 ]

@description This function sets year data from the target register address ( 0x07 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_day_of_the_week()

void rtc5_set_day_of_the_week ( rtc5_t * ctx,
uint8_t w_day )

Set day of the week function.

Parameters
ctxClick object.
wDay
Day of the week data [ 1 : 7 ]
  • 1 : Monday;
  • 2 : Tuesday;
  • 3 : Wednesday;
  • 4 : Thursday;
  • 5 : Friday;
  • 6 : Saturday;
  • 7 : Sunday;

@description This function sets day of the week data to the target register address ( 0x04 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_time()

void rtc5_set_time ( rtc5_t * ctx,
uint8_t time_hours,
uint8_t time_min,
uint8_t time_sec )

Set time hours, minutes and seconds function.

Parameters
ctxClick object.
time_hoursTime hours [ 0 h : 23 h ]
time_minTime minutes [ 0 min : 59 min ]
time_secTime seconds [ 0 sec : 59 sec ]

This function sets time: hours, minutes and seconds data to the target register address ( 0x01, 0x02 & 0x03 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_time_hours()

void rtc5_set_time_hours ( rtc5_t * ctx,
uint8_t hours )

Set hours function.

Parameters
ctxClick object.
hoursTime hours [ 0 h : 23 h ]

@description This function sets hours value to the target register address ( 0x03 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_time_hun_of_sec()

void rtc5_set_time_hun_of_sec ( rtc5_t * ctx,
uint8_t hun_sec )

Set hundred of seconds function.

Parameters
ctxClick object.
hun_secTime: hundred of seconds [ 0 hs : 99 hs ].

@description This function sets hundred of seconds value to the target register address ( 0x00 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_time_min()

void rtc5_set_time_min ( rtc5_t * ctx,
uint8_t minutes )

Set minutes function.

Parameters
ctxClick object.
minutesTime minutes [ 0 min : 59 min ]

@description This function sets minutes value to the target register address ( 0x02 ) of MCP79510 chip on RTC 5 Click.

◆ rtc5_set_time_sec()

void rtc5_set_time_sec ( rtc5_t * ctx,
uint8_t seconds )

Set seconds function.

Parameters
ctxClick object.
secondsTime seconds [ 0 sec : 59 sec ]

@description This function sets seconds value to the target register address ( 0x01 ) of MCP79510 chip on RTC 5 Click.