Prusa MINI Firmware overview
USBD_IOREQ_Exported_FunctionsPrototype
Collaboration diagram for USBD_IOREQ_Exported_FunctionsPrototype:

Functions

USBD_StatusTypeDef USBD_CtlSendData (USBD_HandleTypeDef *pdev, uint8_t *buf, uint16_t len)
 USBD_CtlSendData send data on the ctl pipe. More...
 
USBD_StatusTypeDef USBD_CtlContinueSendData (USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
 USBD_CtlContinueSendData continue sending data on the ctl pipe. More...
 
USBD_StatusTypeDef USBD_CtlPrepareRx (USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
 USBD_CtlPrepareRx receive data on the ctl pipe. More...
 
USBD_StatusTypeDef USBD_CtlContinueRx (USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint16_t len)
 USBD_CtlContinueRx continue receive data on the ctl pipe. More...
 
USBD_StatusTypeDef USBD_CtlSendStatus (USBD_HandleTypeDef *pdev)
 USBD_CtlSendStatus send zero lzngth packet on the ctl pipe. More...
 
USBD_StatusTypeDef USBD_CtlReceiveStatus (USBD_HandleTypeDef *pdev)
 USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe. More...
 
uint16_t USBD_GetRxCount (USBD_HandleTypeDef *pdev, uint8_t epnum)
 USBD_GetRxCount returns the received data length. More...
 

Detailed Description

Function Documentation

◆ USBD_CtlSendData()

USBD_StatusTypeDef USBD_CtlSendData ( USBD_HandleTypeDef pdev,
uint8_t pbuf,
uint16_t  len 
)

USBD_CtlSendData send data on the ctl pipe.

Parameters
pdevdevice instance
buffpointer to data buffer
lenlength of data to be sent
Return values
status
98 {
99  /* Set EP0 State */
100  pdev->ep0_state = USBD_EP0_DATA_IN;
101  pdev->ep_in[0].total_length = len;
102  pdev->ep_in[0].rem_length = len;
103  /* Start the transfer */
104  USBD_LL_Transmit (pdev, 0x00, pbuf, len);
105 
106  return USBD_OK;
107 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_CtlContinueSendData()

USBD_StatusTypeDef USBD_CtlContinueSendData ( USBD_HandleTypeDef pdev,
uint8_t pbuf,
uint16_t  len 
)

USBD_CtlContinueSendData continue sending data on the ctl pipe.

Parameters
pdevdevice instance
buffpointer to data buffer
lenlength of data to be sent
Return values
status
120 {
121  /* Start the next transfer */
122  USBD_LL_Transmit (pdev, 0x00, pbuf, len);
123 
124  return USBD_OK;
125 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_CtlPrepareRx()

USBD_StatusTypeDef USBD_CtlPrepareRx ( USBD_HandleTypeDef pdev,
uint8_t pbuf,
uint16_t  len 
)

USBD_CtlPrepareRx receive data on the ctl pipe.

Parameters
pdevdevice instance
buffpointer to data buffer
lenlength of data to be received
Return values
status
138 {
139  /* Set EP0 State */
141  pdev->ep_out[0].total_length = len;
142  pdev->ep_out[0].rem_length = len;
143  /* Start the transfer */
145  0,
146  pbuf,
147  len);
148 
149  return USBD_OK;
150 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_CtlContinueRx()

USBD_StatusTypeDef USBD_CtlContinueRx ( USBD_HandleTypeDef pdev,
uint8_t pbuf,
uint16_t  len 
)

USBD_CtlContinueRx continue receive data on the ctl pipe.

Parameters
pdevdevice instance
buffpointer to data buffer
lenlength of data to be received
Return values
status
163 {
164 
166  0,
167  pbuf,
168  len);
169  return USBD_OK;
170 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_CtlSendStatus()

USBD_StatusTypeDef USBD_CtlSendStatus ( USBD_HandleTypeDef pdev)

USBD_CtlSendStatus send zero lzngth packet on the ctl pipe.

Parameters
pdevdevice instance
Return values
status
178 {
179 
180  /* Set EP0 State */
182 
183  /* Start the transfer */
184  USBD_LL_Transmit (pdev, 0x00, NULL, 0);
185 
186  return USBD_OK;
187 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_CtlReceiveStatus()

USBD_StatusTypeDef USBD_CtlReceiveStatus ( USBD_HandleTypeDef pdev)

USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe.

Parameters
pdevdevice instance
Return values
status
196 {
197  /* Set EP0 State */
199 
200  /* Start the transfer */
201  USBD_LL_PrepareReceive ( pdev,
202  0,
203  NULL,
204  0);
205 
206  return USBD_OK;
207 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_GetRxCount()

uint16_t USBD_GetRxCount ( USBD_HandleTypeDef pdev,
uint8_t  ep_addr 
)

USBD_GetRxCount returns the received data length.

Parameters
pdevdevice instance
ep_addrendpoint address
Return values
RxData blength
218 {
219  return USBD_LL_GetRxDataSize(pdev, ep_addr);
220 }
Here is the call graph for this function:
USBD_EP0_STATUS_OUT
#define USBD_EP0_STATUS_OUT
Definition: usbd_def.h:130
USBD_LL_GetRxDataSize
uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns the last transfered packet size.
Definition: usbd_conf.c:696
_USBD_HandleTypeDef::ep0_state
uint32_t ep0_state
Definition: usbd_def.h:234
_USBD_HandleTypeDef::ep_in
USBD_EndpointTypeDef ep_in[15]
Definition: usbd_def.h:232
USBD_EP0_DATA_OUT
#define USBD_EP0_DATA_OUT
Definition: usbd_def.h:128
NULL
#define NULL
Definition: usbd_def.h:53
USBD_EndpointTypeDef::rem_length
uint32_t rem_length
Definition: usbd_def.h:220
USBD_LL_Transmit
USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t size)
Transmits data over an endpoint.
Definition: usbd_conf.c:630
USBD_LL_PrepareReceive
USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint16_t size)
Prepares an endpoint for reception.
Definition: usbd_conf.c:664
_USBD_HandleTypeDef::ep_out
USBD_EndpointTypeDef ep_out[15]
Definition: usbd_def.h:233
USBD_EP0_STATUS_IN
#define USBD_EP0_STATUS_IN
Definition: usbd_def.h:129
USBD_EP0_DATA_IN
#define USBD_EP0_DATA_IN
Definition: usbd_def.h:127
pbuf
Definition: pbuf.h:142
USBD_OK
Definition: usbd_def.h:195
USBD_EndpointTypeDef::total_length
uint32_t total_length
Definition: usbd_def.h:219