adc7 2.0.0.0
adc7.h File Reference

This file contains API for ADC 7 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  adc7_t
 Click ctx object definition. More...
 
struct  adc7_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ADC7_MAP_MIKROBUS(cfg, mikrobus)
 
#define ADC7_RETVAL   uint8_t
 
#define ADC7_OK   0x00
 
#define ADC7_INIT_ERROR   0xFF
 
#define ADC7_SINC1_FILT   0x01
 
#define ADC7_SINC2_FILT   0x02
 
#define ADC7_SINC3_FILT   0x03
 
#define ADC7_SINC4_FILT   0x04
 
#define ADC7_SSINC_FILT   0x05
 
#define ADC7_FLAT_PASSBAND_FILT   0x06
 
#define ADC7_AVERAGING_FILT   0x07
 
#define ADC7_DOWNSAMPL_FACT_4   0x02
 
#define ADC7_DOWNSAMPL_FACT_8   0x03
 
#define ADC7_DOWNSAMPL_FACT_16   0x04
 
#define ADC7_DOWNSAMPL_FACT_32   0x05
 
#define ADC7_DOWNSAMPL_FACT_64   0x06
 
#define ADC7_DOWNSAMPL_FACT_128   0x07
 
#define ADC7_DOWNSAMPL_FACT_256   0x08
 
#define ADC7_DOWNSAMPL_FACT_512   0x09
 
#define ADC7_DOWNSAMPL_FACT_1024   0x0A
 
#define ADC7_DOWNSAMPL_FACT_2048   0x0B
 
#define ADC7_DOWNSAMPL_FACT_4096   0x0C
 
#define ADC7_DOWNSAMPL_FACT_8192   0x0D
 
#define ADC7_DOWNSAMPL_FACT_16384   0x0E
 
#define ADC7_GAIN_EXPAN_EN   0x01
 
#define ADC7_GAIN_COMPR_EN   0x02
 
#define ADC7_GAIN_DISABLE   0x00
 
#define ADC7_DATA_NOT_READY   0x01
 
#define ADC7_DATA_IS_READY   0x00
 
#define ADC7_DEVICE_IS_BUSY   0x01
 
#define ADC7_DEVICE_NOT_BUSY   0x00
 
#define ADC7_WRONG_GAIN_CONFIG   0x02
 
#define ADC7_WRONG_DOWNSAMPL_FACT   0x03
 
#define ADC7_WRONG_FILT_TYPE   0x04
 
#define ADC7_HIGH_STATE   0x01
 
#define ADC7_LOW_STATE   0x00
 

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

This file contains API for ADC 7 Click driver.