rtc12 2.0.0.0
rtc12.h File Reference

This file contains API for RTC 12 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  rtc12_t
 RTC 12 Click context object. More...
 
struct  rtc12_cfg_t
 RTC 12 Click configuration object. More...
 
struct  rtc12_time_t
 RTC 12 Click time object. More...
 
struct  rtc12_date_t
 RTC 12 Click date object. More...
 
struct  rtc12_alarm_t
 RTC 12 Click alarm object. More...
 
struct  rtc12_control_t
 RTC 12 Click control object. More...
 

Macros

#define RTC12_REG_SECONDS   0x00
 RTC 12 description register.
 
#define RTC12_REG_MINUTES   0x01
 
#define RTC12_REG_HOUR   0x02
 
#define RTC12_REG_DAY   0x03
 
#define RTC12_REG_DATE   0x04
 
#define RTC12_REG_MONTH   0x05
 
#define RTC12_REG_YEAR   0x06
 
#define RTC12_REG_ALARM_0_SECONDS   0x07
 
#define RTC12_REG_ALARM_0_MINUTES   0x08
 
#define RTC12_REG_ALARM_0_HOUR   0x09
 
#define RTC12_REG_ALARM_0_DAY   0x0A
 
#define RTC12_REG_ALARM_1_SECONDS   0x0B
 
#define RTC12_REG_ALARM_1_MINUTES   0x0C
 
#define RTC12_REG_ALARM_1_HOUR   0x0D
 
#define RTC12_REG_ALARM_1_DAY   0x0E
 
#define RTC12_REG_CONTROL   0x0F
 
#define RTC12_REG_STATUS   0x10
 
#define RTC12_REG_TRICKLE_CHARGER   0x11
 
#define RTC12_SET_EOSC_ENABLE   0x00
 RTC 12 description setting.
 
#define RTC12_SET_EOSC_DISABLE   0x01
 
#define RTC12_SET_DOSF_ENABLE   0x00
 
#define RTC12_SET_DOSF_DISABL   0x01
 
#define RTC12_SET_EGFIL_DISABLE   0x00
 
#define RTC12_SET_EGFIL_ENABLE   0x01
 
#define RTC12_SET_SQW_DISABLE   0x00
 
#define RTC12_SET_SQW_ENABLE   0x01
 
#define RTC12_SET_INTCN_A0IE   0x00
 
#define RTC12_SET_INTCN_A0IE_A1IE   0x01
 
#define RTC12_SET_ALARM_1_DISABLE   0x00
 
#define RTC12_SET_ALARM_1_ENABLE   0x01
 
#define RTC12_SET_ALARM_0_DISABLE   0x00
 
#define RTC12_SET_ALARM_0_ENABLE   0x01
 
#define RTC12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rtc12_return_value_t { RTC12_OK = 0 , RTC12_ERROR = -1 }
 RTC 12 Click return value data. More...
 

Functions

void rtc12_cfg_setup (rtc12_cfg_t *cfg)
 RTC 12 configuration object setup function.
 
err_t rtc12_init (rtc12_t *ctx, rtc12_cfg_t *cfg)
 RTC 12 initialization function.
 
err_t rtc12_default_cfg (rtc12_t *ctx)
 RTC 12 default configuration function.
 
err_t rtc12_generic_write (rtc12_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 12 data writing function.
 
err_t rtc12_generic_read (rtc12_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 12 data reading function.
 
err_t rtc12_set_ctrl_reg (rtc12_t *ctx, rtc12_control_t rtc_ctrl)
 RTC 12 set control register function.
 
err_t rtc12_get_ctrl_reg (rtc12_t *ctx, rtc12_control_t *rtc_ctrl)
 RTC 12 get control register function.
 
err_t rtc12_get_time (rtc12_t *ctx, rtc12_time_t *rtc_time)
 RTC 12 get time function.
 
err_t rtc12_set_time (rtc12_t *ctx, rtc12_time_t rtc_time)
 RTC 12 set time function.
 
err_t rtc12_get_date (rtc12_t *ctx, rtc12_date_t *rtc_date)
 RTC 12 get date function.
 
err_t rtc12_set_date (rtc12_t *ctx, rtc12_date_t rtc_date)
 RTC 12 get time function.
 
err_t rtc12_get_alarm_0 (rtc12_t *ctx, rtc12_alarm_t *rtc_alarm)
 RTC 12 get alarm 0 function.
 
err_t rtc12_set_alarm_0 (rtc12_t *ctx, rtc12_alarm_t rtc_alarm)
 RTC 12 get alarm 0 function.
 
err_t rtc12_get_alarm_1 (rtc12_t *ctx, rtc12_alarm_t *rtc_alarm)
 RTC 12 get alarm 1 function.
 
err_t rtc12_set_alarm_1 (rtc12_t *ctx, rtc12_alarm_t rtc_alarm)
 RTC 12 get alarm 1 function.
 
uint8_t rtc12_check_int (rtc12_t *ctx)
 RTC 12 check interrupt state function.
 
uint8_t rtc12_check_power_fail (rtc12_t *ctx)
 RTC 12 check power fail state function.
 

Detailed Description

This file contains API for RTC 12 Click Driver.

Enumeration Type Documentation

◆ rtc12_return_value_t

RTC 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC12_OK 
RTC12_ERROR