Merge pull request #1269 from pkendall64/crsf-max-output
[ExpressLRS.git] / src / lib / DAC / DAC.h
blob6924d259af6861cb735df5e6709c1c8666037876
1 #pragma once
3 #include "targets.h"
4 #include <Wire.h>
6 #if defined(POWER_OUTPUT_DAC)
8 typedef enum
10 UNKNOWN = 0,
11 RUNNING = 1,
12 STANDBY = 2
13 } DAC_STATE_;
15 //////////////////////////////////////////////////////
17 class DAC
19 public:
20 void init();
21 void standby();
22 void resume();
23 void setVoltageMV(uint32_t voltsMV);
24 void setVoltageRegDirect(uint8_t voltReg);
25 void setPower(int16_t milliVolts);
27 private:
28 DAC_STATE_ m_state;
29 uint32_t m_currVoltageMV;
30 uint8_t m_currVoltageRegVal;
33 extern DAC TxDAC;
34 #endif // defined(POWER_OUTPUT_DAC)