So many arduino integration changes...

This commit is contained in:
2019-12-29 19:56:09 -05:00
parent 5f3cb1b041
commit fa6d1a2af1
10 changed files with 692 additions and 452 deletions

38
include/ard_protocol.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef CHECKM8_TOOL_ARD_PROTOCOL_H
#define CHECKM8_TOOL_ARD_PROTOCOL_H
static const char PROT_PARTIAL_CTRL_XFER = 'P';
static const char PROT_NO_ERROR_CTRL_XFER = 'N';
static const char PROT_NO_ERROR_CTRL_XFER_DATA = 'M';
static const char PROT_CTRL_XFER = 'C';
static const char PROT_RESET = 'R';
static const char PROT_SERIAL_DESC = 'S';
static const char PROT_SUCCESS = '\x00';
static const char PROT_ACK = '\x01';
static const char PROT_FAIL_BADCMD = '\xFF';
static const char PROT_FAIL_NODEV = '\xFE';
static const char PROT_FAIL_WRONGDEV = '\xFD';
static const char PROT_FAIL_USB = '\xFC';
static const char PROT_FAIL_TOOBIG = '\xFB';
static const char PROT_FAIL_INITUSB = '\xEF';
struct usb_xfer_args
{
unsigned char bmRequestType;
unsigned char bRequest;
unsigned short wValue;
unsigned short wIndex;
unsigned short data_len;
};
struct serial_desc_args
{
unsigned short dev_idVendor;
unsigned short dev_idProduct;
unsigned char len;
};
#endif //CHECKM8_TOOL_ARD_PROTOCOL_H

View File

@@ -3,7 +3,9 @@
//#define LIBUSB_LOGGING
#define CHECKM8_LOGGING
//#define WITH_ARDUINO
#define ARDUINO_LOGGING
#define WITH_ARDUINO
#define ARDUINO_DEV "/dev/ttyACM0"
#define ARDUINO_BAUD 115200