DAC device abstraction.
More...
#include <dac.hpp>
|
| | dac (uint16_t resolution, float vref) |
| | Construct a new DAC object.
|
| virtual void | start ()=0 |
| | A virtual method to start the DAC.
|
| virtual void | stop ()=0 |
| | A virtual method to stop the DAC.
|
| virtual float | voltage () const |
| | Retrieves the latest output voltage of the DAC.
|
| virtual void | set_voltage (float volts) |
| | Sets the output voltage of the DAC.
|
| virtual float | vref () const |
| | Retrieves the reference voltage of the DAC.
|
|
| virtual void | write (uint32_t x)=0 |
DAC device abstraction.
This class provides a generic DAC (Digital-to-Analog Converter) abstraction.
- Warning
- Depending on the target platform/RTOS users are expected to define a class that inherits this one and implement at least the pure virtual methods
Definition at line 39 of file dac.hpp.
◆ dac()
| satnogs::comms::lib::bsp::dac::dac |
( |
uint16_t | resolution, |
|
|
float | vref ) |
|
inline |
Construct a new DAC object.
- Parameters
-
| resolution | The resolution of the DAC in number of bits |
| vref | The reference voltage for the DAC in Volts |
Definition at line 48 of file dac.hpp.
◆ set_voltage()
| virtual void satnogs::comms::lib::bsp::dac::set_voltage |
( |
float | volts | ) |
|
|
inlinevirtual |
Sets the output voltage of the DAC.
This method calculates the digital value corresponding to the desired output voltage. The voltage is clamped between 0V and the reference voltage.
- Parameters
-
| volts | The desired output voltage, in Volts. |
Definition at line 93 of file dac.hpp.
◆ start()
| virtual void satnogs::comms::lib::bsp::dac::start |
( |
| ) |
|
|
pure virtual |
A virtual method to start the DAC.
Prepares the DAC for operation.
- Note
- This method must be implemented by the inherited class to configure the DAC and must be invoked before operation.
Implemented in satnogs::comms::dac_bsp.
◆ stop()
| virtual void satnogs::comms::lib::bsp::dac::stop |
( |
| ) |
|
|
pure virtual |
A virtual method to stop the DAC.
This method must be provided by the child class.
Implemented in satnogs::comms::dac_bsp.
◆ voltage()
| virtual float satnogs::comms::lib::bsp::dac::voltage |
( |
| ) |
const |
|
inlinevirtual |
Retrieves the latest output voltage of the DAC.
- Returns
- The latest output voltage, in Volts.
Definition at line 78 of file dac.hpp.
◆ vref()
| virtual float satnogs::comms::lib::bsp::dac::vref |
( |
| ) |
const |
|
inlinevirtual |
Retrieves the reference voltage of the DAC.
- Returns
- The reference voltage, in Volts.
Definition at line 106 of file dac.hpp.
◆ write()
| virtual void satnogs::comms::lib::bsp::dac::write |
( |
uint32_t | x | ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following file:
- libsatnogs-comms/include/satnogs-comms-lib/bsp/dac.hpp