dac4 2.0.0.0
dac4.h File Reference

This file contains API for DAC 4 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  dac4_channel_setting_t
 
struct  dac4_channel_t
 
struct  dac4_v_ref_channels_t
 
struct  dac4_pm_channels_t
 
struct  dac4_gain_channels_t
 
struct  dac4_t
 Click ctx object definition. More...
 
struct  dac4_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DAC4_MAP_MIKROBUS(cfg, mikrobus)
 
#define DAC4_OK   0
 
#define DAC4_ERROR   -1
 
#define DAC4_DEVICE_ADDRESS   0x60
 
#define DAC4_CHANNEL_A   0
 
#define DAC4_CHANNEL_B   1
 
#define DAC4_CHANNEL_C   2
 
#define DAC4_CHANNEL_D   3
 
#define DAC4_UPDATE   0
 
#define DAC4_DONT_UPDATE   1
 
#define DAC4_VREF_EXTERNAL   0
 
#define DAC4_VREF_INTERNAL   1
 
#define DAC4_MODE_NORMAL   0
 
#define DAC4_MODE_1kOhm   1
 
#define DAC4_MODE_100kOhm   2
 
#define DAC4_MODE_500kOhm   3
 
#define DAC4_GAIN_x1   0
 
#define DAC4_GAIN_x2   1
 

Functions

void dac4_cfg_setup (dac4_cfg_t *cfg)
 Config Object Initialization function.
 
err_t dac4_init (dac4_t *ctx, dac4_cfg_t *cfg)
 Initialization function.
 
void dac4_generic_write (dac4_t *ctx, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void dac4_generic_read (dac4_t *ctx, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t dac4_int_get (dac4_t *ctx)
 Getting INT pin state.
 
void dac4_pwm_set (dac4_t *ctx, uint8_t pin_state)
 Setting PWM pin state.
 
void dac4_i2c_get (dac4_t *ctx, uint8_t *get_buffer, uint16_t n_bytes)
 Getting data via I2C.
 
void dac4_i2c_set (dac4_t *ctx, uint8_t *set_buffer, uint16_t n_bytes)
 Setting data via I2C.
 
uint8_t dac4_general_call_reset (dac4_t *ctx)
 Executing reset command.
 
uint8_t dac4_general_call_wake_up (dac4_t *ctx)
 Executing wake up command.
 
uint8_t dac4_general_call_software_update (dac4_t *ctx)
 Executing software update command.
 
uint8_t dac4_fast_write (dac4_t *ctx, dac4_channel_t *channels)
 Executing fast write command.
 
uint8_t dac4_multi_write (dac4_t *ctx, dac4_channel_setting_t *channel_buffer, uint8_t n_channels)
 Executing multi-write command.
 
uint8_t dac4_sequential_write (dac4_t *ctx, uint8_t starting_channel, dac4_channel_setting_t *channel_buffer)
 Executing sequential write command.
 
uint8_t dac4_single_write (dac4_t *ctx, dac4_channel_setting_t *channel_x)
 Executing single write command.
 
uint8_t dac4_voltage_reference_set (dac4_t *ctx, dac4_v_ref_channels_t *vref)
 Setting channel voltage reference values.
 
uint8_t dac4_power_mode_set (dac4_t *ctx, dac4_pm_channels_t *pm)
 Setting channel power modes.
 
uint8_t dac4_gain_set (dac4_t *ctx, dac4_gain_channels_t *gain)
 Writing channel gain values.
 
uint8_t dac4_data_report (dac4_t *ctx, dac4_channel_setting_t *channel_buffer)
 

Detailed Description

This file contains API for DAC 4 Click driver.