rtc7 2.0.0.0
Public function

Functions

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

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_interrupt()

uint8_t rtc7_check_interrupt ( rtc7_t * ctx)

Interrupt Check function.

Parameters
ctxClick object.

This function returns the interrupt state, state of INTA pin.

◆ 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_generic_read()

err_t 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()

err_t 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()

err_t 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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function gets the gmt time data.

◆ rtc7_get_local_time()

err_t 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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function gets the local time data including the determined time zone in calculations.

◆ rtc7_init()

err_t rtc7_init ( rtc7_t * ctx,
rtc7_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ rtc7_init_time()

err_t rtc7_init_time ( rtc7_t * ctx,
int8_t time_zone )

Initialization function.

Parameters
ctxClick object.
time_zoneDetermines the local time zone (from 14 to -12).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function performs the device initialization.

◆ rtc7_read_reg()

err_t rtc7_read_reg ( rtc7_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Read one byte function.

Parameters
ctxClick object.
regAddress which from data be read.
data_outBuffer where data be stored.
lenNumber of bytes to be read.

This function writes one byte data to the register.

◆ rtc7_reset()

err_t rtc7_reset ( rtc7_t * ctx)

Reset function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function performs the device reset.

◆ rtc7_set_gmt_time()

err_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function sets the gmt time to desired value.

◆ rtc7_set_osc()

err_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function performs the oscillator to be configured and enabled.

◆ rtc7_set_timer()

err_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function performs the timer to be configured and enabled.

◆ rtc7_write_reg()

err_t rtc7_write_reg ( rtc7_t * ctx,
uint8_t reg,
uint8_t data_in )

Write one byte function.

Parameters
ctxClick object.
regAddress where data be written.
data_inData to be written.

This function writes one byte data to the register.