dac4 2.0.0.0
Public function

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

Function Documentation

◆ dac4_cfg_setup()

void dac4_cfg_setup ( dac4_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ dac4_data_report()

uint8_t dac4_data_report ( dac4_t * ctx,
dac4_channel_setting_t * channel_buffer )

◆ dac4_fast_write()

uint8_t dac4_fast_write ( dac4_t * ctx,
dac4_channel_t * channels )

Executing fast write command.

Parameters
ctxClick object.
channelsSettings for channels
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes fast write command
dac_channel_setting_t.rdy_bit           - set to 0
dac_channel_setting_t.por_bit           - set to 0
dac_channel_setting_t.channel_select    - set to 0
dac_channel_setting_t.udac_bit          - set to 0
dac_channel_setting_t.voltage_reference - set to 0
dac_channel_setting_t.power_mode        - set to desired value
dac_channel_setting_t.gain_value        - set to 0
dac_channel_setting_t.dac_input_data    - set to desired value

◆ dac4_gain_set()

uint8_t dac4_gain_set ( dac4_t * ctx,
dac4_gain_channels_t * gain )

Writing channel gain values.

Parameters
ctxClick object.
uint8_tgain_channel_a - gain value for channel A
uint8_tgain_channel_b - gain value for channel B
uint8_tgain_channel_c - gain value for channel C
uint8_tgain_channel_d - gain value for channel D
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function sets gain values for each channel

◆ dac4_general_call_reset()

uint8_t dac4_general_call_reset ( dac4_t * ctx)

Executing reset command.

Parameters
ctxClick object.
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes general call reset command

◆ dac4_general_call_software_update()

uint8_t dac4_general_call_software_update ( dac4_t * ctx)

Executing software update command.

Parameters
ctxClick object.
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes general call software update command

◆ dac4_general_call_wake_up()

uint8_t dac4_general_call_wake_up ( dac4_t * ctx)

Executing wake up command.

Parameters
ctxClick object.
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes general call wake up command

◆ dac4_generic_read()

void dac4_generic_read ( dac4_t * ctx,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
data_bufOutput data buf
lenNumber of the bytes to be read

This function reads desired number of data bytes.

◆ dac4_generic_write()

void dac4_generic_write ( dac4_t * ctx,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

This function writes desired number of data bytes.

◆ dac4_i2c_get()

void dac4_i2c_get ( dac4_t * ctx,
uint8_t * get_buffer,
uint16_t n_bytes )

Getting data via I2C.

Parameters
ctxClick object.
uint8_tget_buffer - data buffer
uint16_tn_bytes - number of bytes
Note
This function performs I2C read operation

◆ dac4_i2c_set()

void dac4_i2c_set ( dac4_t * ctx,
uint8_t * set_buffer,
uint16_t n_bytes )

Setting data via I2C.

Parameters
ctxClick object.
uint8_tget_buffer - data buffer
uint16_tn_bytes - number of bytes
Note
This function performs I2C write operation

◆ dac4_init()

err_t dac4_init ( dac4_t * ctx,
dac4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ dac4_int_get()

uint8_t dac4_int_get ( dac4_t * ctx)

Getting INT pin state.

Parameters
ctxClick object.
Returns
0 if INT pin is LOW
1 if INT pin is HIGH
Note
This function returns INT pin state

◆ dac4_multi_write()

uint8_t dac4_multi_write ( dac4_t * ctx,
dac4_channel_setting_t * channel_buffer,
uint8_t n_channels )

Executing multi-write command.

Parameters
ctxClick object.
dac_channel_setting_tchannel_buffer - channel setting buffer
uint8_tn_channels - number of channels
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes multi write command
dac_channel_setting_t.rdy_bit           - set to 0
dac_channel_setting_t.por_bit           - set to 0
dac_channel_setting_t.channel_select    - set to desired value
dac_channel_setting_t.udac_bit          - set to desired value
dac_channel_setting_t.voltage_reference - set to desired value
dac_channel_setting_t.power_mode        - set to desired value
dac_channel_setting_t.gain_value        - set to desired value
dac_channel_setting_t.dac_input_data    - set to desired value

◆ dac4_power_mode_set()

uint8_t dac4_power_mode_set ( dac4_t * ctx,
dac4_pm_channels_t * pm )

Setting channel power modes.

Parameters
ctxClick object.
uint8_tpm_channel_a - power mode for channel A
uint8_tpm_channel_b - power mode for channel B
uint8_tpm_channel_c - power mode for channel C
uint8_tpm_channel_d - power mode for channel D
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function sets power mode for each channel

◆ dac4_pwm_set()

void dac4_pwm_set ( dac4_t * ctx,
uint8_t pin_state )

Setting PWM pin state.

Parameters
ctxClick object.
uint8_tpin_state - pin state
Note
This function sets PWM pin state

◆ dac4_sequential_write()

uint8_t dac4_sequential_write ( dac4_t * ctx,
uint8_t starting_channel,
dac4_channel_setting_t * channel_buffer )

Executing sequential write command.

Parameters
ctxClick object.
uint8_tstarting_channel - starting channel
dac_channel_setting_tchannel_buffer - channel setting buffer
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes sequenctial write command
dac_channel_setting_t.rdy_bit           - set to 0
dac_channel_setting_t.por_bit           - set to 0
dac_channel_setting_t.channel_select    - set to desired value
dac_channel_setting_t.udac_bit          - set to desired value
dac_channel_setting_t.voltage_reference - set to desired value
dac_channel_setting_t.power_mode        - set to desired value
dac_channel_setting_t.gain_value        - set to desired value
dac_channel_setting_t.dac_input_data    - set to desired value

◆ dac4_single_write()

uint8_t dac4_single_write ( dac4_t * ctx,
dac4_channel_setting_t * channel_x )

Executing single write command.

Parameters
ctxClick object.
dac_channel_setting_tchannel_x[ 0 ] - channel settings
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function executes single write command
dac_channel_setting_t.rdy_bit           - set to 0
dac_channel_setting_t.por_bit           - set to 0
dac_channel_setting_t.channel_select    - set to desired value
dac_channel_setting_t.udac_bit          - set to desired value
dac_channel_setting_t.voltage_reference - set to desired value
dac_channel_setting_t.power_mode        - set to desired value
dac_channel_setting_t.gain_value        - set to desired value
dac_channel_setting_t.dac_input_data    - set to desired value

◆ dac4_voltage_reference_set()

uint8_t dac4_voltage_reference_set ( dac4_t * ctx,
dac4_v_ref_channels_t * vref )

Setting channel voltage reference values.

Parameters
ctxClick object.
uint8_tv_ref_channel_a - voltage reference for channel A
uint8_tv_ref_channel_b - voltage reference for channel B
uint8_tv_ref_channel_c - voltage reference for channel C
uint8_tv_ref_channel_d - voltage reference for channel D
Returns
0 for successful operation
1 for unsuccessful operation
Note
This function sets voltage reference value for each channel