aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/usb_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/usb_lld.h')
-rw-r--r--os/hal/templates/usb_lld.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/os/hal/templates/usb_lld.h b/os/hal/templates/usb_lld.h
index 7dbf8b4b9..40970043a 100644
--- a/os/hal/templates/usb_lld.h
+++ b/os/hal/templates/usb_lld.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
+ ChibiOS/HAL - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
/**
- * @file templates/usb_lld.h
- * @brief USB Driver subsystem low level driver header template.
+ * @file PLATFORM/usb_lld.h
+ * @brief PLATFORM USB subsystem low level driver header.
*
* @addtogroup USB
* @{
@@ -37,9 +37,14 @@
#define USB_MAX_ENDPOINTS 4
/**
+ * @brief Status stage handling method.
+ */
+#define USB_EP0_STATUS_STAGE USB_EP0_STATUS_STAGE_SW
+
+/**
* @brief The address can be changed immediately upon packet reception.
*/
-#define USB_SET_ADDRESS_MODE USB_EARLY_SET_ADDRESS
+#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -54,7 +59,7 @@
* @details If set to @p TRUE the support for USB1 is included.
*/
#if !defined(PLATFORM_USB_USE_USB1) || defined(__DOXYGEN__)
-#define PLATFORM_USB_USE_USB1 FALSE
+#define PLATFORM_USB_USE_USB1 FALSE
#endif
/** @} */
@@ -73,7 +78,7 @@ typedef struct {
/**
* @brief Buffer mode, queue or linear.
*/
- bool_t txqueued;
+ bool txqueued;
/**
* @brief Requested transmit transfer size.
*/
@@ -93,8 +98,9 @@ typedef struct {
/**
* @brief Pointer to the output queue.
*/
- OutputQueue *txqueue;
+ output_queue_t *txqueue;
} queue;
+ /* End of the mandatory fields.*/
} mode;
} USBInEndpointState;
@@ -105,7 +111,7 @@ typedef struct {
/**
* @brief Buffer mode, queue or linear.
*/
- bool_t rxqueued;
+ bool rxqueued;
/**
* @brief Requested receive transfer size.
*/
@@ -125,9 +131,10 @@ typedef struct {
/**
* @brief Pointer to the input queue.
*/
- InputQueue *rxqueue;
+ input_queue_t *rxqueue;
} queue;
} mode;
+ /* End of the mandatory fields.*/
} USBOutEndpointState;
/**
@@ -295,6 +302,16 @@ struct USBDriver {
/*===========================================================================*/
/**
+ * @brief Returns the current frame number.
+ *
+ * @param[in] usbp pointer to the @p USBDriver object
+ * @return The current frame number.
+ *
+ * @notapi
+ */
+#define usb_lld_get_frame_number(usbp) 0
+
+/**
* @brief Returns the exact size of a receive transaction.
* @details The received size can be different from the size specified in
* @p usbStartReceiveI() because the last packet could have a size