adc9 2.0.0.0
Public function

Functions

void adc9_cfg_setup (adc9_cfg_t *cfg)
 Config Object Initialization function.
 
ADC9_RETVAL adc9_init (adc9_t *ctx, adc9_cfg_t *cfg)
 Initialization function.
 
void adc9_default_cfg (adc9_t *ctx, adc9_rw_t *rw)
 Click Default Configuration function.
 
void adc9_generic_transfer (adc9_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint8_t adc9_write_fast_cmd (adc9_t *ctx, adc9_rw_t *rw)
 Write fast commands function.
 
uint8_t adc9_write_u8 (adc9_t *ctx, adc9_rw_t *rw, uint8_t wr_data)
 Write byte function.
 
uint8_t adc9_read_u8 (adc9_t *ctx, adc9_rw_t *rw, uint8_t *rd_data)
 Read byte function.
 
uint8_t adc9_write_u16 (adc9_t *ctx, adc9_rw_t *rw, uint16_t wr_data)
 Write word function.
 
uint8_t adc9_read_u16 (adc9_t *ctx, adc9_rw_t *rw, uint16_t *rd_data)
 Read word function.
 
uint8_t adc9_write_u24 (adc9_t *ctx, adc9_rw_t *rw, uint32_t wr_data)
 Write 24-bit function.
 
uint8_t adc9_read_u24 (adc9_t *ctx, adc9_rw_t *rw, uint32_t *rd_data)
 Read 24-bit function.
 
uint8_t adc9_read_u32 (adc9_t *ctx, adc9_rw_t *rw, uint32_t *rd_data)
 Read 32-bit function.
 
uint8_t adc9_irq_pin_state (adc9_t *ctx)
 Get IRQ pin state function.
 
uint8_t adc9_read_def_adc (adc9_t *ctx, adc9_rw_t *rw, int32_t *rd_data)
 Read default adc format value function.
 
uint8_t adc9_read_24_left_adc (adc9_t *ctx, adc9_rw_t *rw, int32_t *rd_data)
 Read left justified adc value function.
 
uint8_t adc9_read_sign_adc (adc9_t *ctx, adc9_rw_t *rw, int32_t *adc_val)
 Read Sign and ADC value function.
 
uint8_t adc9_read_chan_adc (adc9_t *ctx, adc9_rw_t *rw, int32_t *adc_val, uint8_t *chan)
 Read Channel and ADC value function.
 
float adc9_volt_calc (adc9_t *ctx, int32_t adc_val, uint16_t v_ref, uint8_t gain)
 Calculate Voltage function.
 

Detailed Description

Function Documentation

◆ adc9_cfg_setup()

void adc9_cfg_setup ( adc9_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.

◆ adc9_default_cfg()

void adc9_default_cfg ( adc9_t * ctx,
adc9_rw_t * rw )

Click Default Configuration function.

Parameters
ctxClick object.
rwRead/write object.

@description This function executes default configuration for ADC 9 click.

◆ adc9_generic_transfer()

void adc9_generic_transfer ( adc9_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

◆ adc9_init()

ADC9_RETVAL adc9_init ( adc9_t * ctx,
adc9_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ adc9_irq_pin_state()

uint8_t adc9_irq_pin_state ( adc9_t * ctx)

Get IRQ pin state function.

Parameters
ctxClick object.
Returns
1 : Interrupt has not occured , 0 : Interrupt has occured

@description Function is used to check if an interrupt has occured.

◆ adc9_read_24_left_adc()

uint8_t adc9_read_24_left_adc ( adc9_t * ctx,
adc9_rw_t * rw,
int32_t * rd_data )

Read left justified adc value function.

Parameters
ctxClick object.
rwRead/write object.
Struct Argument: 
     dev_adr     8-bit value that defines the dvice.
rd_data32-bit value that defines the ADC output data.
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read ADC value when the left-justified fata format is applied.

◆ adc9_read_chan_adc()

uint8_t adc9_read_chan_adc ( adc9_t * ctx,
adc9_rw_t * rw,
int32_t * adc_val,
uint8_t * chan )

Read Channel and ADC value function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice.
rd_data32-bit value that defines the ADC output data.
chan8-bit value that defines the ADC output channel.
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read ADC value when the read channel and ADC fata format is applied.

◆ adc9_read_def_adc()

uint8_t adc9_read_def_adc ( adc9_t * ctx,
adc9_rw_t * rw,
int32_t * rd_data )

Read default adc format value function.

Parameters
ctxClick object.
rwRead/write object.
Struct Argument: 
     dev_adr     8-bit value that defines the dvice.
rd_data32-bit value that defines the ADC output data.
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read ADC value when the default fata format is applied.

◆ adc9_read_sign_adc()

uint8_t adc9_read_sign_adc ( adc9_t * ctx,
adc9_rw_t * rw,
int32_t * adc_val )

Read Sign and ADC value function.

Parameters
ctxClick object.
rwRead/write object.
Struct Argument: 
     dev_adr     8-bit value that defines the dvice.
rd_data32-bit value that defines the ADC output data.
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read ADC value when the read sign and ADC fata format is applied.

◆ adc9_read_u16()

uint8_t adc9_read_u16 ( adc9_t * ctx,
adc9_rw_t * rw,
uint16_t * rd_data )

Read word function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
     cmd         8-bit value that defines the command( static or incremental read )
rd_data16-bit value that defines the output data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read two bytes of data from user defined register.

◆ adc9_read_u24()

uint8_t adc9_read_u24 ( adc9_t * ctx,
adc9_rw_t * rw,
uint32_t * rd_data )

Read 24-bit function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
     cmd         8-bit value that defines the command( static or incremental read )
rd_data24-bit value that defines the output data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read three bytes of data from user defined register.

◆ adc9_read_u32()

uint8_t adc9_read_u32 ( adc9_t * ctx,
adc9_rw_t * rw,
uint32_t * rd_data )

Read 32-bit function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
     cmd         8-bit value that defines the command( static or incremental read )
rd_data32-bit value that defines the output data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read four bytes of data from user defined register.

◆ adc9_read_u8()

uint8_t adc9_read_u8 ( adc9_t * ctx,
adc9_rw_t * rw,
uint8_t * rd_data )

Read byte function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
     cmd         8-bit value that defines the command( static or incremental read )
rd_data8-bit value that defines the output data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to read single byte of data from user defined register.

◆ adc9_volt_calc()

float adc9_volt_calc ( adc9_t * ctx,
int32_t adc_val,
uint16_t v_ref,
uint8_t gain )

Calculate Voltage function.

Parameters
ctxClick object.
adc_val32-bit value that defines the ADC input data.
v_ref16-bit data that defines reference voltage.
gain8-bit data that defines gain applied.
Returns
volt float calculation value that represents voltage in millivolts.

@description Function is used to calculate voltage based on ADC values.

◆ adc9_write_fast_cmd()

uint8_t adc9_write_fast_cmd ( adc9_t * ctx,
adc9_rw_t * rw )

Write fast commands function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments:
     dev_adr     8-bit value that defines the dvice
     cmd         8-bit value that defines the command
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to execute fast command.

◆ adc9_write_u16()

uint8_t adc9_write_u16 ( adc9_t * ctx,
adc9_rw_t * rw,
uint16_t wr_data )

Write word function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
wr_data16-bit value that defines the input data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to write two bytes of data into user defined register.

◆ adc9_write_u24()

uint8_t adc9_write_u24 ( adc9_t * ctx,
adc9_rw_t * rw,
uint32_t wr_data )

Write 24-bit function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
wr_data24-bit value that defines the input data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to write three bytes of data into user defined register.

◆ adc9_write_u8()

uint8_t adc9_write_u8 ( adc9_t * ctx,
adc9_rw_t * rw,
uint8_t wr_data )

Write byte function.

Parameters
ctxClick object.
rwRead/write object.
Struct Arguments: 
     dev_adr     8-bit value that defines the dvice
     reg         8-bit value that defines the register
wr_data8-bit value that defines the input data
Returns
stat_byte 8-bit value that represents the device's status.

@description Function is used to write single byte of data into user defined register.