1#ifndef PFLIB_MAX5825_H_
2#define PFLIB_MAX5825_H_
29 static const uint8_t WDOG;
34 static const uint8_t RETURNn;
35 static const uint8_t CODEn;
36 static const uint8_t LOADn;
37 static const uint8_t CODEn_LOADALL;
38 static const uint8_t CODEn_LOADn;
39 static const uint8_t REFn;
40 static const uint8_t POWERn;
46 MAX5825(
I2C& i2c, uint8_t max_addr,
int bus = 4);
70 void set(uint8_t cmd, uint16_t data_bytes);
101 void setByDAC(uint8_t i_dac, uint8_t cmd, uint16_t twelve_bit_setting);
137 static const uint8_t ADDR_LED_1;
138 static const uint8_t ADDR_SIPM_0;
139 static const uint8_t ADDR_SIPM_1;
158 void cmdLED(uint8_t i_led, uint8_t cmd, uint16_t twelve_bit_setting);
163 void cmdSiPM(uint8_t i_sipm, uint8_t cmd, uint16_t twelve_bit_setting);
173 void setLED(uint8_t i_led, uint16_t code);
183 void setSiPM(uint8_t i_sipm, uint16_t code);
The HGC ROC has 4 MAX5825 chips doing the DAC for the bias voltages.
Definition: Bias.h:133
void setSiPM(uint8_t i_sipm, uint16_t code)
Set and load the passed CODE for an SiPM bias.
Definition: Bias.cxx:124
Bias(I2C &i2c, int bus=4)
Wrap an I2C class for communicating with all the DAC chips.
Definition: Bias.cxx:94
std::vector< MAX5825 > led_
LED bias chips.
Definition: Bias.h:187
void setLED(uint8_t i_led, uint16_t code)
Set and load the passed CODE for an LED bias.
Definition: Bias.cxx:120
std::vector< MAX5825 > sipm_
SiPM bias chips.
Definition: Bias.h:189
void initialize()
Initialize to standard settings Reference voltage - 4.096V.
Definition: Bias.cxx:101
static const uint8_t ADDR_LED_0
DAC chip addresses.
Definition: Bias.h:136
void cmdSiPM(uint8_t i_sipm, uint8_t cmd, uint16_t twelve_bit_setting)
Pass a setting to one SiPM DAC.
Definition: Bias.cxx:115
void cmdLED(uint8_t i_led, uint8_t cmd, uint16_t twelve_bit_setting)
Pass a setting to one LED DAC.
Definition: Bias.cxx:110
Class which encapsulates the I2C controller in the Polarfire.
Definition: I2C.h:13
Class representing communication with the Digital-Analog Converter on the HGC ROC.
Definition: Bias.h:26
uint8_t our_addr_
our addr on the chip
Definition: Bias.h:116
void setByDAC(uint8_t i_dac, uint8_t cmd, uint16_t twelve_bit_setting)
set by DAC index
Definition: Bias.cxx:80
std::vector< uint8_t > get(uint8_t cmd, int n_return_bytes=2)
Get the settings for the DACs on this MAX.
Definition: Bias.cxx:24
void set(uint8_t cmd, uint16_t data_bytes)
Write a setting for the DACs on this MAX.
Definition: Bias.cxx:40
MAX5825(I2C &i2c, uint8_t max_addr, int bus=4)
Wrap an I2C class for communicating with the MAX5825.
Definition: Bias.cxx:22
void setRefVoltage(int level)
Set reference voltage 0 - external 1 - 2.5V 2 - 2.048V 3 - 4.096V.
Definition: Bias.cxx:61
I2C & i2c_
our connection
Definition: Bias.h:114
int bus_
our bus
Definition: Bias.h:118
std::vector< uint16_t > getByDAC(uint8_t i_dac, uint8_t cmd)
get by DAC index
Definition: Bias.cxx:66
Polarfire Interaction Library.
Definition: Backend.h:8