55#define EOF_RESTART_NOSTOP 2
73#define NVS_USERID 0x00
74#define NVS_ETHERNET_IP 0x02
75#define NVS_ETHERNET_PORT 0x06
76#define NVS_WIFI_IP 0x08
77#define NVS_WIFI_PORT 0x0C
78#define NVS_WIFI_SSID_SIZE 0x0E
79#define NVS_WIFI_SSID 0x0F
80#define NVS_WIFI_SECURITY_TYPE 0x30
81#define NVS_WIFI_PW_SIZE 0x31
82#define NVS_WIFI_PW 0x32
83#define NVS_SERIAL_INTERFACE_MAX_BAUD 0x72
92typedef enum LinxStatus
95 L_FUNCTION_NOT_SUPPORTED,
101typedef enum AioStatus
103 LANALOG_REF_MODE_ERROR=129,
104 LANALOG_REF_VAL_ERROR=130
107typedef enum DioStatus
109 LDIGITAL_PIN_DNE=128,
113typedef enum SPIStatus
115 LSPI_OPEN_FAIL = 128,
119typedef enum I2CStatus
129typedef enum UartStatus
133 LUART_AVAILABLE_FAIL,
139typedef enum ResetWhat
155 unsigned char DeviceFamily;
156 unsigned char DeviceId;
157 unsigned char DeviceNameLen;
158 const unsigned char* DeviceName;
159 unsigned char ListenerBufferSize;
162 unsigned char LinxApiMajor;
163 unsigned char LinxApiMinor;
164 unsigned char LinxApiSubminor;
169 unsigned char NumDigitalChans;
170 const unsigned char* DigitalChans;
173 unsigned char NumAiChans;
174 const unsigned char* AiChans;
175 unsigned char AiResolution;
176 unsigned long AiRefDefault;
177 unsigned long AiRefSet;
180 unsigned char NumAoChans;
181 const unsigned char* AoChans;
182 unsigned char AoResolution;
183 unsigned long AoRefDefault;
184 unsigned long AoRefSet;
187 unsigned char NumPwmChans;
188 const unsigned char* PwmChans;
191 unsigned char NumQeChans;
192 const unsigned char* QeChans;
195 unsigned char NumUartChans;
196 const unsigned char* UartChans;
197 unsigned long UartMaxBaud;
200 unsigned char NumI2cChans;
201 const unsigned char* I2cChans;
204 unsigned char NumSpiChans;
205 const unsigned char* SpiChans;
208 unsigned char NumCanChans;
209 const unsigned char* CanChans;
212 unsigned char NumServoChans;
213 const unsigned char* ServoChans;
216 unsigned short userId;
218 unsigned long ethernetIp;
219 unsigned short ethernetPort;
222 unsigned long WifiIp;
223 unsigned short WifiPort;
224 unsigned char WifiSsidSize;
226 unsigned char WifiSecurity;
227 unsigned char WifiPwSize;
231 unsigned long serialInterfaceMaxBaud;
234 ResetWhat ResetTarget=LRESET_NONE;
235 unsigned char WifiStatus=0xFF;
248 virtual int AnalogRead(
unsigned char numChans,
unsigned char* channels,
unsigned char* values) = 0;
249 virtual int AnalogReadNoPacking(
unsigned char numChans,
unsigned char* channels,
unsigned long* values);
250 virtual int AnalogSetRef(
unsigned char mode,
unsigned long voltage) = 0;
252 virtual int AnalogWrite(
unsigned char numChans,
unsigned char* channels,
unsigned char* values) = 0;
253 virtual int AnalogWriteNoPacking(
unsigned char numChans,
unsigned char* channels,
unsigned long* values);
256 virtual int DigitalWrite(
unsigned char numChans,
unsigned char* channels,
unsigned char* values) = 0;
257 virtual int DigitalWriteNoPacking(
unsigned char numChans,
unsigned char* channels,
unsigned char* values);
258 virtual int DigitalRead(
unsigned char numChans,
unsigned char* channels,
unsigned char* values) = 0;
259 virtual int DigitalReadNoPacking(
unsigned char numChans,
unsigned char* channels,
unsigned char* values);
260 virtual int DigitalWriteSquareWave(
unsigned char channel,
unsigned long freq,
unsigned long duration) = 0;
261 virtual int DigitalReadPulseWidth(
unsigned char stimChan,
unsigned char stimType,
unsigned char respChan,
unsigned char respType,
unsigned long timeout,
unsigned long* width) = 0;
264 virtual int PwmSetDutyCycle(
unsigned char numChans,
unsigned char* channels,
unsigned char* values) = 0;
265 virtual int PwmSetFrequency(
unsigned char numChans,
unsigned char* channels,
unsigned long* values);
268 virtual int SpiOpenMaster(
unsigned char channel) = 0;
269 virtual int SpiSetBitOrder(
unsigned char channel,
unsigned char bitOrder) = 0;
270 virtual int SpiSetMode(
unsigned char channel,
unsigned char mode) = 0;
271 virtual int SpiSetSpeed(
unsigned char channel,
unsigned long speed,
unsigned long* actualSpeed) = 0;
272 virtual int SpiWriteRead(
unsigned char channel,
unsigned char frameSize,
unsigned char numFrames,
unsigned char csChan,
unsigned char csLL,
unsigned char* sendBuffer,
unsigned char* recBuffer) = 0;
275 virtual int I2cOpenMaster(
unsigned char channel) = 0;
276 virtual int I2cSetSpeed(
unsigned char channel,
unsigned long speed,
unsigned long* actualSpeed) = 0;
277 virtual int I2cWrite(
unsigned char channel,
unsigned char slaveAddress,
unsigned char eofConfig,
unsigned char numBytes,
unsigned char* sendBuffer) = 0;
278 virtual int I2cRead(
unsigned char channel,
unsigned char slaveAddress,
unsigned char eofConfig,
unsigned char numBytes,
unsigned int timeout,
unsigned char* recBuffer) = 0;
279 virtual int I2cClose(
unsigned char channel) = 0;
282 virtual int UartOpen(
unsigned char channel,
unsigned long baudRate,
unsigned long* actualBaud) = 0;
283 virtual int UartSetBaudRate(
unsigned char channel,
unsigned long baudRate,
unsigned long* actualBaud) = 0;
284 virtual int UartGetBytesAvailable(
unsigned char channel,
unsigned char *numBytes) = 0;
285 virtual int UartRead(
unsigned char channel,
unsigned char numBytes,
unsigned char* recBuffer,
unsigned char* numBytesRead) = 0;
286 virtual int UartWrite(
unsigned char channel,
unsigned char numBytes,
unsigned char* sendBuffer) = 0;
287 virtual void UartWrite(
unsigned char channel,
char c);
288 virtual void UartWrite(
unsigned char channel,
const char s[]);
289 virtual void UartWrite(
unsigned char channel,
unsigned char c);
290 virtual void UartWrite(
unsigned char channel,
int n);
291 virtual void UartWrite(
unsigned char channel,
unsigned int n);
292 virtual void UartWrite(
unsigned char channel,
long n);
293 virtual void UartWrite(
unsigned char channel,
unsigned long n);
294 virtual void UartWrite(
unsigned char channel,
long n,
int base);
295 virtual void UartWriteln(
unsigned char channel);
296 virtual void UartWriteln(
unsigned char channel,
char c);
297 virtual void UartWriteln(
unsigned char channel,
const char s[]);
298 virtual void UartWriteln(
unsigned char channel,
unsigned char c);
299 virtual void UartWriteln(
unsigned char channel,
int n);
300 virtual void UartWriteln(
unsigned char channel,
long n);
301 virtual void UartWriteln(
unsigned char channel,
unsigned long n);
302 virtual void UartWriteln(
unsigned char channel,
long n,
int base);
303 virtual int UartClose(
unsigned char channel) = 0;
306 virtual int ServoOpen(
unsigned char numChans,
unsigned char* channels) = 0;
307 virtual int ServoSetPulseWidth(
unsigned char numChans,
unsigned char* channels,
unsigned short* pulseWidths) = 0;
308 virtual int ServoClose(
unsigned char numChans,
unsigned char* channels) = 0;
311 virtual int Ws2812Open(
unsigned short numLeds,
unsigned char dataChan);
312 virtual int Ws2812WriteOnePixel(
unsigned short pixelIndex,
unsigned char red,
unsigned char green,
unsigned char blue,
unsigned char refresh);
313 virtual int Ws2812WriteNPixels(
unsigned short startPixel,
unsigned short numPixels,
unsigned char* data,
unsigned char refresh);
314 virtual int Ws2812Refresh();
315 virtual int Ws2812Close();
318 unsigned char ReverseBits(
unsigned char b);
319 virtual unsigned long GetMilliSeconds() = 0;
320 virtual unsigned long GetSeconds() = 0;
321 virtual void DelayMs(
unsigned long ms);
322 virtual void NonVolatileWrite(
int address,
unsigned char data) = 0;
323 virtual unsigned char NonVolatileRead(
int address) = 0;
326 virtual void EnableDebug(
unsigned char channel);
328 virtual void DebugPrint(
char c);
329 virtual void DebugPrint(
const char s[]);
330 virtual void DebugPrint(
unsigned char c);
331 virtual void DebugPrint(
int n);
332 virtual void DebugPrint(
unsigned int n);
333 virtual void DebugPrint(
long n);
334 virtual void DebugPrint(
unsigned long n);
335 virtual void DebugPrint(
long n,
int base);
337 virtual void DebugPrintln();
338 virtual void DebugPrintln(
char c);
339 virtual void DebugPrintln(
const char s[]);
340 virtual void DebugPrintln(
unsigned char c);
341 virtual void DebugPrintln(
int n);
342 virtual void DebugPrintln(
long n);
343 virtual void DebugPrintln(
unsigned long n);
344 virtual void DebugPrintln(
long n,
int base);
347 virtual void DebugPrintPacket(
unsigned char direction,
const unsigned char* packetBuffer);
350 virtual int BoardCommands(
unsigned char command,
unsigned char numInputBytes,
unsigned char* input,
unsigned char* numResponseBytes,
unsigned char* response);
351 virtual int Reset(ResetWhat target);
357 virtual void UartWriteNumber(
unsigned char channel,
unsigned long n,
unsigned char bases);
Base class for board functionality; extended by family and board-specific code.
Definition: device/utility/LinxDevice.h:163