|
pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
|
The HGC ROC has 4 MAX5825 chips doing the DAC for the bias voltages. More...
#include <Bias.h>
Public Member Functions | |
| Bias (std::shared_ptr< I2C > bias_i2c, std::shared_ptr< I2C > board_i2c, bool use_cache) | |
| Wrap I2C objects for communicating with all the DAC chips. | |
| Bias (const Bias &)=delete | |
| dont copy construct this class | |
| Bias & | operator= (const Bias &)=delete |
| dont copy assign this class | |
| void | initialize () |
| Initialize to standard settings. | |
| double | readTemp () |
| Read the temperature from the temp sensor on the HGCROC board. | |
| std::optional< int > | readSiPM (uint8_t i_sipm) |
| std::optional< int > | readLED (uint8_t i_led) |
| void | setSiPM (uint8_t i_sipm, uint16_t code) |
| void | setLED (uint8_t i_led, uint16_t code) |
Private Attributes | |
| std::shared_ptr< I2C > | i2c_bias_ |
| I2C comms with bias DACs MAX5825. | |
| std::shared_ptr< I2C > | i2c_board_ |
| I2C comms with HGCROC board periferials. | |
| std::vector< MAX5825 > | led_ |
| LED bias chips. | |
| std::vector< MAX5825 > | sipm_ |
| SiPM bias chips. | |
| bool | use_cache_ |
| whether to use the software cache of the settings | |
| std::array< std::optional< int >, N_CHANNELS > | sipm_cache_ |
| cache of sipm settings | |
| std::array< std::optional< int >, N_CHANNELS > | led_cache_ |
| cache of led settings | |
The HGC ROC has 4 MAX5825 chips doing the DAC for the bias voltages.
Two of the chips handle the 16 LED bias voltages and the other two handle the 16 SiPM bias voltages.
Both the LED and SiPM bias voltages are indexed from 0 to 15. The conversion from that index to a chip and DAC index on that chip is done in this class.
The readback of the DAC settings in the MAX5825 seem to require a "repeated start" I2C transaction where the register to be read and the read command are sent before the next I2C stop. Originally pointed out by Lennart at Lund, this "repeated start" transaction cannot be done by the lpGBT, so actual readback of the DAC settings is not supported in fiberfull setups.
| pflib::Bias::Bias | ( | std::shared_ptr< I2C > | bias_i2c, |
| std::shared_ptr< I2C > | board_i2c, | ||
| bool | use_cache ) |
Wrap I2C objects for communicating with all the DAC chips.
The bus is 4 + <board-number>, so we set the default to 4 for the case where we only have one board with bus number 0.
| void pflib::Bias::initialize | ( | ) |
Initialize to standard settings.
reset all CODEs, DACs, and CRs to zero
Set internal ref on DAC to 4.096 V
Set up the GPIO device MCP23008
Turn on the status LED
Set up the board temperature sensor TMP101
Set up the two onewire-to-I2C devices DS2482