rtc16 2.0.0.0
rtc16.h File Reference

This file contains API for RTC 16 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  rtc16_t
 RTC 16 Click context object. More...
 
struct  rtc16_cfg_t
 RTC 16 Click configuration object. More...
 
struct  rtc16_time_t
 RTC 16 Click time object. More...
 
struct  rtc16_date_t
 RTC 16 Click date object. More...
 

Macros

#define RTC16_REG_SECOND_COUNTER   0x00
 RTC 16 Register Map.
 
#define RTC16_REG_MINUTE_COUNTER   0x01
 
#define RTC16_REG_HOUR_COUNTER   0x02
 
#define RTC16_REG_DAY_OF_WEEK_COUNTER   0x03
 
#define RTC16_REG_DAY_COUNTER   0x04
 
#define RTC16_REG_MONTH_COUNTER   0x05
 
#define RTC16_REG_YEAR_COUNTER   0x06
 
#define RTC16_REG_TIME_TRIMMING   0x07
 
#define RTC16_REG_ALARM_A_MINUTE   0x08
 
#define RTC16_REG_ALARM_A_HOUR   0x09
 
#define RTC16_REG_ALARM_A_DAY_OF_WEEK   0x0A
 
#define RTC16_REG_ALARM_B_MINUTE   0x0B
 
#define RTC16_REG_ALARM_B_HOUR   0x0C
 
#define RTC16_REG_ALARM_B_DAY_OF_WEEK   0x0D
 
#define RTC16_REG_CONTROL1   0x0E
 
#define RTC16_REG_CONTROL2   0x0F
 
#define RTC16_CONTROL1_ALARM_A_DISABLE   0x00
 RTC 16 Control 1 register settings.
 
#define RTC16_CONTROL1_ALARM_A_ENABLE   0x80
 
#define RTC16_CONTROL1_ALARM_B_DISABLE   0x00
 
#define RTC16_CONTROL1_ALARM_B_ENABLE   0x40
 
#define RTC16_CONTROL1_TEST_NORMAL   0x00
 
#define RTC16_CONTROL1_TEST_TEST   0x10
 
#define RTC16_CONTROL1_CT_OFF   0x00
 
#define RTC16_CONTROL1_CT_FIXED_L   0x01
 
#define RTC16_CONTROL1_CT_PULSE_2HZ   0x02
 
#define RTC16_CONTROL1_CT_PULSE_1HZ   0x03
 
#define RTC16_CONTROL1_CT_EVERY_SECOND   0x04
 
#define RTC16_CONTROL1_CT_EVERY_MINUTE   0x05
 
#define RTC16_CONTROL1_CT_EVERY_HOUR   0x06
 
#define RTC16_CONTROL1_CT_EVERY_MONTH   0x07
 
#define RTC16_CONTROL2_12HOUR_TIME   0x00
 RTC 16 Control 2 register settings.
 
#define RTC16_CONTROL2_24HOUR_TIME   0x20
 
#define RTC16_CONTROL2_ADJ_BIT   0x10
 
#define RTC16_CONTROL2_CLOCK_ENABLE   0x00
 
#define RTC16_CONTROL2_CLOCK_DISABLE   0x08
 
#define RTC16_CONTROL2_CLEAR_INTERRUPT   0x04
 
#define RTC16_CONTROL2_CLEAR_ALARM_A   0x02
 
#define RTC16_CONTROL2_CLEAR_ALARM_B   0x01
 
#define RTC16_MONDAY   0x00
 RTC 16 day of week values.
 
#define RTC16_TUESDAY   0x01
 
#define RTC16_WEDNESDAY   0x02
 
#define RTC16_THURSDAY   0x03
 
#define RTC16_FRIDAY   0x04
 
#define RTC16_SATURDAY   0x05
 
#define RTC16_SUNDAY   0x06
 
#define RTC16_FAST_READ_BIT   0x04
 RTC 16 fast read bit value.
 
#define RTC16_DEVICE_ADDRESS   0x32
 RTC 16 device address setting.
 
#define RTC16_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rtc16_return_value_t { RTC16_OK = 0 , RTC16_ERROR = -1 }
 RTC 16 Click return value data. More...
 

Functions

void rtc16_cfg_setup (rtc16_cfg_t *cfg)
 RTC 16 configuration object setup function.
 
err_t rtc16_init (rtc16_t *ctx, rtc16_cfg_t *cfg)
 RTC 16 initialization function.
 
err_t rtc16_default_cfg (rtc16_t *ctx)
 RTC 16 default configuration function.
 
err_t rtc16_write_register (rtc16_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 16 write register function.
 
err_t rtc16_write_multiple_registers (rtc16_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 RTC 16 write multiple registers function.
 
err_t rtc16_read_register (rtc16_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 16 read register function.
 
err_t rtc16_read_register_fast (rtc16_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 16 read register fast function.
 
err_t rtc16_read_multiple_registers (rtc16_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 RTC 16 read multiple registers function.
 
err_t rtc16_read_multiple_registers_fast (rtc16_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 RTC 16 read multiple registers fast function.
 
uint8_t rtc16_get_int_pin (rtc16_t *ctx)
 RTC 16 get int pin function.
 
err_t rtc16_clear_interrupts (rtc16_t *ctx)
 RTC 16 clear interrupts function.
 
err_t rtc16_set_time (rtc16_t *ctx, rtc16_time_t *time)
 RTC 16 set time function.
 
err_t rtc16_read_time (rtc16_t *ctx, rtc16_time_t *time)
 RTC 16 read time function.
 
err_t rtc16_set_date (rtc16_t *ctx, rtc16_date_t *date)
 RTC 16 set date function.
 
err_t rtc16_read_date (rtc16_t *ctx, rtc16_date_t *date)
 RTC 16 read date function.
 

Detailed Description

This file contains API for RTC 16 Click Driver.

Enumeration Type Documentation

◆ rtc16_return_value_t

RTC 16 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC16_OK 
RTC16_ERROR