adc26 2.1.0.0
Loading...
Searching...
No Matches
adc26.h File Reference

This file contains API for ADC 26 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  adc26_t
 ADC 26 Click context object. More...
 
struct  adc26_cfg_t
 ADC 26 Click configuration object. More...
 

Macros

#define ADC26_REG_CONVERSION   0x00
 ADC 26 register map.
 
#define ADC26_REG_CONFIG   0x01
 
#define ADC26_REG_LO_THRESH   0x02
 
#define ADC26_REG_HI_THRESH   0x03
 
#define ADC26_CONFIG_OS_NO_EFFECT   0x0000
 ADC 26 CONFIG register setting.
 
#define ADC26_CONFIG_OS_START_CONVERSION   0x8000
 
#define ADC26_CONFIG_OS_MASK   0x8000
 
#define ADC26_CONFIG_MUX_P_AIN0_N_AIN1   0x0000
 
#define ADC26_CONFIG_MUX_P_AIN0_N_AIN3   0x1000
 
#define ADC26_CONFIG_MUX_P_AIN1_N_AIN3   0x2000
 
#define ADC26_CONFIG_MUX_P_AIN2_N_AIN3   0x3000
 
#define ADC26_CONFIG_MUX_P_AIN0_N_GND   0x4000
 
#define ADC26_CONFIG_MUX_P_AIN1_N_GND   0x5000
 
#define ADC26_CONFIG_MUX_P_AIN2_N_GND   0x6000
 
#define ADC26_CONFIG_MUX_P_AIN3_N_GND   0x7000
 
#define ADC26_CONFIG_MUX_MASK   0x7000
 
#define ADC26_CONFIG_PGA_6_144V   0x0000
 
#define ADC26_CONFIG_PGA_4_096V   0x0200
 
#define ADC26_CONFIG_PGA_2_048V   0x0400
 
#define ADC26_CONFIG_PGA_1_024V   0x0600
 
#define ADC26_CONFIG_PGA_0_512V   0x0800
 
#define ADC26_CONFIG_PGA_0_256V   0x0A00
 
#define ADC26_CONFIG_PGA_MASK   0x0E00
 
#define ADC26_CONFIG_MODE_CONTINUOUS   0x0000
 
#define ADC26_CONFIG_MODE_SINGLE_SHOT   0x0100
 
#define ADC26_CONFIG_MODE_MASK   0x0100
 
#define ADC26_CONFIG_DR_128_SPS   0x0000
 
#define ADC26_CONFIG_DR_250_SPS   0x0020
 
#define ADC26_CONFIG_DR_490_SPS   0x0040
 
#define ADC26_CONFIG_DR_920_SPS   0x0060
 
#define ADC26_CONFIG_DR_1600_SPS   0x0080
 
#define ADC26_CONFIG_DR_2400_SPS   0x00A0
 
#define ADC26_CONFIG_DR_3300_SPS   0x00C0
 
#define ADC26_CONFIG_DR_MASK   0x00E0
 
#define ADC26_CONFIG_COMP_MODE_TRADITIONAL   0x0000
 
#define ADC26_CONFIG_COMP_MODE_WINDOW   0x0010
 
#define ADC26_CONFIG_COMP_MODE_MASK   0x0010
 
#define ADC26_CONFIG_COMP_POL_ACTIVE_LOW   0x0000
 
#define ADC26_CONFIG_COMP_POL_ACTIVE_HIGH   0x0008
 
#define ADC26_CONFIG_COMP_POL_MASK   0x0008
 
#define ADC26_CONFIG_COMP_LAT_NONLATCHING   0x0000
 
#define ADC26_CONFIG_COMP_LAT_LATCHING   0x0004
 
#define ADC26_CONFIG_COMP_LAT_MASK   0x0004
 
#define ADC26_CONFIG_COMP_QUE_ONE_CONV   0x0000
 
#define ADC26_CONFIG_COMP_QUE_TWO_CONV   0x0001
 
#define ADC26_CONFIG_COMP_QUE_FOUR_CONV   0x0002
 
#define ADC26_CONFIG_COMP_QUE_DISABLE   0x0003
 
#define ADC26_CONFIG_COMP_QUE_MASK   0x0003
 
#define ADC26_MUX_P_AIN0_N_AIN1   0
 ADC 26 MUX setting.
 
#define ADC26_MUX_P_AIN0_N_AIN3   1
 
#define ADC26_MUX_P_AIN1_N_AIN3   2
 
#define ADC26_MUX_P_AIN2_N_AIN3   3
 
#define ADC26_MUX_P_AIN0_N_GND   4
 
#define ADC26_MUX_P_AIN1_N_GND   5
 
#define ADC26_MUX_P_AIN2_N_GND   6
 
#define ADC26_MUX_P_AIN3_N_GND   7
 
#define ADC26_PGA_0_256V   0
 ADC 26 PGA setting.
 
#define ADC26_PGA_0_512V   1
 
#define ADC26_PGA_1_024V   2
 
#define ADC26_PGA_2_048V   3
 
#define ADC26_PGA_4_096V   4
 
#define ADC26_ADC_MIN   ( -2048 )
 ADC 26 data range setting.
 
#define ADC26_ADC_MAX   ( 2047 )
 
#define ADC26_ADC_RESOLUTION   2048.0f
 ADC 26 voltage calculation setting.
 
#define ADC26_ADC_GAIN_MIN   0.256f
 
#define ADC26_DEVICE_ADDRESS_GND   0x48
 ADC 26 device address setting.
 
#define ADC26_DEVICE_ADDRESS_VCC   0x49
 
#define ADC26_DEVICE_ADDRESS_SDA   0x4A
 
#define ADC26_DEVICE_ADDRESS_SCL   0x4B
 
#define ADC26_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  adc26_return_value_t { ADC26_OK = 0 , ADC26_ERROR = -1 }
 ADC 26 Click return value data. More...
 

Functions

void adc26_cfg_setup (adc26_cfg_t *cfg)
 ADC 26 configuration object setup function.
 
err_t adc26_init (adc26_t *ctx, adc26_cfg_t *cfg)
 ADC 26 initialization function.
 
err_t adc26_default_cfg (adc26_t *ctx)
 ADC 26 default configuration function.
 
err_t adc26_write_reg (adc26_t *ctx, uint8_t reg, uint16_t data_in)
 ADC 26 write reg function.
 
err_t adc26_read_reg (adc26_t *ctx, uint8_t reg, uint16_t *data_out)
 ADC 26 read reg function.
 
uint8_t adc26_get_alert_pin (adc26_t *ctx)
 ADC 26 get alert pin function.
 
err_t adc26_start_conversion (adc26_t *ctx, uint8_t mux, uint8_t pga)
 ADC 26 start conversion function.
 
err_t adc26_write_threshold (adc26_t *ctx, int16_t lo_thresh, int16_t hi_thresh)
 ADC 26 write threshold function.
 
err_t adc26_read_adc (adc26_t *ctx, int16_t *data_out)
 ADC 26 read ADC function.
 
err_t adc26_read_voltage (adc26_t *ctx, float *voltage)
 ADC 26 read voltage function.
 

Detailed Description

This file contains API for ADC 26 Click Driver.

Enumeration Type Documentation

◆ adc26_return_value_t

ADC 26 Click return value data.

Predefined enum values for driver return values.

Enumerator
ADC26_OK 
ADC26_ERROR