Modular Electronics  0.1
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
AD5764 Class Reference

#include <AD5764.h>

Inheritance diagram for AD5764:
DacSpi

Public Member Functions

 AD5764 (uint8_t sync_pin, uint8_t spi_bus_config_pin, uint8_t ldac_pin, uint8_t slot_number=0, double full_scale=10.0)
 
uint8_t Initialize (void)
 
virtual double BytesToVoltage (spi_utils::Message message)
 
virtual spi_utils::Message SetVoltageMessage (uint8_t channel, double voltage)
 
virtual spi_utils::Message InitializeMessage (void)
 
- Public Member Functions inherited from DacSpi
 DacSpi (uint8_t sync_pin, uint8_t spi_bus_config_pin, uint8_t ldac_pin, uint8_t bit_resolution, uint8_t clock_divider=4, BitOrder bit_order=MSBFIRST, uint8_t spi_mode=SPI_MODE1)
 
uint8_t Begin (void)
 
uint8_t Initialize (void)
 
double SetVoltage (uint8_t channel, double voltage, bool update_outputs=true)
 
void UpdateAnalogOutputs (void)
 
double GetVoltage (uint8_t channel)
 

Additional Inherited Members

Detailed Description

AD5764 class

Author
Carlos Kometter
Version
0.1
Date
2018

Constructor & Destructor Documentation

AD5764::AD5764 ( uint8_t  sync_pin,
uint8_t  spi_bus_config_pin,
uint8_t  ldac_pin,
uint8_t  slot_number = 0,
double  full_scale = 10.0 
)

Constructor

Parameters
[in]sync_pinThe sync or chip select of the dac chip. Different than spi_bus_config_pin.
[in]spi_bus_config_pinThe pin that identifies the bus. More than one dac can share the same pin.
[in]ldac_pinThe ldac pin used to update the analog outputs.
[in]slot_numberThis number is used to identify the chip or board. (default: 0)
[in]full_scaleThe full scale of the dac voltage in V units. (default: 10)

Member Function Documentation

double AD5764::BytesToVoltage ( spi_utils::Message  message)
virtual

Uses chip specifications (e.g. bit resolution, registers, range) to convert a set of bytes stored in a Message object to voltage. Each DAC has its own convertion function. Check the datasheet of each chip and override the function below accordingly.

Parameters
[in]messageMessage object which stores the bytes for conversion.
Returns
The current voltage setted on the dac register.

Reimplemented from DacSpi.

uint8_t AD5764::Initialize ( void  )
inline

Dummy function for inheritance compatibility.

Returns
0
virtual spi_utils::Message AD5764::InitializeMessage ( void  )
inlinevirtual
Returns
Message object to intialize Dac.

Reimplemented from DacSpi.

spi_utils::Message AD5764::SetVoltageMessage ( uint8_t  channel,
double  voltage 
)
virtual
Parameters
[in]channelSpecifies the channel the Message will set the voltage to.
[in]voltageSpecifies the voltage.
Returns
Message object to write data register.

Reimplemented from DacSpi.


The documentation for this class was generated from the following files: