digipot2 2.0.0.0
|
API for configuring and manipulating DIGI POT 2 Click driver. More...
Topics | |
DIGI POT 2 MikroBUS Map | |
MikroBUS pin mapping of DIGI POT 2 Click driver. | |
DIGI POT 2 Macros | |
Macros of Click driver. | |
Functions | |
void | digipot2_cfg_setup (digipot2_cfg_t *cfg) |
DIGI POT 2 configuration object setup function. | |
err_t | digipot2_init (digipot2_t *ctx, digipot2_cfg_t *cfg) |
DIGI POT 2 initialization function. | |
void | digipot2_generic_transfer (digipot2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | digipot2_set_wiper_positions (digipot2_t *ctx, uint8_t wiper_pos) |
Set wiper position. | |
float | digipot2_convert_output (uint16_t adc_val, float v_ref) |
Convert ADC value to volatage. | |
API for configuring and manipulating DIGI POT 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void digipot2_cfg_setup | ( | digipot2_cfg_t * | cfg | ) |
DIGI POT 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See digipot2_cfg_t object definition for detailed explanation. |
float digipot2_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 digipot2_generic_transfer | ( | digipot2_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 digipot2_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 digipot2_init | ( | digipot2_t * | ctx, |
digipot2_cfg_t * | cfg ) |
DIGI POT 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See digipot2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See digipot2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void digipot2_set_wiper_positions | ( | digipot2_t * | ctx, |
uint8_t | wiper_pos ) |
Set wiper position.
The function sets 8-bit wiper positions data.
[in] | ctx | : Click context object. See digipot2_t object definition for detailed explanation. |
[out] | wiper_pos | : uint8_t wiper positions data. |