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

This file contains API for RTC 24 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  rtc24_t
 RTC 24 Click context object. More...
struct  rtc24_cfg_t
 RTC 24 Click configuration object. More...
struct  rtc24_time_t
 RTC 24 Click time object. More...
struct  rtc24_date_t
 RTC 24 Click date object. More...

Macros

#define RTC24_REG_SECONDS   0x00
 RTC 24 register list.
#define RTC24_REG_MINUTES   0x01
#define RTC24_REG_HOURS   0x02
#define RTC24_REG_DAY   0x03
#define RTC24_REG_DATE   0x04
#define RTC24_REG_MONTH   0x05
#define RTC24_REG_YEAR   0x06
#define RTC24_REG_CONTROL   0x07
#define RTC24_REG_RAM_START   0x08
#define RTC24_REG_RAM_END   0x3F
#define RTC24_CONTROL_OUT_LOW   0x00
 RTC 24 CONTROL register setting.
#define RTC24_CONTROL_OUT_HIGH   0x80
#define RTC24_CONTROL_OUT_MASK   0x80
#define RTC24_CONTROL_SQWE_DIS   0x00
#define RTC24_CONTROL_SQWE_EN   0x10
#define RTC24_CONTROL_SQWE_MASK   0x10
#define RTC24_CONTROL_RS_1HZ   0x00
#define RTC24_CONTROL_RS_4_096KHZ   0x01
#define RTC24_CONTROL_RS_8_192KHZ   0x02
#define RTC24_CONTROL_RS_32_768KHZ   0x03
#define RTC24_CONTROL_RS_MASK   0x03
#define RTC24_MONDAY   0x00
 RTC 24 day of week values.
#define RTC24_TUESDAY   0x01
#define RTC24_WEDNESDAY   0x02
#define RTC24_THURSDAY   0x03
#define RTC24_FRIDAY   0x04
#define RTC24_SATURDAY   0x05
#define RTC24_SUNDAY   0x06
#define RTC24_DUMMY_RAM   0xA5
 RTC 24 dummy RAM data for communication check.
#define RTC24_DEVICE_ADDRESS   0x68
 RTC 24 device address setting.
#define RTC24_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  rtc24_return_value_t { RTC24_OK = 0 , RTC24_ERROR = -1 }
 RTC 24 Click return value data. More...

Functions

void rtc24_cfg_setup (rtc24_cfg_t *cfg)
 RTC 24 configuration object setup function.
err_t rtc24_init (rtc24_t *ctx, rtc24_cfg_t *cfg)
 RTC 24 initialization function.
err_t rtc24_default_cfg (rtc24_t *ctx)
 RTC 24 default configuration function.
err_t rtc24_write_regs (rtc24_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 RTC 24 write multiple registers function.
err_t rtc24_read_regs (rtc24_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 RTC 24 read multiple registers function.
err_t rtc24_write_reg (rtc24_t *ctx, uint8_t reg, uint8_t data_in)
 RTC 24 write single register function.
err_t rtc24_read_reg (rtc24_t *ctx, uint8_t reg, uint8_t *data_out)
 RTC 24 read single register function.
uint8_t rtc24_get_sqw_pin (rtc24_t *ctx)
 RTC 24 get square wave pin function.
err_t rtc24_check_communication (rtc24_t *ctx)
 RTC 24 check communication function.
err_t rtc24_set_time (rtc24_t *ctx, rtc24_time_t *time)
 RTC 24 set time function.
err_t rtc24_read_time (rtc24_t *ctx, rtc24_time_t *time)
 RTC 24 read time function.
err_t rtc24_set_date (rtc24_t *ctx, rtc24_date_t *date)
 RTC 24 set date function.
err_t rtc24_read_date (rtc24_t *ctx, rtc24_date_t *date)
 RTC 24 read date function.

Detailed Description

This file contains API for RTC 24 Click Driver.

Enumeration Type Documentation

◆ rtc24_return_value_t

RTC 24 Click return value data.

Predefined enum values for driver return values.

Enumerator
RTC24_OK 
RTC24_ERROR