Re-add in old Endpoint/Pipe workaround for unordered pipes - add new ORDERED_EP_CONFI...
[pub/USBasp.git] / Demos / Device / Incomplete / TestAndMeasurement / TestAndMeasurement.h
index 2d5f82f..3862805 100644 (file)
@@ -3,7 +3,7 @@
      Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
-      www.fourwalledcubicle.com\r
+           www.lufa-lib.org\r
 */\r
 \r
 /*\r
 \r
        /* Macros: */\r
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */\r
-               #define LEDMASK_USB_NOTREADY                   LEDS_LED1\r
+               #define LEDMASK_USB_NOTREADY                  LEDS_LED1\r
 \r
                /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */\r
-               #define LEDMASK_USB_ENUMERATING               (LEDS_LED2 | LEDS_LED3)\r
+               #define LEDMASK_USB_ENUMERATING              (LEDS_LED2 | LEDS_LED3)\r
 \r
                /** LED mask for the library LED driver, to indicate that the USB interface is ready. */\r
-               #define LEDMASK_USB_READY                     (LEDS_LED2 | LEDS_LED4)\r
+               #define LEDMASK_USB_READY                    (LEDS_LED2 | LEDS_LED4)\r
 \r
                /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
-               #define LEDMASK_USB_ERROR                     (LEDS_LED1 | LEDS_LED3)\r
+               #define LEDMASK_USB_ERROR                    (LEDS_LED1 | LEDS_LED3)\r
                \r
+               /** LED mask for the library LED driver, to indicate that the USB interface is busy. */\r
+               #define LEDMASK_USB_BUSY                      LEDS_LED2\r
+\r
                #define Req_InitiateAbortBulkOut              0x01\r
                #define Req_CheckAbortBulkOutStatus           0x02\r
                #define Req_InitiateAbortBulkIn               0x03\r
                        uint8_t Reserved2[6];\r
                        uint8_t Reserved3[12];                  \r
                } TMC_Capabilities_t;\r
+               \r
+               typedef struct\r
+               {\r
+                       unsigned char LastMessageTransaction : 1;\r
+                       unsigned char Reserved               : 7;\r
+\r
+                       uint8_t Reserved2[3];\r
+               } TMC_DevOUTMessageHeader_t;\r
+\r
+               typedef struct\r
+               {\r
+                       unsigned char TermCharEnabled        : 1;\r
+                       unsigned char Reserved               : 7;\r
+\r
+                       uint8_t TermChar;\r
+                       uint8_t Reserved2[2];\r
+               } TMC_DevINMessageHeader_t;\r
 \r
                typedef struct\r
                {\r
-                       uint8_t MessageID;\r
-                       uint8_t Tag;\r
-                       uint8_t InverseTag;\r
-                       uint8_t Reserved;\r
+                       uint8_t  MessageID;\r
+                       uint8_t  Tag;\r
+                       uint8_t  InverseTag;\r
+                       uint8_t  Reserved;\r
+                       uint32_t TransferSize;\r
+                       \r
+                       union\r
+                       {\r
+                               TMC_DevOUTMessageHeader_t DeviceOUT;\r
+                               TMC_DevINMessageHeader_t  DeviceIN;\r
+                               uint32_t                  VendorSpecific;\r
+                       } MessageIDSpecific;\r
                } TMC_MessageHeader_t;\r
-               \r
+\r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
                void TMC_Task(void);\r
+               bool ReadTMCHeader(TMC_MessageHeader_t* const MessageHeader);\r
+               bool WriteTMCHeader(TMC_MessageHeader_t* const MessageHeader);\r
 \r
                void EVENT_USB_Device_Connect(void);\r
                void EVENT_USB_Device_Disconnect(void);\r
                void EVENT_USB_Device_ConfigurationChanged(void);\r
-               void EVENT_USB_Device_UnhandledControlRequest(void);\r
+               void EVENT_USB_Device_ControlRequest(void);\r
 \r
                uint8_t StreamCallback_AbortINOnRequest(void);\r
                uint8_t StreamCallback_AbortOUTOnRequest(void);\r
 \r
 #endif\r
+