vtohz3 2.0.0.0
|
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. | |
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.
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.
[out] | cfg | : Click configuration structure. See vtohz3_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See vtohz3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See vtohz3_t object definition for detailed explanation. |
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.
[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). |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See vtohz3_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See vtohz3_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See vtohz3_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See vtohz3_t object definition for detailed explanation. |
[in] | freq | : Frequency in Hz. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.