vtohz3 2.0.0.0
V to Hz 3 Click Driver

API for configuring and manipulating V to Hz 3 Click driver. More...

Topics

 V to Hz 3 Settings
 Settings for V to Hz 3 Click driver.
 
 V to Hz 3 MikroBUS Map
 MikroBUS pin mapping of V to Hz 3 Click driver.
 

Functions

void vtohz3_cfg_setup (vtohz3_cfg_t *cfg)
 V to Hz 3 configuration object setup function.
 
err_t vtohz3_init (vtohz3_t *ctx, vtohz3_cfg_t *cfg)
 V to Hz 3 initialization function.
 
err_t vtohz3_set_input_frequency (vtohz3_t *ctx, uint32_t freq)
 V to Hz 3 set input frequency function.
 
err_t vtohz3_disable_input_frequency (vtohz3_t *ctx)
 V to Hz 3 disable input frequency function.
 
void vtohz3_set_buf_pin (vtohz3_t *ctx, uint8_t state)
 V to Hz 3 set buf pin function.
 
uint8_t vtohz3_get_fout_pin (vtohz3_t *ctx)
 V to Hz 3 get fout pin function.
 
err_t vtohz3_read_an_pin_value (vtohz3_t *ctx, uint16_t *data_out)
 V to Hz 3 read AN pin value function.
 
err_t vtohz3_read_an_pin_voltage (vtohz3_t *ctx, float *data_out)
 V to Hz 3 read AN pin voltage level function.
 
uint32_t vtohz3_get_frequency (vtohz3_t *ctx, float voltage, float vref_in)
 V to Hz 3 get frequency function.
 

Detailed Description

API for configuring and manipulating V to Hz 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ vtohz3_cfg_setup()

void vtohz3_cfg_setup ( vtohz3_cfg_t * cfg)

V to Hz 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See vtohz3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ vtohz3_disable_input_frequency()

err_t vtohz3_disable_input_frequency ( vtohz3_t * ctx)

V to Hz 3 disable input frequency function.

This function disables the output frequency of the programmable oscillator, which is the AD7740 input frequency.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ vtohz3_get_fout_pin()

uint8_t vtohz3_get_fout_pin ( vtohz3_t * ctx)

V to Hz 3 get fout pin function.

This function returns the FOUT pin logic state.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ vtohz3_get_frequency()

uint32_t vtohz3_get_frequency ( vtohz3_t * ctx,
float voltage,
float vref_in )

V to Hz 3 get frequency function.

This function converts voltage to the estimated output frequency in Hz.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
[in]voltage: Voltage from AN pin.
[in]vref_in: AD7740 voltage reference input (2.5V if not connected).
Returns
Estimated output frequency in Hz.
Note
None.

◆ vtohz3_init()

err_t vtohz3_init ( vtohz3_t * ctx,
vtohz3_cfg_t * cfg )

V to Hz 3 initialization function.

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

Parameters
[out]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See vtohz3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ vtohz3_read_an_pin_value()

err_t vtohz3_read_an_pin_value ( vtohz3_t * ctx,
uint16_t * data_out )

V to Hz 3 read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ vtohz3_read_an_pin_voltage()

err_t vtohz3_read_an_pin_voltage ( vtohz3_t * ctx,
float * data_out )

V to Hz 3 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ vtohz3_set_buf_pin()

void vtohz3_set_buf_pin ( vtohz3_t * ctx,
uint8_t state )

V to Hz 3 set buf pin function.

This function sets the BUF pin state which is a buffered mode select pin.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ vtohz3_set_input_frequency()

err_t vtohz3_set_input_frequency ( vtohz3_t * ctx,
uint32_t freq )

V to Hz 3 set input frequency function.

This function enables and sets output frequency of the programmable oscillator, which is the AD7740 input frequency.

Parameters
[in]ctx: Click context object. See vtohz3_t object definition for detailed explanation.
[in]freq: Frequency in Hz.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The frequency is limited by the AD7740 Voltage-to-Frequency Converter to 32KHz as a minimal and 1MHz as a maximal input frequency.