\r
#include "TestAndMeasurement.h"\r
\r
+/** Contains the (usually static) capabilities of the TMC device. This table is requested by the\r
+ * host upon enumeration to give it information on what features of the Test and Measurement USB\r
+ * Class the device supports.\r
+ */\r
+TMC_Capabilities_t Capabilities =\r
+ {\r
+ .Status = TMC_REQUEST_STATUS_SUCCESS,\r
+ .TMCVersion = VERSION_BCD(1.00),\r
+ \r
+ .Interface =\r
+ {\r
+ .ListenOnly = false,\r
+ .TalkOnly = false,\r
+ .PulseIndicateSupported = true,\r
+ },\r
+\r
+ .Device =\r
+ {\r
+ .SupportsAbortINOnMatch = false,\r
+ },\r
+ };\r
+\r
+\r
/** Main program entry point. This routine contains the overall program flow, including initial\r
* setup of all components and the main program loop.\r
*/\r
case Req_GetCapabilities:\r
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- \r
+ /* Acknowledge the SETUP packet, ready for data transfer */\r
+ Endpoint_ClearSETUP();\r
+ \r
+ /* Write the device capabilities to the control endpoint */\r
+ Endpoint_Write_Control_Stream_LE(&Capabilities, sizeof(TMC_Capabilities_t));\r
+ \r
+ /* Finalize the stream transfer to send the last packet or clear the host abort */\r
+ Endpoint_ClearOUT();\r
}\r
\r
break;\r
/* Device must be connected and configured for the task to run */\r
if (USB_DeviceState != DEVICE_STATE_Configured)\r
return;\r
+ \r
+ Endpoint_SelectEndpoint(TMC_OUT_EPNUM);\r
+ \r
+ if (Endpoint_IsOUTReceived())\r
+ {\r
+ // TEMP - Indicate data received\r
+ LEDs_SetAllLEDs(LEDS_ALL_LEDS);\r
+ Endpoint_ClearOUT();\r
+ }\r
}\r
#define TMC_REQUEST_STATUS_NOTRANSFER 0x81\r
#define TMC_REQUEST_STATUS_NOCHECKINITIATED 0x82\r
#define TMC_REQUEST_STATUS_CHECKINPROGRESS 0x83\r
+\r
+ /* Type Defines */\r
+ typedef struct\r
+ {\r
+ uint8_t Status;\r
+ uint8_t _RESERVED1;\r
+\r
+ uint16_t TMCVersion;\r
+ \r
+ struct\r
+ {\r
+ unsigned char ListenOnly : 1;\r
+ unsigned char TalkOnly : 1;\r
+ unsigned char PulseIndicateSupported : 1;\r
+ unsigned char _RESERVED : 5;\r
+ } Interface;\r
+ \r
+ struct\r
+ {\r
+ unsigned char SupportsAbortINOnMatch : 1;\r
+ unsigned char _RESERVED : 7;\r
+ } Device;\r
+ \r
+ uint8_t _RESERVED2[6];\r
+ uint8_t _RESERVED3[12]; \r
+ } TMC_Capabilities_t;\r
\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
* to the next version released. It does not indicate all new additions to the library in each version change, only
* areas relevant to making older projects compatible with the API changes of each new release.
*
- * \section Sec_Migration100513 Migrating from 100513 to XXXXXX
+ * \section Sec_MigrationXXXXXX Migrating from 100513 to XXXXXX
*
* <b>Non-USB Library Components</b>
* - The Dataflash board driver stub file has changed, as dataflash functions previously located in the internal