Prusa MINI Firmware overview
USBH_IOREQ_Private_Functions
Collaboration diagram for USBH_IOREQ_Private_Functions:

Functions

USBH_StatusTypeDef USBH_CtlSendSetup (USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t pipe_num)
 USBH_CtlSendSetup Sends the Setup Packet to the Device. More...
 
USBH_StatusTypeDef USBH_CtlSendData (USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num, uint8_t do_ping)
 USBH_CtlSendData Sends a data Packet to the Device. More...
 
USBH_StatusTypeDef USBH_CtlReceiveData (USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num)
 USBH_CtlReceiveData Receives the Device Response to the Setup Packet. More...
 
USBH_StatusTypeDef USBH_BulkSendData (USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num, uint8_t do_ping)
 USBH_BulkSendData Sends the Bulk Packet to the device. More...
 
USBH_StatusTypeDef USBH_BulkReceiveData (USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num)
 USBH_BulkReceiveData Receives IN bulk packet from device. More...
 
USBH_StatusTypeDef USBH_InterruptReceiveData (USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t length, uint8_t pipe_num)
 USBH_InterruptReceiveData Receives the Device Response to the Interrupt IN token. More...
 
USBH_StatusTypeDef USBH_InterruptSendData (USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t length, uint8_t pipe_num)
 USBH_InterruptSendData Sends the data on Interrupt OUT Endpoint. More...
 
USBH_StatusTypeDef USBH_IsocReceiveData (USBH_HandleTypeDef *phost, uint8_t *buff, uint32_t length, uint8_t pipe_num)
 USBH_IsocReceiveData Receives the Device Response to the Isochronous IN token. More...
 
USBH_StatusTypeDef USBH_IsocSendData (USBH_HandleTypeDef *phost, uint8_t *buff, uint32_t length, uint8_t pipe_num)
 USBH_IsocSendData Sends the data on Isochronous OUT Endpoint. More...
 

Detailed Description

Function Documentation

◆ USBH_CtlSendSetup()

USBH_StatusTypeDef USBH_CtlSendSetup ( USBH_HandleTypeDef phost,
uint8_t buff,
uint8_t  pipe_num 
)

USBH_CtlSendSetup Sends the Setup Packet to the Device.

Parameters
phostHost Handle
buffBuffer pointer from which the Data will be send to Device
pipe_numPipe Number
Return values
USBHStatus
103 {
104 
105  USBH_LL_SubmitURB (phost, /* Driver handle */
106  pipe_num, /* Pipe index */
107  0, /* Direction : OUT */
108  USBH_EP_CONTROL, /* EP type */
109  USBH_PID_SETUP, /* Type setup */
110  buff, /* data buffer */
111  USBH_SETUP_PKT_SIZE, /* data length */
112  0);
113  return USBH_OK;
114 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_CtlSendData()

USBH_StatusTypeDef USBH_CtlSendData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint16_t  length,
uint8_t  pipe_num,
uint8_t  do_ping 
)

USBH_CtlSendData Sends a data Packet to the Device.

Parameters
phostHost Handle
buffBuffer pointer from which the Data will be sent to Device
lengthLength of the data to be sent
pipe_numPipe Number
Return values
USBHStatus
131 {
132  if(phost->device.speed != USBH_SPEED_HIGH)
133  {
134  do_ping = 0;
135  }
136 
137  USBH_LL_SubmitURB (phost, /* Driver handle */
138  pipe_num, /* Pipe index */
139  0, /* Direction : OUT */
140  USBH_EP_CONTROL, /* EP type */
141  USBH_PID_DATA, /* Type Data */
142  buff, /* data buffer */
143  length, /* data length */
144  do_ping); /* do ping (HS Only)*/
145 
146  return USBH_OK;
147 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_CtlReceiveData()

USBH_StatusTypeDef USBH_CtlReceiveData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint16_t  length,
uint8_t  pipe_num 
)

USBH_CtlReceiveData Receives the Device Response to the Setup Packet.

Parameters
phostHost Handle
buffBuffer pointer in which the response needs to be copied
lengthLength of the data to be received
pipe_numPipe Number
Return values
USBHStatus.
163 {
164  USBH_LL_SubmitURB (phost, /* Driver handle */
165  pipe_num, /* Pipe index */
166  1, /* Direction : IN */
167  USBH_EP_CONTROL, /* EP type */
168  USBH_PID_DATA, /* Type Data */
169  buff, /* data buffer */
170  length, /* data length */
171  0);
172  return USBH_OK;
173 
174 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_BulkSendData()

USBH_StatusTypeDef USBH_BulkSendData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint16_t  length,
uint8_t  pipe_num,
uint8_t  do_ping 
)

USBH_BulkSendData Sends the Bulk Packet to the device.

Parameters
phostHost Handle
buffBuffer pointer from which the Data will be sent to Device
lengthLength of the data to be sent
pipe_numPipe Number
Return values
USBHStatus
191 {
192  if(phost->device.speed != USBH_SPEED_HIGH)
193  {
194  do_ping = 0;
195  }
196 
197  USBH_LL_SubmitURB (phost, /* Driver handle */
198  pipe_num, /* Pipe index */
199  0, /* Direction : IN */
200  USBH_EP_BULK, /* EP type */
201  USBH_PID_DATA, /* Type Data */
202  buff, /* data buffer */
203  length, /* data length */
204  do_ping); /* do ping (HS Only)*/
205  return USBH_OK;
206 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_BulkReceiveData()

USBH_StatusTypeDef USBH_BulkReceiveData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint16_t  length,
uint8_t  pipe_num 
)

USBH_BulkReceiveData Receives IN bulk packet from device.

Parameters
phostHost Handle
buffBuffer pointer in which the received data packet to be copied
lengthLength of the data to be received
pipe_numPipe Number
Return values
USBHStatus.
222 {
223  USBH_LL_SubmitURB (phost, /* Driver handle */
224  pipe_num, /* Pipe index */
225  1, /* Direction : IN */
226  USBH_EP_BULK, /* EP type */
227  USBH_PID_DATA, /* Type Data */
228  buff, /* data buffer */
229  length, /* data length */
230  0);
231  return USBH_OK;
232 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_InterruptReceiveData()

USBH_StatusTypeDef USBH_InterruptReceiveData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint8_t  length,
uint8_t  pipe_num 
)

USBH_InterruptReceiveData Receives the Device Response to the Interrupt IN token.

Parameters
phostHost Handle
buffBuffer pointer in which the response needs to be copied
lengthLength of the data to be received
pipe_numPipe Number
Return values
USBHStatus.
248 {
249  USBH_LL_SubmitURB (phost, /* Driver handle */
250  pipe_num, /* Pipe index */
251  1, /* Direction : IN */
252  USBH_EP_INTERRUPT, /* EP type */
253  USBH_PID_DATA, /* Type Data */
254  buff, /* data buffer */
255  length, /* data length */
256  0);
257 
258  return USBH_OK;
259 }
Here is the call graph for this function:

◆ USBH_InterruptSendData()

USBH_StatusTypeDef USBH_InterruptSendData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint8_t  length,
uint8_t  pipe_num 
)

USBH_InterruptSendData Sends the data on Interrupt OUT Endpoint.

Parameters
phostHost Handle
buffBuffer pointer from where the data needs to be copied
lengthLength of the data to be sent
pipe_numPipe Number
Return values
USBHStatus.
274 {
275  USBH_LL_SubmitURB (phost, /* Driver handle */
276  pipe_num, /* Pipe index */
277  0, /* Direction : OUT */
278  USBH_EP_INTERRUPT, /* EP type */
279  USBH_PID_DATA, /* Type Data */
280  buff, /* data buffer */
281  length, /* data length */
282  0);
283 
284  return USBH_OK;
285 }
Here is the call graph for this function:

◆ USBH_IsocReceiveData()

USBH_StatusTypeDef USBH_IsocReceiveData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint32_t  length,
uint8_t  pipe_num 
)

USBH_IsocReceiveData Receives the Device Response to the Isochronous IN token.

Parameters
phostHost Handle
buffBuffer pointer in which the response needs to be copied
lengthLength of the data to be received
pipe_numPipe Number
Return values
USBHStatus.
300 {
301  USBH_LL_SubmitURB (phost, /* Driver handle */
302  pipe_num, /* Pipe index */
303  1, /* Direction : IN */
304  USBH_EP_ISO, /* EP type */
305  USBH_PID_DATA, /* Type Data */
306  buff, /* data buffer */
307  length, /* data length */
308  0);
309 
310 
311  return USBH_OK;
312 }
Here is the call graph for this function:

◆ USBH_IsocSendData()

USBH_StatusTypeDef USBH_IsocSendData ( USBH_HandleTypeDef phost,
uint8_t buff,
uint32_t  length,
uint8_t  pipe_num 
)

USBH_IsocSendData Sends the data on Isochronous OUT Endpoint.

Parameters
phostHost Handle
buffBuffer pointer from where the data needs to be copied
lengthLength of the data to be sent
pipe_numPipe Number
Return values
USBHStatus.
327 {
328  USBH_LL_SubmitURB (phost, /* Driver handle */
329  pipe_num, /* Pipe index */
330  0, /* Direction : OUT */
331  USBH_EP_ISO, /* EP type */
332  USBH_PID_DATA, /* Type Data */
333  buff, /* data buffer */
334  length, /* data length */
335  0);
336 
337  return USBH_OK;
338 }
Here is the call graph for this function:
USBH_LL_SubmitURB
USBH_StatusTypeDef USBH_LL_SubmitURB(USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t *, uint16_t, uint8_t)
Submit a new URB to the low level driver.
Definition: usbh_conf.c:475
USBH_PID_DATA
#define USBH_PID_DATA
Definition: usbh_ioreq.h:59
USBH_PID_SETUP
#define USBH_PID_SETUP
Definition: usbh_ioreq.h:58
USBH_SETUP_PKT_SIZE
#define USBH_SETUP_PKT_SIZE
Definition: usbh_ioreq.h:66
USBH_OK
Definition: usbh_def.h:304
_USBH_HandleTypeDef::device
USBH_DeviceTypeDef device
Definition: usbh_def.h:456
USBH_DeviceTypeDef::speed
uint8_t speed
Definition: usbh_def.h:426
USBH_EP_ISO
#define USBH_EP_ISO
Definition: usbh_ioreq.h:62
USBH_EP_INTERRUPT
#define USBH_EP_INTERRUPT
Definition: usbh_ioreq.h:64
USBH_SPEED_HIGH
Definition: usbh_def.h:319
USBH_EP_BULK
#define USBH_EP_BULK
Definition: usbh_ioreq.h:63
length
png_uint_32 length
Definition: png.c:2247
USBH_EP_CONTROL
#define USBH_EP_CONTROL
Definition: usbh_ioreq.h:61