rtc17 2.0.0.0
rtc17.h File Reference

This file contains API for RTC 17 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  rtc17_t
 RTC 17 Click context object. More...
 
struct  rtc17_cfg_t
 RTC 17 Click configuration object. More...
 
struct  rtc17_time_t
 RTC 17 Click time object. More...
 
struct  rtc17_date_t
 RTC 17 Click date object. More...
 

Macros

#define RTC17_REG_SECOND_COUNTER   0x00
 RTC 17 Register Map.
 
#define RTC17_REG_MINUTE_COUNTER   0x01
 
#define RTC17_REG_HOUR_COUNTER   0x02
 
#define RTC17_REG_DAY_OF_WEEK_COUNTER   0x03
 
#define RTC17_REG_DAY_COUNTER   0x04
 
#define RTC17_REG_MONTH_COUNTER   0x05
 
#define RTC17_REG_YEAR_COUNTER   0x06
 
#define RTC17_REG_OSC_ADJ   0x07
 
#define RTC17_REG_ALARM_W_MINUTE   0x08
 
#define RTC17_REG_ALARM_W_HOUR   0x09
 
#define RTC17_REG_ALARM_W_DAY_OF_WEEK   0x0A
 
#define RTC17_REG_ALARM_D_MINUTE   0x0B
 
#define RTC17_REG_ALARM_D_HOUR   0x0C
 
#define RTC17_REG_CONTROL1   0x0E
 
#define RTC17_REG_CONTROL2   0x0F
 
#define RTC17_CONTROL1_ALARM_W_DISABLE   0x00
 RTC 17 Control 1 register settings.
 
#define RTC17_CONTROL1_ALARM_W_ENABLE   0x80
 
#define RTC17_CONTROL1_ALARM_D_DISABLE   0x00
 
#define RTC17_CONTROL1_ALARM_D_ENABLE   0x40
 
#define RTC17_CONTROL1_12HOUR_TIME   0x00
 
#define RTC17_CONTROL1_24HOUR_TIME   0x20
 
#define RTC17_CONTROL1_CLOCK1_ENABLE   0x00
 
#define RTC17_CONTROL1_CLOCK1_DISABLE   0x10
 
#define RTC17_CONTROL1_TEST_NORMAL   0x00
 
#define RTC17_CONTROL1_TEST_TEST   0x08
 
#define RTC17_CONTROL1_CT_OFF   0x00
 
#define RTC17_CONTROL1_CT_FIXED_L   0x01
 
#define RTC17_CONTROL1_CT_PULSE_2HZ   0x02
 
#define RTC17_CONTROL1_CT_PULSE_1HZ   0x03
 
#define RTC17_CONTROL1_CT_EVERY_SECOND   0x04
 
#define RTC17_CONTROL1_CT_EVERY_MINUTE   0x05
 
#define RTC17_CONTROL1_CT_EVERY_HOUR   0x06
 
#define RTC17_CONTROL1_CT_EVERY_MONTH   0x07
 
#define RTC17_CONTROL2_VDSL_2p1V   0x00
 RTC 17 Control 2 register settings.
 
#define RTC17_CONTROL2_VDSL_1p6V   0x80
 
#define RTC17_CONTROL2_VDET_ABOVE   0x00
 
#define RTC17_CONTROL2_VDET_BELOW   0x40
 
#define RTC17_CONTROL2_SCRATCH_BIT   0x20
 
#define RTC17_CONTROL2_XSTP_NORMAL   0x00
 
#define RTC17_CONTROL2_XSTP_HALT   0x10
 
#define RTC17_CONTROL2_CLOCK2_ENABLE   0x00
 
#define RTC17_CONTROL2_CLOCK2_DISABLE   0x08
 
#define RTC17_CONTROL2_CLEAR_INTERRUPT   0x04
 
#define RTC17_CONTROL2_CLEAR_ALARM_W   0x02
 
#define RTC17_CONTROL2_CLEAR_ALARM_D   0x01
 
#define RTC17_MONDAY   0x00
 RTC 17 day of week values.
 
#define RTC17_TUESDAY   0x01
 
#define RTC17_WEDNESDAY   0x02
 
#define RTC17_THURSDAY   0x03
 
#define RTC17_FRIDAY   0x04
 
#define RTC17_SATURDAY   0x05
 
#define RTC17_SUNDAY   0x06
 
#define RTC17_SET_DEVICE_ADDRESS   0x32
 RTC 17 device address setting.
 
#define RTC17_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rtc17_return_value_t { RTC17_OK = 0 , RTC17_ERROR = -1 }
 RTC 17 Click return value data. More...
 

Functions

void rtc17_cfg_setup (rtc17_cfg_t *cfg)
 RTC 17 configuration object setup function.
 
err_t rtc17_init (rtc17_t *ctx, rtc17_cfg_t *cfg)
 RTC 17 initialization function.
 
err_t rtc17_default_cfg (rtc17_t *ctx)
 RTC 17 default configuration function.
 
err_t rtc17_write_register (rtc17_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 17 write register function.
 
err_t rtc17_write_multiple_registers (rtc17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 RTC 17 write multiple registers function.
 
err_t rtc17_read_register (rtc17_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 17 read register function.
 
err_t rtc17_read_multiple_registers (rtc17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 RTC 17 read multiple registers function.
 
uint8_t rtc17_get_int_pin (rtc17_t *ctx)
 RTC 17 get int pin function.
 
err_t rtc17_clear_interrupts (rtc17_t *ctx)
 RTC 17 clear interrupts function.
 
err_t rtc17_set_time (rtc17_t *ctx, rtc17_time_t *time)
 RTC 17 set time function.
 
err_t rtc17_read_time (rtc17_t *ctx, rtc17_time_t *time)
 RTC 17 read time function.
 
err_t rtc17_set_date (rtc17_t *ctx, rtc17_date_t *date)
 RTC 17 set date function.
 
err_t rtc17_read_date (rtc17_t *ctx, rtc17_date_t *date)
 RTC 17 read date function.
 

Detailed Description

This file contains API for RTC 17 Click Driver.

Enumeration Type Documentation

◆ rtc17_return_value_t

RTC 17 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC17_OK 
RTC17_ERROR