15 #include "carma/szaarrayutils/regmap.h"
20 #define PMAC_DATA_MAX_LEN 1400
51 PMAC_GETBUFFER = 0xC5,
54 PMAC_GETRESPONSE = 0xBF,
56 PMAC_READREADY = 0xC2,
61 PMAC_WRITEBUFFER = 0xC6,
62 PMAC_WRITEERROR = 0xC7,
67 unsigned char requestType_;
68 unsigned char request_;
69 unsigned short wValue_;
70 unsigned short wIndex_;
71 unsigned short wLength_;
76 unsigned char sendData_[PMAC_DATA_MAX_LEN];
92 void packCtrlResponseCmd();
97 void packFwDownLoadCmd();
102 void packPmacGetIpAddressCmd();
107 void packPmacSetIpAddressCmd(
unsigned int address);
112 void packPmacIpAddressCmd(
bool setIp=
false,
unsigned int address=0x0);
117 void packPmacFlushCmd();
123 void packPmacGetBufferCmd();
128 void packPmacGetLineCmd();
133 void packPmacGetMemCmd(
unsigned short offset,
134 unsigned short length);
140 void packPmacGetResponseCmd(std::string outString);
145 void packPmacPortCmd(
unsigned char port);
150 void packPmacPortCmd();
155 void packPmacReadReadyCmd();
160 void packPmacSendCtrlCharCmd(
char outch);
165 void packPmacSendLineCmd(std::string line);
170 void packPmacSetBitCmd(
unsigned short bitNo,
bool on);
175 void packPmacSetBitsCmd(
unsigned int mask);
180 void packPmacSetMemCmd(
unsigned short offset,
181 unsigned short length,
182 unsigned char* data);
187 void packPmacWriteBufferCmd(
unsigned int* data,
unsigned int len);
197 void packWriteRegCmd(RegMapBlock* blk,
198 unsigned int first,
unsigned int nreg,
199 unsigned int* value);
204 void packReadRegCmd(RegMapBlock* blk,
205 unsigned int first,
unsigned int nreg);
220 size_t responseLength();
226 void readRegResponse(RegMapBlock *blk,
227 unsigned int first,
unsigned int nreg,
228 unsigned int* response);
234 unsigned int* readRegResponse(RegMapBlock *blk,
235 unsigned int first,
unsigned int nreg);
239 friend class PmacComms;
247 unsigned short cmdSize_;
252 bool expectsResponse_;
258 unsigned short responseLength_;
263 unsigned char readData_[PMAC_DATA_MAX_LEN];
269 unsigned char tmpBuffer_[PMAC_DATA_MAX_LEN];
294 const void* sendData();
302 #endif // End #ifndef