aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/OTGv1
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-10 16:31:03 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-10 16:31:03 +0000
commitc762926b68f6a6c7f1e71b8acf9b1dd29d6e481f (patch)
tree595000cdeb9dd88826192dcf82d47381de9cb03e /os/hal/platforms/STM32/OTGv1
parent1d023ea90143296fe13176df8be2aa91d88e702d (diff)
downloadChibiOS-c762926b68f6a6c7f1e71b8acf9b1dd29d6e481f.tar.gz
ChibiOS-c762926b68f6a6c7f1e71b8acf9b1dd29d6e481f.tar.bz2
ChibiOS-c762926b68f6a6c7f1e71b8acf9b1dd29d6e481f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4265 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/OTGv1')
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c93
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.h12
2 files changed, 45 insertions, 60 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 26a5975ee..44d292b8b 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -77,7 +77,7 @@ static uint8_t ep0setup_buffer[8];
* @brief EP0 initialization structure.
*/
static const USBEndpointConfig ep0config = {
- USB_EP_MODE_TYPE_CTRL | USB_EP_MODE_TRANSACTION,
+ USB_EP_MODE_TYPE_CTRL,
_usb_ep0setup,
_usb_ep0in,
_usb_ep0out,
@@ -716,57 +716,6 @@ void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) {
}
/**
- * @brief Reads from a dedicated packet buffer.
- * @pre In order to use this function he endpoint must have been
- * initialized in packet mode.
- * @note This function can be invoked both in thread and IRQ context.
- *
- * @param[in] usbp pointer to the @p USBDriver object
- * @param[in] ep endpoint number
- * @param[out] buf buffer where to copy the packet data
- * @param[in] n maximum number of bytes to copy. This value must
- * not exceed the maximum packet size for this endpoint.
- * @return The received packet size regardless the specified
- * @p n parameter.
- * @retval 0 Zero size packet received.
- *
- * @notapi
- */
-size_t usb_lld_read_packet_buffer(USBDriver *usbp, usbep_t ep,
- uint8_t *buf, size_t n) {
-
- (void)usbp;
- (void)ep;
- (void)buf;
- (void)n;
-
- return 0;
-}
-
-/**
- * @brief Writes to a dedicated packet buffer.
- * @pre In order to use this function he endpoint must have been
- * initialized in packet mode.
- * @note This function can be invoked both in thread and IRQ context.
- *
- * @param[in] usbp pointer to the @p USBDriver object
- * @param[in] ep endpoint number
- * @param[in] buf buffer where to fetch the packet data
- * @param[in] n maximum number of bytes to copy. This value must
- * not exceed the maximum packet size for this endpoint.
- *
- * @notapi
- */
-void usb_lld_write_packet_buffer(USBDriver *usbp, usbep_t ep,
- const uint8_t *buf, size_t n) {
-
- (void)usbp;
- (void)ep;
- (void)buf;
- (void)n;
-}
-
-/**
* @brief Prepares for a receive operation.
*
* @param[in] usbp pointer to the @p USBDriver object
@@ -821,6 +770,46 @@ void usb_lld_prepare_transmit(USBDriver *usbp, usbep_t ep,
}
/**
+ * @brief Prepares for a receive transaction on an OUT endpoint.
+ * @pre In order to use this function the endpoint must have been
+ * initialized in transaction mode.
+ * @post The endpoint is ready for @p usbStartReceiveI().
+ * @note The receive transaction size is equal to the space in the queue
+ * rounded to the lower multiple of a packet size. So make sure there
+ * is room for at least one packet in the queue before starting
+ * the receive operation.
+ *
+ * @param[in] usbp pointer to the @p USBDriver object
+ * @param[in] ep endpoint number
+ * @param[in] iq input queue to be filled with incoming data
+ *
+ * @special
+ */
+void usb_lld_prepare_queued_receive(USBDriver *usbp, usbep_t ep,
+ InputQueue *iq) {
+
+}
+
+/**
+ * @brief Prepares for a transmit transaction on an IN endpoint.
+ * @pre In order to use this function the endpoint must have been
+ * initialized in transaction mode.
+ * @post The endpoint is ready for @p usbStartTransmitI().
+ * @note The transmit transaction size is equal to the data contained
+ * in the queue.
+ *
+ * @param[in] usbp pointer to the @p USBDriver object
+ * @param[in] ep endpoint number
+ * @param[in] oq output queue to be fetched for outgoing data
+ *
+ * @special
+ */
+void usb_lld_prepare_queued_transmit(USBDriver *usbp, usbep_t ep,
+ OutputQueue *oq) {
+
+}
+
+/**
* @brief Starts a receive operation on an OUT endpoint.
*
* @param[in] usbp pointer to the @p USBDriver object
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.h b/os/hal/platforms/STM32/OTGv1/usb_lld.h
index 4cc18a05b..687d788ff 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.h
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.h
@@ -130,10 +130,6 @@ typedef struct {
*/
typedef struct {
/**
- * @brief Number of packets to receive.
- */
- uint16_t rxpkts;
- /**
* @brief Pointer to the receive buffer.
*/
uint8_t *rxbuf;
@@ -377,14 +373,14 @@ extern "C" {
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_buffer(USBDriver *usbp, usbep_t ep,
- uint8_t *buf, size_t n);
- void usb_lld_write_packet_buffer(USBDriver *usbp, usbep_t ep,
- const uint8_t *buf, size_t n);
void usb_lld_prepare_receive(USBDriver *usbp, usbep_t ep,
uint8_t *buf, size_t n);
void usb_lld_prepare_transmit(USBDriver *usbp, usbep_t ep,
const uint8_t *buf, size_t n);
+ void usb_lld_prepare_queued_receive(USBDriver *usbp, usbep_t ep,
+ InputQueue *iq);
+ void usb_lld_prepare_queued_transmit(USBDriver *usbp, usbep_t ep,
+ OutputQueue *oq);
void usb_lld_start_out(USBDriver *usbp, usbep_t ep);
void usb_lld_start_in(USBDriver *usbp, usbep_t ep);
void usb_lld_stall_out(USBDriver *usbp, usbep_t ep);