EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
em_usbxpress.h File Reference

Detailed Description

Header file for the USBXpress firmware library. Includes function prototypes, type definitions, and function return value macro 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.h.

#include <stdint.h>
#include <stdbool.h>
#include "em_common.h"

Go to the source code of this file.

Data Structures

struct  USBX_Init_t
 USBXpress initialization function parameter typedef. More...
 

Macros

#define STATIC_USBX_BUF(x, y)
 Macro for creating WORD (4 byte) aligned static uint8_t array with size which is a multiple of WORD size. More...
 
#define USBX_BUF(x, y)   SL_ALIGN(4) uint8_t x[((y)+3)&~3] SL_ATTRIBUTE_ALIGN(4)
 Macro for creating WORD (4 byte) aligned uint8_t array with size which is a multiple of WORD size. More...
 
#define USBX_DEV_CLOSE   0x00000020
 Device Instance Closed on host side.
 
#define USBX_DEV_CONFIGURED   0x00000040
 Device has entered configured state.
 
#define USBX_DEV_OPEN   0x00000010
 Device Instance Opened on host side.
 
#define USBX_DEV_SUSPEND   0x00000080
 USB suspend signaling present on bus.
 
#define USBX_FIFO_PURGE   0x00000008
 Receive and Transmit FIFO's were purged.
 
#define USBX_RESET   0x00000001
 USB Reset Interrupt has occurred.
 
#define USBX_RX_COMPLETE   0x00000004
 Receive Complete Interrupt has occurred.
 
#define USBX_RX_OVERRUN   0x00000100
 Data received with no place to put it.
 
#define USBX_STATUS_DEVICE_UNCONFIGURED   USB_STATUS_DEVICE_UNCONFIGURED
 Failed because the device is not configured.
 
#define USBX_STATUS_EP_BUSY   USB_STATUS_EP_BUSY
 Failed because the endpoint is busy.
 
#define USBX_STATUS_EP_STALLED   USB_STATUS_EP_STALLED
 Failed because the endpoint is stalled.
 
#define USBX_STATUS_ILLEGAL   USB_STATUS_ILLEGAL
 Failed due to an illegal parameter.
 
#define USBX_STATUS_OK   USB_STATUS_OK
 Success.
 
#define USBX_STRING_DESC(_name, ...)
 Macro for creating USB-Compliant UTF-16LE UNICODE string descriptor. More...
 
#define USBX_TX_COMPLETE   0x00000002
 Transmit Complete Interrupt has occurred.
 

Typedefs

typedef void(* USBX_apiCallback_t) (void)
 

Functions

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...
 
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...