rtc2 2.0.0.0
rtc2.h File Reference

This file contains API for RTC2 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  rtc2_t
 Click ctx object definition. More...
 
struct  rtc2_data_t
 Data structure definition. More...
 
struct  rtc2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define RTC2_MAP_MIKROBUS(cfg, mikrobus)
 
#define RTC2_RETVAL   uint8_t
 
#define RTC2_OK   0x00
 
#define RTC2_INIT_ERROR   0xFF
 
#define RTC2_I2C_ADDRESS   0x68
 
#define RTC2_REG_TIME_SEC   0x00
 
#define RTC2_REG_TIME_MIN   0x01
 
#define RTC2_REG_TIME_HOUR   0x02
 
#define RTC2_REG_TIME_DAY_OF_THE_WEEK   0x03
 
#define RTC2_REG_TIME_DATE_DAY   0x04
 
#define RTC2_REG_TIME_DATE_MONTH   0x05
 
#define RTC2_REG_TIME_DATE_YEAR   0x06
 
#define RTC2_REG_CONTROL   0x07
 
#define RTC2_ENABLE_COUNTING   0x7F
 
#define RTC2_DISABLE_COUNTING   0x80
 
#define RTC2_CONFIG_RATE_LOW   0x00
 
#define RTC2_CONFIG_RATE_HIGH   0x80
 
#define RTC2_CONFIG_RATE_SELECT_1_HZ   0x10
 
#define RTC2_CONFIG_RATE_SELECT_4_096_kHZ   0x11
 
#define RTC2_CONFIG_RATE_SELECT_8_192_kHZ   0x12
 
#define RTC2_CONFIG_RATE_SELECT_32_768_kHZ   0x13
 

Functions

void rtc2_cfg_setup (rtc2_cfg_t *cfg)
 Config Object Initialization function.
 
RTC2_RETVAL rtc2_init (rtc2_t *ctx, rtc2_cfg_t *cfg)
 Initialization function.
 
void rtc2_generic_write (rtc2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void rtc2_generic_read (rtc2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t rtc2_read_byte (rtc2_t *ctx, uint8_t reg_address)
 Generic read byte of data function.
 
void rtc2_write_byte (rtc2_t *ctx, uint8_t reg_address, uint8_t write_data)
 Generic write byte of data function.
 
void rtc2_enable_counting (rtc2_t *ctx)
 Enable counting function.
 
void rtc2_disable_counting (rtc2_t *ctx)
 Disable counting function.
 
uint8_t rtc2_get_time_seconds (rtc2_t *ctx)
 Get seconds function.
 
void rtc2_set_time_seconds (rtc2_t *ctx, uint8_t seconds)
 Set seconds function.
 
uint8_t rtc2_get_time_minutes (rtc2_t *ctx)
 Get hours function.
 
void rtc2_set_time_minutes (rtc2_t *ctx, uint8_t minutes)
 Set minutes function.
 
uint8_t rtc2_get_time_hours (rtc2_t *ctx)
 Set hours function.
 
void rtc2_set_time_hours (rtc2_t *ctx, uint8_t hours)
 Set hours function.
 
uint8_t rtc2_get_day_of_the_week (rtc2_t *ctx)
 Set day of the week function.
 
void rtc2_set_day_of_the_week (rtc2_t *ctx, uint8_t w_day)
 Generic read function.
 
uint8_t rtc2_get_date_day (rtc2_t *ctx)
 Get day function.
 
void rtc2_set_date_day (rtc2_t *ctx, uint8_t date_day)
 Set day function.
 
uint8_t rtc2_get_date_month (rtc2_t *ctx)
 Get month function.
 
void rtc2_set_date_month (rtc2_t *ctx, uint8_t date_month)
 Set month function.
 
uint8_t rtc2_get_date_year (rtc2_t *ctx)
 Get year function.
 
void rtc2_set_date_year (rtc2_t *ctx, uint16_t date_year)
 Set year function.
 
void rtc2_set_time (rtc2_t *ctx, uint8_t time_hours, uint8_t time_minutes, uint8_t time_seconds)
 Set time hours, minutes and seconds function.
 
void rtc2_get_time (rtc2_t *ctx, uint8_t *time_hours, uint8_t *time_minutes, uint8_t *time_seconds)
 Get time hours, minutes and seconds function.
 
void rtc2_set_date (rtc2_t *ctx, rtc2_data_t *date)
 Generic read function.
 
void rtc2_get_date (rtc2_t *ctx, rtc2_data_t *date)
 Generic read function.
 
void rtc2_set_frequency_sqwe (rtc2_t *ctx, uint8_t rate_select)
 Set frequency of square-wave output function.
 

Detailed Description

This file contains API for RTC2 Click driver.