dac6 2.0.0.0
Functions
Public function

Functions

void dac6_cfg_setup (dac6_cfg_t *cfg)
 Config Object Initialization function. More...
 
DAC6_RETVAL dac6_init (dac6_t *ctx, dac6_cfg_t *cfg)
 Initialization function. More...
 
void dac6_generic_transfer (dac6_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function. More...
 
void dac6_write_data (dac6_t *ctx, uint16_t wr_data)
 Generic write function. More...
 
float dac6_set_output (dac6_t *ctx)
 Set DAC output function. More...
 

Detailed Description

Function Documentation

◆ dac6_cfg_setup()

void dac6_cfg_setup ( dac6_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ dac6_generic_transfer()

void dac6_generic_transfer ( dac6_t ctx,
uint8_t *  wr_buf,
uint16_t  wr_len,
uint8_t *  rd_buf,
uint16_t  rd_len 
)

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ dac6_init()

DAC6_RETVAL dac6_init ( dac6_t ctx,
dac6_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ dac6_set_output()

float dac6_set_output ( dac6_t ctx)

Set DAC output function.

Parameters
ctxClick object.
Strucrure arguments:
  • chan 8-bit data that defines output channel
  • op_mod 8-bit data that defines mode of operation
  • set_out 16-bit data that defines output level
  • v_ref 16-bit reference voltage input [ mv ]

@description Function is used to set operation mode output channel and level.

Note
 
  • Device's output levels range from 0 to 4095.
  • Device's ideal output voltage can be calculated by using the equation : Vout = Vrefin � (set_out / 4095).
  • It is advisable to use predefined values or to consult the datasheet.

◆ dac6_write_data()

void dac6_write_data ( dac6_t ctx,
uint16_t  wr_data 
)

Generic write function.

Parameters
ctxClick object.
wr_data16-bit write data

@description Sends 16-bit data to the device's input shift register.