STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
USBD_CDC_IF_Private_FunctionPrototypes

Private functions declaration. More...

Collaboration diagram for USBD_CDC_IF_Private_FunctionPrototypes:

Functions

static int8_t CDC_Init_HS (void)
 Initializes the CDC media low layer over the USB HS IP.
static int8_t CDC_DeInit_HS (void)
 DeInitializes the CDC media low layer.
static int8_t CDC_Control_HS (uint8_t cmd, uint8_t *pbuf, uint16_t length)
 Manage the CDC class requests.
static int8_t CDC_Receive_HS (uint8_t *Buf, uint32_t *Len)
 Data received over USB OUT endpoint are sent over CDC interface through this function.
static int8_t CDC_TransmitCplt_HS (uint8_t *Buf, uint32_t *Len, uint8_t epnum)
 CDC_TransmitCplt_HS Data transmitted callback.
static bool is_bootloader_cmd (const uint8_t *b, uint32_t n)

Detailed Description

Private functions declaration.

Function Documentation

◆ CDC_Control_HS()

int8_t CDC_Control_HS ( uint8_t cmd,
uint8_t * pbuf,
uint16_t length )
static

Manage the CDC class requests.

Parameters
cmdCommand code
pbufBuffer containing command data (request parameters)
lengthNumber of data to be sent (in bytes)
Return values
Resultof the operation: USBD_OK if all operations are OK else USBD_FAIL

Definition at line 190 of file usbd_cdc_if.c.

References CDC_CLEAR_COMM_FEATURE, CDC_GET_COMM_FEATURE, CDC_GET_ENCAPSULATED_RESPONSE, CDC_GET_LINE_CODING, CDC_SEND_BREAK, CDC_SEND_ENCAPSULATED_COMMAND, CDC_SET_COMM_FEATURE, CDC_SET_CONTROL_LINE_STATE, CDC_SET_LINE_CODING, g_usb_terminal_connected, line_coding, and USBD_OK.

◆ CDC_DeInit_HS()

int8_t CDC_DeInit_HS ( void )
static

DeInitializes the CDC media low layer.

Parameters
None
Return values
USBD_OKif all operations are OK else USBD_FAIL

Definition at line 175 of file usbd_cdc_if.c.

References g_usb_terminal_connected, and USBD_OK.

◆ CDC_Init_HS()

int8_t CDC_Init_HS ( void )
static

Initializes the CDC media low layer over the USB HS IP.

Return values
USBD_OKif all operations are OK else USBD_FAIL

Definition at line 160 of file usbd_cdc_if.c.

References hUsbDeviceHS, USBD_CDC_SetRxBuffer(), USBD_CDC_SetTxBuffer(), USBD_OK, UserRxBufferHS, and UserTxBufferHS.

◆ CDC_Receive_HS()

int8_t CDC_Receive_HS ( uint8_t * Buf,
uint32_t * Len )
static

Data received over USB OUT endpoint are sent over CDC interface through this function.

Note
This function will issue a NAK packet on any OUT packet received on USB endpoint until exiting this function. If you exit this function before transfer is complete on CDC interface (ie. using DMA controller) it will result in receiving more data while previous ones are still not sent.
Parameters
BufBuffer of data to be received
LenNumber of data received (in bytes)
Return values
Resultof the operation: USBD_OK if all operations are OK else USBD_FAILL

Definition at line 258 of file usbd_cdc_if.c.

References app_state(), BOOTLOADER_MAGIC, FLIGHT_IDLE, HAL_PWR_EnableBkUpAccess(), hUsbDeviceHS, is_bootloader_cmd(), NVIC_SystemReset, RTC, USBD_CDC_ReceivePacket(), USBD_CDC_SetRxBuffer(), and USBD_OK.

◆ CDC_TransmitCplt_HS()

int8_t CDC_TransmitCplt_HS ( uint8_t * Buf,
uint32_t * Len,
uint8_t epnum )
static

CDC_TransmitCplt_HS Data transmitted callback.

Note
This function is IN transfer complete callback used to inform user that the submitted Data is successfully sent over USB.
Parameters
BufBuffer of data to be received
LenNumber of data received (in bytes)
Return values
Resultof the operation: USBD_OK if all operations are OK else USBD_FAIL

Definition at line 313 of file usbd_cdc_if.c.

References result, UNUSED, and USBD_OK.

◆ is_bootloader_cmd()

bool is_bootloader_cmd ( const uint8_t * b,
uint32_t n )
static

Definition at line 336 of file usbd_cdc_if.c.

References b.

Referenced by CDC_Receive_HS().