libxr
Embedded C++ framework for bare-metal, RTOS and Linux
Loading...
Searching...
No Matches
LibXR::DAC Class Referenceabstract

数字模拟转换器(DAC)基类 Abstract base class for Digital-to-Analog Converter (DAC) More...

#include <dac.hpp>

Inheritance diagram for LibXR::DAC:
[legend]

Public Member Functions

 DAC ()=default
 默认构造函数 / Default constructor
 
virtual ErrorCode Write (float voltage)=0
 输出 DAC 电压 / Outputs the DAC voltage
 

Detailed Description

数字模拟转换器(DAC)基类 Abstract base class for Digital-to-Analog Converter (DAC)

该类定义了 DAC 设备的基本接口,所有 DAC 设备应继承此类并实现 Write 方法。 This class defines the basic interface for a DAC device. All DAC devices should inherit from this class and implement the Write method.

Definition at line 17 of file dac.hpp.

Member Function Documentation

◆ Write()

virtual ErrorCode LibXR::DAC::Write ( float voltage)
pure virtual

输出 DAC 电压 / Outputs the DAC voltage

Parameters
voltage需要输出的模拟电压值 / The analog voltage value to be output
Returns
错误码 / ErrorCode

该方法为纯虚函数,子类必须实现此方法以提供具体的 DAC 输出功能。 This is a pure virtual function. Subclasses must implement this method to provide specific DAC output functionality.

Implemented in LibXR::ESP32DAC, and LibXR::STM32DAC.


The documentation for this class was generated from the following file: