From 3e95b389c37046759cbe9df2e671240ec5666ad8 Mon Sep 17 00:00:00 2001 From: Amir Hammad Date: Sat, 30 Jul 2016 12:24:20 +0200 Subject: add option to pass data to control writes Signed-off-by: Amir Hammad --- include/driver/usbh_device_driver.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/driver') 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 -- cgit