rtc7  2.0.0.0
Functions
Public function

Functions

void rtc7_cfg_setup (rtc7_cfg_t *cfg)
 Config Object Initialization function. More...
 
RTC7_RETVAL rtc7_init (rtc7_t *ctx, rtc7_cfg_t *cfg)
 Initialization function. More...
 
void rtc7_generic_write (rtc7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void rtc7_generic_read (rtc7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint8_t rtc7_write_reg (rtc7_t *ctx, uint8_t register_address, uint8_t transfer_data)
 Write one byte function. More...
 
uint8_t rtc7_read_reg (rtc7_t *ctx, uint8_t register_address, uint8_t n_bytes, uint8_t *data_out)
 Read one byte function. More...
 
uint8_t rtc7_init_time (rtc7_t *ctx, int8_t time_zone, uint8_t time_mode)
 Initialization function. More...
 
void rtc7_enable_dst (rtc7_t *ctx)
 Distance Enable function. More...
 
void rtc7_disable_dst (rtc7_t *ctx)
 Distance Disable function. More...
 
uint8_t rtc7_set_osc (rtc7_t *ctx, uint8_t enable_osc, uint8_t clk_in, uint8_t clk_out)
 Oscillator Set function. More...
 
uint8_t rtc7_set_timer (rtc7_t *ctx, uint8_t enable_timer, uint8_t timer_freq)
 Timer Set function. More...
 
void rtc7_reset (rtc7_t *ctx)
 Reset function. More...
 
void rtc7_get_gmt_time (rtc7_t *ctx, rtc7_time_t *gmt_time)
 Get Gmt Time function. More...
 
void rtc7_get_local_time (rtc7_t *ctx, rtc7_time_t *local_time)
 Get Local Time function. More...
 
uint8_t rtc7_set_gmt_time (rtc7_t *ctx, rtc7_time_t *time)
 Set Gmt Time function. More...
 
uint8_t rtc7_check_interr (rtc7_t *ctx)
 Interrupt Check function. More...
 
uint8_t rtc7_check_psw (rtc7_t *ctx)
 Power Switch Control function. More...
 

Detailed Description

Function Documentation

◆ rtc7_cfg_setup()

void rtc7_cfg_setup ( rtc7_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ rtc7_check_interr()

uint8_t rtc7_check_interr ( rtc7_t ctx)

Interrupt Check function.

Parameters
ctxClick object.

This function checks the interrupt state, state of INTA pin. This pin also can be used as input for external clock.

◆ rtc7_check_psw()

uint8_t rtc7_check_psw ( rtc7_t ctx)

Power Switch Control function.

Parameters
ctxClick object.

This function checks the state of Power Switch Control output pin.

◆ rtc7_disable_dst()

void rtc7_disable_dst ( rtc7_t ctx)

Distance Disable function.

Parameters
ctxClick object.

This function doesn't include time distance measurement in calculations.

◆ rtc7_enable_dst()

void rtc7_enable_dst ( rtc7_t ctx)

Distance Enable function.

Parameters
ctxClick object.

This function includes time distance measurement in calculations.

◆ rtc7_generic_read()

void rtc7_generic_read ( rtc7_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

This function reads data from the desired register.

◆ rtc7_generic_write()

void rtc7_generic_write ( rtc7_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

This function writes data to the desired register.

◆ rtc7_get_gmt_time()

void rtc7_get_gmt_time ( rtc7_t ctx,
rtc7_time_t gmt_time 
)

Get Gmt Time function.

Parameters
ctxClick object.
gmt_timeStructure where time data be stored.

This function gets the gmt time data in both time formats.

◆ rtc7_get_local_time()

void rtc7_get_local_time ( rtc7_t ctx,
rtc7_time_t local_time 
)

Get Local Time function.

Parameters
ctxClick object.
local_timeStructure where local time data be stored.

This function gets the local time data including the determined time zone in calculations. Function gets time data in both time formats.

◆ rtc7_init()

RTC7_RETVAL rtc7_init ( rtc7_t ctx,
rtc7_cfg_t cfg 
)

Initialization function.

Parameters
rtc7Click object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ rtc7_init_time()

uint8_t rtc7_init_time ( rtc7_t ctx,
int8_t  time_zone,
uint8_t  time_mode 
)

Initialization function.

Parameters
ctxClick object.
time_zoneDetermines the local time zone (from 14 to -12).
time_mode0x00 - 24 hours format, 0x40 - 12 hours format.

This function performs the device initialization.

◆ rtc7_read_reg()

uint8_t rtc7_read_reg ( rtc7_t ctx,
uint8_t  register_address,
uint8_t  n_bytes,
uint8_t *  data_out 
)

Read one byte function.

Parameters
ctxClick object.
register_addressAddress which from data be read.
n_bytesNumber of bytes to be read.
data_outBuffer where data be stored.

This function writes one byte data to the register.

◆ rtc7_reset()

void rtc7_reset ( rtc7_t ctx)

Reset function.

Parameters
ctxClick object.

This function performs the device reset.

◆ rtc7_set_gmt_time()

uint8_t rtc7_set_gmt_time ( rtc7_t ctx,
rtc7_time_t time 
)

Set Gmt Time function.

Parameters
ctxClick object.
timeStructure which from time data be written.

This function sets the gmt time to desired value.

◆ rtc7_set_osc()

uint8_t rtc7_set_osc ( rtc7_t ctx,
uint8_t  enable_osc,
uint8_t  clk_in,
uint8_t  clk_out 
)

Oscillator Set function.

Parameters
ctxClick object.
enable_osc0x00 - enable osc, 0x08 - disable osc.
clk_inDetermines the input frequency.
clk_outDetermines the output frequency.

This function performs the oscillator to be configured and enabled.

◆ rtc7_set_timer()

uint8_t rtc7_set_timer ( rtc7_t ctx,
uint8_t  enable_timer,
uint8_t  timer_freq 
)

Timer Set function.

Parameters
ctxClick object.
enable_timer0x00 - disable timer, 0x10 - enable timer.
timer_freqDetermines the timer frequency.

This function performs the timer to be configured and enabled.

◆ rtc7_write_reg()

uint8_t rtc7_write_reg ( rtc7_t ctx,
uint8_t  register_address,
uint8_t  transfer_data 
)

Write one byte function.

Parameters
ctxClick object.
register_addressAddress where data be written.
transfer_dataData to be written.

This function writes one byte data to the register.