slider 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ slider_cfg_setup()

void slider_cfg_setup ( slider_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ slider_default_cfg()

void slider_default_cfg ( slider_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Slider click.

◆ slider_enable_led_output()

void slider_enable_led_output ( slider_t * ctx,
uint8_t state )

Output enable function.

Parameters
ctxClick object.
state0 - 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.

◆ slider_enable_output_laches()

void slider_enable_output_laches ( slider_t * ctx,
uint8_t state )

Output laches enable function.

Parameters
ctxClick object.
state0 - 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.

◆ slider_generic_transfer()

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.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ slider_init()

SLIDER_RETVAL slider_init ( slider_t * ctx,
slider_cfg_t * cfg )

Initialization function.

Parameters
sliderClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ slider_read_adc()

uint32_t slider_read_adc ( slider_t * ctx)

ADC read function.

Parameters
ctxClick object.
Returns
22-bit ADC conversion value

@description Function reads via SPI bus ADC value and converts it to 22-bit value.

◆ slider_read_adc_and_ready()

uint32_t slider_read_adc_and_ready ( slider_t * ctx)

ADC and READY read function.

Parameters
ctxClick object.
Returns
22-bit ADC conversion value.

@description Function calls slider_readADC function, but first checks is ADC conversion finished, and waits until conversion is complete.

◆ slider_write_output()

uint32_t slider_write_output ( slider_t * ctx)

Output write function.

Parameters
ctxClick object.
Returns
22-bit ADC converted value.

@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.