adc7 2.0.0.0
Public function

Functions

void adc7_cfg_setup (adc7_cfg_t *cfg)
 Config Object Initialization function.
 
void adc7_default_cfg (adc7_t *ctx)
 Default Configuration Initialization function.
 
ADC7_RETVAL adc7_init (adc7_t *ctx, adc7_cfg_t *cfg)
 Initialization function.
 
uint8_t adc7_set_config (adc7_t *ctx, uint8_t gain_config, uint8_t down_samp_factor, uint8_t filter_type)
 Configuration set function.
 
uint8_t adc7_check_data_ready (adc7_t *ctx)
 Data Ready Check Function.
 
uint8_t adc7_check_busy (adc7_t *ctx)
 Busy Check Function.
 
void adc7_set_clock (adc7_t *ctx, uint8_t state)
 Set Clock.
 
void adc7_preset_mode (adc7_t *ctx, uint8_t state)
 Preset Mode.
 
uint8_t adc7_read_bytes (adc7_t *ctx, uint8_t n_bytes, uint8_t *data_out)
 Read Bytes Function.
 
void adc7_start_conv_cycle (adc7_t *ctx)
 Start Conversion Function.
 
uint8_t adc7_read_results (adc7_t *ctx, float *voltage)
 Start Conversion Function.
 

Detailed Description

Function Documentation

◆ adc7_cfg_setup()

void adc7_cfg_setup ( adc7_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.

◆ adc7_check_busy()

uint8_t adc7_check_busy ( adc7_t * ctx)

Busy Check Function.

Parameters
ctxClick object.
Returns
0 - Device is not busy, 1 - Device is busy.

@description Function checks if device is busy.

◆ adc7_check_data_ready()

uint8_t adc7_check_data_ready ( adc7_t * ctx)

Data Ready Check Function.

Parameters
ctxClick object.
Returns
0 - Data is ready, 1 - Data is not ready.

@description Function checks if data is ready for reading.

◆ adc7_default_cfg()

void adc7_default_cfg ( adc7_t * ctx)

Default Configuration Initialization function.

Parameters
ctxClick object.

@description This function initializes default click configuration.

◆ adc7_init()

ADC7_RETVAL adc7_init ( adc7_t * ctx,
adc7_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ adc7_preset_mode()

void adc7_preset_mode ( adc7_t * ctx,
uint8_t state )

Preset Mode.

Parameters
ctxClick object.
state0 - Normal Mode, 1 - Preset Mode.

@description Function puts the device to Preset or to Normal Mode.

◆ adc7_read_bytes()

uint8_t adc7_read_bytes ( adc7_t * ctx,
uint8_t n_bytes,
uint8_t * data_out )

Read Bytes Function.

Parameters
ctxClick object.
n_bytesNumber of bytes to be read.
data_outMemory where data bytes be stored.
Returns
Is data ready or not.

@description Function reads the desired number of data bytes. (32-bit converted data from ADC + configuration byte/bytes).

◆ adc7_read_results()

uint8_t adc7_read_results ( adc7_t * ctx,
float * voltage )

Start Conversion Function.

Parameters
ctxClick object.
voltageMemory where converted voltage value is stored.
Returns
Is data ready or not.

@description Function reads 32bit converted voltage value from AD converter and calculates this value to mV.

◆ adc7_set_clock()

void adc7_set_clock ( adc7_t * ctx,
uint8_t state )

Set Clock.

Parameters
ctxClick object.
state0 - low state, 1 - high state.

@description Function sets clock (MCK) pin to desired state.

◆ adc7_set_config()

uint8_t adc7_set_config ( adc7_t * ctx,
uint8_t gain_config,
uint8_t down_samp_factor,
uint8_t filter_type )

Configuration set function.

Parameters
ctxClick object.
gain_configGain Configuration.
down_samp_factorDown Sampling Factor.
filter_typeFilter Type.
Returns
Is device busy or not.

@description Function performs the device configuration by sending configuration data to configure the next conversion cycle.

◆ adc7_start_conv_cycle()

void adc7_start_conv_cycle ( adc7_t * ctx)

Start Conversion Function.

Parameters
ctxClick object.

@description Function generates clock signal on MCK pin and on that way starts and performs the desired number of conversion cycles, determined by Down Sampling Factor number.