USBMSD SD card Hello World for Mbed platforms
Dependencies: mbed USBMSD_SD USBDevice
Diff: USBDevice/USBDevice/USBDevice_Types.h
- Revision:
- 7:6494da2a5c60
- Parent:
- 6:126c4d980196
- Child:
- 8:534fd41d8cc7
--- a/USBDevice/USBDevice/USBDevice_Types.h Mon Nov 14 10:00:07 2011 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* USBDevice_Types.h */ -/* USB Device type definitions, conversions and constants */ -/* Copyright (c) 2011 ARM Limited. All rights reserved. */ - -#ifndef USBDEVICE_TYPES_H -#define USBDEVICE_TYPES_H - -/* Standard requests */ -#define GET_STATUS (0) -#define CLEAR_FEATURE (1) -#define SET_FEATURE (3) -#define SET_ADDRESS (5) -#define GET_DESCRIPTOR (6) -#define SET_DESCRIPTOR (7) -#define GET_CONFIGURATION (8) -#define SET_CONFIGURATION (9) -#define GET_INTERFACE (10) -#define SET_INTERFACE (11) - -/* bmRequestType.dataTransferDirection */ -#define HOST_TO_DEVICE (0) -#define DEVICE_TO_HOST (1) - -/* bmRequestType.Type*/ -#define STANDARD_TYPE (0) -#define CLASS_TYPE (1) -#define VENDOR_TYPE (2) -#define RESERVED_TYPE (3) - -/* bmRequestType.Recipient */ -#define DEVICE_RECIPIENT (0) -#define INTERFACE_RECIPIENT (1) -#define ENDPOINT_RECIPIENT (2) -#define OTHER_RECIPIENT (3) - -/* Descriptors */ -#define DESCRIPTOR_TYPE(wValue) (wValue >> 8) -#define DESCRIPTOR_INDEX(wValue) (wValue & 0xf) - -typedef struct { - struct { - uint8_t dataTransferDirection; - uint8_t Type; - uint8_t Recipient; - } bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -} SETUP_PACKET; - -typedef struct { - SETUP_PACKET setup; - uint8_t *ptr; - uint32_t remaining; - uint8_t direction; - bool zlp; - bool notify; -} CONTROL_TRANSFER; - -typedef enum {ATTACHED, POWERED, DEFAULT, ADDRESS, CONFIGURED} DEVICE_STATE; - -typedef struct { - volatile DEVICE_STATE state; - uint8_t configuration; - bool suspended; -} USB_DEVICE; - -#endif