digipot 2.0.0.0
|
API for configuring and manipulating DIGI POT Click driver. More...
Topics | |
DIGI POT MikroBUS Map | |
MikroBUS pin mapping of DIGI POT Click driver. | |
DIGI POT Macros | |
Macros of Click driver. | |
Functions | |
void | digipot_cfg_setup (digipot_cfg_t *cfg) |
DIGI POT configuration object setup function. | |
err_t | digipot_init (digipot_t *ctx, digipot_cfg_t *cfg) |
DIGI POT initialization function. | |
void | digipot_generic_transfer (digipot_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | digipot_set_wiper_positions (digipot_t *ctx, uint8_t wiper_pos) |
Set wiper position. | |
float | digipot_convert_output (uint16_t adc_val, float v_ref) |
Convert ADC value to volatage. | |
API for configuring and manipulating DIGI POT Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void digipot_cfg_setup | ( | digipot_cfg_t * | cfg | ) |
DIGI POT configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See digipot_cfg_t object definition for detailed explanation. |
float digipot_convert_output | ( | uint16_t | adc_val, |
float | v_ref ) |
Convert ADC value to volatage.
The function convert 10-bit ADC value to volatage reference.
[in] | adc_val | : 10-bit ADC value. |
[in] | wiper_pos | : float voltage reference: 3.3V or 5V. |
void digipot_generic_transfer | ( | digipot_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
Generic SPI transfer, for sending and receiving packages
[in] | ctx | : Click context object. See digipot_t object definition for detailed explanation. |
[in] | wr_buf | : Write data buffer |
[in] | wr_len | : Number of byte in write data buffer |
[out] | rd_buf | : Read data buffer |
[in] | rd_len | : Number of byte in read data buffer |
err_t digipot_init | ( | digipot_t * | ctx, |
digipot_cfg_t * | cfg ) |
DIGI POT initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See digipot_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See digipot_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.