digipot2
2.0.0.0
|
Functions | |
void | digipot2_cfg_setup (digipot2_cfg_t *cfg) |
Config Object Initialization function. More... | |
DIGIPOT2_RETVAL | digipot2_init (digipot2_t *ctx, digipot2_cfg_t *cfg) |
Initialization function. More... | |
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. More... | |
void | digipot2_write_byte (digipot2_t *ctx, uint8_t command, uint8_t write_data) |
Generic write 8-bit data function. More... | |
void | digipot2_set_wiper_positions (digipot2_t *ctx, uint8_t wiper_positions) |
Set 8-bit wiper positions. More... | |
float | digipot2_convert_output (digipot2_t *ctx, uint16_t value_adc, float v_ref) |
Convert ADC value to volatage. More... | |
void digipot2_cfg_setup | ( | digipot2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
float digipot2_convert_output | ( | digipot2_t * | ctx, |
uint16_t | value_adc, | ||
float | v_ref | ||
) |
Convert ADC value to volatage.
ctx | Click object. |
value_adc | 10-bit ADC value. |
v_ref | Voltage Reference 3.3V or 5V. |
Convert 10-bit ADC value to volatage.
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.
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 |
Generic SPI transfer, for sending and receiving packages
DIGIPOT2_RETVAL digipot2_init | ( | digipot2_t * | ctx, |
digipot2_cfg_t * | cfg | ||
) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void digipot2_set_wiper_positions | ( | digipot2_t * | ctx, |
uint8_t | wiper_positions | ||
) |
Set 8-bit wiper positions.
ctx | Click object. |
wiper_positions | 8-bit wiper positions data. |
Function set 8-bit wiper positions data via SPI on the TPL0501 chip register.
void digipot2_write_byte | ( | digipot2_t * | ctx, |
uint8_t | command, | ||
uint8_t | write_data | ||
) |
Generic write 8-bit data function.
ctx | Click object. |
command | 8-bit data address command. |
write_data | 8-bit data to write. |
Function write 8-bit data via SPI on the TPL0501 chip register.