Parent class containing methods common to AD5666, AD5676, and AD5686 DAC chips.
More...
#include <ad56x6.h>
|
| | AD56x6 (NanoPi &np, int cs) |
| | Constructor.
|
| |
|
unsigned char * | AssembleWord (uint8_t cmd, uint8_t chan, uint16_t *data=NULL) |
| | Assembles the SPI word from command, channel, and data.
|
| |
|
bool | Set (unsigned short chan, uint16_t setting, bool confirm=true) |
| | Sets the selected DAC channel to a value, confirms with readback.
|
| |
| virtual uint16_t | GetSetting (double v, unsigned short chan=0)=0 |
| | Translates analog voltage to DAC setting, requires calibration.
|
| |
| virtual double | GetVoltage (uint16_t s, unsigned short chan=0)=0 |
| | Translates DAC setting to analog voltage, requires calibration.
|
| |
| bool | RampVoltage (unsigned short chan, uint16_t vset=-1, unsigned int steps=16, unsigned int tdelay=500) |
| | Test method to ramp through voltage settings.
|
| |
|
void | PowerOn () |
| | Send POWER_UP command to DAC.
|
| |
|
uint16_t | GetData () |
| | Extract 16 bit setting from readback word.
|
| |
| void | Readback (short ch=-1) |
| | Read back DAC settings and write them to vector readback.
|
| |
|
|
const uint16_t | vfull = 0xffff |
| | Full scale output.
|
| |
|
const uint8_t | nbytes = 3 |
| | Size of data word in bytes.
|
| |
|
std::vector< uint16_t > | readback |
| | Read back DAC settings after Readback() was called.
|
| |
|
|
virtual uint8_t | EncChan (uint8_t chan) |
| | Format channel number for use in SPI word (3-bit number)
|
| |
|
|
uint32_t | bits = 0 |
| |
|
NanoPi * | nanoPi = NULL |
| |
|
const int | cselect |
| |
|
bool | verbose = false |
| |
Parent class containing methods common to AD5666, AD5676, and AD5686 DAC chips.
This contains everything needed for the SPI communication with an AD56x6 DAC chip, except for those parts that differ between chips.
◆ AD56x6()
| AD56x6::AD56x6 |
( |
NanoPi & | np, |
|
|
int | cs ) |
|
inline |
Constructor.
- Parameters
-
| np | An instance of a NanoPi object, needed for the actual hardware communication |
| cs | SPI channel select addressing the chip in question |
◆ GetSetting()
| virtual uint16_t AD56x6::GetSetting |
( |
double | v, |
|
|
unsigned short | chan = 0 ) |
|
pure virtual |
Translates analog voltage to DAC setting, requires calibration.
Implemented in AD5676, and AD5686R.
◆ GetVoltage()
| virtual double AD56x6::GetVoltage |
( |
uint16_t | s, |
|
|
unsigned short | chan = 0 ) |
|
pure virtual |
Translates DAC setting to analog voltage, requires calibration.
Implemented in AD5676, and AD5686R.
◆ RampVoltage()
| bool AD56x6::RampVoltage |
( |
unsigned short | chan, |
|
|
uint16_t | vset = -1, |
|
|
unsigned int | steps = 16, |
|
|
unsigned int | tdelay = 500 ) |
Test method to ramp through voltage settings.
Only used for functionality tests, not that useful for general use.
- Parameters
-
| chan | channel number |
| vset | maximum setting, use -1 to go to full scale |
| steps | number of steps between 0 and vset |
| tdelay | milliseconds to wait between steps |
◆ Readback()
| void AD56x6::Readback |
( |
short | ch = -1 | ) |
|
Read back DAC settings and write them to vector readback.
- Parameters
-
| ch | channel to read back, -1 reads all channels |
The documentation for this class was generated from the following files: