Prusa MINI Firmware overview
USB_CORE_Exported_Functions
Collaboration diagram for USB_CORE_Exported_Functions:

Functions

uint8_t USBD_CDC_RegisterInterface (USBD_HandleTypeDef *pdev, USBD_CDC_ItfTypeDef *fops)
 USBD_CDC_RegisterInterface. More...
 
uint8_t USBD_CDC_SetTxBuffer (USBD_HandleTypeDef *pdev, uint8_t *pbuff, uint16_t length)
 USBD_CDC_SetTxBuffer. More...
 
uint8_t USBD_CDC_SetRxBuffer (USBD_HandleTypeDef *pdev, uint8_t *pbuff)
 USBD_CDC_SetRxBuffer. More...
 
uint8_t USBD_CDC_ReceivePacket (USBD_HandleTypeDef *pdev)
 USBD_CDC_ReceivePacket prepare OUT Endpoint for reception. More...
 
uint8_t USBD_CDC_TransmitPacket (USBD_HandleTypeDef *pdev)
 USBD_CDC_DataOut Data received on non-control Out endpoint. More...
 

Detailed Description

Function Documentation

◆ USBD_CDC_RegisterInterface()

uint8_t USBD_CDC_RegisterInterface ( USBD_HandleTypeDef pdev,
USBD_CDC_ItfTypeDef fops 
)

USBD_CDC_RegisterInterface.

Parameters
pdevdevice instance
fopsCD Interface callback
Return values
status
792 {
793  uint8_t ret = USBD_FAIL;
794 
795  if(fops != NULL)
796  {
797  pdev->pUserData= fops;
798  ret = USBD_OK;
799  }
800 
801  return ret;
802 }
Here is the caller graph for this function:

◆ USBD_CDC_SetTxBuffer()

uint8_t USBD_CDC_SetTxBuffer ( USBD_HandleTypeDef pdev,
uint8_t pbuff,
uint16_t  length 
)

USBD_CDC_SetTxBuffer.

Parameters
pdevdevice instance
pbuffTx Buffer
Return values
status
813 {
815 
816  hcdc->TxBuffer = pbuff;
817  hcdc->TxLength = length;
818 
819  return USBD_OK;
820 }
Here is the caller graph for this function:

◆ USBD_CDC_SetRxBuffer()

uint8_t USBD_CDC_SetRxBuffer ( USBD_HandleTypeDef pdev,
uint8_t pbuff 
)

USBD_CDC_SetRxBuffer.

Parameters
pdevdevice instance
pbuffRx Buffer
Return values
status
831 {
833 
834  hcdc->RxBuffer = pbuff;
835 
836  return USBD_OK;
837 }
Here is the caller graph for this function:

◆ USBD_CDC_ReceivePacket()

uint8_t USBD_CDC_ReceivePacket ( USBD_HandleTypeDef pdev)

USBD_CDC_ReceivePacket prepare OUT Endpoint for reception.

Parameters
pdevdevice instance
Return values
status
884 {
886 
887  /* Suspend or Resume USB Out process */
888  if(pdev->pClassData != NULL)
889  {
890  if(pdev->dev_speed == USBD_SPEED_HIGH )
891  {
892  /* Prepare Out endpoint to receive next packet */
894  CDC_OUT_EP,
895  hcdc->RxBuffer,
897  }
898  else
899  {
900  /* Prepare Out endpoint to receive next packet */
902  CDC_OUT_EP,
903  hcdc->RxBuffer,
905  }
906  return USBD_OK;
907  }
908  else
909  {
910  return USBD_FAIL;
911  }
912 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ USBD_CDC_TransmitPacket()

uint8_t USBD_CDC_TransmitPacket ( USBD_HandleTypeDef pdev)

USBD_CDC_DataOut Data received on non-control Out endpoint.

Parameters
pdevdevice instance
epnumendpoint number
Return values
status
847 {
849 
850  if(pdev->pClassData != NULL)
851  {
852  if(hcdc->TxState == 0)
853  {
854  /* Tx Transfer in progress */
855  hcdc->TxState = 1;
856 
857  /* Transmit next packet */
858  USBD_LL_Transmit(pdev,
859  CDC_IN_EP,
860  hcdc->TxBuffer,
861  hcdc->TxLength);
862 
863  return USBD_OK;
864  }
865  else
866  {
867  return USBD_BUSY;
868  }
869  }
870  else
871  {
872  return USBD_FAIL;
873  }
874 }
Here is the call graph for this function:
Here is the caller graph for this function:
USBD_CDC_HandleTypeDef::RxBuffer
uint8_t * RxBuffer
Definition: usbd_cdc.h:116
USBD_FAIL
Definition: usbd_def.h:197
_USBD_HandleTypeDef::pClassData
void * pClassData
Definition: usbd_def.h:246
NULL
#define NULL
Definition: usbd_def.h:53
CDC_IN_EP
#define CDC_IN_EP
Definition: usbd_cdc.h:52
USBD_CDC_HandleTypeDef::TxState
__IO uint32_t TxState
Definition: usbd_cdc.h:121
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_BUSY
Definition: usbd_def.h:196
USBD_SPEED_HIGH
Definition: usbd_def.h:188
USBD_CDC_HandleTypeDef
Definition: usbd_cdc.h:111
uint8_t
const uint8_t[]
Definition: 404_html.c:3
CDC_DATA_FS_OUT_PACKET_SIZE
#define CDC_DATA_FS_OUT_PACKET_SIZE
Definition: usbd_cdc.h:66
_USBD_HandleTypeDef::dev_speed
USBD_SpeedTypeDef dev_speed
Definition: usbd_def.h:231
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_CDC_HandleTypeDef::TxBuffer
uint8_t * TxBuffer
Definition: usbd_cdc.h:117
_USBD_HandleTypeDef::pUserData
void * pUserData
Definition: usbd_def.h:247
CDC_OUT_EP
#define CDC_OUT_EP
Definition: usbd_cdc.h:53
length
png_uint_32 length
Definition: png.c:2247
USBD_CDC_HandleTypeDef::TxLength
uint32_t TxLength
Definition: usbd_cdc.h:119
USBD_OK
Definition: usbd_def.h:195
CDC_DATA_HS_OUT_PACKET_SIZE
#define CDC_DATA_HS_OUT_PACKET_SIZE
Definition: usbd_cdc.h:63