On this page
article
peary::component::DAC7678
peary::component::DAC7678
DAC7678 Digital-to-Analog Converter Component. More…
#include <peary/hardware/components/DAC7678.hpp>
Inherits from peary::hal::Component
Public Types
| Name | |
|---|---|
| enum class | Command { WR_DAC_IN = 0x00, WR_UPDATE = 0x10, WR_GLOBAL_LDAC = 0x20, WR_SINGLE_LDAC = 0x30, WR_POWER_DOWN = 0x40, WR_CLEAR_CODE = 0x50, WR_LDAC = 0x60, WR_RESET = 0x70, WR_STATIC_MODE = 0x80, WR_FLEX_MODE = 0x90, POWER_UP = 0x00, POWER_DOWN_1K = 0x20, POWER_DOWN_100K = 0x40, POWER_DOWN_HZ = 0x60, RD_DAC_IN = 0x00, RD_DAC = 0x10, RD_POWER_DOWN = 0x40, RD_CLEAR_CODE = 0x50, RD_LDAC = 0x60, RD_STATIC_MODE = 0x80, RD_FLEX_MODE = 0x90} |
| enum class | Channel { VOUTA = 0x00, VOUTB = 0x01, VOUTC = 0x02, VOUTD = 0x03, VOUTE = 0x04, VOUTF = 0x05, VOUTG = 0x06, VOUTH = 0x07, ALL = 0x0F} |
Public Functions
| Name | |
|---|---|
| DAC7678(const std::string & i2c_bus, uint8_t device_address, double vref)Constructor for DAC7678 class. | |
| void | setVoltage(Channel channel, double voltage)Set the output voltage for a specific channel. |
| double | getVoltage(Channel channel)Get the output voltage for a specific channel. |
| void | setOutput(Channel channel, bool enable)Enable or disable the output of a specific channel. |
Additional inherited members
Public Functions inherited from peary::hal::Component
| Name | |
|---|---|
| Component() =defaultDefault constructor. | |
| virtual | ~Component() =defaultDefault destructor. |
Detailed Description
class peary::component::DAC7678;
DAC7678 Digital-to-Analog Converter Component.
This class allows to control voltages using DAC7678 with QFN packaging. Currently, only straight binary encoding with the TWOC pins pulled low are supported
Public Types Documentation
enum Command
| Enumerator | Value | Description |
|---|---|---|
| WR_DAC_IN | 0x00 | |
| WR_UPDATE | 0x10 | |
| WR_GLOBAL_LDAC | 0x20 | |
| WR_SINGLE_LDAC | 0x30 | |
| WR_POWER_DOWN | 0x40 | |
| WR_CLEAR_CODE | 0x50 | |
| WR_LDAC | 0x60 | |
| WR_RESET | 0x70 | |
| WR_STATIC_MODE | 0x80 | |
| WR_FLEX_MODE | 0x90 | |
| POWER_UP | 0x00 | |
| POWER_DOWN_1K | 0x20 | |
| POWER_DOWN_100K | 0x40 | |
| POWER_DOWN_HZ | 0x60 | |
| RD_DAC_IN | 0x00 | |
| RD_DAC | 0x10 | |
| RD_POWER_DOWN | 0x40 | |
| RD_CLEAR_CODE | 0x50 | |
| RD_LDAC | 0x60 | |
| RD_STATIC_MODE | 0x80 | |
| RD_FLEX_MODE | 0x90 |
enum Channel
| Enumerator | Value | Description |
|---|---|---|
| VOUTA | 0x00 | |
| VOUTB | 0x01 | |
| VOUTC | 0x02 | |
| VOUTD | 0x03 | |
| VOUTE | 0x04 | |
| VOUTF | 0x05 | |
| VOUTG | 0x06 | |
| VOUTH | 0x07 | |
| ALL | 0x0F |
Public Functions Documentation
function DAC7678
DAC7678(
const std::string & i2c_bus,
uint8_t device_address,
double vref
)
Constructor for DAC7678 class.
Parameters:
- i2c_bus The I2C bus to which the DAC7678 is connected
- device_address The I2C address of the DAC7678 device
- vref The reference voltage used for the DAC conversions
function setVoltage
void setVoltage(
Channel channel,
double voltage
)
Set the output voltage for a specific channel.
Parameters:
- channel The channel to set the voltage for
- voltage The voltage to set (in volts)
function getVoltage
double getVoltage(
Channel channel
)
Get the output voltage for a specific channel.
Parameters:
- channel The channel to get the voltage from
Return: The voltage of the specified channel (in volts)
function setOutput
void setOutput(
Channel channel,
bool enable
)
Enable or disable the output of a specific channel.
Parameters:
- channel The channel to enable or disable
- enable True to enable the output, false to disable
Updated on 2025-11-14 at 11:31:23 +0100