M1M3 Support System
Loading...
Searching...
No Matches
IExpansionFPGA.h
1/*
2 * This file is part of LSST M1M3 support system package.
3 *
4 * Developed for the Vera C. Rubin Telescope and Site System.
5 * This product includes software developed by the LSST Project
6 * (https://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef LSST_M1M3_SS_FPGA_IEXPANSIONFPGA_H_
25#define LSST_M1M3_SS_FPGA_IEXPANSIONFPGA_H_
26
27#include <ExpansionFPGAApplicationSettings.h>
28
29namespace LSST {
30namespace M1M3 {
31namespace SS {
32
44public:
46 virtual ~IExpansionFPGA() {}
47
48 static IExpansionFPGA &get();
49
50 void setResource(bool enabled, std::string resource) {
51 _disabled = !enabled;
52 _fpga_resource = resource;
53 }
54
60 virtual void initialize() = 0;
61
67 virtual void open() = 0;
68
74 virtual void close() = 0;
75
81 virtual void finalize() = 0;
82
89 virtual void sample() = 0;
90
108 virtual void readSlot1(float *data) = 0;
109
138 virtual void readSlot2(uint32_t *data) = 0;
139
140protected:
141 bool _disabled;
142 std::string _fpga_resource;
143
144private:
145 IExpansionFPGA &operator=(const IExpansionFPGA &) = delete;
146 IExpansionFPGA(const IExpansionFPGA &) = delete;
147};
148
149} /* namespace SS */
150} /* namespace M1M3 */
151} /* namespace LSST */
152
153#endif /* LSST_M1M3_SS_FPGA_IEXPANSIONFPGA_H_ */
Abstract interface for communication with expansion FPGA.
Definition IExpansionFPGA.h:43
virtual void readSlot1(float *data)=0
Read 6 float from float array indicator.
virtual void finalize()=0
Should be called after closing FPGA.
virtual void readSlot2(uint32_t *data)=0
Reads 32 bitfield of DIO status.
virtual void open()=0
Load & run FPGA code, setup interrupts.
virtual void initialize()=0
Initialize FPGA.
virtual void close()=0
Close FPGA, stop FPGA code.
virtual void sample()=0
Writes sample request.