aboutsummaryrefslogtreecommitdiff
path: root/include/libopenstm32/usb.h
diff options
context:
space:
mode:
authorGareth McMullin2010-11-04 16:49:03 +1300
committerGareth McMullin2010-11-04 16:49:03 +1300
commit87960830f4eb656f410ff3b220151e0b5ad9a556 (patch)
treece2ff6208c79ca40be61a27a5da0e46735ee2745 /include/libopenstm32/usb.h
parentd6eacce827a8ebffb5e82b48d4c88eb097594c1e (diff)
Fixed HALT condition handling and data toggle.
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
******************************************************************************/