|
REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
The AD5452 is the 12-Bit Multiplying DAC, used in the C-Block (one AD5452 per lane). More...
#include <AD5452.h>


Public Member Functions | |
| AD5452 (bus::addr_t address, uint8_t alt_function_idx) | |
| AD5452 (bus::addr_t base_addr, uint8_t func_addr_shift, uint8_t alt_function_idx) | |
| void | set_scale (float scale) |
| Value gets clamped to min and max values. | |
| void | set_scale (uint16_t scale_raw) |
| DataFunction (bus::addr_t address, uint8_t alt_function_idx, const SPISettings &spiSettings) | |
Public Member Functions inherited from functions::DataFunction | |
| DataFunction (bus::addr_t address, uint8_t alt_function_idx, const SPISettings &spiSettings) | |
| void | begin_communication () const |
| void | end_communication () const |
| 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 |
Public Member Functions inherited from functions::Function | |
| Function (bus::addr_t address) | |
Static Public Member Functions | |
| static uint16_t | float_to_raw (float scale) |
| static float | raw_to_float (uint16_t raw) |
Static Public Attributes | |
| static const SPISettings | DEFAULT_SPI_SETTINGS {4'000'000, MSBFIRST, SPI_MODE1} |
| static constexpr float | MIN_FACTOR = -1.1f |
| static constexpr float | MAX_FACTOR = +1.1f |
| static constexpr uint16_t | RAW_MIN = 0 |
| static constexpr uint16_t | RAW_MAX = 4095 |
Additional Inherited Members | |
Public Attributes inherited from functions::DataFunction | |
| const SPISettings & | spi_settings |
Public Attributes inherited from functions::Function | |
| const bus::addr_t | address |
Static Protected Member Functions inherited from functions::DataFunction | |
| static SPIClass & | get_raw_spi () |
Protected Attributes inherited from functions::DataFunction | |
| bus::addr_t | alt_function_address |
| bool | use_csel = false |
Detailed Description
The AD5452 is the 12-Bit Multiplying DAC, used in the C-Block (one AD5452 per lane).
This class encapsulates the SPI programming access to the chip.
Constructor & Destructor Documentation
◆ AD5452() [1/2]
|
explicit |
Definition at line 9 of file AD5452.cpp.
References functions::Function::address, DataFunction(), and DEFAULT_SPI_SETTINGS.
Referenced by AD5452().
◆ AD5452() [2/2]
| functions::AD5452::AD5452 | ( | bus::addr_t | base_addr, |
| uint8_t | func_addr_shift, | ||
| uint8_t | alt_function_idx ) |
Definition at line 12 of file AD5452.cpp.
References AD5452().
Member Function Documentation
◆ DataFunction()
| functions::DataFunction::DataFunction | ( | bus::addr_t | address, |
| uint8_t | alt_function_idx, | ||
| const SPISettings & | spiSettings ) |
Definition at line 68 of file functions.cpp.
Referenced by AD5452().
◆ float_to_raw()
|
static |
Definition at line 15 of file AD5452.cpp.
References MAX_FACTOR, MIN_FACTOR, RAW_MAX, and RAW_MIN.
Referenced by set_scale().
◆ raw_to_float()
|
static |
Definition at line 24 of file AD5452.cpp.
References MAX_FACTOR, MIN_FACTOR, RAW_MAX, and RAW_MIN.
◆ set_scale() [1/2]
| void functions::AD5452::set_scale | ( | float | scale | ) |
Value gets clamped to min and max values.
Definition at line 36 of file AD5452.cpp.
References float_to_raw(), and set_scale().
Referenced by set_scale().
◆ set_scale() [2/2]
| void functions::AD5452::set_scale | ( | uint16_t | scale_raw | ) |
Definition at line 28 of file AD5452.cpp.
References functions::DataFunction::begin_communication(), functions::DataFunction::end_communication(), and bus::spi.
Member Data Documentation
◆ DEFAULT_SPI_SETTINGS
|
static |
◆ MAX_FACTOR
|
staticconstexpr |
Definition at line 21 of file AD5452.h.
Referenced by float_to_raw(), and raw_to_float().
◆ MIN_FACTOR
|
staticconstexpr |
Definition at line 20 of file AD5452.h.
Referenced by float_to_raw(), and raw_to_float().
◆ RAW_MAX
|
staticconstexpr |
Definition at line 24 of file AD5452.h.
Referenced by float_to_raw(), and raw_to_float().
◆ RAW_MIN
|
staticconstexpr |
Definition at line 23 of file AD5452.h.
Referenced by float_to_raw(), and raw_to_float().
The documentation for this class was generated from the following files:
- lib/hardware/src/chips/AD5452.h
- lib/hardware/src/chips/AD5452.cpp
Public Member Functions inherited from