digipot
2.0.0.0
|
Functions | |
void | digipot_cfg_setup (digipot_cfg_t *cfg) |
Config Object Initialization function. More... | |
DIGIPOT_RETVAL | digipot_init (digipot_t *ctx, digipot_cfg_t *cfg) |
Initialization function. More... | |
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. More... | |
void | digipot_set_wiper_positions (digipot_t *ctx, uint8_t wiper_pos) |
Set wiper position. More... | |
float | digipot_convert_output (uint16_t adc_val, float v_ref) |
Convert ADC value to volatage. More... | |
void digipot_cfg_setup | ( | digipot_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
float digipot_convert_output | ( | uint16_t | adc_val, |
float | v_ref | ||
) |
Convert ADC value to volatage.
adc_val | 10-bit ADC value. |
wiper_pos | float voltage reference: 3.3V or 5V. |
@description The function convert 10-bit ADC value to volatage reference.
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.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
DIGIPOT_RETVAL digipot_init | ( | digipot_t * | ctx, |
digipot_cfg_t * | cfg | ||
) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void digipot_set_wiper_positions | ( | digipot_t * | ctx, |
uint8_t | wiper_pos | ||
) |
Set wiper position.
ctx | Click object. |
wiper_pos | uint8_t wiper positions data. |
@description The function sets 8-bit wiper positions data.