M1M3 Support System
Loading...
Searching...
No Matches
BusList.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 BUSLIST_H_
25#define BUSLIST_H_
26
27#include <ILCDataTypes.h>
28#include <ModbusBuffer.h>
29
30namespace LSST {
31namespace M1M3 {
32namespace SS {
33
34class ILCMessageFactory;
35class ILCSubnetData;
36
57class BusList {
58public:
60
67 virtual void buildBuffer();
68
69 int32_t getLength() { return this->buffer.getLength(); }
70 uint16_t *getBuffer() { return this->buffer.getBuffer(); }
71
72 int32_t *getExpectedHPResponses() { return this->expectedHPResponses; }
73 int32_t *getExpectedFAResponses() { return this->expectedFAResponses; }
74 int32_t *getExpectedHMResponses() { return this->expectedHMResponses; }
75
80 virtual void update() {}
81
82protected:
87 ILCMessageFactory *ilcMessageFactory;
88
93
94 // number of expected responses
95 int32_t expectedHPResponses[HP_COUNT];
96 int32_t expectedFAResponses[FA_COUNT];
97 int32_t expectedHMResponses[HP_COUNT];
98 int32_t subnetStartIndex;
99
104 void startSubnet(uint8_t subnet);
105
109 void endSubnet();
110};
111
112} /* namespace SS */
113} /* namespace M1M3 */
114} /* namespace LSST */
115
116#endif /* BUSLIST_H_ */
Abstract class.
Definition BusList.h:57
virtual void update()
Called when update to buffer is required.
Definition BusList.h:80
ILCSubnetData * subnetData
Status of messages on a subnet.
Definition BusList.h:86
ModbusBuffer buffer
Buffer holding data send to FPGA Command FIFO.
Definition BusList.h:92
virtual void buildBuffer()
(Re)-build message send to FPGA.
Definition BusList.cpp:36
void endSubnet()
Ends subnet.
Definition BusList.cpp:72
void startSubnet(uint8_t subnet)
Writes command to start a subnet message on the bus.
Definition BusList.cpp:45
Definition ILCMessageFactory.h:37
Definition ILCSubnetData.h:38
Utility class for Modbus buffer management.
Definition ModbusBuffer.h:42