dac5 2.0.0.0
dac5.h File Reference

This file contains API for DAC 5 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  dac5_t
 Click ctx object definition. More...
 
struct  dac5_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DAC5_MAP_MIKROBUS(cfg, mikrobus)
 
#define DAC5_RETVAL   uint8_t
 
#define DAC5_OK   0x00
 
#define DAC5_INIT_ERROR   0xFF
 
#define DAC5_ERROR   0
 
#define DAC5_SUCCESS   1
 
#define DAC5_SLAVE_ADDRESS_BROADCAST   0x47
 
#define DAC5_SLAVE_ADDRESS_GND   0x48
 
#define DAC5_SLAVE_ADDRESS_VCC   0x49
 
#define DAC5_SLAVE_ADDRESS_SDA   0x4A
 
#define DAC5_SLAVE_ADDRESS_SCL   0x4B
 
#define DAC5_VREF_3300MV   3300
 
#define DAC5_VREF_5000MV   5000
 
#define DAC5_VREF_2048MV   2048
 
#define DAC5_VREF_1024MV   1024
 
#define DAC5_REG_CONFIG   0x01
 
#define DAC5_REG_STATUS_TRIGGER   0x02
 
#define DAC5_REG_BRDCAST   0x03
 
#define DAC5_REG_DAC_A_DATA   0x08
 
#define DAC5_REG_DAC_B_DATA   0x09
 
#define DAC5_REG_DAC_C_DATA   0x0A
 
#define DAC5_REG_DAC_D_DATA   0x0B
 
#define DAC5_REG_DAC_E_DATA   0x0C
 
#define DAC5_REG_DAC_F_DATA   0x0D
 
#define DAC5_REG_DAC_G_DATA   0x0E
 
#define DAC5_REG_DAC_H_DATA   0x0F
 
#define DAC5_CONFIG_DEFAULT   0x00FF
 
#define DAC5_CONFIG_GLOBAL_ENABLED   0x0000
 
#define DAC5_CONFIG_GLOBAL_DISABLED   0x0100
 
#define DAC5_CONFIG_A_ENABLED   0x0000
 
#define DAC5_CONFIG_A_DISABLED   0x0001
 
#define DAC5_CONFIG_B_ENABLED   0x0000
 
#define DAC5_CONFIG_B_DISABLED   0x0002
 
#define DAC5_CONFIG_C_ENABLED   0x0000
 
#define DAC5_CONFIG_C_DISABLED   0x0004
 
#define DAC5_CONFIG_D_ENABLED   0x0000
 
#define DAC5_CONFIG_D_DISABLED   0x0008
 
#define DAC5_CONFIG_E_ENABLED   0x0000
 
#define DAC5_CONFIG_E_DISABLED   0x0010
 
#define DAC5_CONFIG_F_ENABLED   0x0000
 
#define DAC5_CONFIG_F_DISABLED   0x0020
 
#define DAC5_CONFIG_G_ENABLED   0x0000
 
#define DAC5_CONFIG_G_DISABLED   0x0040
 
#define DAC5_CONFIG_H_ENABLED   0x0000
 
#define DAC5_CONFIG_H_DISABLED   0x0080
 
#define DAC5_DEVICE_ID   0x0300
 
#define DAC5_SOFTWARE_RESET   0x000A
 
#define DAC5_MIN_DATA   0x0000
 
#define DAC5_MAX_DATA   0x0FFF
 
#define DAC5_ERROR   0
 
#define DAC5_SUCCESS   1
 
#define DAC5_SYNCHRONOUS   1
 
#define DAC5_ASYNCHRONOUS   0
 

Functions

void dac5_cfg_setup (dac5_cfg_t *cfg)
 Config Object Initialization function.
 
DAC5_RETVAL dac5_init (dac5_t *ctx, dac5_cfg_t *cfg)
 Initialization function.
 
void dac5_generic_write (dac5_t *ctx, uint8_t reg, uint16_t data_buf)
 Generic write function.
 
uint16_t dac5_generic_read (dac5_t *ctx, uint8_t reg)
 Generic read function.
 
void dac5_config (dac5_t *ctx, uint16_t config_data)
 Function for configurating click.
 
uint16_t dac5_get_device_id (dac5_t *ctx)
 Function for reading device id.
 
void dac5_software_reset (dac5_t *ctx)
 Function for software reset.
 
void dac5_clear (dac5_t *ctx)
 Function for clearing sent data.
 
uint8_t dac5_set_ldac_pin (dac5_t *ctx, uint8_t status)
 Function for setting LDAC pin status.
 
uint8_t dac5_send_data (dac5_t *ctx, uint8_t data_reg, uint16_t data_buf)
 Function for sending data to one output.
 

Detailed Description

This file contains API for DAC 5 Click driver.