rtc9 2.0.0.0
rtc9.h File Reference

This file contains API for RTC 9 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  rtc9_set_data_t
 
struct  rtc9_get_time_t
 
struct  rtc9_get_date_t
 
struct  rtc9_t
 Click ctx object definition. More...
 
struct  rtc9_cfg_t
 Click configuration structure definition. More...
 

Macros

#define RTC9_MAP_MIKROBUS(cfg, mikrobus)
 
#define RTC9_RETVAL   uint8_t
 
#define RTC9_OK   0x00
 
#define RTC9_INIT_ERROR   0xFF
 
#define RTC9_SLAVE_ADDRESS   0x68
 
#define RTC9_REG_PART_SECONDS   0x00
 
#define RTC9_REG_SECONDS   0x01
 
#define RTC9_REG_MINUTES   0x02
 
#define RTC9_REG_CENTURY_HOURS   0x03
 
#define RTC9_REG_DAY   0x04
 
#define RTC9_REG_DATE   0x05
 
#define RTC9_REG_MONTH   0x06
 
#define RTC9_REG_YEAR   0x07
 
#define RTC9_REG_DIGITAL_CALIBRATION   0x08
 
#define RTC9_REG_WATCHDOG   0x09
 
#define RTC9_REG_ALARM1_MONTH   0x0A
 
#define RTC9_REG_ALARM1_DATE   0x0B
 
#define RTC9_REG_ALARM1_HOUR   0x0C
 
#define RTC9_REG_ALARM1_MINUTES   0x0D
 
#define RTC9_REG_ALARM1_SECONDS   0x0E
 
#define RTC9_REG_FLAGS   0x0F
 
#define RTC9_REG_TIMER_VALUE   0x10
 
#define RTC9_REG_TIMER_CONTROL   0x11
 
#define RTC9_REG_ANALOG_CALIBRATION   0x12
 
#define RTC9_REG_SQW   0x13
 
#define RTC9_REG_ALARM2_MONTH   0x14
 
#define RTC9_REG_ALARM2_DATE   0x15
 
#define RTC9_REG_ALARM2_HOUR   0x16
 
#define RTC9_REG_ALARM2_MINUTES   0x17
 
#define RTC9_REG_ALARM2_SECONDS   0x18
 
#define RTC9_FLAG_WATCHDOG_ENABLE   0x80
 
#define RTC9_FLAG_WATCHDOG_DISABLE   0x00
 
#define RTC9_FLAG_ALARM_1_ENABLE   0x40
 
#define RTC9_FLAG_ALARM_1_DISABLE   0x00
 
#define RTC9_FLAG_ALARM_2_ENABLE   0x20
 
#define RTC9_FLAG_ALARM_2_DISABLE   0x00
 
#define RTC9_FLAG_BATTERY_LOW_ENABLE   0x10
 
#define RTC9_FLAG_BATTERY_LOW_DISABLE   0x00
 
#define RTC9_FLAG_TIMER_ENABLE   0x08
 
#define RTC9_FLAG_TIMER_DISABLE   0x00
 
#define RTC9_FLAG_OSCILATOR_FAIL_ENABLE   0x04
 
#define RTC9_FLAG_OSCILATOR_FAIL_DISABLE   0x00
 
#define RTC9_TIMER_CONTROL_ENABLE   0x80
 
#define RTC9_TIMER_CONTROL_DISABLE   0x00
 
#define RTC9_TIMER_CONTROL_NORMAL_INT   0x00
 
#define RTC9_TIMER_CONTROL_FREE_RUNNING_INT   0x40
 
#define RTC9_TIMER_CONTROL_INT_OUT_ASSERT   0x20
 
#define RTC9_TIMER_CONTROL_INT_OUT_DE_ASSERT   0x00
 
#define RTC9_TIMER_CONTROL_TIMER_SOURCE_FREQ_244p1_US   0x00
 
#define RTC9_TIMER_CONTROL_TIMER_SOURCE_FREQ_15p6_MS   0x01
 
#define RTC9_TIMER_CONTROL_TIMER_SOURCE_FREQ_1_S   0x02
 
#define RTC9_TIMER_CONTROL_TIMER_SOURCE_FREQ_60_S   0x03
 
#define RTC9_ANALOG_CALIBRATION_OSCILATOR_FREQ_NORMAL   0x00
 
#define RTC9_ANALOG_CALIBRATION_OSCILATOR_FREQ_SLOW   0x27
 
#define RTC9_ANALOG_CALIBRATION_OSCILATOR_FREQ_FAST   0xC8
 
#define RTC9_DIGITAL_CALIBRATION_POSITIVE   0x20
 
#define RTC9_DIGITAL_CALIBRATION_NEGATIVE   0x00
 
#define RTC9_DIGITAL_CALIBRATION_FREQ_TEST_ENABLED   0x40
 
#define RTC9_DIGITAL_CALIBRATION_FREQ_TEST_DISABLED   0x00
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_0   0x00
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_1   0x01
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_2   0x02
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_3   0x03
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_4   0x04
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_5   0x05
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_6   0x06
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_7   0x07
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_8   0x08
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_9   0x09
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_10   0x0A
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_11   0x0B
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_12   0x0C
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_13   0x0D
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_14   0x0E
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_15   0x0F
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_16   0x10
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_17   0x11
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_18   0x12
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_19   0x13
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_20   0x14
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_21   0x15
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_22   0x16
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_23   0x17
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_24   0x18
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_25   0x19
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_26   0x1A
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_27   0x1B
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_28   0x1C
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_29   0x1D
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_30   0x1E
 
#define RTC9_DIGITAL_CALIBRATION_VALUE_31   0x1F
 
#define RTC9_WATCHDOG_OSCILATOR_FAIL_ENABLED   0x80
 
#define RTC9_WATCHDOG_OSCILATOR_FAIL_DISABLED   0x00
 
#define RTC9_WATCHDOG_RESOLUTION_1_DIV_16_SEC   0x00
 
#define RTC9_WATCHDOG_RESOLUTION_1_DIV_4_SEC   0x01
 
#define RTC9_WATCHDOG_RESOLUTION_1_SEC   0x02
 
#define RTC9_WATCHDOG_RESOLUTION_4_SEC   0x03
 
#define RTC9_MONTH_JANUARY   0x01
 
#define RTC9_MONTH_FEBRUARY   0x02
 
#define RTC9_MONTH_MARCH   0x03
 
#define RTC9_MONTH_APRIL   0x04
 
#define RTC9_MONTH_MAY   0x05
 
#define RTC9_MONTH_JUNE   0x06
 
#define RTC9_MONTH_JULY   0x07
 
#define RTC9_MONTH_AUGUST   0x08
 
#define RTC9_MONTH_SEPTEMBER   0x09
 
#define RTC9_MONTH_OCTOBER   0x0A
 
#define RTC9_MONTH_NOVEMBER   0x0B
 
#define RTC9_MONTH_DECEMBER   0x0C
 
#define RTC9_DAY_SUNDAY   0x01
 
#define RTC9_DAY_MONDAY   0x02
 
#define RTC9_DAY_TUESDAY   0x03
 
#define RTC9_DAY_WEDNESDAY   0x04
 
#define RTC9_DAY_THURSDAY   0x05
 
#define RTC9_DAY_FRIDAY   0x06
 
#define RTC9_DAY_SATURDAY   0x07
 

Functions

void rtc9_cfg_setup (rtc9_cfg_t *cfg)
 Config Object Initialization function.
 
RTC9_RETVAL rtc9_init (rtc9_t *ctx, rtc9_cfg_t *cfg)
 Initialization function.
 
void rtc9_generic_write (rtc9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void rtc9_generic_read (rtc9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void rtc9_wakeup (rtc9_t *ctx)
 Wake-up process.
 
void rtc9_software_reset (rtc9_t *ctx)
 Software reset.
 
void rtc9_hardware_reset (rtc9_t *ctx)
 Hardware reset.
 
void rtc9_set_time (rtc9_t *ctx, uint8_t hour, uint8_t min, uint8_t sec)
 Set new time - 24 hour format.
 
void rtc9_set_date (rtc9_t *ctx, rtc9_set_data_t *set_data)
 Set new date.
 
void rtc9_get_time (rtc9_t *ctx, rtc9_get_time_t *get_time)
 Get new time - 24 hour format.
 
void rtc9_get_date (rtc9_t *ctx, rtc9_get_date_t *get_data)
 Get new date.
 
char * rtc9_current_month (uint8_t month)
 Month in the String format.
 
char * rtc9_current_day_of_week (uint8_t day_of_week)
 Day of Week in the String format.
 
void rtc9_set_alarm_time (rtc9_t *ctx, uint8_t hour, uint8_t min, uint8_t sec)
 Set new ALARM 1 time - 24 hour format.
 
void rtc9_set_alarm_date (rtc9_t *ctx, uint8_t day, uint8_t month, uint8_t year)
 Set new ALARM 1 date.
 
void rtc9_read_flag_status (rtc9_t *ctx, uint8_t *read_data)
 Reads FLAGS regiter.
 

Detailed Description

This file contains API for RTC 9 Click driver.