rtc10 2.0.0.0
rtc10.h File Reference

This file contains API for Rtc 10 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  rtc10_t
 Click ctx object definition. More...
 
struct  rtc10_cfg_t
 Click configuration structure definition. More...
 

Macros

#define RTC10_MAP_MIKROBUS(cfg, mikrobus)
 
#define RTC10_RETVAL   uint8_t
 
#define RTC10_OK   0x00
 
#define RTC10_INIT_ERROR   0xFF
 
#define RTC10_I2C_SLAVE_ADDRESS   0x68
 
#define RTC10_RTCSEC   0x00
 
#define RTC10_RTCMIN   0x01
 
#define RTC10_RTCHOUR   0x02
 
#define RTC10_RTCWKDAY   0x03
 
#define RTC10_RTCDATE   0x04
 
#define RTC10_RTCMTH   0x05
 
#define RTC10_RTCYEAR   0x06
 
#define RTC10_ALM1SEC   0x07
 
#define RTC10_ALM1MIN   0x08
 
#define RTC10_ALM1HOUR   0x09
 
#define RTC10_ALM1DATE   0x0A
 
#define RTC10_ALM2MIN   0x0B
 
#define RTC10_ALM2HOUR   0x0C
 
#define RTC10_ALM2DATE   0x0D
 
#define RTC10_CONTROL   0x0E
 
#define RTC10_STATUS   0x0F
 
#define RTC10_AGING   0x10
 
#define RTC10_TEMPERATURE_MSB   0x11
 
#define RTC10_TEMPERATURE_LSB   0x12
 
#define RTC10_DISABLE_ALARMS   0x00
 
#define RTC10_ENABLE_ALARM_1   0x01
 
#define RTC10_ENABLE_ALARM_2   0x02
 
#define RTC10_ENABLE_INTERRUPT   0x04
 

Functions

void rtc10_cfg_setup (rtc10_cfg_t *cfg)
 Config Object Initialization function.
 
RTC10_RETVAL rtc10_init (rtc10_t *ctx, rtc10_cfg_t *cfg)
 Initialization function.
 
void rtc10_default_cfg (rtc10_t *ctx)
 Click Default Configuration function.
 
void rtc10_generic_write (rtc10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void rtc10_generic_read (rtc10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void rtc10_hw_reset (rtc10_t *ctx)
 Hardware reset function.
 
uint8_t rtc10_check_interrupt (rtc10_t *ctx)
 Check the state of interrupt function.
 
uint8_t rtc10_read_byte (rtc10_t *ctx, uint8_t reg_address)
 Generic read function.
 
void rtc10_write_byte (rtc10_t *ctx, uint8_t reg_address, uint8_t write_data)
 Generic read function.
 
uint8_t rtc10_get_time_seconds (rtc10_t *ctx)
 Get seconds function.
 
void rtc10_set_time_seconds (rtc10_t *ctx, uint8_t seconds)
 Generic read function.
 
uint8_t rtc10_get_time_minutes (rtc10_t *ctx)
 Get seconds function.
 
void rtc10_set_time_minutes (rtc10_t *ctx, uint8_t minutes)
 Generic read function.
 
uint8_t rtc10_get_century_flag (rtc10_t *ctx)
 Get century flag function.
 
void rtc10_set_century_flag (rtc10_t *ctx)
 Set century flag function.
 
uint8_t rtc10_get_time_hours (rtc10_t *ctx)
 Get hours function.
 
void rtc10_set_time_hours (rtc10_t *ctx, uint8_t hours)
 Set hours function.
 
uint8_t rtc10_get_day_of_the_week (rtc10_t *ctx)
 Get day of the week function.
 
void rtc10_set_day_of_the_week (rtc10_t *ctx, uint8_t w_day)
 Set day of the week function.
 
uint8_t rtc10_get_date_day (rtc10_t *ctx)
 Get date function.
 
void rtc10_set_date_day (rtc10_t *ctx, uint8_t date_day)
 Set date function.
 
uint8_t rtc10_get_date_month (rtc10_t *ctx)
 Get month function.
 
void rtc10_set_date_month (rtc10_t *ctx, uint8_t date_month)
 Set month function.
 
uint8_t rtc10_get_date_year (rtc10_t *ctx)
 Get year function.
 
void rtc10_set_date_year (rtc10_t *ctx, uint16_t date_year)
 Set month function.
 
void rtc10_set_time (rtc10_t *ctx, uint8_t time_hours, uint8_t time_minutes, uint8_t time_seconds)
 Set time: hours, minutes and seconds function.
 
void rtc10_get_time (rtc10_t *ctx, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds)
 Get time hours, minutes and seconds function.
 
void rtc10_set_date (rtc10_t *ctx, uint8_t day_of_the_week, uint8_t date_day, uint8_t date_month, uint16_t date_year)
 Set date hours, minutes and seconds function.
 
void rtc10_get_date (rtc10_t *ctx, uint8_t *day_of_the_week, uint8_t *date_day, uint8_t *date_month, uint8_t *date_year)
 Get time hours, minutes and seconds function.
 
uint8_t rtc10_get_alarm_time_seconds (rtc10_t *ctx)
 Get alarm time seconds function.
 
void rtc10_set_alarm_time_seconds (rtc10_t *ctx, uint8_t seconds)
 Set alarm time seconds function.
 
uint8_t rtc10_get_alarm_time_minutes (rtc10_t *ctx)
 Get alarm time minutes function.
 
void rtc10_set_alarm_time_minutes (rtc10_t *ctx, uint8_t minutes)
 Set alarm time seconds function.
 
uint8_t rtc10_get_alarm_time_hours (rtc10_t *ctx)
 Get alarm time hours function.
 
void rtc10_set_alarm_time_hours (rtc10_t *ctx, uint8_t hours)
 Set alarm time seconds function.
 
uint8_t rtc10_get_alarm_date_day (rtc10_t *ctx)
 Get alarm days function.
 
void rtc10_set_alarm_date_day (rtc10_t *ctx, uint8_t date_day)
 Set alarm days function.
 
void rtc10_set_first_alarm (rtc10_t *ctx, uint8_t time_days, uint8_t time_hours, uint8_t time_minutes, uint8_t time_seconds)
 Set Alarm 1 time: hours, minutes and seconds function.
 
void rtc10_get_first_alarm (rtc10_t *ctx, uint8_t *time_days, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds)
 Get Alarm 1 time hours, minutes and seconds function.
 
void rtc10_set_second_alarm (rtc10_t *ctx, uint8_t time_days, uint8_t time_hours, uint8_t time_minutes)
 Set Alarm 2 time: hours, minutes and seconds function.
 
void rtc10_get_second_alarm (rtc10_t *ctx, uint8_t *time_days, uint8_t *time_hours, uint8_t *time_minutes)
 Set Alarm 2 time: hours, minutes and seconds function.
 
void rtc10_enable_counting (rtc10_t *ctx)
 Enable counting function.
 
void rtc10_set_config (rtc10_t *ctx, uint8_t config_data)
 Set configuration function.
 
uint8_t rtc10_get_status (rtc10_t *ctx)
 Get configuration status function.
 
float rtc10_get_temperature (rtc10_t *ctx)
 Get temperature function.
 

Detailed Description

This file contains API for Rtc 10 Click driver.