EFM32 Gecko Software Documentation  efm32g-doc-5.1.2
em_usbxpress.c File Reference

Detailed Description

USBXpress global variable declaration, initialization, and call-back function definitions.

Version
5.1.2

License

Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

This file is licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file em_usbxpress.c.

#include <stddef.h>
#include <stdbool.h>
#include "em_usbxpress_internal.h"
#include "em_usbxpress_descriptors.h"
#include "em_usbxpress.h"

Go to the source code of this file.

Functions

USB_DeviceDescriptor_TypeDef USBXCORE_deviceDesc SL_ATTRIBUTE_ALIGN (4)
 Copy of device descriptor, so it can be edited. More...
 
void USBX_apiCallbackDisable (void)
 Inhibits user API call-backs and does NOT disable the USB interrupt.
 
void USBX_apiCallbackEnable (USBX_apiCallback_t f)
 Enables user API call-backs. More...
 
int USBX_blockRead (uint8_t *block, uint32_t numBytes, uint32_t *countPtr)
 User API function to get data from host. More...
 
int USBX_blockWrite (uint8_t *block, uint32_t numBytes, uint32_t *countPtr)
 User API function to send data to host. More...
 
 USBX_BUF (USBXCORE_overflowBuffer, USB_FS_BULK_EP_MAXSIZE)
 Buffer to hold overflow rx data if a ZLP read returns more than zero bytes.
 
void USBX_disable (void)
 Disables the USB interface.
 
uint32_t USBX_getCallbackSource (void)
 User API function to get the call-back source. More...
 
uint_least16_t USBX_getLibraryVersion (void)
 Returns the USBXpress library version. More...
 
void USBX_init (USBX_Init_t *p)
 User API USB initialization function. More...
 
void USBX_jumpCallback (void)
 Conditionally jumps to the user call-back routine. More...
 
void USBXCORE_resetState (void)
 Resets internal USBXpress variables. More...
 

Variables

uint32_t USBXCORE_apiEa
 Enable or disable status of USB_API interrupts.
 
uint32_t USBXCORE_apiIntValue
 Byte holding the current USB_API interrupts.
 
uint32_t * USBXCORE_byteCountInPtr
 Pointer to variable holding number of bytes written.
 
uint32_t * USBXCORE_byteCountOutPtr
 Pointer to variable holding number of bytes read.
 
uint32_t USBXCORE_readSize
 Number of bytes sent to USBX_blockRead() as numBytes.
 
bool USBXCORE_rxOverflowPacketAvailable = false
 Boolean indicating if data was received while expecting a ZLP.
 
uint32_t USBXCORE_rxOverflowPacketSize = 0
 Size of Rx Overflow Packet.
 
USB_StringDescriptor_TypeDef const * USBXCORE_stringDescTable [4]
 Table of pointers to various string descriptors.
 
uint32_t USBXCORE_writeSize
 Number of bytes sent to USBX_blockWrite() as numBytes.
 
bool USBXCORE_zlpActive = false
 Boolean indicating whether a ZLP read is active.
 

Function Documentation

const USB_ExtendedPropertiesDescriptor_t USBXCORE_extendedPropertiesDesc SL_ATTRIBUTE_ALIGN ( )
Initial value:
=
{
0x0100,
{0, 0, 0, 0, 0, 0, 0},
{
{
0,
1,
"WINUSB\0",
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},
},
}
}
#define FEATURE_EXTENDED_COMPATIBILITY_ID
Extended Compatibility ID Descriptor.
#define NUM_IFCS_WITH_EXT_COMPAT
Number of interfaces with extended compatibility descriptors.
#define EXT_COMP_DESC_SIZE
Size of Extended Compatibility Descriptor.

Copy of device descriptor, so it can be edited.

Extended Properties Descriptor.

Compatible ID Feature Descriptor.

Copy of configuration descriptor.

void USBX_jumpCallback ( void  )

Conditionally jumps to the user call-back routine.

If the user call-back routine is already in progress, this function does nothing. Otherwise, this function jumps to the call-back defined via USBX_callbackEnable().

Definition at line 264 of file em_usbxpress.c.

Referenced by USBX_DeviceStateChangeCb(), USBX_inXferCompleteCb(), USBX_outXferCompleteCb(), USBX_ResetCb(), and USBX_SetupCmdCb().

void USBXCORE_resetState ( void  )

Resets internal USBXpress variables.

This function resets the internal USBXpress variables. It should be called after a cancel-type event (USBXpress Close, USB de-configure, FIFO flush, etc.).

Definition at line 276 of file em_usbxpress.c.

References USBXCORE_rxOverflowPacketAvailable, and USBXCORE_zlpActive.

Referenced by USBX_DeviceStateChangeCb(), USBX_ResetCb(), and USBX_SetupCmdCb().