APM:Libraries
usbd_ioreq.c
Go to the documentation of this file.
1 
28 /* Includes ------------------------------------------------------------------*/
29 #include "usbd_ioreq.h"
30 
96  const uint8_t *pbuf,
97  uint16_t len)
98 {
99  USBD_Status ret = USBD_OK;
100 
101  pdev->dev.in_ep[0].total_data_len = len;
102  pdev->dev.in_ep[0].rem_data_len = len;
104 
105  DCD_EP_Tx (pdev, 0, pbuf, len);
106 
107  return ret;
108 }
109 
119  uint8_t *pbuf,
120  uint16_t len)
121 {
122  USBD_Status ret = USBD_OK;
123 
124  DCD_EP_Tx (pdev, 0, pbuf, len);
125 
126 
127  return ret;
128 }
129 
139  uint8_t *pbuf,
140  uint16_t len)
141 {
142  USBD_Status ret = USBD_OK;
143 
144  pdev->dev.out_ep[0].total_data_len = len;
145  pdev->dev.out_ep[0].rem_data_len = len;
147 
148  DCD_EP_PrepareRx (pdev,
149  0,
150  pbuf,
151  len);
152 
153 
154  return ret;
155 }
156 
166  uint8_t *pbuf,
167  uint16_t len)
168 {
169  USBD_Status ret = USBD_OK;
170 
171  DCD_EP_PrepareRx (pdev,
172  0,
173  pbuf,
174  len);
175  return ret;
176 }
184 {
185  USBD_Status ret = USBD_OK;
187  DCD_EP_Tx (pdev,
188  0,
189  NULL,
190  0);
191 
192  USB_OTG_EP0_OutStart(pdev);
193 
194  return ret;
195 }
196 
204 {
205  USBD_Status ret = USBD_OK;
207  DCD_EP_PrepareRx ( pdev,
208  0,
209  NULL,
210  0);
211 
212  USB_OTG_EP0_OutStart(pdev);
213 
214  return ret;
215 }
216 
217 
225 uint16_t USBD_GetRxCount (USB_OTG_CORE_HANDLE *pdev , uint8_t epnum)
226 {
227  return pdev->dev.out_ep[epnum].xfer_count;
228 }
229 
244 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define USB_OTG_EP0_STATUS_IN
Definition: usb_core.h:56
USBD_Status
Definition: usbd_core.h:51
void USB_OTG_EP0_OutStart(USB_OTG_CORE_HANDLE *pdev)
configures EPO to receive SETUP packets
Definition: usb_core.c:1917
USBD_Status USBD_CtlSendData(USB_OTG_CORE_HANDLE *pdev, const uint8_t *pbuf, uint16_t len)
USBD_CtlSendData send data on the ctl pipe.
Definition: usbd_ioreq.c:95
#define USB_OTG_EP0_STATUS_OUT
Definition: usb_core.h:57
uint32_t DCD_EP_Tx(USB_OTG_CORE_HANDLE *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t buf_len)
Transmit data over USB.
Definition: usb_dcd.c:261
uint8_t device_state
Definition: usb_core.h:255
#define USB_OTG_EP0_DATA_OUT
Definition: usb_core.h:55
USB_OTG_EP in_ep[USB_OTG_MAX_TX_FIFOS]
Definition: usb_core.h:262
USBD_Status USBD_CtlPrepareRx(USB_OTG_CORE_HANDLE *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlPrepareRx receive data on the ctl pipe.
Definition: usbd_ioreq.c:138
DCD_DEV dev
Definition: usb_core.h:301
USBD_Status USBD_CtlContinueSendData(USB_OTG_CORE_HANDLE *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlContinueSendData continue sending data on the ctl pipe.
Definition: usbd_ioreq.c:118
#define NULL
Definition: hal_types.h:59
header file for the usbd_ioreq.c file
uint32_t rem_data_len
Definition: usb_core.h:152
USB_OTG_EP out_ep[USB_OTG_MAX_TX_FIFOS]
Definition: usb_core.h:263
#define USB_OTG_EP0_DATA_IN
Definition: usb_core.h:54
USBD_Status USBD_CtlSendStatus(USB_OTG_CORE_HANDLE *pdev)
USBD_CtlSendStatus send zero lzngth packet on the ctl pipe.
Definition: usbd_ioreq.c:183
USBD_Status USBD_CtlReceiveStatus(USB_OTG_CORE_HANDLE *pdev)
USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe.
Definition: usbd_ioreq.c:203
uint32_t total_data_len
Definition: usb_core.h:153
uint16_t USBD_GetRxCount(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
USBD_GetRxCount returns the received data length.
Definition: usbd_ioreq.c:225
USBD_Status USBD_CtlContinueRx(USB_OTG_CORE_HANDLE *pdev, uint8_t *pbuf, uint16_t len)
USBD_CtlContinueRx continue receive data on the ctl pipe.
Definition: usbd_ioreq.c:165
uint32_t DCD_EP_PrepareRx(USB_OTG_CORE_HANDLE *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t buf_len)
DCD_EP_PrepareRx.
Definition: usb_dcd.c:221
uint32_t xfer_count
Definition: usb_core.h:150