rtc5 2.0.0.0
rtc5.h File Reference

This file contains API for RTC5 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  rtc5_t
 Click ctx object definition. More...
 
struct  rtc5_cfg_t
 Click configuration structure definition. More...
 
struct  rtc5_timedate_t
 Time and date structure definition. More...
 

Macros

#define RTC5_MAP_MIKROBUS(cfg, mikrobus)
 
#define RTC5_RETVAL   uint8_t
 
#define RTC5_OK   0x00
 
#define RTC5_INIT_ERROR   0xFF
 
#define RTC5_REG_TIME_HUN_OF_SEC   0x00
 
#define RTC5_REG_TIME_SEC   0x01
 
#define RTC5_REG_TIME_MIN   0x02
 
#define RTC5_REG_TIME_HOUR   0x03
 
#define RTC5_REG_TIME_DAY_OF_THE_WEEK   0x04
 
#define RTC5_REG_TIME_DATE_DAY   0x05
 
#define RTC5_REG_TIME_DATE_MONTH   0x06
 
#define RTC5_REG_TIME_DATE_YEAR   0x07
 
#define RTC5_REG_CONFIG   0x08
 
#define RTC5_REG_CALIBRATION   0x09
 
#define RTC5_REG_ALARM_0_SEC   0x0C
 
#define RTC5_REG_ALARM_0_MIN   0x0D
 
#define RTC5_REG_ALARM_0_HOUR   0x0E
 
#define RTC5_REG_ALARM_0_DATE_DATE   0x0F
 
#define RTC5_REG_ALARM_0_DATE_DAY   0x10
 
#define RTC5_REG_ALARM_0_MONTH   0x11
 
#define RTC5_REG_ALARM_1_HUN_OF_SEC   0x12
 
#define RTC5_REG_ALARM_1_SEC   0x13
 
#define RTC5_REG_ALARM_1_MIN   0x14
 
#define RTC5_REG_ALARM_1_HOUR   0x15
 
#define RTC5_REG_ALARM_1_DATE_DATE   0x16
 
#define RTC5_REG_ALARM_1_DATE_DAY   0x17
 
#define RTC5_ALARM_0_VALUE   0x00
 
#define RTC5_ALARM_1_VALUE   0x01
 
#define RTC5_SPI_WRITE   0x12
 
#define RTC5_SPI_READ   0x13
 
#define RTC5_OSC_DISABLE   0x00
 
#define RTC5_OSC_ENABLE   0x01
 
#define RTC5_COUNTING_DISABLE   0x7F
 
#define RTC5_COUNTING_ENABLE   0x80
 
#define RTC5_CLR_CMD   0x54
 
#define RTC5_DAY_OF_THE_WEEK_MONDAY   1
 
#define RTC5_DAY_OF_THE_WEEK_TUESDAY   2
 
#define RTC5_DAY_OF_THE_WEEK_WEDNESDAY   3
 
#define RTC5_DAY_OF_THE_WEEK_THURSDAY   4
 
#define RTC5_DAY_OF_THE_WEEK_FRIDAY   5
 
#define RTC5_DAY_OF_THE_WEEK_SATURDAY   6
 
#define RTC5_DAY_OF_THE_WEEK_SUNDAY   7
 

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

This file contains API for RTC5 Click driver.