|
pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
|
Class representing communication with the Digital-Analog Converter on the HGC ROC. More...
#include <Bias.h>
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. | |
Private Attributes | |
| std::shared_ptr< I2C > | i2c_ |
| our connection | |
| uint8_t | our_addr_ |
| our addr on the chip | |
Class representing communication with the Digital-Analog Converter on the HGC ROC.
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.
| pflib::MAX5825::MAX5825 | ( | std::shared_ptr< I2C > | i2c, |
| uint8_t | max_addr ) |
| 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.
| 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"
| 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.
| void pflib::MAX5825::setRefVoltage | ( | int | level | ) |
Set reference voltage.
| [in] | level | (0 - external, 1 - 2.5V, 2 - 2.048V, 3 - 4.096V) |