aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-06 09:51:16 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-06 09:51:16 +0000
commit4e68b68d5a799300bcbbfb3fdff0ea584239bcb0 (patch)
tree4e9bd4ee6753cbe7a32cc276d3309c6a391f4630 /os/hal/platforms
parent200f020df922ac84ffc0e0c98c97a193e3180b1f (diff)
downloadChibiOS-4e68b68d5a799300bcbbfb3fdff0ea584239bcb0.tar.gz
ChibiOS-4e68b68d5a799300bcbbfb3fdff0ea584239bcb0.tar.bz2
ChibiOS-4e68b68d5a799300bcbbfb3fdff0ea584239bcb0.zip
USB rework, step 2.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2714 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r--os/hal/platforms/STM32/usb_lld.c234
-rw-r--r--os/hal/platforms/STM32/usb_lld.h108
2 files changed, 241 insertions, 101 deletions
diff --git a/os/hal/platforms/STM32/usb_lld.c b/os/hal/platforms/STM32/usb_lld.c
index 3fe6771ea..c55251d9b 100644
--- a/os/hal/platforms/STM32/usb_lld.c
+++ b/os/hal/platforms/STM32/usb_lld.c
@@ -62,7 +62,7 @@ static const USBEndpointConfig ep0config = {
_usb_ep0out,
0x40,
0x40,
- EPR_EP_TYPE_CONTROL | EPR_STAT_TX_STALL | EPR_STAT_RX_VALID,
+ EPR_EP_TYPE_CONTROL | EPR_STAT_TX_NAK | EPR_STAT_RX_VALID,
0x40,
0x80
};
@@ -71,6 +71,58 @@ static const USBEndpointConfig ep0config = {
/* Driver local functions. */
/*===========================================================================*/
+/**
+ * @brief Copies a packet from memory into a packet buffer.
+ *
+ * @param[in] ep endpoint number
+ * @param[in] buf buffer where to fetch the endpoint data
+ * @param[in] n maximum number of bytes to copy
+ */
+static void write_packet(usbep_t ep, const uint8_t *buf, size_t n){
+ uint32_t *pmap;
+ stm32_usb_descriptor_t *udp;
+ size_t count;
+
+ udp = USB_GET_DESCRIPTOR(ep);
+ pmap = USB_ADDR2PTR(udp->TXADDR);
+ udp->TXCOUNT = n;
+ count = (n + 1) / 2;
+ while (count) {
+ *pmap++ = *(uint16_t *)buf;
+ buf += 2;
+ count--;
+ }
+ EPR_SET_STAT_TX(ep, EPR_STAT_TX_VALID);
+}
+
+/**
+ * @brief Copies a packet from a packet buffer into memory.
+ *
+ * @param[in] ep endpoint number
+ * @param[in] buf buffer where to copy the endpoint data
+ * @param[in] n maximum number of bytes to copy
+ * @return The packet size.
+ * @retval 0 Special case, zero sized packet.
+ */
+static size_t read_packet(usbep_t ep, uint8_t *buf, size_t n){
+ uint32_t *pmap;
+ stm32_usb_descriptor_t *udp;
+ size_t count;
+
+ udp = USB_GET_DESCRIPTOR(ep);
+ pmap = USB_ADDR2PTR(udp->RXADDR);
+ count = udp->RXCOUNT & RXCOUNT_COUNT_MASK;
+ if (n > count)
+ n = count;
+ count = (n + 1) / 2;
+ while (count) {
+ *(uint16_t *)buf = (uint16_t)*pmap++;
+ buf += 2;
+ count--;
+ }
+ return n;
+}
+
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
@@ -95,6 +147,7 @@ CH_IRQ_HANDLER(USB_HP_IRQHandler) {
*/
CH_IRQ_HANDLER(USB_LP_IRQHandler) {
uint32_t istr;
+ size_t n;
USBDriver *usbp = &USBD1;
CH_IRQ_PROLOGUE();
@@ -104,15 +157,15 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) {
/* USB bus reset condition handling.*/
if (istr & ISTR_RESET) {
_usb_reset(usbp);
- if (usbp->usb_config->uc_event_cb)
- usbp->usb_config->uc_event_cb(usbp, USB_EVENT_RESET);
+ if (usbp->config->event_cb)
+ usbp->config->event_cb(usbp, USB_EVENT_RESET);
STM32_USB->ISTR = ~ISTR_RESET;
}
/* SOF handling.*/
if (istr & ISTR_SOF) {
- if (usbp->usb_config->uc_sof_cb)
- usbp->usb_config->uc_sof_cb(usbp);
+ if (usbp->config->sof_cb)
+ usbp->config->sof_cb(usbp);
STM32_USB->ISTR = ~ISTR_SOF;
}
@@ -120,19 +173,55 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) {
while (istr & ISTR_CTR) {
uint32_t ep;
uint32_t epr = STM32_USB->EPR[ep = istr & ISTR_EP_ID_MASK];
- const USBEndpointConfig *epcp = usbp->usb_ep[ep]->uep_config;
+ const USBEndpointConfig *epcp = usbp->ep[ep]->config;
if (epr & EPR_CTR_TX) {
/* IN endpoint, transmission.*/
EPR_CLEAR_CTR_TX(ep);
- if (epcp->uepc_in_cb)
- epcp->uepc_in_cb(usbp, ep);
+ n = USB_GET_DESCRIPTOR(ep)->TXCOUNT;
+ usbp->ep[ep]->txbuf += n;
+ usbp->ep[ep]->txcnt += n;
+ usbp->ep[ep]->txsize -= n;
+ if (usbp->ep[ep]->txsize > 0) {
+ /* Transfer not completed, there are more packets to send.*/
+ if (usbp->ep[ep]->txsize > epcp->in_maxsize)
+ n = epcp->in_maxsize;
+ else
+ n = usbp->ep[ep]->txsize;
+ write_packet(ep, usbp->ep[ep]->txbuf, n);
+ }
+ else {
+ /* Transfer completed, invoking the callback, if defined.*/
+ if (epcp->in_cb)
+ epcp->in_cb(usbp, ep);
+ }
}
if (epr & EPR_CTR_RX) {
- /* OUT endpoint, receive.*/
EPR_CLEAR_CTR_RX(ep);
- if (epcp->uepc_out_cb)
- epcp->uepc_out_cb(usbp, ep);
+ /* OUT endpoint, receive.*/
+ if ((epr & EPR_SETUP) && (ep == 0)) {
+ /* Special case, setup packet for EP0, enforcing a reset of the
+ EP0 state machine for robustness.*/
+ usbp->ep0state = USB_EP0_WAITING_SETUP;
+ read_packet(0, usbp->setup, 8);
+ epcp->out_cb(usbp, ep);
+ }
+ else {
+ n = read_packet(ep, usbp->ep[ep]->rxbuf, usbp->ep[ep]->rxsize);
+ usbp->ep[ep]->rxbuf += n;
+ usbp->ep[ep]->rxcnt += n;
+ usbp->ep[ep]->rxsize -= n;
+ usbp->ep[ep]->rxpkts -= 1;
+ if (usbp->ep[ep]->rxpkts > 0) {
+ /* Transfer not completed, there are more packets to receive.*/
+ EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID);
+ }
+ else {
+ /* Transfer completed, invoking the callback, if defined.*/
+ if (epcp->out_cb)
+ epcp->out_cb(usbp, ep);
+ }
+ }
}
istr = STM32_USB->ISTR;
}
@@ -169,7 +258,7 @@ void usb_lld_init(void) {
*/
void usb_lld_start(USBDriver *usbp) {
- if (usbp->usb_state == USB_STOP) {
+ if (usbp->state == USB_STOP) {
/* Clock activation.*/
#if STM32_USB_USE_USB1
if (&USBD1 == usbp) {
@@ -202,7 +291,7 @@ void usb_lld_start(USBDriver *usbp) {
void usb_lld_stop(USBDriver *usbp) {
/* If in ready state then disables the USB clock.*/
- if (usbp->usb_state == USB_STOP) {
+ if (usbp->state == USB_STOP) {
#if STM32_ADC_USE_ADC1
if (&USBD1 == usbp) {
NVICDisableVector(USB_HP_CAN1_TX_IRQn);
@@ -234,14 +323,14 @@ void usb_lld_reset(USBDriver *usbp) {
/*CNTR_WKUPM | CNTR_ERRM | CNTR_PMAOVRM |*/ CNTR_CTRM;
/* The SOF interrupt is only enabled if a callback is defined for
this service because it is an high rate source.*/
- if (usbp->usb_config->uc_sof_cb != NULL)
+ if (usbp->config->sof_cb != NULL)
cntr |= CNTR_SOFM;
STM32_USB->CNTR = cntr;
/* EP0 initialization.*/
memset(&ep0state, 0, sizeof ep0state);
- ep0state.uep_config = &ep0config;
- usbp->usb_ep[0] = &ep0state;
+ ep0state.config = &ep0config;
+ usbp->ep[0] = &ep0state;
usb_lld_init_endpoint(usbp, 0);
}
@@ -249,14 +338,12 @@ void usb_lld_reset(USBDriver *usbp) {
* @brief Sets the USB address.
*
* @param[in] usbp pointer to the @p USBDriver object
- * @param[in] addr the USB address
*
* @notapi
*/
-void usb_lld_set_address(USBDriver *usbp, uint8_t addr) {
+void usb_lld_set_address(USBDriver *usbp) {
- (void)usbp;
- STM32_USB->DADDR = (uint32_t)addr | DADDR_EF;
+ STM32_USB->DADDR = (uint32_t)(usbp->address) | DADDR_EF;
}
/**
@@ -270,23 +357,23 @@ void usb_lld_set_address(USBDriver *usbp, uint8_t addr) {
void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) {
uint16_t nblocks;
stm32_usb_descriptor_t *dp;
- const USBEndpointConfig *epcp = usbp->usb_ep[ep]->uep_config;
+ const USBEndpointConfig *epcp = usbp->ep[ep]->config;
/* EPxR register setup.*/
- EPR_SET(ep, epcp->uepc_epr | ep);
- EPR_TOGGLE(ep, epcp->uepc_epr);
+ EPR_SET(ep, epcp->epr | ep);
+ EPR_TOGGLE(ep, epcp->epr);
/* Endpoint size and address initialization.*/
- if (epcp->uepc_out_maxsize > 62)
- nblocks = (((((epcp->uepc_out_maxsize - 1) | 0x1f) + 1) / 32) << 10) |
+ if (epcp->out_maxsize > 62)
+ nblocks = (((((epcp->out_maxsize - 1) | 0x1f) + 1) / 32) << 10) |
0x8000;
else
- nblocks = ((((epcp->uepc_out_maxsize - 1) | 1) + 1) / 2) << 10;
+ nblocks = ((((epcp->out_maxsize - 1) | 1) + 1) / 2) << 10;
dp = USB_GET_DESCRIPTOR(ep);
dp->TXCOUNT = 0;
dp->RXCOUNT = nblocks;
- dp->TXADDR = epcp->uepc_inaddr;
- dp->RXADDR = epcp->uepc_outaddr;
+ dp->TXADDR = epcp->inaddr;
+ dp->RXADDR = epcp->outaddr;
}
/**
@@ -379,7 +466,7 @@ size_t usb_lld_get_writeable(USBDriver *usbp, usbep_t ep) {
if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_NAK)
return 0;
- return (size_t)usbp->usb_ep[ep]->uep_config->uepc_in_maxsize;
+ return (size_t)usbp->ep[ep]->config->in_maxsize;
}
/**
@@ -422,20 +509,20 @@ size_t usb_lld_write(USBDriver *usbp, usbep_t ep,
}
/**
- * @brief Returns the status of an IN endpoint.
+ * @brief Returns the status of an OUT endpoint.
*
* @param[in] usbp pointer to the @p USBDriver object
* @param[in] ep endpoint number
*
* @notapi
*/
-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)usbp;
- switch (STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) {
- case EPR_STAT_TX_DIS:
+ switch (STM32_USB->EPR[ep] & EPR_STAT_RX_MASK) {
+ case EPR_STAT_RX_DIS:
return EP_STATUS_DISABLED;
- case EPR_STAT_TX_STALL:
+ case EPR_STAT_RX_STALL:
return EP_STATUS_STALLED;
default:
return EP_STATUS_ACTIVE;
@@ -443,20 +530,20 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) {
}
/**
- * @brief Returns the status of an OUT endpoint.
+ * @brief Returns the status of an IN endpoint.
*
* @param[in] usbp pointer to the @p USBDriver object
* @param[in] ep endpoint number
*
* @notapi
*/
-usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) {
+usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) {
(void)usbp;
- switch (STM32_USB->EPR[ep] & EPR_STAT_RX_MASK) {
- case EPR_STAT_RX_DIS:
+ switch (STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) {
+ case EPR_STAT_TX_DIS:
return EP_STATUS_DISABLED;
- case EPR_STAT_RX_STALL:
+ case EPR_STAT_TX_STALL:
return EP_STATUS_STALLED;
default:
return EP_STATUS_ACTIVE;
@@ -464,17 +551,50 @@ usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) {
}
/**
- * @brief Brings an IN endpoint in the stalled state.
+ * @brief Starts a receive operation on an OUT endpoint.
*
* @param[in] usbp pointer to the @p USBDriver object
* @param[in] ep endpoint number
+ * @param[out] buf buffer where to copy the endpoint data
+ * @param[in] n maximum number of bytes to copy in the buffer
*
* @notapi
*/
-void usb_lld_stall_in(USBDriver *usbp, usbep_t ep) {
+void usb_lld_start_out(USBDriver *usbp, usbep_t ep,
+ uint8_t *buf, size_t n) {
+ USBEndpointState *uesp = usbp->ep[ep];
+
+ uesp->rxbuf = buf;
+ uesp->rxsize = n;
+ uesp->rxcnt = 0;
+ if (uesp->rxsize == 0) /* Special case for zero sized packets.*/
+ uesp->rxpkts = 1;
+ else
+ uesp->rxpkts = (uint16_t)((n + uesp->config->out_maxsize - 1) /
+ uesp->config->out_maxsize);
+ EPR_SET_STAT_RX(ep, EPR_STAT_RX_VALID);
+}
- (void)usbp;
- EPR_SET_STAT_TX(ep, EPR_STAT_TX_STALL);
+/**
+ * @brief Starts a transmit operation on an IN endpoint.
+ *
+ * @param[in] usbp pointer to the @p USBDriver object
+ * @param[in] ep endpoint number
+ * @param[in] buf buffer where to fetch the endpoint data
+ * @param[in] n maximum number of bytes to copy
+ *
+ * @notapi
+ */
+void usb_lld_start_in(USBDriver *usbp, usbep_t ep,
+ const uint8_t *buf, size_t n) {
+ USBEndpointState *uesp = usbp->ep[ep];
+
+ uesp->txbuf = buf;
+ uesp->txsize = n;
+ uesp->txcnt = 0;
+ if (n > (size_t)uesp->config->in_maxsize)
+ n = (size_t)uesp->config->in_maxsize;
+ write_packet(ep, buf, n);
}
/**
@@ -492,21 +612,17 @@ void usb_lld_stall_out(USBDriver *usbp, usbep_t ep) {
}
/**
- * @brief Brings an IN endpoint in the active state.
+ * @brief Brings an IN endpoint in the stalled state.
*
* @param[in] usbp pointer to the @p USBDriver object
* @param[in] ep endpoint number
*
* @notapi
*/
-void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) {
+void usb_lld_stall_in(USBDriver *usbp, usbep_t ep) {
(void)usbp;
-
- /* Makes sure to not put to NAK an endpoint that is already
- transferring.*/
- if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_VALID)
- EPR_SET_STAT_TX(ep, EPR_STAT_TX_NAK);
+ EPR_SET_STAT_TX(ep, EPR_STAT_TX_STALL);
}
/**
@@ -527,6 +643,24 @@ void usb_lld_clear_out(USBDriver *usbp, usbep_t ep) {
EPR_SET_STAT_TX(ep, EPR_STAT_RX_NAK);
}
+/**
+ * @brief Brings an IN endpoint in the active state.
+ *
+ * @param[in] usbp pointer to the @p USBDriver object
+ * @param[in] ep endpoint number
+ *
+ * @notapi
+ */
+void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) {
+
+ (void)usbp;
+
+ /* Makes sure to not put to NAK an endpoint that is already
+ transferring.*/
+ if ((STM32_USB->EPR[ep] & EPR_STAT_TX_MASK) != EPR_STAT_TX_VALID)
+ EPR_SET_STAT_TX(ep, EPR_STAT_TX_NAK);
+}
+
#endif /* HAL_USE_USB */
/** @} */
diff --git a/os/hal/platforms/STM32/usb_lld.h b/os/hal/platforms/STM32/usb_lld.h
index e21bbecd2..7947e22fc 100644
--- a/os/hal/platforms/STM32/usb_lld.h
+++ b/os/hal/platforms/STM32/usb_lld.h
@@ -41,6 +41,11 @@
*/
#define USB_MAX_ENDPOINTS USB_ENDOPOINTS_NUMBER
+/**
+ * @brief This device requires the address change after the status packet.
+ */
+#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -89,40 +94,40 @@
/*===========================================================================*/
/**
- * @brief Type of an USB Endpoint configuration structure.
+ * @brief Type of an USB endpoint configuration structure.
* @note Platform specific restrictions may apply to endpoints.
*/
typedef struct {
/**
* @brief IN endpoint notification callback.
*/
- usbepcallback_t uepc_in_cb;
+ usbepcallback_t in_cb;
/**
* @brief OUT endpoint notification callback.
*/
- usbepcallback_t uepc_out_cb;
+ usbepcallback_t out_cb;
/**
* @brief IN endpoint maximum packet size.
*/
- uint16_t uepc_in_maxsize;
+ uint16_t in_maxsize;
/**
* @brief OUT endpoint maximum packet size.
*/
- uint16_t uepc_out_maxsize;
+ uint16_t out_maxsize;
/* End of the mandatory fields.*/
/**
* @brief EPxR register initialization value.
* @note Do not specify the EA field, leave it to zero.
*/
- uint16_t uepc_epr;
+ uint16_t epr;
/**
* @brief Endpoint IN buffer address as offset in the PMA.
*/
- uint16_t uepc_inaddr;
+ uint16_t inaddr;
/**
* @brief Endpoint OUT buffer address as offset in the PMA.
*/
- uint16_t uepc_outaddr;
+ uint16_t outaddr;
} USBEndpointConfig;
@@ -133,39 +138,44 @@ typedef struct {
/**
* @brief Configuration associated to the endpoint.
*/
- const USBEndpointConfig *uep_config;
+ const USBEndpointConfig *config;
+ /**
+ * @brief @p TRUE if transmitting else @p FALSE.
+ */
+ uint8_t transmitting;
+ /**
+ * @brief @p TRUE if receiving else @p FALSE.
+ */
+ uint8_t receiving;
+ /* End of the mandatory fields.*/
+ /**
+ * @brief Number of packets to receive.
+ */
+ uint16_t rxpkts;
/**
* @brief Pointer to the transmission buffer.
*/
- const uint8_t *uep_txbuf;
+ const uint8_t *txbuf;
/**
* @brief Pointer to the receive buffer.
*/
- uint8_t *uep_rxbuf;
+ uint8_t *rxbuf;
/**
* @brief Requested transmit transfer size.
*/
- size_t uep_txsize;
+ size_t txsize;
/**
* @brief Requested receive transfer size.
*/
- size_t uep_rxsize;
+ size_t rxsize;
/**
* @brief Transmitted bytes so far.
*/
- size_t uep_txcnt;
+ size_t txcnt;
/**
* @brief Received bytes so far.
*/
- size_t uep_rxcnt;
- /**
- * @brief @p TRUE if transmitting else @p FALSE.
- */
- uint8_t uep_transmitting;
- /**
- * @brief @p TRUE if receiving else @p FALSE.
- */
- uint8_t uep_receiving;
+ size_t rxcnt;
} USBEndpointState;
/**
@@ -176,22 +186,22 @@ typedef struct {
* @brief USB events callback.
* @details This callback is invoked when an USB driver event is registered.
*/
- usbeventcb_t uc_event_cb;
+ usbeventcb_t event_cb;
/**
* @brief Device GET_DESCRIPTOR request callback.
* @note This callback is mandatory and cannot be set to @p NULL.
*/
- usbgetdescriptor_t uc_get_descriptor_cb;
+ usbgetdescriptor_t get_descriptor_cb;
/**
* @brief Requests hook callback.
* @details This hook allows to be notified of standard requests or to
* handle non standard requests.
*/
- usbreqhandler_t uc_requests_hook_cb;
+ usbreqhandler_t requests_hook_cb;
/**
* @brief Start Of Frame callback.
*/
- usbcallback_t uc_sof_cb;
+ usbcallback_t sof_cb;
/* End of the mandatory fields.*/
} USBConfig;
@@ -202,60 +212,52 @@ struct USBDriver {
/**
* @brief Driver state.
*/
- usbstate_t usb_state;
+ usbstate_t state;
/**
* @brief Current configuration data.
*/
- const USBConfig *usb_config;
+ const USBConfig *config;
/**
* @brief Field available to user, it can be used to associate an
* application-defined handler to the USB driver.
*/
- void *usb_param;
+ void *param;
/**
* @brief Active endpoints configurations.
*/
- USBEndpointState *usb_ep[USB_MAX_ENDPOINTS + 1];
+ USBEndpointState *ep[USB_MAX_ENDPOINTS + 1];
/**
* @brief Endpoint 0 state.
*/
- usbep0state_t usb_ep0state;
+ usbep0state_t ep0state;
/**
* @brief Next position in the buffer to be transferred through endpoint 0.
*/
- uint8_t *usb_ep0next;
+ uint8_t *ep0next;
/**
- * @brief Maximum number of bytes to be tranferred through endpoint 0.
+ * @brief Maximum number of bytes to be transferred through endpoint 0.
*/
- size_t usb_ep0max;
+ size_t ep0max;
/**
- * @brief Number of bytes yet to be tranferred through endpoint 0.
+ * @brief Number of bytes yet to be transferred through endpoint 0.
*/
- size_t usb_ep0n;
- /**
- * @brief Size of the last packet transferred through endpoint 0.
- */
- size_t usb_ep0lastsize;
- /**
- * @brief Endpoint 0 end transaction callback.
- */
- usbcallback_t usb_ep0endcb;
+ size_t ep0n;
/**
* @brief Setup packet buffer.
*/
- uint8_t usb_setup[8];
+ uint8_t setup[8];
/**
* @brief Current USB device status.
*/
- uint16_t usb_status;
+ uint16_t status;
/**
* @brief Assigned USB address.
*/
- uint8_t usb_address;
+ uint8_t address;
/**
* @brief Current USB device configuration.
*/
- uint8_t usb_configuration;
+ uint8_t configuration;
/* End of the mandatory fields.*/
};
@@ -305,7 +307,7 @@ extern "C" {
void usb_lld_start(USBDriver *usbp);
void usb_lld_stop(USBDriver *usbp);
void usb_lld_reset(USBDriver *usbp);
- void usb_lld_set_address(USBDriver *usbp, uint8_t addr);
+ void usb_lld_set_address(USBDriver *usbp);
void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep);
void usb_lld_disable_endpoints(USBDriver *usbp);
size_t usb_lld_get_readable(USBDriver *usbp, usbep_t ep);
@@ -315,10 +317,14 @@ extern "C" {
const uint8_t *buf, size_t n);
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_start_out(USBDriver *usbp, usbep_t ep,
+ uint8_t *buf, size_t n);
+ void usb_lld_start_in(USBDriver *usbp, usbep_t ep,
+ const uint8_t *buf, size_t n);
void usb_lld_stall_in(USBDriver *usbp, usbep_t ep);
void usb_lld_stall_out(USBDriver *usbp, usbep_t ep);
- void usb_lld_clear_in(USBDriver *usbp, usbep_t ep);
void usb_lld_clear_out(USBDriver *usbp, usbep_t ep);
+ void usb_lld_clear_in(USBDriver *usbp, usbep_t ep);
#ifdef __cplusplus
}
#endif