adac3 2.0.0.0
adac3.h File Reference

This file contains API for ADAC 3 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  adac3_t
 ADAC 3 Click context object. More...
 
struct  adac3_cfg_t
 ADAC 3 Click configuration object. More...
 

Macros

#define ADAC3_CONTROL_AOUT_ENABLE   0x40
 ADAC 3 control byte settings.
 
#define ADAC3_CONTROL_AIN_SINGLE_ENDED   0x00
 
#define ADAC3_CONTROL_AIN_3_DIFFERENTIAL   0x10
 
#define ADAC3_CONTROL_AIN_MIXED   0x20
 
#define ADAC3_CONTROL_AIN_2_DIFFERENTIAL   0x30
 
#define ADAC3_CONTROL_AUTO_INCREMENT   0x04
 
#define ADAC3_CONTROL_AD_CH0   0x00
 
#define ADAC3_CONTROL_AD_CH1   0x01
 
#define ADAC3_CONTROL_AD_CH2   0x02
 
#define ADAC3_CONTROL_AD_CH3   0x03
 
#define ADAC3_VREF_2048mV   2048.0
 ADAC 3 calculation values.
 
#define ADAC3_VREF_4096mV   4096.0
 
#define ADAC3_RESOLUTION   0xFF
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_000   0x48
 ADAC 3 device address setting.
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_001   0x49
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_010   0x4A
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_011   0x4B
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_100   0x4C
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_101   0x4D
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_110   0x4E
 
#define ADAC3_DEVICE_ADDRESS_A2A1A0_111   0x4F
 
#define ADAC3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  adac3_return_value_t { ADAC3_OK = 0 , ADAC3_ERROR = -1 }
 ADAC 3 Click return value data. More...
 

Functions

void adac3_cfg_setup (adac3_cfg_t *cfg)
 ADAC 3 configuration object setup function.
 
err_t adac3_init (adac3_t *ctx, adac3_cfg_t *cfg)
 ADAC 3 initialization function.
 
err_t adac3_default_cfg (adac3_t *ctx)
 ADAC 3 default configuration function.
 
err_t adac3_write_control (adac3_t *ctx, uint8_t control)
 ADAC 3 write control function.
 
err_t adac3_write_dac (adac3_t *ctx, uint8_t dac)
 ADAC 3 write dac function.
 
err_t adac3_read_adc (adac3_t *ctx, uint8_t *adc)
 ADAC 3 read adc function.
 

Detailed Description

This file contains API for ADAC 3 Click Driver.

Enumeration Type Documentation

◆ adac3_return_value_t

ADAC 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
ADAC3_OK 
ADAC3_ERROR