adc3 2.0.0.0
Public function

Functions

void adc3_cfg_setup (adc3_cfg_t *cfg)
 Config Object Initialization function.
 
ADC3_RETVAL adc3_init (adc3_t *ctx, adc3_cfg_t *cfg)
 Initialization function.
 
void adc3_default_cfg (adc3_t *ctx)
 Click Default Configuration function.
 
void adc3_generic_write (adc3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void adc3_generic_read (adc3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void adc3_reset (adc3_t *ctx)
 General call reset function.
 
void adc3_latch (adc3_t *ctx)
 General call latch function.
 
void adc3_conversion (adc3_t *ctx)
 General call conversion function.
 
int16_t adc3_read_measurement (adc3_t *ctx, uint8_t channel, uint8_t resolution, uint8_t gain)
 ADC3 read measurement function.
 
float adc3_read_voltage (adc3_t *ctx, uint8_t channel, uint8_t resolution, uint8_t gain)
 Read voltage function.
 

Detailed Description

Function Documentation

◆ adc3_cfg_setup()

void adc3_cfg_setup ( adc3_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.

◆ adc3_conversion()

void adc3_conversion ( adc3_t * ctx)

General call conversion function.

Parameters
ctxClick object.

@description This function is used to initiate general call conversion.

Note
When the device receives this command, the configuration will be set to the One-Shot Conversion mode and a single conversion will be performed. The PGA and data rate settings are unchanged with this general call.

◆ adc3_default_cfg()

void adc3_default_cfg ( adc3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Adc3 click.

◆ adc3_generic_read()

void adc3_generic_read ( adc3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ adc3_generic_write()

void adc3_generic_write ( adc3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ adc3_init()

ADC3_RETVAL adc3_init ( adc3_t * ctx,
adc3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ adc3_latch()

void adc3_latch ( adc3_t * ctx)

General call latch function.

Parameters
ctxClick object.

@description This function is used to initiate general call latch.

Note
The device will latch the logic status of the external address selection pins, but will not perform a reset.

◆ adc3_read_measurement()

int16_t adc3_read_measurement ( adc3_t * ctx,
uint8_t channel,
uint8_t resolution,
uint8_t gain )

ADC3 read measurement function.

Parameters
ctxClick object.
channel8-bit data representing channel, conversion mode, conversion rate, and PGA gain values.
resolution8-bit data representing conversion rate.
gain8-bit data representing PGA gain.
Returns
result 16-bit value read from output register

@description This function is used to read digitaly converted data from any of the 4 channels.

Note
Function converts data correctly, and then uses default settings from datasheet for further operation.

◆ adc3_read_voltage()

float adc3_read_voltage ( adc3_t * ctx,
uint8_t channel,
uint8_t resolution,
uint8_t gain )

Read voltage function.

Parameters
ctxClick object.
channel8-bit data representing channel, conversion mode, conversion rate, and PGA gain values.
resolution8-bit data representing conversion rate.
gain8-bit data representing PGA gain.
Returns
result 16-bit value read from output register

@description This function is used to read ADC value and calculate voltage.

Note
Function converts data correctly, and then uses default settings from datasheet for further operation.

◆ adc3_reset()

void adc3_reset ( adc3_t * ctx)

General call reset function.

Parameters
ctxClick object.

@description This function is used to initiate general call reset.

Note
The device will abort current conversion and perform internal reset and latch the logic status of external address selection pins.