REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
The DAC60508 is the 12-Bit 8-channel DAC, used in the MInt-Block for the initial conditions. More...
#include <DAC60508.h>


Public Member Functions | |
DAC60508 (bus::addr_t address, float reference_voltage=2.5f) | |
uint16_t | float_to_raw (float value) const |
Value gets clamped to min and max values. | |
float | raw_to_float (uint16_t value) const |
bool | set_channel_raw (uint8_t idx, uint16_t value) const |
Raw value can be between RAW_ZERO and RAW_MAX. | |
bool | set_channel (uint8_t idx, float value) const |
bool | init () const |
bool | set_external_reference (bool set=true) const |
bool | set_double_gain (uint8_t idx, bool set=true) const |
bool | set_double_gain (bool set=true) const |
DataFunction (bus::addr_t address, const SPISettings &spiSettings) | |
![]() | |
DataFunction (bus::addr_t address, const SPISettings &spiSettings) | |
void | begin_communication () const |
void | end_communication () const |
![]() | |
Function (bus::addr_t address) | |
Static Public Member Functions | |
static constexpr uint8_t | REG_DAC (const uint8_t i) |
Static Public Attributes | |
static constexpr uint8_t | REG_NOOP = 0 |
static constexpr uint8_t | REG_DEVICE_ID = 1 |
static constexpr uint8_t | REG_SYNC = 2 |
static constexpr uint8_t | REG_CONFIG = 3 |
static constexpr uint8_t | REG_GAIN = 4 |
static constexpr uint8_t | REG_TRIGGER = 5 |
static constexpr uint8_t | REG_BROADCAST = 6 |
static constexpr uint8_t | REG_STATUS = 7 |
static constexpr uint16_t | RAW_ZERO = 0x0 |
static constexpr uint16_t | RAW_MAX = 0x0FFF |
static const SPISettings | DEFAULT_SPI_SETTINGS {4'000'000, MSBFIRST, SPI_MODE2} |
Additional Inherited Members | |
![]() | |
const SPISettings & | spi_settings |
![]() | |
const bus::addr_t | address |
![]() | |
void | transfer (const void *mosi_buf, void *miso_buf, size_t count) const |
uint8_t | transfer8 (uint8_t data_in) const |
uint16_t | transfer16 (uint16_t data_in) const |
uint32_t | transfer32 (uint32_t data_in) const |
![]() | |
static SPIClass & | get_raw_spi () |
Detailed Description
The DAC60508 is the 12-Bit 8-channel DAC, used in the MInt-Block for the initial conditions.
This class encapsulates the SPI programming access to the chip.
Definition at line 17 of file DAC60508.h.
Constructor & Destructor Documentation
◆ DAC60508()
|
explicit |
Definition at line 33 of file DAC60508.cpp.
Member Function Documentation
◆ DataFunction()
functions::DataFunction::DataFunction | ( | bus::addr_t | address, |
const SPISettings & | spiSettings ) |
Definition at line 63 of file functions.cpp.
◆ float_to_raw()
uint16_t functions::DAC60508::float_to_raw | ( | float | value | ) | const |
Value gets clamped to min and max values.
Definition at line 36 of file DAC60508.cpp.
◆ init()
bool functions::DAC60508::init | ( | ) | const |
Definition at line 58 of file DAC60508.cpp.
References REG_CONFIG, and REG_GAIN.
◆ raw_to_float()
float functions::DAC60508::raw_to_float | ( | uint16_t | value | ) | const |
Definition at line 44 of file DAC60508.cpp.
◆ REG_DAC()
|
inlinestaticconstexpr |
Definition at line 28 of file DAC60508.h.
◆ set_channel()
bool functions::DAC60508::set_channel | ( | uint8_t | idx, |
float | value ) const |
Definition at line 54 of file DAC60508.cpp.
◆ set_channel_raw()
bool functions::DAC60508::set_channel_raw | ( | uint8_t | idx, |
uint16_t | value ) const |
Raw value can be between RAW_ZERO and RAW_MAX.
Definition at line 48 of file DAC60508.cpp.
◆ set_double_gain() [1/2]
bool functions::DAC60508::set_double_gain | ( | bool | set = true | ) | const |
Definition at line 90 of file DAC60508.cpp.
◆ set_double_gain() [2/2]
bool functions::DAC60508::set_double_gain | ( | uint8_t | idx, |
bool | set = true ) const |
Definition at line 77 of file DAC60508.cpp.
◆ set_external_reference()
bool functions::DAC60508::set_external_reference | ( | bool | set = true | ) | const |
Definition at line 68 of file DAC60508.cpp.
Member Data Documentation
◆ DEFAULT_SPI_SETTINGS
|
static |
Definition at line 7 of file DAC60508.h.
◆ RAW_MAX
|
staticconstexpr |
Definition at line 31 of file DAC60508.h.
Referenced by blocks::MMulBlockHAL_V_1_0_X::float_to_raw_calibration(), and blocks::MMulBlockHAL_V_1_0_X::raw_to_float_calibration().
◆ RAW_ZERO
|
staticconstexpr |
Definition at line 30 of file DAC60508.h.
Referenced by blocks::MMulBlockHAL_V_1_0_X::float_to_raw_calibration(), and blocks::MMulBlockHAL_V_1_0_X::raw_to_float_calibration().
◆ REG_BROADCAST
|
staticconstexpr |
Definition at line 25 of file DAC60508.h.
◆ REG_CONFIG
|
staticconstexpr |
Definition at line 22 of file DAC60508.h.
Referenced by init().
◆ REG_DEVICE_ID
|
staticconstexpr |
Definition at line 20 of file DAC60508.h.
◆ REG_GAIN
|
staticconstexpr |
Definition at line 23 of file DAC60508.h.
Referenced by init().
◆ REG_NOOP
|
staticconstexpr |
Definition at line 19 of file DAC60508.h.
◆ REG_STATUS
|
staticconstexpr |
Definition at line 26 of file DAC60508.h.
◆ REG_SYNC
|
staticconstexpr |
Definition at line 21 of file DAC60508.h.
◆ REG_TRIGGER
|
staticconstexpr |
Definition at line 24 of file DAC60508.h.
The documentation for this class was generated from the following files:
- lib/hardware/src/chips/DAC60508.h
- lib/hardware/src/chips/DAC60508.cpp