rtc15 2.2.0
Loading...
Searching...
No Matches
rtc15.h File Reference

This file contains API for RTC 15 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  rtc15_t
 RTC 15 Click context object. More...
struct  rtc15_cfg_t
 RTC 15 Click configuration object. More...
struct  rtc15_time_t
 RTC 15 Click time object. More...
struct  rtc15_date_t
 RTC 15 Click date object. More...

Macros

#define RTC15_REG_CONTROL1   0x00
 RTC 15 register list.
#define RTC15_REG_CONTROL2   0x01
#define RTC15_REG_OFFSET   0x02
#define RTC15_REG_RAM   0x03
#define RTC15_REG_SECONDS   0x04
#define RTC15_REG_MINUTES   0x05
#define RTC15_REG_HOURS   0x06
#define RTC15_REG_DATE   0x07
#define RTC15_REG_WEEKDAY   0x08
#define RTC15_REG_MONTH   0x09
#define RTC15_REG_YEAR   0x0A
#define RTC15_REG_SECONDS_ALARM   0x0B
#define RTC15_REG_MINUTES_ALARM   0x0C
#define RTC15_REG_HOURS_ALARM   0x0D
#define RTC15_REG_DATE_ALARM   0x0E
#define RTC15_REG_WEEKDAY_ALARM   0x0F
#define RTC15_REG_TIMER_VALUE   0x10
#define RTC15_REG_TIMER_MODE   0x11
#define RTC15_CONTROL1_TEST_NORMAL   0x00
 RTC 15 CONTROL1 register settings.
#define RTC15_CONTROL1_TEST_EXTCLK   0x80
#define RTC15_CONTROL1_TEST_MASK   0x80
#define RTC15_CONTROL1_SR_NORMAL   0x00
#define RTC15_CONTROL1_SR_RESET   0x58
#define RTC15_CONTROL1_SR_MASK   0x58
#define RTC15_CONTROL1_STOP_NO_STOP   0x00
#define RTC15_CONTROL1_STOP_RTC_STOP   0x20
#define RTC15_CONTROL1_STOP_MASK   0x20
#define RTC15_CONTROL1_CIE_DIS   0x00
#define RTC15_CONTROL1_CIE_EN   0x04
#define RTC15_CONTROL1_CIE_MASK   0x04
#define RTC15_CONTROL1_12_24_24   0x00
#define RTC15_CONTROL1_12_24_12   0x02
#define RTC15_CONTROL1_12_24_MASK   0x02
#define RTC15_CONTROL2_AIE_DIS   0x00
 RTC 15 CONTROL2 register settings.
#define RTC15_CONTROL2_AIE_EN   0x80
#define RTC15_CONTROL2_AIE_MASK   0x80
#define RTC15_CONTROL2_AF_DIS   0x00
#define RTC15_CONTROL2_AF_EN   0x40
#define RTC15_CONTROL2_AF_MASK   0x40
#define RTC15_CONTROL2_MI_DIS   0x00
#define RTC15_CONTROL2_MI_EN   0x20
#define RTC15_CONTROL2_MI_MASK   0x20
#define RTC15_CONTROL2_HMI_DIS   0x00
#define RTC15_CONTROL2_HMI_EN   0x10
#define RTC15_CONTROL2_HMI_MASK   0x10
#define RTC15_CONTROL2_TF_DIS   0x00
#define RTC15_CONTROL2_TF_EN   0x08
#define RTC15_CONTROL2_TF_MASK   0x08
#define RTC15_CONTROL2_FD_32_768KHZ   0x00
#define RTC15_CONTROL2_FD_16_384KHZ   0x01
#define RTC15_CONTROL2_FD_8_192KHZ   0x02
#define RTC15_CONTROL2_FD_4_096KHZ   0x03
#define RTC15_CONTROL2_FD_2_048KHZ   0x04
#define RTC15_CONTROL2_FD_1_024KHZ   0x05
#define RTC15_CONTROL2_FD_1HZ   0x06
#define RTC15_CONTROL2_FD_LOW   0x07
#define RTC15_CONTROL2_FD_MASK   0x07
#define RTC15_OFFSET_MODE_NORMAL   0x00
 RTC 15 OFFSET register settings.
#define RTC15_OFFSET_MODE_FAST   0x80
#define RTC15_OFFSET_MODE_MASK   0x80
#define RTC15_OFFSET_OFFSET_MASK   0x7F
#define RTC15_TIMER_VALUE_DEFAULT   0x01
 RTC 15 TIMER_VALUE register settings.
#define RTC15_TIMER_MODE_TD_4_096KHZ   0x00
 RTC 15 TIMER_MODE register settings.
#define RTC15_TIMER_MODE_TD_64HZ   0x08
#define RTC15_TIMER_MODE_TD_1HZ   0x10
#define RTC15_TIMER_MODE_TD_1_OVER_64HZ   0x18
#define RTC15_TIMER_MODE_TD_MASK   0x18
#define RTC15_TIMER_MODE_TE_DIS   0x00
#define RTC15_TIMER_MODE_TE_EN   0x04
#define RTC15_TIMER_MODE_TE_MASK   0x04
#define RTC15_TIMER_MODE_TIE_DIS   0x00
#define RTC15_TIMER_MODE_TIE_EN   0x02
#define RTC15_TIMER_MODE_TIE_MASK   0x02
#define RTC15_TIMER_MODE_TI_TP_INTERVAL   0x00
#define RTC15_TIMER_MODE_TI_TP_PULSE   0x01
#define RTC15_TIMER_MODE_TI_TP_MASK   0x01
#define RTC15_MONDAY   0x00
 RTC 15 day of week values.
#define RTC15_TUESDAY   0x01
#define RTC15_WEDNESDAY   0x02
#define RTC15_THURSDAY   0x03
#define RTC15_FRIDAY   0x04
#define RTC15_SATURDAY   0x05
#define RTC15_SUNDAY   0x06
#define RTC15_DUMMY_RAM   0xA5
 RTC 15 dummy RAM data for communication check.
#define RTC15_DEVICE_ADDRESS   0x51
 RTC 15 device address setting.
#define RTC15_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  rtc15_return_value_t { RTC15_OK = 0 , RTC15_ERROR = -1 }
 RTC 15 Click return value data. More...

Functions

void rtc15_cfg_setup (rtc15_cfg_t *cfg)
 RTC 15 configuration object setup function.
err_t rtc15_init (rtc15_t *ctx, rtc15_cfg_t *cfg)
 RTC 15 initialization function.
err_t rtc15_default_cfg (rtc15_t *ctx)
 RTC 15 default configuration function.
err_t rtc15_write_regs (rtc15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 15 write multiple registers function.
err_t rtc15_read_regs (rtc15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 15 read multiple registers function.
err_t rtc15_write_reg (rtc15_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 15 write single register function.
err_t rtc15_read_reg (rtc15_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 15 read single register function.
void rtc15_enable_device (rtc15_t *ctx)
 RTC 15 enable device function.
void rtc15_disable_device (rtc15_t *ctx)
 RTC 15 disable device function.
void rtc15_enable_clkout (rtc15_t *ctx)
 RTC 15 enable clock output function.
void rtc15_disable_clkout (rtc15_t *ctx)
 RTC 15 disable clock output function.
uint8_t rtc15_get_int_pin (rtc15_t *ctx)
 RTC 15 get interrupt pin function.
err_t rtc15_check_communication (rtc15_t *ctx)
 RTC 15 check communication function.
err_t rtc15_set_time (rtc15_t *ctx, rtc15_time_t *time)
 RTC 15 set time function.
err_t rtc15_read_time (rtc15_t *ctx, rtc15_time_t *time)
 RTC 15 read time function.
err_t rtc15_set_date (rtc15_t *ctx, rtc15_date_t *date)
 RTC 15 set date function.
err_t rtc15_read_date (rtc15_t *ctx, rtc15_date_t *date)
 RTC 15 read date function.

Detailed Description

This file contains API for RTC 15 Click Driver.

Enumeration Type Documentation

◆ rtc15_return_value_t

RTC 15 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC15_OK 
RTC15_ERROR