From 3d50b5c9e0eee6ca4eb2e9c1114fcd8ff109e984 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 10 Mar 2011 18:54:58 +0000 Subject: USB improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2815 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/templates/usb_lld.c | 18 ++++++++++++++++++ os/hal/templates/usb_lld.h | 1 + 2 files changed, 19 insertions(+) (limited to 'os/hal/templates') diff --git a/os/hal/templates/usb_lld.c b/os/hal/templates/usb_lld.c index d2750d2e5..823946385 100644 --- a/os/hal/templates/usb_lld.c +++ b/os/hal/templates/usb_lld.c @@ -203,6 +203,24 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { } +/** + * @brief Reads a setup packet from the dedicated packet buffer. + * @details This function must be invoked in the context of the @p setup_cb + * callback in order to read the received setup packet. + * @pre In order to use this function the endpoint must have been + * initialized as a control endpoint. + * @post The endpoint is ready to accept another packet. + * + * @param[in] usbp pointer to the @p USBDriver object + * @param[in] ep endpoint number + * @param[out] buf buffer where to copy the packet data + * + * @notapi + */ +void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) { + +} + /** * @brief Reads a packet from the dedicated packet buffer. * @pre In order to use this function he endpoint must have been diff --git a/os/hal/templates/usb_lld.h b/os/hal/templates/usb_lld.h index 254f6c5da..5b235eaa4 100644 --- a/os/hal/templates/usb_lld.h +++ b/os/hal/templates/usb_lld.h @@ -282,6 +282,7 @@ extern "C" { void usb_lld_disable_endpoints(USBDriver *usbp); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); + void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf); size_t usb_lld_read_packet(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n); void usb_lld_write_packet(USBDriver *usbp, usbep_t ep, -- cgit v1.2.3