Prusa MINI Firmware overview
USBH_PIPES_Private_Functions
Collaboration diagram for USBH_PIPES_Private_Functions:

Functions

static uint16_t USBH_GetFreePipe (USBH_HandleTypeDef *phost)
 USBH_GetFreePipe. More...
 
USBH_StatusTypeDef USBH_OpenPipe (USBH_HandleTypeDef *phost, uint8_t pipe_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
 USBH_Open_Pipe Open a pipe. More...
 
USBH_StatusTypeDef USBH_ClosePipe (USBH_HandleTypeDef *phost, uint8_t pipe_num)
 USBH_ClosePipe Close a pipe. More...
 
uint8_t USBH_AllocPipe (USBH_HandleTypeDef *phost, uint8_t ep_addr)
 USBH_Alloc_Pipe Allocate a new Pipe. More...
 
USBH_StatusTypeDef USBH_FreePipe (USBH_HandleTypeDef *phost, uint8_t idx)
 USBH_Free_Pipe Free the USB Pipe. More...
 

Detailed Description

Function Documentation

◆ USBH_GetFreePipe()

static uint16_t USBH_GetFreePipe ( USBH_HandleTypeDef phost)
static

USBH_GetFreePipe.

Parameters
phostHost Handle Get a free Pipe number for allocation to a device endpoint
Return values
idxFree Pipe number
174 {
175  uint8_t idx = 0;
176 
177  for (idx = 0 ; idx < 11 ; idx++)
178  {
179  if ((phost->Pipes[idx] & 0x8000) == 0)
180  {
181  return idx;
182  }
183  }
184  return 0xFFFF;
185 }
Here is the caller graph for this function:

◆ USBH_OpenPipe()

USBH_StatusTypeDef USBH_OpenPipe ( USBH_HandleTypeDef phost,
uint8_t  pipe_num,
uint8_t  epnum,
uint8_t  dev_address,
uint8_t  speed,
uint8_t  ep_type,
uint16_t  mps 
)

USBH_Open_Pipe Open a pipe.

Parameters
phostHost Handle
pipe_numPipe Number
dev_addressUSB Device address allocated to attached device
speed: USB device speed (Full/Low)
ep_typeend point type (Bulk/int/ctl)
mpsmax pkt size
Return values
USBHStatus
100 {
101 
102  USBH_LL_OpenPipe(phost,
103  pipe_num,
104  epnum,
105  dev_address,
106  speed,
107  ep_type,
108  mps);
109 
110  return USBH_OK;
111 
112 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_ClosePipe()

USBH_StatusTypeDef USBH_ClosePipe ( USBH_HandleTypeDef phost,
uint8_t  pipe_num 
)

USBH_ClosePipe Close a pipe.

Parameters
phostHost Handle
pipe_numPipe Number
Return values
USBHStatus
123 {
124 
125  USBH_LL_ClosePipe(phost, pipe_num);
126 
127  return USBH_OK;
128 
129 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_AllocPipe()

uint8_t USBH_AllocPipe ( USBH_HandleTypeDef phost,
uint8_t  ep_addr 
)

USBH_Alloc_Pipe Allocate a new Pipe.

Parameters
phostHost Handle
ep_addrEnd point for which the Pipe to be allocated
Return values
Pipenumber
139 {
140  uint16_t pipe;
141 
142  pipe = USBH_GetFreePipe(phost);
143 
144  if (pipe != 0xFFFF)
145  {
146  phost->Pipes[pipe] = 0x8000 | ep_addr;
147  }
148  return pipe;
149 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBH_FreePipe()

USBH_StatusTypeDef USBH_FreePipe ( USBH_HandleTypeDef phost,
uint8_t  idx 
)

USBH_Free_Pipe Free the USB Pipe.

Parameters
phostHost Handle
idxPipe number to be freed
Return values
USBHStatus
159 {
160  if(idx < 11)
161  {
162  phost->Pipes[idx] &= 0x7FFF;
163  }
164  return USBH_OK;
165 }
Here is the caller graph for this function:
USBH_LL_OpenPipe
USBH_StatusTypeDef USBH_LL_OpenPipe(USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t)
Open a pipe of the low level driver.
Definition: usbh_conf.c:388
USBH_GetFreePipe
static uint16_t USBH_GetFreePipe(USBH_HandleTypeDef *phost)
USBH_GetFreePipe.
Definition: usbh_pipes.c:173
USBH_OK
Definition: usbh_def.h:304
_USBH_HandleTypeDef::Pipes
uint32_t Pipes[15]
Definition: usbh_def.h:460
uint8_t
const uint8_t[]
Definition: 404_html.c:3
USBH_LL_ClosePipe
USBH_StatusTypeDef USBH_LL_ClosePipe(USBH_HandleTypeDef *phost, uint8_t)
Close a pipe of the low level driver.
Definition: usbh_conf.c:422