Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
EVAL-AD5686R.ino File Reference

Exerciser program for ad5686 no-OS driver. More...

Detailed Description

Exerciser program for ad5686 no-OS driver.

Author
Gbrisebois (grego.nosp@m.ry.b.nosp@m.riseb.nosp@m.ois@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright 2017(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  • The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
  • Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
Gbrisebois (sean..nosp@m.smit.nosp@m.h@ana.nosp@m.log..nosp@m.com)

Copyright 2017(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  • The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
  • Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file EVAL-AD5686R.ino.

Go to the source code of this file.

Functions

static void setup ()
 
static void loop ()
 
static void print_title ()
 Prints the title block. More...
 
static void print_prompt (uint8_t selected_dac, float ref_voltage)
 
static uint8_t menu_1_select_dac (uint8_t *selected_dac)
 
static uint8_t menu_2_write_to_input_register (uint8_t selected_dac, float vref)
 Menu 2: Write to input register only. More...
 
static uint8_t menu_3_update_dac (uint8_t selected_dac)
 
static uint8_t menu_4_write_and_update_dac (uint8_t selected_dac, float vref)
 
static uint8_t menu_5_set_DAC_power_mode (uint8_t selected_dac)
 
static uint8_t menu_6_select_ref_voltage (float *vref)
 
static uint8_t menu_7_read_back_registers ()
 
static uint8_t menu_8_set_ldac_mask ()
 
static uint8_t menu_9_assert_ldac ()
 
static uint8_t menu_10_set_gain ()
 
static uint8_t menu_11_assert_soft_reset ()
 
static uint8_t menu_12_assert_hard_reset ()
 
static uint16_t voltage_to_code (float voltage, float vRef)
 
static uint16_t get_voltage_code (float vRef)
 
static float get_voltage_float ()
 

Variables

const String dac_selection [4]
 
i2c_init_param i2c_params
 
spi_init_param spi_params
 
ad5686_init_param init_params
 
ad5686_dev * device
 
gpio_desc gpio_gain
 
static int32_t connected = -1
 

Function Documentation

◆ get_voltage_code()

static uint16_t get_voltage_code ( float  vRef)
static

Definition at line 573 of file EVAL-AD5686R.ino.

◆ get_voltage_float()

static float get_voltage_float ( )
static

Definition at line 580 of file EVAL-AD5686R.ino.

◆ loop()

static void loop ( void  )
static

Definition at line 137 of file EVAL-AD5686R.ino.

◆ menu_10_set_gain()

static uint8_t menu_10_set_gain ( )
static

Definition at line 499 of file EVAL-AD5686R.ino.

◆ menu_11_assert_soft_reset()

static uint8_t menu_11_assert_soft_reset ( )
static

Definition at line 533 of file EVAL-AD5686R.ino.

◆ menu_12_assert_hard_reset()

static uint8_t menu_12_assert_hard_reset ( )
static

Definition at line 542 of file EVAL-AD5686R.ino.

◆ menu_1_select_dac()

static uint8_t menu_1_select_dac ( uint8_t *  selected_dac)
static

Definition at line 264 of file EVAL-AD5686R.ino.

◆ menu_2_write_to_input_register()

static uint8_t menu_2_write_to_input_register ( uint8_t  selected_dac,
float  vref 
)
static

Menu 2: Write to input register only.

Does not update the output voltage.

Returns
Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
vrefDAC to be updated. 0=A, 1=B, 2=All

Definition at line 294 of file EVAL-AD5686R.ino.

◆ menu_3_update_dac()

static uint8_t menu_3_update_dac ( uint8_t  selected_dac)
static

Definition at line 304 of file EVAL-AD5686R.ino.

◆ menu_4_write_and_update_dac()

static uint8_t menu_4_write_and_update_dac ( uint8_t  selected_dac,
float  vref 
)
static
Parameters
vrefDAC to be updated. 0=A, 1=B, 2=All

Definition at line 316 of file EVAL-AD5686R.ino.

◆ menu_5_set_DAC_power_mode()

static uint8_t menu_5_set_DAC_power_mode ( uint8_t  selected_dac)
static

Definition at line 329 of file EVAL-AD5686R.ino.

◆ menu_6_select_ref_voltage()

static uint8_t menu_6_select_ref_voltage ( float *  vref)
static

Definition at line 415 of file EVAL-AD5686R.ino.

◆ menu_7_read_back_registers()

static uint8_t menu_7_read_back_registers ( )
static

Definition at line 451 of file EVAL-AD5686R.ino.

◆ menu_8_set_ldac_mask()

static uint8_t menu_8_set_ldac_mask ( )
static

Definition at line 471 of file EVAL-AD5686R.ino.

◆ menu_9_assert_ldac()

static uint8_t menu_9_assert_ldac ( )
static

Definition at line 489 of file EVAL-AD5686R.ino.

◆ print_prompt()

static void print_prompt ( uint8_t  selected_dac,
float  ref_voltage 
)
static
Parameters
ref_voltagethis parameter is passed so that it can be printed at the bottom of the menu.

Definition at line 231 of file EVAL-AD5686R.ino.

◆ print_title()

static void print_title ( void  )
static

Prints the title block.

Definition at line 218 of file EVAL-AD5686R.ino.

◆ setup()

static void setup ( void  )
static

Definition at line 102 of file EVAL-AD5686R.ino.

◆ voltage_to_code()

static uint16_t voltage_to_code ( float  voltage,
float  vRef 
)
static

Definition at line 555 of file EVAL-AD5686R.ino.

Variable Documentation

◆ connected

int32_t connected = -1
static

Definition at line 100 of file EVAL-AD5686R.ino.

◆ dac_selection

const String dac_selection[4]
Initial value:
=
{
"A",
"B",
"C",
"D"
}

Definition at line 56 of file EVAL-AD5686R.ino.

◆ device

ad5686_dev* device

Definition at line 91 of file EVAL-AD5686R.ino.

◆ gpio_gain

gpio_desc gpio_gain
Initial value:

Definition at line 93 of file EVAL-AD5686R.ino.

◆ i2c_params

i2c_init_param i2c_params
Initial value:

Definition at line 65 of file EVAL-AD5686R.ino.

◆ init_params

ad5686_init_param init_params
Initial value:
=
{
4,
5,
ID_AD5686R,
}
i2c_init_param i2c_params
spi_init_param spi_params

Definition at line 82 of file EVAL-AD5686R.ino.

◆ spi_params

spi_init_param spi_params
Initial value:
=
{
50000000,
1,
}
#define QUIKEVAL_CS
QuikEval CS pin (SPI chip select on QuikEval connector pin 6) connects to Arduino SS pin...
Definition: Linduino.h:57

Definition at line 73 of file EVAL-AD5686R.ino.