adc12 2.0.0.0
adc12.h File Reference

This file contains API for ADC 12 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  adc12_t
 ADC 12 Click context object. More...
 
struct  adc12_cfg_t
 ADC 12 Click configuration object. More...
 

Macros

#define ADC12_CMD_SD_MASK   0x80
 ADC 12 commands list.
 
#define ADC12_CMD_SD_DIFF   0x00
 
#define ADC12_CMD_SD_SINGLE_END   0x80
 
#define ADC12_CMD_PD_MASK   0x0C
 
#define ADC12_CMD_PD_PDADCONV   0x00
 
#define ADC12_CMD_PD_IROFF_ADON   0x04
 
#define ADC12_CMD_PD_IRON_ADOFF   0x08
 
#define ADC12_CMD_PD_IRON_ADON   0x0C
 
#define ADC12_SINGLE_END_CH0   0
 ADC 12 Single-Ended channels selection.
 
#define ADC12_SINGLE_END_CH1   1
 
#define ADC12_SINGLE_END_CH2   2
 
#define ADC12_SINGLE_END_CH3   3
 
#define ADC12_SINGLE_END_CH4   4
 
#define ADC12_SINGLE_END_CH5   5
 
#define ADC12_SINGLE_END_CH6   6
 
#define ADC12_SINGLE_END_CH7   7
 
#define ADC12_DIFF_CH0_P_CH1_N   0
 ADC 12 Differential channels selection.
 
#define ADC12_DIFF_CH1_P_CH0_N   1
 
#define ADC12_DIFF_CH2_P_CH3_N   2
 
#define ADC12_DIFF_CH3_P_CH2_N   3
 
#define ADC12_DIFF_CH4_P_CH5_N   4
 
#define ADC12_DIFF_CH5_P_CH4_N   5
 
#define ADC12_DIFF_CH6_P_CH7_N   6
 
#define ADC12_DIFF_CH7_P_CH6_N   7
 
#define ADC12_INTERNAL_VREF   2500
 ADC 12 Internal Reference value.
 
#define ADC12_RES   4096.0
 ADC 12 ADC Resolution value.
 
#define ADC12_DEV_ADDR_DEFAULT   0x48
 ADC 12 device address setting.
 
#define ADC12_DEV_ADDR_01   0x49
 
#define ADC12_DEV_ADDR_10   0x4A
 
#define ADC12_DEV_ADDR_11   0x4B
 
#define ADC12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  adc12_return_value_t { ADC12_OK = 0 , ADC12_ERROR = -1 }
 ADC 12 Click return value data. More...
 

Functions

void adc12_cfg_setup (adc12_cfg_t *cfg)
 ADC 12 configuration object setup function.
 
err_t adc12_init (adc12_t *ctx, adc12_cfg_t *cfg)
 ADC 12 initialization function.
 
err_t adc12_send_cmd (adc12_t *ctx, uint8_t cmd_byte)
 ADC 12 send command function.
 
err_t adc12_read_data (adc12_t *ctx, uint16_t *data_out)
 ADC 12 read data function.
 
void adc12_set_sd_mode (adc12_t *ctx, uint8_t sd_mode)
 ADC 12 set the Single-Ended/Differential Inputs function.
 
uint8_t adc12_get_sd_mode (adc12_t *ctx)
 ADC 12 get the Single-Ended/Differential Inputs function.
 
void adc12_set_pd_mode (adc12_t *ctx, uint8_t pd_mode)
 ADC 12 set the Power-Down mode function.
 
uint8_t adc12_get_pd_mode (adc12_t *ctx)
 ADC 12 get the Power-Down mode function.
 
err_t adc12_read_raw_data (adc12_t *ctx, uint8_t ch, uint16_t *data_out)
 ADC 12 read raw ADC data function.
 
err_t adc12_read_voltage (adc12_t *ctx, uint8_t ch, uint16_t vref, float *data_out)
 ADC 12 read voltage function.
 

Detailed Description

This file contains API for ADC 12 Click Driver.

Enumeration Type Documentation

◆ adc12_return_value_t

ADC 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
ADC12_OK 
ADC12_ERROR