aboutsummaryrefslogtreecommitdiff
path: root/include/libopenstm32/usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libopenstm32/usb.h')
-rw-r--r--include/libopenstm32/usb.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/libopenstm32/usb.h b/include/libopenstm32/usb.h
index 3e0efe9..6edfee3 100644
--- a/include/libopenstm32/usb.h
+++ b/include/libopenstm32/usb.h
@@ -244,6 +244,18 @@
(USB_EP_NTOGGLE_MSK & \
(~USB_EP_ADDR))) | ADDR))
+/* Macros for clearing DTOG bits */
+#define USB_CLR_EP_TX_DTOG(EP) \
+ SET_REG(USB_EP_REG(EP), \
+ (GET_REG(USB_EP_REG(EP)) & \
+ USB_EP_NTOGGLE_MSK) | USB_EP_TX_DTOG)
+
+#define USB_CLR_EP_RX_DTOG(EP) \
+ SET_REG(USB_EP_REG(EP), \
+ (GET_REG(USB_EP_REG(EP)) & \
+ USB_EP_NTOGGLE_MSK) | USB_EP_RX_DTOG)
+
+
/******************************************************************************
* USB BTABLE registers
******************************************************************************/