SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::bsp::dac Class Referenceabstract

DAC device abstraction. More...

#include <dac.hpp>

Inheritance diagram for satnogs::comms::lib::bsp::dac:
satnogs::comms::dac_bsp

Public Member Functions

 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.

Protected Member Functions

virtual void write (uint32_t x)=0

Detailed Description

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.

Constructor & Destructor Documentation

◆ dac()

satnogs::comms::lib::bsp::dac::dac ( uint16_t resolution,
float vref )
inline

Construct a new DAC object.

Parameters
resolutionThe resolution of the DAC in number of bits
vrefThe reference voltage for the DAC in Volts

Definition at line 48 of file dac.hpp.

Member Function Documentation

◆ 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
voltsThe 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

Implemented in satnogs::comms::dac_bsp.


The documentation for this class was generated from the following file:
  • libsatnogs-comms/include/satnogs-comms-lib/bsp/dac.hpp