dac11 2.0.0.0
dac11.h File Reference

This file contains API for DAC 11 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  dac11_t
 DAC 11 Click context object. More...
 
struct  dac11_cfg_t
 DAC 11 Click configuration object. More...
 

Macros

#define DAC11_CMD_CHANNEL_A   0x00
 DAC 11 commands list.
 
#define DAC11_CMD_CHANNEL_B   0x01
 
#define DAC11_CMD_CHANNEL_C   0x02
 
#define DAC11_CMD_CHANNEL_D   0x03
 
#define DAC11_CMD_CHANNEL_E   0x04
 
#define DAC11_CMD_CHANNEL_F   0x05
 
#define DAC11_CMD_CHANNEL_G   0x06
 
#define DAC11_CMD_CHANNEL_H   0x07
 
#define DAC11_CMD_WRM   0x08
 
#define DAC11_CMD_WTM   0x09
 
#define DAC11_CMD_UPDATE_SELECT   0x0A
 
#define DAC11_CMD_CHANNEL_A_WRITE   0x0B
 
#define DAC11_CMD_BROADCAST   0x0C
 
#define DAC11_CMD_PD_HIGH_Z   0x0D
 
#define DAC11_CMD_PD_100KOHM   0x0E
 
#define DAC11_CMD_PD_2p5KOHM   0x0F
 
#define DAC11_SELECT_CHANNEL_A   0x01
 DAC 11 select channel flags.
 
#define DAC11_SELECT_CHANNEL_B   0x02
 
#define DAC11_SELECT_CHANNEL_C   0x04
 
#define DAC11_SELECT_CHANNEL_D   0x08
 
#define DAC11_SELECT_CHANNEL_E   0x10
 
#define DAC11_SELECT_CHANNEL_F   0x20
 
#define DAC11_SELECT_CHANNEL_G   0x40
 
#define DAC11_SELECT_CHANNEL_H   0x80
 
#define DAC11_SELECT_ALL_CHANNELS   0xFF
 
#define DAC11_MIN_DAC_VALUE   0x0000
 DAC 11 range values.
 
#define DAC11_MAX_DAC_VALUE   0x0FFF
 
#define DAC11_VREF_3V3   3.3
 DAC 11 vref values.
 
#define DAC11_VREF_5V   5
 
#define DAC11_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define DAC11_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define DAC11_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  dac11_return_value_t { DAC11_OK = 0 , DAC11_ERROR = -1 }
 DAC 11 Click return value data. More...
 

Functions

void dac11_cfg_setup (dac11_cfg_t *cfg)
 DAC 11 configuration object setup function.
 
err_t dac11_init (dac11_t *ctx, dac11_cfg_t *cfg)
 DAC 11 initialization function.
 
err_t dac11_default_cfg (dac11_t *ctx)
 DAC 11 default configuration function.
 
err_t dac11_generic_write (dac11_t *ctx, uint16_t *data_in, uint8_t len)
 DAC 11 generic write function.
 
err_t dac11_write_control_reg (dac11_t *ctx, uint8_t cmd, uint16_t data_in)
 DAC 11 write control register function.
 
err_t dac11_set_all_ch_value (dac11_t *ctx, uint16_t dac_value)
 DAC 11 set all channels value function.
 
err_t dac11_set_all_ch_voltage (dac11_t *ctx, float vref, float voltage)
 DAC 11 set all channels voltage function.
 
err_t dac11_set_specific_ch_value (dac11_t *ctx, uint8_t channel, uint16_t dac_value)
 DAC 11 set specific channels value function.
 
err_t dac11_set_specific_ch_voltage (dac11_t *ctx, uint8_t channel, float vref, float voltage)
 DAC 11 set specific channels voltage function.
 

Detailed Description

This file contains API for DAC 11 Click Driver.

Enumeration Type Documentation

◆ dac11_return_value_t

DAC 11 Click return value data.

Predefined enum values for driver return values.

Enumerator
DAC11_OK 
DAC11_ERROR