summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-07-30 12:24:20 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-07-30 12:24:20 +0200
commit3e95b389c37046759cbe9df2e671240ec5666ad8 (patch)
treebca91eed95fab4b392426f6b8fa2efd8a0758a29 /include/driver
parent0c1bd8ff76fbe191b7eb136d371ef30fc83c8eb0 (diff)
downloadsecure-hid-3e95b389c37046759cbe9df2e671240ec5666ad8.tar.gz
secure-hid-3e95b389c37046759cbe9df2e671240ec5666ad8.tar.bz2
secure-hid-3e95b389c37046759cbe9df2e671240ec5666ad8.zip
add option to pass data to control writes
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/usbh_device_driver.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/driver/usbh_device_driver.h b/include/driver/usbh_device_driver.h
index 690044c..9307f77 100644
--- a/include/driver/usbh_device_driver.h
+++ b/include/driver/usbh_device_driver.h
@@ -56,6 +56,11 @@ enum USBH_POLL_STATUS {
USBH_POLL_STATUS_DEVICE_DISCONNECTED
};
+enum USBH_CONTROL_TYPE {
+ USBH_CONTROL_TYPE_SETUP,
+ USBH_CONTROL_TYPE_DATA
+};
+
/**
* @brief The _usbh_device struct
*
@@ -121,6 +126,8 @@ struct _usbh_packet {
*/
uint8_t endpoint_type;
+ enum USBH_CONTROL_TYPE control_type;
+
/// Endpoint number 0..15
uint8_t endpoint_address;
@@ -210,7 +217,8 @@ void usbh_write(usbh_device_t *dev, const usbh_packet_t *packet);
/* Helper functions used by device drivers */
void device_xfer_control_read(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
-void device_xfer_control_write(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
+void device_xfer_control_write_setup(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
+void device_xfer_control_write_data(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
END_DECLS