ngscopeclient 0.1-dev+51fbda87c
GWInstekGPDX303SPowerSupply.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
36#ifndef GWInstekGPDX303SPowerSupply_h
37#define GWInstekGPDX303SPowerSupply_h
38
39#include "SCPIDevice.h"
40#include "SCPIPowerSupply.h"
41#include "SCPITransport.h"
42
43#include <bitset>
44#include <string>
45
51 : public virtual SCPIPowerSupply
52 , public virtual SCPIDevice
53{
54public:
57
58 //Device information
59 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
60
61 //Device capabilities
62 bool SupportsMasterOutputSwitching() override;
63
64 //Read sensors
65 double GetPowerVoltageActual(int chan) override; //actual voltage after current limiting
66 double GetPowerVoltageNominal(int chan) override; //set point
67 double GetPowerCurrentActual(int chan) override; //actual current drawn by the load
68 double GetPowerCurrentNominal(int chan) override; //current limit
69
70 //Configuration
71 void SetPowerVoltage(int chan, double volts) override;
72 void SetPowerCurrent(int chan, double amps) override;
73 bool IsPowerConstantCurrent(int chan) override;
74
75 bool GetMasterPowerEnable() override;
76 void SetMasterPowerEnable(bool enable) override;
77
78protected:
79 std::bitset<8> GetStatusRegister();
80
81public:
82 static std::string GetDriverNameInternal();
83 POWER_INITPROC(GWInstekGPDX303SPowerSupply)
84};
85
86#endif
Declaration of SCPITransport.
A GW Instek GPD-(X)303S power supply.
Definition: GWInstekGPDX303SPowerSupply.h:53
std::bitset< 8 > GetStatusRegister()
Helper method to return the status register as a set of bits.
Definition: GWInstekGPDX303SPowerSupply.cpp:112
static std::string GetDriverNameInternal()
Return the constant driver name "gwinstek_gpdx303s".
Definition: GWInstekGPDX303SPowerSupply.cpp:76
bool SupportsMasterOutputSwitching() override
Determines if the power supply supports ganged master switching of all outputs.
Definition: GWInstekGPDX303SPowerSupply.cpp:89
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition: GWInstekGPDX303SPowerSupply.cpp:81
GWInstekGPDX303SPowerSupply(SCPITransport *transport)
Initialize the driver.
Definition: GWInstekGPDX303SPowerSupply.cpp:50
An SCPI-based device.
Definition: SCPIDevice.h:37
An SCPI-based power supply.
Definition: SCPIPowerSupply.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47