rtc19 2.1.0.0
rtc19.h File Reference

This file contains API for RTC 19 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  rtc19_t
 RTC 19 Click context object. More...
 
struct  rtc19_cfg_t
 RTC 19 Click configuration object. More...
 
struct  rtc19_time_t
 RTC 19 Click time object. More...
 
struct  rtc19_date_t
 RTC 19 Click date object. More...
 

Macros

#define RTC19_REG_STATUS   0x00
 RTC 19 RTC register list.
 
#define RTC19_REG_INT_EN   0x01
 
#define RTC19_REG_RTC_RESET   0x02
 
#define RTC19_REG_RTC_CONFIG1   0x03
 
#define RTC19_REG_RTC_CONFIG2   0x04
 
#define RTC19_REG_TIMESTAMP_CONFIG   0x05
 
#define RTC19_REG_TIMER_CONFIG   0x06
 
#define RTC19_REG_SLEEP_CONFIG   0x07
 
#define RTC19_REG_SECONDS_1_128   0x08
 
#define RTC19_REG_SECONDS   0x09
 
#define RTC19_REG_MINUTES   0x0A
 
#define RTC19_REG_HOURS   0x0B
 
#define RTC19_REG_DAY   0x0C
 
#define RTC19_REG_DATE   0x0D
 
#define RTC19_REG_MONTH   0x0E
 
#define RTC19_REG_YEAR   0x0F
 
#define RTC19_REG_ALM1_SEC   0x10
 
#define RTC19_REG_ALM1_MIN   0x11
 
#define RTC19_REG_ALM1_HRS   0x12
 
#define RTC19_REG_ALM1_DAY_DATE   0x13
 
#define RTC19_REG_ALM1_MON   0x14
 
#define RTC19_REG_ALM1_YEAR   0x15
 
#define RTC19_REG_ALM2_MIN   0x16
 
#define RTC19_REG_ALM2_HRS   0x17
 
#define RTC19_REG_ALM2_DAY_DATE   0x18
 
#define RTC19_REG_TIMER_COUNT2   0x19
 
#define RTC19_REG_TIMER_COUNT1   0x1A
 
#define RTC19_REG_TIMER_INIT2   0x1B
 
#define RTC19_REG_TIMER_INIT1   0x1C
 
#define RTC19_REG_PWR_MGMT   0x1D
 
#define RTC19_REG_TRICKLE_REG   0x1E
 
#define RTC19_REG_OFFSET_HIGH   0x20
 
#define RTC19_REG_OFFSET_LOW   0x21
 
#define RTC19_REG_TS0_SEC_1_128   0x30
 RTC 19 TS RAM register list.
 
#define RTC19_REG_TS0_SEC   0x31
 
#define RTC19_REG_TS0_MIN   0x32
 
#define RTC19_REG_TS0_HOUR   0x33
 
#define RTC19_REG_TS0_DATE   0x34
 
#define RTC19_REG_TS0_MONTH   0x35
 
#define RTC19_REG_TS0_YEAR   0x36
 
#define RTC19_REG_TS0_FLAGS   0x37
 
#define RTC19_REG_TS1_SEC_1_128   0x38
 
#define RTC19_REG_TS1_SEC   0x39
 
#define RTC19_REG_TS1_MIN   0x3A
 
#define RTC19_REG_TS1_HOUR   0x3B
 
#define RTC19_REG_TS1_DATE   0x3C
 
#define RTC19_REG_TS1_MONTH   0x3D
 
#define RTC19_REG_TS1_YEAR   0x3E
 
#define RTC19_REG_TS1_FLAGS   0x3F
 
#define RTC19_REG_TS2_SEC_1_128   0x40
 
#define RTC19_REG_TS2_SEC   0x41
 
#define RTC19_REG_TS2_MIN   0x42
 
#define RTC19_REG_TS2_HOUR   0x43
 
#define RTC19_REG_TS2_DATE   0x44
 
#define RTC19_REG_TS2_MONTH   0x45
 
#define RTC19_REG_TS2_YEAR   0x46
 
#define RTC19_REG_TS2_FLAGS   0x47
 
#define RTC19_REG_TS3_SEC_1_128   0x48
 
#define RTC19_REG_TS3_SEC   0x49
 
#define RTC19_REG_TS3_MIN   0x4A
 
#define RTC19_REG_TS3_HOUR   0x4B
 
#define RTC19_REG_TS3_DATE   0x4C
 
#define RTC19_REG_TS3_MONTH   0x4D
 
#define RTC19_REG_TS3_YEAR   0x4E
 
#define RTC19_REG_TS3_FLAGS   0x4F
 
#define RTC19_RTC_RESET_CLEAR   0x00
 RTC 19 RTC_RESET register setting.
 
#define RTC19_RTC_RESET_SET   0x01
 
#define RTC19_INT_EN_DOSF   0x40
 RTC 19 INT_EN register setting.
 
#define RTC19_INT_EN_PFAILE   0x20
 
#define RTC19_INT_EN_VBATLOWIE   0x10
 
#define RTC19_INT_EN_DIE   0x08
 
#define RTC19_INT_EN_TIE   0x04
 
#define RTC19_INT_EN_A2IE   0x02
 
#define RTC19_INT_EN_A1IE   0x01
 
#define RTC19_TIMER_CONFIG_TE   0x10
 RTC 19 TIMER_CONFIG register setting.
 
#define RTC19_TIMER_CONFIG_TPAUSE   0x08
 
#define RTC19_TIMER_CONFIG_TRPT   0x04
 
#define RTC19_TIMER_CONFIG_TFS_1024HZ   0x00
 
#define RTC19_TIMER_CONFIG_TFS_256HZ   0x01
 
#define RTC19_TIMER_CONFIG_TFS_64HZ   0x02
 
#define RTC19_TIMER_CONFIG_TFS_16HZ   0x03
 
#define RTC19_TIMER_CONFIG_TFS_MASK   0x03
 
#define RTC19_TIMER_INIT_16CNT   0x000F
 RTC 19 TIMER_INIT register setting.
 
#define RTC19_MONDAY   0x01
 RTC 19 day of week values.
 
#define RTC19_TUESDAY   0x02
 
#define RTC19_WEDNESDAY   0x03
 
#define RTC19_THURSDAY   0x04
 
#define RTC19_FRIDAY   0x05
 
#define RTC19_SATURDAY   0x06
 
#define RTC19_SUNDAY   0x07
 
#define RTC19_DEVICE_ADDRESS   0x68
 RTC 19 device address setting.
 
#define RTC19_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rtc19_return_value_t { RTC19_OK = 0 , RTC19_ERROR = -1 }
 RTC 19 Click return value data. More...
 

Functions

void rtc19_cfg_setup (rtc19_cfg_t *cfg)
 RTC 19 configuration object setup function.
 
err_t rtc19_init (rtc19_t *ctx, rtc19_cfg_t *cfg)
 RTC 19 initialization function.
 
err_t rtc19_default_cfg (rtc19_t *ctx)
 RTC 19 default configuration function.
 
err_t rtc19_generic_write (rtc19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 19 I2C writing function.
 
err_t rtc19_generic_read (rtc19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 19 I2C reading function.
 
err_t rtc19_write_register (rtc19_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 19 write register function.
 
err_t rtc19_read_register (rtc19_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 19 read register function.
 
void rtc19_set_din_pin (rtc19_t *ctx, uint8_t state)
 RTC 19 set din pin function.
 
uint8_t rtc19_get_psw_pin (rtc19_t *ctx)
 RTC 19 get psw pin function.
 
uint8_t rtc19_get_inta_pin (rtc19_t *ctx)
 RTC 19 get inta pin function.
 
uint8_t rtc19_get_intb_pin (rtc19_t *ctx)
 RTC 19 get intb pin function.
 
err_t rtc19_set_time (rtc19_t *ctx, rtc19_time_t *time)
 RTC 19 set time function.
 
err_t rtc19_read_time (rtc19_t *ctx, rtc19_time_t *time)
 RTC 19 read time function.
 
err_t rtc19_set_date (rtc19_t *ctx, rtc19_date_t *date)
 RTC 19 set date function.
 
err_t rtc19_read_date (rtc19_t *ctx, rtc19_date_t *date)
 RTC 19 read date function.
 
err_t rtc19_reset_device (rtc19_t *ctx)
 RTC 19 reset device function.
 
err_t rtc19_clear_interrupts (rtc19_t *ctx)
 RTC 19 clear interrupts function.
 

Detailed Description

This file contains API for RTC 19 Click Driver.

Enumeration Type Documentation

◆ rtc19_return_value_t

RTC 19 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC19_OK 
RTC19_ERROR