From f52213d4e322c19452a2860cf2517bc7b14d79b6 Mon Sep 17 00:00:00 2001 From: Melissa Goad Date: Sun, 22 Jan 2017 00:35:15 -0600 Subject: [PATCH] Add more PID token types --- src/usb.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/usb.h b/src/usb.h index b61e702f2..69adcf96b 100644 --- a/src/usb.h +++ b/src/usb.h @@ -7,7 +7,9 @@ typedef struct uint8_t pid; //low 4 bits are the real pid, top 4 bits are just ~pid uint8_t dev_addr; uint8_t dev_endpoint; - uint8_t* data; + int crc5; + uint16_t crc16; + uint8_t data[1024]; int len; void* device; } usb_packet_t; @@ -26,7 +28,14 @@ typedef enum typedef enum { + USB_PID_TOKEN_STALL = 0x1e, USB_PID_TOKEN_SETUP = 0x2d, + USB_PID_TOKEN_PRE = 0x3c, + USB_PID_TOKEN_DATA1 = 0x4b, + USB_PID_TOKEN_NAK = 0x5a, USB_PID_TOKEN_IN = 0x69, + USB_PID_TOKEN_SOF = 0xa5, + USB_PID_TOKEN_DATA0 = 0xc3, + USB_PID_TOKEN_ACK = 0xd2, USB_PID_TOKEN_OUT = 0xe1 } usb_pid_type_t; \ No newline at end of file