diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2017-09-09 11:20:03 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2017-09-09 11:20:03 +0000 |
commit | 7da97fec6a03aaecd0238c5b7ac46651bbd080d5 (patch) | |
tree | da41c73bf474129c7832306f8898dd27d0a34307 /os/hal/ports/STM32 | |
parent | 66cf5195f983d64d24e708333907679529449b0b (diff) | |
download | ChibiOS-7da97fec6a03aaecd0238c5b7ac46651bbd080d5.tar.gz ChibiOS-7da97fec6a03aaecd0238c5b7ac46651bbd080d5.tar.bz2 ChibiOS-7da97fec6a03aaecd0238c5b7ac46651bbd080d5.zip |
Tentative implementation of USB host wake-up API.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10570 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c | 3 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h | 18 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.h | 18 |
3 files changed, 32 insertions, 7 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c index b1802bc71..7cf690f5d 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c +++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c @@ -556,9 +556,6 @@ static void usb_lld_serve_interrupt(USBDriver *usbp) { otgp->PCGCCTL &= ~(PCGCCTL_STPPCLK | PCGCCTL_GATEHCLK);
}
- /* Clear the Remote Wake-up Signaling.*/
- otgp->DCTL |= DCTL_RWUSIG;
-
_usb_wakeup(usbp);
}
diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h index 5f94a67ab..4c4177133 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h +++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h @@ -541,7 +541,7 @@ struct USBDriver { /**
* @brief Connects the USB device.
*
- * @api
+ * @notapi
*/
#if (STM32_OTG_STEPPING == 1) || defined(__DOXYGEN__)
#define usb_lld_connect_bus(usbp) ((usbp)->otg->GCCFG |= GCCFG_VBUSBSEN)
@@ -552,7 +552,7 @@ struct USBDriver { /**
* @brief Disconnect the USB device.
*
- * @api
+ * @notapi
*/
#if (STM32_OTG_STEPPING == 1) || defined(__DOXYGEN__)
#define usb_lld_disconnect_bus(usbp) ((usbp)->otg->GCCFG &= ~GCCFG_VBUSBSEN)
@@ -560,6 +560,20 @@ struct USBDriver { #define usb_lld_disconnect_bus(usbp) ((usbp)->otg->DCTL |= DCTL_SDIS)
#endif
+/**
+ * @brief Start of host wake-up procedure.
+ *
+ * @notapi
+ */
+#define usb_lld_start_wakeup_host(usbp) ((usbp)->otg->DCTL |= DCTL_RWUSIG)
+
+/**
+ * @brief Stop of host wake-up procedure.
+ *
+ * @notapi
+ */
+#define usb_lld_stop_wakeup_host(usbp) ((usbp)->otg->DCTL &= ~DCTL_RWUSIG)
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.h b/os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.h index 7971189ae..db199e33d 100644 --- a/os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.h +++ b/os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.h @@ -422,7 +422,7 @@ struct USBDriver { /**
* @brief Connects the USB device.
*
- * @api
+ * @notapi
*/
#if !defined(usb_lld_connect_bus)
#define usb_lld_connect_bus(usbp) (STM32_USB->BCDR |= USB_BCDR_DPPU)
@@ -431,7 +431,7 @@ struct USBDriver { /**
* @brief Disconnect the USB device.
*
- * @api
+ * @notapi
*/
#if !defined(usb_lld_disconnect_bus)
#define usb_lld_disconnect_bus(usbp) (STM32_USB->BCDR &= ~USB_BCDR_DPPU)
@@ -448,6 +448,20 @@ struct USBDriver { #endif
#endif /* STM32L1XX */
+/**
+ * @brief Start of host wake-up procedure.
+ *
+ * @notapi
+ */
+#define usb_lld_start_wakeup_host(usbp) (STM32_USB->CNTR |= USB_CNTR_RESUME)
+
+/**
+ * @brief Stop of host wake-up procedure.
+ *
+ * @notapi
+ */
+#define usb_lld_stop_wakeup_host(usbp) (STM32_USB->CNTR &= ~USB_CNTR_RESUME)
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
|