41 #ifndef YOCTO_SPIPORT_H 42 #define YOCTO_SPIPORT_H 55 #ifndef _Y_VOLTAGELEVEL_ENUM 56 #define _Y_VOLTAGELEVEL_ENUM 68 #ifndef _Y_SSPOLARITY_ENUM 69 #define _Y_SSPOLARITY_ENUM 76 #ifndef _Y_SHITFTSAMPLING_ENUM 77 #define _Y_SHITFTSAMPLING_ENUM 84 #define Y_RXCOUNT_INVALID (YAPI_INVALID_UINT) 85 #define Y_TXCOUNT_INVALID (YAPI_INVALID_UINT) 86 #define Y_ERRCOUNT_INVALID (YAPI_INVALID_UINT) 87 #define Y_RXMSGCOUNT_INVALID (YAPI_INVALID_UINT) 88 #define Y_TXMSGCOUNT_INVALID (YAPI_INVALID_UINT) 89 #define Y_LASTMSG_INVALID (YAPI_INVALID_STRING) 90 #define Y_CURRENTJOB_INVALID (YAPI_INVALID_STRING) 91 #define Y_STARTUPJOB_INVALID (YAPI_INVALID_STRING) 92 #define Y_COMMAND_INVALID (YAPI_INVALID_STRING) 93 #define Y_PROTOCOL_INVALID (YAPI_INVALID_STRING) 94 #define Y_SPIMODE_INVALID (YAPI_INVALID_STRING) 109 #pragma option push -w-8022 181 int get_rxCount(
void);
184 {
return this->get_rxCount(); }
193 int get_txCount(
void);
196 {
return this->get_txCount(); }
205 int get_errCount(
void);
208 {
return this->get_errCount(); }
217 int get_rxMsgCount(
void);
220 {
return this->get_rxMsgCount(); }
229 int get_txMsgCount(
void);
232 {
return this->get_txMsgCount(); }
241 string get_lastMsg(
void);
244 {
return this->get_lastMsg(); }
253 string get_currentJob(
void);
256 {
return this->get_currentJob(); }
269 int set_currentJob(
const string& newval);
271 {
return this->set_currentJob(newval); }
280 string get_startupJob(
void);
283 {
return this->get_startupJob(); }
296 int set_startupJob(
const string& newval);
298 {
return this->set_startupJob(newval); }
300 string get_command(
void);
303 {
return this->get_command(); }
305 int set_command(
const string& newval);
307 {
return this->set_command(newval); }
321 {
return this->get_voltageLevel(); }
340 {
return this->set_voltageLevel(newval); }
353 string get_protocol(
void);
356 {
return this->get_protocol(); }
373 int set_protocol(
const string& newval);
375 {
return this->set_protocol(newval); }
387 string get_spiMode(
void);
390 {
return this->get_spiMode(); }
404 int set_spiMode(
const string& newval);
406 {
return this->set_spiMode(newval); }
418 {
return this->get_ssPolarity(); }
431 {
return this->set_ssPolarity(newval); }
444 {
return this->get_shitftSampling(); }
459 {
return this->set_shitftSampling(newval); }
488 static YSpiPort* FindSpiPort(
string func);
506 virtual int sendCommand(
string text);
515 virtual int reset(
void);
526 virtual int writeByte(
int code);
537 virtual int writeStr(
string text);
548 virtual int writeBin(
string buff);
559 virtual int writeArray(vector<int> byteList);
570 virtual int writeHex(
string hexString);
581 virtual int writeLine(
string text);
592 virtual int readByte(
void);
605 virtual string readStr(
int nChars);
618 virtual string readBin(
int nChars);
631 virtual vector<int> readArray(
int nChars);
644 virtual string readHex(
int nBytes);
659 virtual string readLine(
void);
682 virtual vector<string> readMessages(
string pattern,
int maxWait);
693 virtual int read_seek(
int absPos);
700 virtual int read_tell(
void);
708 virtual int read_avail(
void);
722 virtual string queryLine(
string query,
int maxWait);
735 virtual int uploadJob(
string jobfile,
string jsonDef);
748 virtual int selectJob(
string jobfile);
760 virtual int set_SS(
int val);
775 {
return this->nextSpiPort();}
786 static YSpiPort* FirstSpiPort(
void);
Y_SHITFTSAMPLING_enum _shitftSampling
YSpiPortValueCallback _valueCallbackSpiPort
YSpiPort * yFirstSpiPort(void)
Y_VOLTAGELEVEL_enum voltageLevel(void)
void(* YSpiPortValueCallback)(YSpiPort *func, const string &functionValue)
Y_SHITFTSAMPLING_enum shitftSampling(void)
int setCurrentJob(const string &newval)
static const string LASTMSG_INVALID
#define YAPI_INVALID_UINT
static const string CURRENTJOB_INVALID
static const string SPIMODE_INVALID
static YSpiPort * FindSpiPort(string func)
static YSpiPort * First(void)
virtual int _parseAttr(YJSONObject *json_val)
int setStartupJob(const string &newval)
Y_SSPOLARITY_enum _ssPolarity
static YSpiPort * Find(string func)
int setProtocol(const string &newval)
int setVoltageLevel(Y_VOLTAGELEVEL_enum newval)
int setSsPolarity(Y_SSPOLARITY_enum newval)
static YSpiPort * FirstSpiPort(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
int setSpiMode(const string &newval)
#define YOCTO_CLASS_EXPORT
Y_VOLTAGELEVEL_enum _voltageLevel
Y_SSPOLARITY_enum ssPolarity(void)
int setShitftSampling(Y_SHITFTSAMPLING_enum newval)
static const string PROTOCOL_INVALID
static const string STARTUPJOB_INVALID
static const string COMMAND_INVALID
int setCommand(const string &newval)
YSpiPort * yFindSpiPort(const string &func)
virtual int _invokeValueCallback(string value)