33 #include "os_io_seproxyhal.h"
34 #include "os_helpers.h"
37 #include "usbd_core.h"
69 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
72 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_DISCONNECT;
73 io_seproxyhal_spi_send(buffer, 4);
89 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
92 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_ADDR;
94 io_seproxyhal_spi_send(buffer, 5);
97 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
100 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_CONNECT;
101 io_seproxyhal_spi_send(buffer, 4);
114 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
117 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_DISCONNECT;
118 io_seproxyhal_spi_send(buffer, 4);
141 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
144 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_ENDPOINTS;
149 case USBD_EP_TYPE_CTRL:
150 buffer[6] = SEPROXYHAL_TAG_USB_CONFIG_TYPE_CONTROL;
152 case USBD_EP_TYPE_ISOC:
153 buffer[6] = SEPROXYHAL_TAG_USB_CONFIG_TYPE_ISOCHRONOUS;
155 case USBD_EP_TYPE_BULK:
156 buffer[6] = SEPROXYHAL_TAG_USB_CONFIG_TYPE_BULK;
158 case USBD_EP_TYPE_INTR:
159 buffer[6] = SEPROXYHAL_TAG_USB_CONFIG_TYPE_INTERRUPT;
163 io_seproxyhal_spi_send(buffer, 8);
177 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
180 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_ENDPOINTS;
183 buffer[6] = SEPROXYHAL_TAG_USB_CONFIG_TYPE_DISABLED;
185 io_seproxyhal_spi_send(buffer, 8);
213 buffer[0] = SEPROXYHAL_TAG_USB_EP_PREPARE;
217 buffer[4] = SEPROXYHAL_TAG_USB_EP_PREPARE_DIR_STALL;
219 io_seproxyhal_spi_send(buffer, 6);
220 if (ep_addr & 0x80) {
239 buffer[0] = SEPROXYHAL_TAG_USB_EP_PREPARE;
243 buffer[4] = SEPROXYHAL_TAG_USB_EP_PREPARE_DIR_UNSTALL;
245 io_seproxyhal_spi_send(buffer, 6);
246 if (ep_addr & 0x80) {
264 if((ep_addr & 0x80) == 0x80)
283 buffer[0] = SEPROXYHAL_TAG_USB_CONFIG;
286 buffer[3] = SEPROXYHAL_TAG_USB_CONFIG_ADDR;
287 buffer[4] = dev_addr;
288 io_seproxyhal_spi_send(buffer, 5);
307 buffer[0] = SEPROXYHAL_TAG_USB_EP_PREPARE;
308 buffer[1] = (3+size)>>8;
309 buffer[2] = (3+size);
311 buffer[4] = SEPROXYHAL_TAG_USB_EP_PREPARE_DIR_IN;
313 io_seproxyhal_spi_send(buffer, 6);
314 io_seproxyhal_spi_send(pbuf, size);
332 buffer[0] = SEPROXYHAL_TAG_USB_EP_PREPARE;
336 buffer[4] = SEPROXYHAL_TAG_USB_EP_PREPARE_DIR_OUT;
338 io_seproxyhal_spi_send(buffer, 6);
USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Flushes an endpoint of the Low Level Driver.
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
Initializes the Low Level portion of the Device driver.
uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns Stall condition.
USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev)
Starts the Low Level portion of the Device driver.
unsigned int ep_out_stall
USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev)
De-Initializes the Low Level portion of the Device driver.
USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t size)
Transmits data over an endpoint.
USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Sets a Stall condition on an endpoint of the Low Level Driver.
USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev)
Stops the Low Level portion of the Device driver.
USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr)
Assigns a USB address to the device.
USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Clears a Stall condition on an endpoint of the Low Level Driver.
USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps)
Opens an endpoint of the Low Level Driver.
USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Closes an endpoint of the Low Level Driver.
USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint16_t size)
Prepares an endpoint for reception.