adac 2.0.0.0
adac.h File Reference

This file contains API for ADAC 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  adac_t
 Click ctx object definition. More...
 
struct  adac_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ADAC_MAP_MIKROBUS(cfg, mikrobus)
 
#define ADAC_RETVAL   uint8_t
 
#define ADAC_OK   0x00
 
#define ADAC_INIT_ERROR   0xFF
 
#define ADAC_I2C_SLAVE_ADDR   0X10
 
#define ADAC_SOFT_RESET_CMD   0x0DAC
 
#define ADAC_NO_OP   0X00
 
#define ADAC_ADC_SEQUENCE   0X02
 
#define ADAC_GP_CONTROL   0X03
 
#define ADAC_ADC_CONFIG   0X04
 
#define ADAC_DAC_CONFIG   0X05
 
#define ADAC_PULL_DOWN   0X06
 
#define ADAC_LDAC_MODE   0X07
 
#define ADAC_GPIO_WR_CONFIG   0X08
 
#define ADAC_GPIO_WR_DATA   0X09
 
#define ADAC_GPIO_RD_CONFIG   0X0A
 
#define ADAC_POWER_REF_CTRL   0X0B
 
#define ADAC_OPEN_DRAIN_CFG   0X0C
 
#define ADAC_THREE_STATE   0X0D
 
#define ADAC_SOFT_RESET   0X0F
 
#define ADAC_CONFIG_MOD   0X00
 
#define ADAC_DAC_WRITE   0X10
 
#define ADAC_ADC_READ   0X40
 
#define ADAC_DAC_READ   0X50
 
#define ADAC_GPIO_READ   0X60
 
#define ADAC_REG_READ   0X70
 
#define ADAC_VREF_ON   0X02
 
#define ADAC_SEQUENCE_ON   0X02
 
#define ADAC_IO0   0X01
 
#define ADAC_IO1   0X02
 
#define ADAC_IO2   0X04
 
#define ADAC_IO3   0X08
 
#define ADAC_IO4   0X10
 
#define ADAC_IO5   0X20
 
#define ADAC_IO6   0X40
 
#define ADAC_IO7   0X80
 
#define ADAC_PB_PIN0   0X00
 
#define ADAC_PB_PIN1   0X01
 
#define ADAC_PB_PIN2   0X02
 
#define ADAC_PB_PIN3   0X03
 
#define ADAC_PB_PIN4   0X04
 
#define ADAC_PB_PIN5   0X05
 
#define ADAC_PB_PIN6   0X06
 
#define ADAC_PB_PIN7   0X07
 
#define ADAC_PB_DAC0   0X10
 
#define ADAC_PB_DAC1   0X11
 
#define ADAC_PB_DAC2   0X12
 
#define ADAC_PB_DAC3   0X13
 
#define ADAC_PB_DAC4   0X14
 
#define ADAC_PB_DAC5   0X15
 
#define ADAC_PB_DAC6   0X16
 
#define ADAC_PB_DAC7   0X17
 
#define ADAC_DAC_RANGE_SEL   0X0010
 
#define ADAC_ADC_RANGE_SEL   0X0020
 
#define ADAC_WRITE_ALL_DACS   0X0040
 
#define ADAC_LOCK_CONFIG   0X0080
 
#define ADAC_ADC_BUFF_ENABLE   0X0100
 
#define ADAC_ADC_BUFF_PRE_CHAR   0X0200
 
#define ADAC_PD_CHAN_0   0X0001
 
#define ADAC_PD_CHAN_1   0X0002
 
#define ADAC_PD_CHAN_2   0X0004
 
#define ADAC_PD_CHAN_3   0X0008
 
#define ADAC_PD_CHAN_4   0X0010
 
#define ADAC_PD_CHAN_5   0X0020
 
#define ADAC_PD_CHAN_6   0X0040
 
#define ADAC_PD_CHAN_7   0x0080
 
#define ADAC_REF_BUFF_POW_UP   0x0200
 
#define ADAC_PD_ALL   0x0400
 

Functions

void adac_cfg_setup (adac_cfg_t *cfg)
 Config Object Initialization function.
 
ADAC_RETVAL adac_init (adac_t *ctx, adac_cfg_t *cfg)
 Initialization function.
 
void adac_generic_write (adac_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void adac_generic_read (adac_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void adac_hardware_reset (adac_t *ctx)
 Hardware reset function.
 
void adac_software_reset (adac_t *ctx, uint16_t cmd)
 Software reset function.
 
void adac_power_down_settings (adac_t *ctx, uint16_t settings)
 Power down function.
 
void adac_general_purpose_settings (adac_t *ctx, uint16_t settings)
 General purpose function.
 
uint16_t adac_read_config (adac_t *ctx)
 Read configuration function.
 
void adac_write_gpio (adac_t *ctx, uint8_t w_data)
 Write GPIO function.
 
uint8_t adac_read_gpio (adac_t *ctx)
 Read GPIO function.
 
uint16_t adac_read_dac (adac_t *ctx, uint8_t *chan)
 Read DAC function.
 
uint16_t adac_read_adc (adac_t *ctx, uint8_t *chan)
 Read ADC function.
 
void adac_write_dac_data (adac_t *ctx, uint8_t chan, uint16_t w_data)
 Write DAC data function.
 
void adac_write_dac (adac_t *ctx, uint8_t chan, uint8_t msb, uint8_t lsb)
 Write DAC function.
 
void adac_set_configuration (adac_t *ctx, uint8_t ptr, uint8_t msb, uint8_t lsb)
 Set configuration function.
 
uint16_t adac_read_data (adac_t *ctx, uint8_t addr)
 Read data function.
 
void adac_write_data (adac_t *ctx, uint8_t addr, uint16_t w_data)
 Write data function.
 

Detailed Description

This file contains API for ADAC Click driver.