Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define RTC14_REG_SC 0x00
60 #define RTC14_REG_MN 0x01
61 #define RTC14_REG_HR 0x02
62 #define RTC14_REG_DT 0x03
63 #define RTC14_REG_MO 0x04
64 #define RTC14_REG_YR 0x05
65 #define RTC14_REG_DW 0x06
66 #define RTC14_REG_SR 0x07
67 #define RTC14_REG_INT 0x08
68 #define RTC14_REG_ATR 0x0A
69 #define RTC14_REG_DTR 0x0B
70 #define RTC14_REG_SCA 0x0C
71 #define RTC14_REG_MNA 0x0D
72 #define RTC14_REG_HRA 0x0E
73 #define RTC14_REG_DTA 0x0F
74 #define RTC14_REG_MOA 0x10
75 #define RTC14_REG_DWA 0x11
76 #define RTC14_REG_USR1 0x12
77 #define RTC14_REG_USR2 0x13
78 #define RTC14_REG_SCT 0x14
79 #define RTC14_REG_MNT 0x15
80 #define RTC14_REG_HRT 0x16
81 #define RTC14_REG_DTT 0x17
82 #define RTC14_REG_MOT 0x18
83 #define RTC14_REG_YRT 0x19
101 #define RTC14_SET_HOURS_FORMAT_12 0x00
102 #define RTC14_SET_HOURS_FORMAT_24 0x80
103 #define RTC14_SET_HOURS_FORMAT_12_AM 0x00
104 #define RTC14_SET_HOURS_FORMAT_12_PM 0x20
105 #define RTC14_SET_ALARM_ENABLE 0x80
106 #define RTC14_SET_INT_ENABLE 0x40
107 #define RTC14_SET_SOFT_RESET 0x80
108 #define RTC14_SET_ENABLE_WRTC 0x10
114 #define RTC14_DW_SUNDAY 0x00
115 #define RTC14_DW_MONDAY 0x01
116 #define RTC14_DW_TUESDAY 0x02
117 #define RTC14_DW_WEDNESDAY 0x03
118 #define RTC14_DW_THURSDAY 0x04
119 #define RTC14_DW_FRIDAY 0x05
120 #define RTC14_DW_SATURDAY 0x06
127 #define RTC14_SET_DEV_ADDR 0x6F
145 #define RTC14_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
147 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
148 cfg.fo = MIKROBUS( mikrobus, MIKROBUS_AN ); \
149 cfg.ein = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
150 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
166 digital_in_t int_pin;
172 uint8_t slave_address;
200 uint8_t hours_format;
err_t rtc14_write_sram(rtc14_t *ctx, uint16_t sram_data_in)
RTC 14 write SRAM function.
err_t rtc14_generic_write(rtc14_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
RTC 14 I2C writing function.
err_t rtc14_generic_read(rtc14_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
RTC 14 I2C reading function.
uint8_t rtc14_get_interrupt(rtc14_t *ctx)
RTC 14 get interrupt function.
err_t rtc14_get_time(rtc14_t *ctx, rtc14_time_t *rtc_time)
RTC 14 get time function.
rtc14_return_value_t
RTC 14 Click return value data.
Definition: rtc14.h:255
err_t rtc14_get_time_stamp(rtc14_t *ctx, rtc14_time_stamp_t *rtc_time_stamp)
RTC 14 get time stamp function.
err_t rtc14_get_alarm(rtc14_t *ctx, rtc14_alarm_t *rtc_alarm)
RTC 14 get alarm function.
err_t rtc14_init(rtc14_t *ctx, rtc14_cfg_t *cfg)
RTC 14 initialization function.
err_t rtc14_get_date(rtc14_t *ctx, rtc14_date_t *rtc_date)
RTC 14 get date function.
uint8_t rtc14_get_fout(rtc14_t *ctx)
RTC 14 get fout function.
err_t rtc14_set_alarm(rtc14_t *ctx, rtc14_alarm_t rtc_alarm)
RTC 14 set alarm function.
err_t rtc14_set_time(rtc14_t *ctx, rtc14_time_t rtc_time)
RTC 14 set time function.
RTC 14 Click alarm object.
Definition: rtc14.h:225
RTC 14 Click context object.
Definition: rtc14.h:158
RTC 14 Click time object.
Definition: rtc14.h:197
RTC 14 Click configuration object.
Definition: rtc14.h:179
void rtc14_trigger_time_stamp(rtc14_t *ctx)
RTC 14 trigger time stamp function.
err_t rtc14_default_cfg(rtc14_t *ctx)
RTC 14 default configuration function.
RTC 14 Click time stamp object.
Definition: rtc14.h:240
err_t rtc14_set_date(rtc14_t *ctx, rtc14_date_t rtc_date)
RTC 14 set date function.
err_t rtc14_soft_reset(rtc14_t *ctx)
RTC 14 soft reset function.
RTC 14 Click date object.
Definition: rtc14.h:211
err_t rtc14_enable_rtc(rtc14_t *ctx)
RTC 14 enable RTC function.
err_t rtc14_read_sram(rtc14_t *ctx, uint16_t *sram_data_out)
RTC 14 I2C reading SRAM function.
void rtc14_cfg_setup(rtc14_cfg_t *cfg)
RTC 14 configuration object setup function.