aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates')
-rw-r--r--os/hal/templates/usb_lld.c18
-rw-r--r--os/hal/templates/usb_lld.h1
2 files changed, 19 insertions, 0 deletions
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
@@ -204,6 +204,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
* initialized in packet mode.
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,