summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-09-01 10:38:18 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-09-08 07:54:06 +0200
commite0fbb799bd0dcf8592d08d6a8734e0afcb7e2b81 (patch)
treeec93c3396ec30bb96af6f743903d2f6d0d95dd0e /include
parent3493c1c0878db2b2c367fcdd9e69e4dcc104cad6 (diff)
downloadsecure-hid-e0fbb799bd0dcf8592d08d6a8734e0afcb7e2b81.tar.gz
secure-hid-e0fbb799bd0dcf8592d08d6a8734e0afcb7e2b81.tar.bz2
secure-hid-e0fbb799bd0dcf8592d08d6a8734e0afcb7e2b81.zip
usbh_core refactor
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/driver/usbh_device_driver.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/driver/usbh_device_driver.h b/include/driver/usbh_device_driver.h
index bace1ef..6dd53c3 100644
--- a/include/driver/usbh_device_driver.h
+++ b/include/driver/usbh_device_driver.h
@@ -61,6 +61,23 @@ enum USBH_CONTROL_TYPE {
USBH_CONTROL_TYPE_DATA
};
+enum USBH_ENUM_STATE {
+ USBH_ENUM_STATE_SET_ADDRESS,
+ USBH_ENUM_STATE_FIRST = USBH_ENUM_STATE_SET_ADDRESS,
+ USBH_ENUM_STATE_SET_ADDRESS_EMPTY_READ,
+ USBH_ENUM_STATE_SET_ADDRESS_EMPTY_READ_COMPLETE,
+ USBH_ENUM_STATE_DEVICE_DT_READ_SETUP,
+ USBH_ENUM_STATE_DEVICE_DT_READ,
+ USBH_ENUM_STATE_DEVICE_DT_READ_COMPLETE,
+ USBH_ENUM_STATE_CONFIGURATION_DT_HEADER_READ_SETUP,
+ USBH_ENUM_STATE_CONFIGURATION_DT_HEADER_READ,
+ USBH_ENUM_STATE_CONFIGURATION_DT_HEADER_READ_COMPLETE,
+ USBH_ENUM_STATE_CONFIGURATION_DT_READ_SETUP,
+ USBH_ENUM_STATE_CONFIGURATION_DT_READ,
+ USBH_ENUM_STATE_CONFIGURATION_DT_READ_COMPLETE,
+ USBH_ENUM_STATE_FIND_DRIVER,
+};
+
/**
* @brief The _usbh_device struct
*
@@ -77,7 +94,7 @@ struct _usbh_device {
enum USBH_SPEED speed;
/// state used for enumeration purposes
- uint8_t state;
+ enum USBH_ENUM_STATE state;
/// toggle bit
uint8_t toggle0;