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

#include <AD7734.h>

Inheritance diagram for AD7734:
AdcSpi

Public Member Functions

 AD7734 (uint8_t sync_pin, uint8_t spi_bus_config_pin, uint8_t data_ready_pin, uint8_t slot_number=0, uint8_t reset_pin=0)
 
- Public Member Functions inherited from AdcSpi
 AdcSpi (uint8_t sync_pin, uint8_t spi_bus_config_pin, uint8_t data_ready_pin, uint8_t bit_resolution, uint8_t reset_pin=0, uint8_t clock_divider=7, BitOrder bit_order=MSBFIRST, uint8_t spi_mode=SPI_MODE3)
 
bool Begin (void)
 
double ReadVoltage (uint8_t channel=0)
 
uint8_t ReadVoltage (uint8_t channel, byte previous_meas[], bool send)
 

Protected Member Functions

virtual double BytesToVoltage (spi_utils::Message message)
 
virtual spi_utils::Message SingleConversionModeMessage (uint8_t channel)
 
virtual spi_utils::Message ReadDataRegisterMessage (uint8_t channel)
 

Detailed Description

AD7734 class

Author
Carlos Kometter
Version
0.1
Date
2018

Constructor & Destructor Documentation

AD7734::AD7734 ( uint8_t  sync_pin,
uint8_t  spi_bus_config_pin,
uint8_t  data_ready_pin,
uint8_t  slot_number = 0,
uint8_t  reset_pin = 0 
)

Constructor

Parameters
[in]sync_pinThe sync or chip select of the adc chip. Different than spi_bus_config_pin
[in]spi_bus_config_pinThe pin that identifies the bus. More than one adc can share the same pin.
[in]data_ready_pinThis pin tells whether the adc has finished measuring a voltage.
[in]slot_numberThis number is used to identify the chip or board. (default: 0)
[in]reset_pinThe reset pin

Member Function Documentation

double AD7734::BytesToVoltage ( spi_utils::Message  message)
protectedvirtual

Uses chip specifications (e.g. bit resolution, registers, range) to convert a set of bytes stored in a Message object to voltage. Each ADC 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 measured voltage.

Implements AdcSpi.

spi_utils::Message AD7734::ReadDataRegisterMessage ( uint8_t  channel)
protectedvirtual
Parameters
[in]channelThe channel to be read.
Returns
Message object to read the data register.

Implements AdcSpi.

spi_utils::Message AD7734::SingleConversionModeMessage ( uint8_t  channel)
protectedvirtual
Parameters
[in]channelThe channel to start single conversion mode on dump mode.
Returns
Message object to start single conversion mode on dump mode.

Implements AdcSpi.


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