rtc20 2.1.0.0
rtc20.h File Reference

This file contains API for RTC 20 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  rtc20_t
 RTC 20 Click context object. More...
 
struct  rtc20_cfg_t
 RTC 20 Click configuration object. More...
 
struct  rtc20_time_t
 RTC 20 Click time object. More...
 
struct  rtc20_date_t
 RTC 20 Click date object. More...
 
struct  rtc20_ctrl_signals_t
 RTC 20 Click control signals object. More...
 

Macros

#define RTC20_REG_HUNDREDTHS   0x00
 RTC 20 description register.
 
#define RTC20_REG_SECONDS   0x01
 
#define RTC20_REG_MINUTES   0x02
 
#define RTC20_REG_HOURS   0x03
 
#define RTC20_REG_DATE   0x04
 
#define RTC20_REG_MONTH   0x05
 
#define RTC20_REG_YEAR   0x06
 
#define RTC20_REG_DAY   0x07
 
#define RTC20_REG_HUNDREDTHS_ALARM   0x08
 
#define RTC20_REG_SECONDS_ALARM   0x09
 
#define RTC20_REG_MINUTES_ALARM   0x0A
 
#define RTC20_REG_HOURS_ALARM   0x0B
 
#define RTC20_REG_DATE_ALARM   0x0C
 
#define RTC20_REG_MONTH_ALARM   0x0D
 
#define RTC20_REG_WEEKDAYS_ALARM   0x0E
 
#define RTC20_REG_STATUS   0x0F
 
#define RTC20_REG_CONTROL1   0x10
 
#define RTC20_REG_CONTROL2   0x11
 
#define RTC20_REG_OSC_CONTROL   0x1C
 
#define RTC20_REG_OSC_STATUS   0x1D
 
#define RTC20_SET_CTRL_STOP_DISABLE   0x00
 RTC 20 description setting.
 
#define RTC20_SET_CTRL_STOP_ENABLE   0x01
 
#define RTC20_SET_CTRL_HOURS_OP_MODE_24h   0x00
 
#define RTC20_SET_CTRL_HOURS_OP_MODE_12h   0x01
 
#define RTC20_SET_CTRL_OUTB_nIRQ2   0x00
 
#define RTC20_SET_CTRL_OUTB_LKO2   0x01
 
#define RTC20_SET_CTRL_OUT_nIRQ   0x00
 
#define RTC20_SET_CTRL_OUT_SQWE   0x01
 
#define RTC20_SET_CTRL_ARST_NO_CLR   0x00
 
#define RTC20_SET_CTRL_ARST_CLR   0x01
 
#define RTC20_SET_CTRL_WRTC_DISABLE   0x00
 
#define RTC20_SET_CTRL_WRTC_ENABLE   0x01
 
#define RTC20_SET_CTRL_OUT2S_nIRQ_ENABLE   0x00
 
#define RTC20_SET_CTRL_OUT2S_SQW_ENABLE   0x01
 
#define RTC20_SET_CTRL_OUT2S_nAIRQ_ENABLE   0x03
 
#define RTC20_SET_CTRL_OUT2S_TIRQ_ENABLE   0x04
 
#define RTC20_SET_CTRL_OUT2S_nTIRQ_ENABLE   0x05
 
#define RTC20_SET_CTRL_OUT2S_OUTB_ENABLE   0x07
 
#define RTC20_SET_CTRL_OUT1S_nIRQ_ENABLE   0x00
 
#define RTC20_SET_CTRL_OUT1S_SQW_ENABLE   0x01
 
#define RTC20_SET_CTRL_OUT1S_SQW_nIRQ_ENABLE   0x02
 
#define RTC20_SET_CTRL_OUT1S_nAIRQ_ENABLE   0x03
 
#define RTC20_DW_SUNDAY   0
 RTC 20 Days of the Week.
 
#define RTC20_DW_MONDAY   1
 
#define RTC20_DW_TUESDAY   2
 
#define RTC20_DW_WEDNESDAY   3
 
#define RTC20_DW_THURSDAY   4
 
#define RTC20_DW_FRIDAY   5
 
#define RTC20_DW_SATURDAY   6
 
#define RTC20_DEVICE_ADDRESS   0x69
 RTC 20 device address setting.
 
#define RTC20_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rtc20_return_value_t { RTC20_OK = 0 , RTC20_ERROR = -1 }
 RTC 20 Click return value data. More...
 

Functions

void rtc20_cfg_setup (rtc20_cfg_t *cfg)
 RTC 20 configuration object setup function.
 
err_t rtc20_init (rtc20_t *ctx, rtc20_cfg_t *cfg)
 RTC 20 initialization function.
 
err_t rtc20_generic_write (rtc20_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 20 I2C writing function.
 
err_t rtc20_generic_read (rtc20_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 20 I2C reading function.
 
void rtc20_wdi_pin_state (rtc20_t *ctx, uint8_t pin_state)
 RTC 20 I2C reading function.
 
void rtc20_ext_pin_state (rtc20_t *ctx, uint8_t pin_state)
 RTC 20 I2C reading function.
 
err_t rtc20_set_time (rtc20_t *ctx, rtc20_time_t rtc_time)
 RTC 20 set time function.
 
err_t rtc20_get_time (rtc20_t *ctx, rtc20_time_t *rtc_time)
 RTC 20 get time function.
 
err_t rtc20_set_date (rtc20_t *ctx, rtc20_date_t rtc_date)
 RTC 20 set date function.
 
err_t rtc20_get_date (rtc20_t *ctx, rtc20_date_t *rtc_date)
 RTC 20 get date function.
 
err_t rtc20_set_alarm (rtc20_t *ctx, rtc20_time_t rtc_alarm_time, rtc20_date_t rtc_alarm_date)
 RTC 20 set alarm function.
 
err_t rtc20_get_alarm (rtc20_t *ctx, rtc20_time_t *rtc_alarm_time, rtc20_date_t *rtc_alarm_date)
 RTC 20 get alarm function.
 
err_t rtc20_get_status (rtc20_t *ctx, uint8_t *status)
 RTC 20 get status function.
 
err_t rtc20_set_ctrl_signals (rtc20_t *ctx, rtc20_ctrl_signals_t ctrl_signals)
 RTC 20 set ctrl signals function.
 
err_t rtc20_get_ctrl_signals (rtc20_t *ctx, rtc20_ctrl_signals_t *ctrl_signals)
 RTC 20 get ctrl signals function.
 
uint8_t rtc20_get_ir1_pin (rtc20_t *ctx)
 RTC 20 get IR1 pin function.
 
uint8_t rtc20_get_ir2_pin (rtc20_t *ctx)
 RTC 20 get IR2 pin function.
 

Detailed Description

This file contains API for RTC 20 Click Driver.

Enumeration Type Documentation

◆ rtc20_return_value_t

RTC 20 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC20_OK 
RTC20_ERROR