slider 2.0.0.0
|
Functions | |
void | slider_cfg_setup (slider_cfg_t *cfg) |
Config Object Initialization function. | |
SLIDER_RETVAL | slider_init (slider_t *ctx, slider_cfg_t *cfg) |
Initialization function. | |
void | slider_default_cfg (slider_t *ctx) |
Click Default Configuration function. | |
void | slider_generic_transfer (slider_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint32_t | slider_read_adc (slider_t *ctx) |
ADC read function. | |
uint32_t | slider_read_adc_and_ready (slider_t *ctx) |
ADC and READY read function. | |
void | slider_enable_led_output (slider_t *ctx, uint8_t state) |
Output enable function. | |
void | slider_enable_output_laches (slider_t *ctx, uint8_t state) |
Output laches enable function. | |
uint32_t | slider_write_output (slider_t *ctx) |
Output write function. | |
void slider_cfg_setup | ( | slider_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void slider_default_cfg | ( | slider_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Slider click.
void slider_enable_led_output | ( | slider_t * | ctx, |
uint8_t | state ) |
Output enable function.
ctx | Click object. |
state | 0 - logic low, 1 - logic high. |
@description Function enables LED output to shows output laches when state is low, and disables LED output when state is high, by seting AN pin on state value.
void slider_enable_output_laches | ( | slider_t * | ctx, |
uint8_t | state ) |
Output laches enable function.
ctx | Click object. |
state | 0 - logic low, 1 - logic high. |
@description Function enables output laches to monitor converted ADC value, when state is high, and disables monitoring when state is low, by seting RST pin on state value.
void slider_generic_transfer | ( | slider_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
SLIDER_RETVAL slider_init | ( | slider_t * | ctx, |
slider_cfg_t * | cfg ) |
Initialization function.
slider | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint32_t slider_read_adc | ( | slider_t * | ctx | ) |
ADC read function.
ctx | Click object. |
@description Function reads via SPI bus ADC value and converts it to 22-bit value.
uint32_t slider_read_adc_and_ready | ( | slider_t * | ctx | ) |
ADC and READY read function.
ctx | Click object. |
@description Function calls slider_readADC function, but first checks is ADC conversion finished, and waits until conversion is complete.
uint32_t slider_write_output | ( | slider_t * | ctx | ) |
Output write function.
ctx | Click object. |
@description Function calls slider_readADCAndReady function, checks is conversion finished, reads converted value, writes this value on LED output laches and returns 22-bit value as result of conversion.