clockgen2  2.0.0.0
Functions

Functions

void clockgen2_cfg_setup (clockgen2_cfg_t *cfg)
 Config Object Initialization function. More...
 
CLOCKGEN2_RETVAL clockgen2_init (clockgen2_t *ctx, clockgen2_cfg_t *cfg)
 Initialization function. More...
 
void clockgen2_generic_write (clockgen2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void clockgen2_generic_read (clockgen2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void clockgen2_set_dtr_pin (clockgen2_t *ctx, uint8_t state)
 Set dtr pin function. More...
 
void clockgen2_set_pdn_pin (clockgen2_t *ctx, uint8_t state)
 Set pdn pin function. More...
 
void clockgen2_set_oe_pin (clockgen2_t *ctx, uint8_t state)
 Set oe pin function. More...
 
void clockgen2_write (clockgen2_t *ctx, uint8_t w_reg, uint8_t w_data)
 Writing 1B function. More...
 
void clockgen2_set_prescaler (clockgen2_t *ctx, uint8_t val)
 Prescaler set function. More...
 
void clockgen2_change_address (clockgen2_t *ctx, uint8_t new_addr)
 Prescaler set function. More...
 
void clockgen2_store_config (clockgen2_t *ctx)
 Settings save function. More...
 
void clockgen2_auto_setting_preserve (clockgen2_t *ctx, uint8_t state)
 Auto setting preservation function. More...
 
void clockgen2_output_enable (clockgen2_t *ctx, uint8_t state)
 Settings save function. More...
 

Detailed Description

Function Documentation

◆ clockgen2_auto_setting_preserve()

void clockgen2_auto_setting_preserve ( clockgen2_t ctx,
uint8_t  state 
)

Auto setting preservation function.

Parameters
ctxClick object.
stateValue to comapre with Enable/Disable registers.

Function used for enabling/disabling auto settings preservation.

Note
This option needs to be disabled if the eeprom settings are changed very often to minimize the wear of the eeprom memory.

◆ clockgen2_cfg_setup()

void clockgen2_cfg_setup ( clockgen2_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.

◆ clockgen2_change_address()

void clockgen2_change_address ( clockgen2_t ctx,
uint8_t  new_addr 
)

Prescaler set function.

Parameters
ctxClick object.
new_addrNew slave address.

Function configures the clockgen2 slave address at runtime.

Note
User can chose between 7 differnet addresses. The default unshifted 7bit address is 0x58.

◆ clockgen2_generic_read()

void clockgen2_generic_read ( clockgen2_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.

◆ clockgen2_generic_write()

void clockgen2_generic_write ( clockgen2_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.

◆ clockgen2_init()

CLOCKGEN2_RETVAL clockgen2_init ( clockgen2_t ctx,
clockgen2_cfg_t cfg 
)

Initialization function.

Parameters
clockgen2Click object.
cfgClick configuration structure.

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

◆ clockgen2_output_enable()

void clockgen2_output_enable ( clockgen2_t ctx,
uint8_t  state 
)

Settings save function.

Parameters
ctxClick object.
statePin value.

Function for enabling/disabling of the clock output.

◆ clockgen2_set_dtr_pin()

void clockgen2_set_dtr_pin ( clockgen2_t ctx,
uint8_t  state 
)

Set dtr pin function.

Parameters
ctxClick object.
statePin state value.

Set the state of the DTR pin.

◆ clockgen2_set_oe_pin()

void clockgen2_set_oe_pin ( clockgen2_t ctx,
uint8_t  state 
)

Set oe pin function.

Parameters
ctxClick object.
statePin state value.

Set the state of the OE pin.

◆ clockgen2_set_pdn_pin()

void clockgen2_set_pdn_pin ( clockgen2_t ctx,
uint8_t  state 
)

Set pdn pin function.

Parameters
ctxClick object.
statePin state value.

Set the state of the PDN pin.

◆ clockgen2_set_prescaler()

void clockgen2_set_prescaler ( clockgen2_t ctx,
uint8_t  val 
)

Prescaler set function.

Parameters
ctxClick object.
valWrite address.

Function for setting the main clock prescaler.

Note
Prescaler range is from 0 - 8.

◆ clockgen2_store_config()

void clockgen2_store_config ( clockgen2_t ctx)

Settings save function.

Parameters
ctxClick object.

Function used for saving the settings to the eeprom if the the auto preserve settings is disabled.

◆ clockgen2_write()

void clockgen2_write ( clockgen2_t ctx,
uint8_t  w_reg,
uint8_t  w_data 
)

Writing 1B function.

Parameters
ctxClick object.
w_regWrite address.
w_dataData to be written.

Function for writing data to a specified register.