pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::MAX5825 Class Reference

Class representing communication with the Digital-Analog Converter on the HGC ROC. More...

#include <Bias.h>

Collaboration diagram for pflib::MAX5825:
[legend]

Public Member Functions

 MAX5825 (std::shared_ptr< I2C > i2c, uint8_t max_addr)
 Wrap an I2C class for communicating with the MAX5825.
 
void reset ()
 send the SW_RESET command to the MAX5825
 
std::vector< uint8_t > get (uint8_t channel)
 Get the settings for the DACs on this MAX.
 
void set (uint8_t channel, uint16_t data_bytes)
 Write a setting for the DACs on this MAX.
 
void setRefVoltage (int level)
 Set reference voltage.
 

Static Public Attributes

static const uint8_t WDOG = 1 << 4
 
static const uint8_t RETURNn = 7 << 4
 
static const uint8_t CODEn = 8 << 4
 
static const uint8_t LOADn = 9 << 4
 
static const uint8_t CODEn_LOADALL = 10 << 4
 
static const uint8_t CODEn_LOADn = 11 << 4
 
static const uint8_t REFn = 2 << 4
 
static const uint8_t POWERn = 4 << 4
 

Private Attributes

std::shared_ptr< I2Ci2c_
 our connection
 
uint8_t our_addr_
 our addr on the chip
 

Detailed Description

Class representing communication with the Digital-Analog Converter on the HGC ROC.

MAX5825

https://datasheets.maximintegrated.com/en/ds/MAX5823-MAX5825.pdf

CODE - future setting for the DAC output LOAD - load CODE into DAC outputs CODE_LOAD - CODE and then LOAD

The lower-level set and get functions are for chip-wide configuration (e.g. the watch dog WDOG configuration).

Use the {set,get}byDAC functions when setting or getting DAC parameters.

Constructor & Destructor Documentation

◆ MAX5825()

pflib::MAX5825::MAX5825 ( std::shared_ptr< I2C > i2c,
uint8_t max_addr )

Wrap an I2C class for communicating with the MAX5825.

The bus we are on is the same as the ROC's bus.

Member Function Documentation

◆ get()

std::vector< uint8_t > pflib::MAX5825::get ( uint8_t channel)

Get the settings for the DACs on this MAX.

We return the bytes requested i.e. further parsing will be necessary especially in the per-DAC case where the settings are the twelve MSBs from two concatenated returned bytes.

◆ reset()

void pflib::MAX5825::reset ( )

send the SW_RESET command to the MAX5825

"All CODE, DAC, and Control Register values are returned to their power-on reset values"

◆ set()

void pflib::MAX5825::set ( uint8_t channel,
uint16_t data_bytes )

Write a setting for the DACs on this MAX.

The input two data bytes is a single 16-bit word where the 8 MSBs are the first data byte and the 8 LSBs are the second. Some pre-parsing may be necessary e.g. 12-bit settings for a specific DAC would need to be passed as data_bytes = actual_12_bit_setting << 4; Since the chip expects the 12-bit settings to be the 12 MSBs from these two concatenated data words.

◆ setRefVoltage()

void pflib::MAX5825::setRefVoltage ( int level)

Set reference voltage.

Parameters
[in]level(0 - external, 1 - 2.5V, 2 - 2.048V, 3 - 4.096V)

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