Silicon Laboratories SiM3U1xx Manual do Utilizador Página 9

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 30
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 8
AN758
Rev. 0.1 9
5.1.4. CDC_Device_SendByte
USB CDC sends one byte to USB IN FIFO.
Syntax
uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
const uint8_t Data)
Parameters
CDCInterfaceInfo: Pointer to CDC Class state structure
Data: byte data to send
Return Value
Error code: definition can be found in EndpointStream.h
ENDPOINT_RWSTREAM_NoError
ENDPOINT_RWSTREAM_EndpointStalled
ENDPOINT_RWSTREAM_DeviceDisconnected
ENDPOINT_RWSTREAM_BusSuspended
ENDPOINT_RWSTREAM_Timeout
ENDPOINT_RWSTREAM_IncompleteTransfer
Description
This function sends one byte to USB IN FIFO.
Note: Endpoint_ClearIN()must be called to send data to USB host, otherwise, the data will keep in USB device FIFO.
Example
CDC_Device_SendByte(&VirtualSerial_CDC_Interface,0x55);
Endpoint_ClearIN();
5.1.5. CDC_Device_BytesReceived
USB CDC number of bytes received.
Syntax
uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const
CDCInterfaceInfo)
Parameters
CDCInterfaceInfo: Pointer to CDC Class state structure
Return Value
Bytes received in USB endpoint.
Description
This function check how many bytes received in USB data out endpoint
Example
uint32_t recv_count;
recv_count = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);
Vista de página 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 29 30

Comentários a estes Manuais

Sem comentários