XMC USB Library: XMC USB Library

XMC USB Library 1.0.0
  • Main Page
  • Modules
  • Data Structures
  • Files
XMC USB Library

Table of Contents

  • Overview
    • Why using LUFA for XMC USB Device applications?
  • Supported devices and toolchains
  • Directories and Files
  • XMC USB Library examples
    • GenericHID: Generic HID device demonstration application.
    • VirtualSerial: Communications Device Class demonstration application.
    • WINUSB: WINUSB demonstration application.
  • XMC USB Library Licensing

This package contains the device version of the open-source USB LUFA library for being used with XMC microcontrollers. This library is based on the LUFA library version 140928. For a proper use, this package requires XMCLib version 2.0.0.

Overview

LUFA is a simple to use, lightweight framework which allows for the quick and easy creation of complex USB applications. Please, download XMCLib version 2.0.0 package from the Infineon website in order to have the hardware access layer necessary for the proper use of the XMC USB Library.

Why using LUFA for XMC USB Device applications?

The LUFA Library has many advantages over implementing the code required to drive the XMC USB directly. It is much more preferable to incorporate LUFA into your existing projects - or even make a new project using LUFA - than it is to start from scratch and use the XMC USB registers directly.

Some of these reasons are:

  • Speed of Development: LUFA ships with a wide range of pre-made demos and projects for you to try, learn and extend. In addition, there are inbuilt class drivers for several of the USB classes which you can make use of in your projects with minimal effort.
  • Maintainability: As LUFA takes care of much of the USB implementation, you can be left to focusing on your actual project's functionality, rather than being held back developing and debugging the USB stack code. Since LUFA uses clear APIs for USB development, your code will be more readable than if it had the low level USB stack code integrated into it directly. Updating the LUFA library is a simple folder-replacement and gives new features and bug fixes in seconds each time a new release is made.
  • Size: Not just requiring less code to make complex USB devices, LUFA is written to compile down as much as possible into optimal code, to occupy only a small space for its feature set.
  • Support: Since many people are now using LUFA in their own projects, you can take advantage of other's knowledge when you run into difficulties or need some advice.

Supported devices and toolchains

The following 32-Bit Industrial Microcontrollers based on ARM Cortex are supported:

  • XMC4500 series
  • XMC4400 series
  • XMC4200 series
  • XMC4100 series

The following tool chains are supported:

  • GNU GCC for ARM (gcc) found in Atollic TrueSTUDIO, DAVE and Rowley CrossWorks.
  • Keil MDK-ARM Microcontroller Development Kit v5.x (armcc)
  • IAR Embedded Workbench for ARM v7.x(iccarm)
  • TASKING VX-toolset for ARM v5.(carm)

Directories and Files

The following diagram shows the most important directories and files provided in the distribution.

* USBlib\                          - USBlib root directory
* |
* +-USB\                             - USBlib code folder
* |
* | +-Class\                           - Class Driver layer from LUFA stack
* | | +-Common                           - Common header files and parsers
* | | +-Device\                          - Device specific source and header files
* | | +-CDCClass.h                       - Communication Device Class
* | | +-HIDClass.h                       - Human Interface Device Class
* | | +-MassStorageClass.h               - Mass Storage Class
* | |
* | +-Common                           - Common header files from LUFA stack
* | | +-Architectures.h
* | | +-ArchitectureSpecific.h
* | | +-Attributes.h
* | | +-BoardTypes.h
* | | +-Common.h
* | | +-CompilerSpecific.h
* | | +-Endianness.h
* | |
* | +-Core\                            - Device specific interface layer LUFA Core layer
* | | +-XMC4000\                           - XMC4000 devices interface layer
* | | +- . . .
* | |
* | +-USB.h                            - Master include file for the library USB functionality
* |
* +-Examples\                        - Examples making use of the USBlib
* | +-Device\                          - Device examples folder
* | | +-GenericHID\                    - Generic HID Device example folder
* | | | +-ARM\                           - Generic HID Device Keil MDK project folder
* | | | +-HostTestApp\                   - Python Application for testing in the Host side
* | | | +-main.c                         - Main source code of the application example
* | | | +-Descriptors.c                  - Descriptors source code of the application example
* | | | +-...
* | | +-VirtualSerial\               - Virtual Serial Port Device example folder
* | | | +-ARM\                           - Virtual Serial Port Device Keil MDK project folder
* | | | +-VirtualSerial_Signed_..\       - Signed Virtual Serial Port Driver for Windows OS
* | | | +-IAR\                           - Virtual Serial Port Device IAR project folder
* | | | +-main.c                         - Main source code of the application example
* | | | +-Descriptors.c                  - Descriptors source code of the application example
* | | | +-...
* | | +-WinUSB\
* | | | +-ARM\                           - WINUSB Device Keil MDK project folder
* | | | +-HostTestApp\                   - Winodws OS Application executable for testing in the Host side
* | | | +-WinUSB_Signed_..\          - Signed WINUSB Driver for Windows OS
* | | | +-main.c                         - Main source code of the application example
* | | | +-Descriptors.c                  - Descriptors source code of the application example
* | | | +-...
* |
* +-Doc\                             - Doxygen documentation
* | +-html\                            - Doxygen html folder documentation
* | +- . . .
*

XMC USB Library examples

The XMC USB Library comes with set of examples, one per Class (HID, CDC and WINUSB classes). All the examples are toolchain agnostic

GenericHID: Generic HID device demonstration application.

This gives a simple reference application for implementing a generic HID device, using the basic USB HID drivers in all modern OSes (i.e. no special drivers required). By default it accepts and sends up to 8 byte reports to and from a USB Host, and transmits the last sent report back to the host. Last version of Python and its pywinusb library need to be installed in the host side.

On start-up the system will automatically enumerate and function as a vendor HID device.

Run the python application "test_generic_hid_winusb.py" inside the HostTestApp folder in the Host. This script will send a continuous stream of generic reports to the device, to show a variable LED pattern on the Relax Kit board. Send and received report data is printed to the terminal.

VirtualSerial: Communications Device Class demonstration application.

This gives a simple reference application for implementing a CDC device acting as a virtual serial port.

Before running this demo for the first time on a new computer, you will need to supply the driver for the Host side. When running under Windows, please install the Signed Driver (.INF file) located in VirtualSerial_Signed_Package_Driver folder.

WINUSB: WINUSB demonstration application.

This gives a simple reference application for implementing a WINUSB device. using the the Infineon CPU board together with the HMI_OLED extension.

Run the WinUSB-Example.exe inside the HostTestApp folder in the Host to interact with the microcontroller.

Before running this demo for the first time on a new computer, you will need to supply the driver for the Host side. When running under Windows, please install the Signed Driver (.INF file) located in WinUSB_Signed_Package_Driver folder.

XMC USB Library Licensing

License Terms and Copyright Information Infineon code

Copyright (c) 2015, Infineon Technologies AG All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

To improve the quality of the software, users are encouraged to share modifications, enhancements or bug fixes with Infineon Technologies AG (suppo.nosp@m.rt@i.nosp@m.nfine.nosp@m.on.c.nosp@m.om).

Legal Disclaimer The information given in this document shall in no event be regarded as a guarantee of conditions or characteristics. With respect to any examples or hints given herein, any typical values stated herein and/or any information regarding the application of the device, Infineon Technologies hereby disclaims any and all warranties and liabilities of any kind, including without limitation, warranties of non-infringement of intellectual property rights of any third party.

Information For further information on technology, delivery terms and conditions and prices, please contact the nearest Infineon Technologies Office (www.infineon.com).

Warnings Due to technical requirements, components may contain dangerous substances. For information on the types in question, please contact the nearest Infineon Technologies Office. Infineon Technologies components may be used in life-support devices or systems only with the express written approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure of that life-support device or system or to affect the safety or effectiveness of that device or system. Life support devices or systems are intended to be implanted in the human body or to support and/or maintain and sustain and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may be endangered.

License Terms and Copyright Information LUFA code

             LUFA Library
  Copyright (C) Dean Camera, 2015.

dean [at] fourwalledcubicle [dot] com
           www.lufa-lib.org

Permission to use, copy, modify, and distribute this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.

The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.

Generated by doxygen 1.8.10


XMC USB Library: Modules

  • Data Structures
  • Files
Modules
Here is a list of all modules:
[detail level 1234]
▼ Common Utility Headers - LUFA/Drivers/Common/Common.h | Common library convenience headers, macros and functions
Hardware Architectures | Supported library architecture defines
Architecture Specific Definitions | Architecture specific definitions relating to specific processor architectures
Function/Variable Attributes | Special function/variable attribute macros
Board Types | Supported pre-made board hardware defines
Global Interrupt Macros | Convenience macros for the management of interrupts globally within the device
Compiler Specific Definitions | Compiler specific definitions for code optimization and correctness
▼ Endianness and Byte Ordering | Convenience macros and functions relating to byte (re-)ordering
Byte Reordering | Macros and functions for forced byte reordering
Endianness Conversion | Macros and functions for automatic endianness conversion
Handling of EP0 Control Request |
▼ USB Core - LUFA/Drivers/USB/USB.h | Core driver for the microcontroller hardware USB module
▼ HID Report Parser | USB Human Interface Device (HID) Class report descriptor parser
HID Report Descriptor Item Constants |
▼ Device Management | USB Device management definitions for USB device mode
Device Management (XMC) | USB Device definitions for the Infineon XMC4000 microcontrollers
▼ Endpoint Management | Endpoint management definitions
▼ Endpoint Data Reading and Writing | Endpoint data read/write definitions
Read/Write of Primitive Data Types | Endpoint data primitive read/write definitions
Read/Write of Multi-Byte Streams | Endpoint data stream transmission and reception management
Endpoint Packet Management | USB Endpoint package management definitions
USB Events | USB Event management definitions
Host Management | USB Host management definitions for USB host mode
USB On The Go (OTG) Management | USB OTG management definitions
▼ Pipe Management | Pipe management definitions
▼ Pipe Data Reading and Writing | Pipe data read/write definitions
Read/Write of Primitive Data Types | Pipe data primitive read/write definitions
Read/Write of Multi-Byte Streams | Pipe data stream transmission and reception management
Pipe Packet Management | Pipe packet management definitions
Pipe Control Request Management | Pipe control request definitions
▼ USB Descriptors | Standard USB Descriptor definitions
Configuration Descriptor Parser | USB Configuration Descriptor definitions
Standard USB Requests | USB control endpoint request definitions
▼ USB Interface Management | USB Controller definitions for general USB controller management
USB Interface Management (XMC4000) | USB Controller definitions for the Infineon XMC4000 microcontrollers
USB Mode Tokens | USB mode and feature support definitions
▼ USB Class Drivers | Drivers for the various standardized USB device classes
▼ CDC-ACM (Virtual Serial) Class Driver | USB class driver for the USB-IF CDC-ACM (Virtual Serial) class standard
Common Class Definitions |
CDC Class Device Mode Driver |
▼ HID Class Driver | USB class driver for the USB-IF Human Interface Device (HID) class standard
Common Class Definitions |
HID Class Device Mode Driver |
▼ Mass Storage Class Driver | USB class driver for the USB-IF Bulk-Only Transport Mass Storage class standard
Common Class Definitions |
Mass Storage Class Device Mode Driver |


XMC USB Library: Common Utility Headers - LUFA/Drivers/Common/Common.h

Modules | Macros
Common Utility Headers - LUFA/Drivers/Common/Common.h

Common library convenience headers, macros and functions. More...

Modules

Hardware Architectures
Supported library architecture defines.
Architecture Specific Definitions
Architecture specific definitions relating to specific processor architectures.
Function/Variable Attributes
Special function/variable attribute macros.
Board Types
Supported pre-made board hardware defines.
Global Interrupt Macros
Convenience macros for the management of interrupts globally within the device.
Compiler Specific Definitions
Compiler specific definitions for code optimization and correctness.
Endianness and Byte Ordering
Convenience macros and functions relating to byte (re-)ordering.

Macros

#define | __INCLUDE_FROM_COMMON_H
#define | ARCH_LITTLE_ENDIAN
#define | MACROS do
#define | MACROE while (0)
#define | MAX(x, y) (((x) > (y)) ? (x) : (y))
#define | MIN(x, y) (((x) < (y)) ? (x) : (y))
#define | STRINGIFY(x) #x
#define | STRINGIFY_EXPANDED(x) STRINGIFY(x)
#define | CONCAT(x, y) x ## y
#define | CONCAT_EXPANDED(x, y) CONCAT(x, y)

Detailed Description

Common library convenience headers, macros and functions.

Common utility headers containing macros, functions, enums and types which are common to all aspects of the library.

Macro Definition Documentation

#define CONCAT | ( | x,
 |  | y
 | ) | x ## y

Concatenates the given input into a single token, via the C Preprocessor.

Parameters
[in] | x | First item to concatenate.
[in] | y | Second item to concatenate.
Returns
Concatenated version of the input.
#define CONCAT_EXPANDED | ( | x,
 |  | y
 | ) | CONCAT(x, y)

CConcatenates the given input into a single token after macro expansion, via the C Preprocessor.

Parameters
[in] | x | First item to concatenate.
[in] | y | Second item to concatenate.
Returns
Concatenated version of the expanded input.
#define MAX | ( | x,
 |  | y
 | ) | (((x) > (y)) ? (x) : (y))

Convenience macro to determine the larger of two values.

Attention
This macro should only be used with operands that do not have side effects from being evaluated multiple times.
Parameters
[in] | x | First value to compare
[in] | y | First value to compare
Returns
The larger of the two input parameters
#define MIN | ( | x,
 |  | y
 | ) | (((x) < (y)) ? (x) : (y))

Convenience macro to determine the smaller of two values.

Attention
This macro should only be used with operands that do not have side effects from being evaluated multiple times.
Parameters
[in] | x | First value to compare.
[in] | y | First value to compare.
Returns
The smaller of the two input parameters
#define STRINGIFY ( x ) #x

Converts the given input into a string, via the C Preprocessor. This macro puts literal quotation marks around the input, converting the source into a string literal.

Parameters
[in] x Input to convert into a string literal.
Returns
String version of the input.
#define STRINGIFY_EXPANDED ( x ) STRINGIFY(x)

Converts the given input into a string after macro expansion, via the C Preprocessor. This macro puts literal quotation marks around the expanded input, converting the source into a string literal.

Parameters
[in] x Input to expand and convert into a string literal.
Returns
String version of the expanded input.


XMC USB Library: Hardware Architectures

Hardware Architectures
Common Utility Headers - LUFA/Drivers/Common/Common.h

Supported library architecture defines. More...

Supported library architecture defines.

Architecture macros for selecting the desired target microcontroller architecture. One of these values should be defined as the value of ARCH in the user project makefile via the -D compiler switch to GCC, to select the target architecture.

The selected architecture should remain consistent with the makefile ARCH value, which is used to select the underlying driver source files for each architecture.


XMC USB Library: Architecture Specific Definitions

Architecture Specific Definitions
Common Utility Headers - LUFA/Drivers/Common/Common.h

Architecture specific definitions relating to specific processor architectures. More...

Architecture specific definitions relating to specific processor architectures.

Architecture specific macros, functions and other definitions, which relate to specific architectures. This definitions may or may not be available in some form on other architectures, and thus should be protected by preprocessor checks in portable code to prevent compile errors.


XMC USB Library: Function/Variable Attributes

Function/Variable Attributes
Common Utility Headers - LUFA/Drivers/Common/Common.h

Special function/variable attribute macros. More...

Special function/variable attribute macros.

This module contains macros for applying specific attributes to functions and variables to control various optimizer and code generation features of the compiler. Attributes may be placed in the function prototype or variable declaration in any order, and multiple attributes can be specified for a single item via a space separated list.

On incompatible versions of GCC or on other compilers, these macros evaluate to nothing unless they are critical to the code's function and thus must throw a compile error when used.


XMC USB Library: Board Types

Macros
Board Types
Common Utility Headers - LUFA/Drivers/Common/Common.h

Supported pre-made board hardware defines. More...

Macros

#define | BOARD_USER 0
#define | BOARD_NONE 1
#define | BOARD_USBKEY 2
#define | BOARD_STK525 3
#define | BOARD_STK526 4
#define | BOARD_RZUSBSTICK 5
#define | BOARD_ATAVRUSBRF01 6
#define | BOARD_BUMBLEB 7
#define | BOARD_XPLAIN 8
#define | BOARD_XPLAIN_REV1 9
#define | BOARD_EVK527 10
#define | BOARD_TEENSY 11
#define | BOARD_USBTINYMKII 12
#define | BOARD_BENITO 13
#define | BOARD_JMDBU2 14
#define | BOARD_OLIMEX162 15
#define | BOARD_UDIP 16
#define | BOARD_BUI 17
#define | BOARD_UNO 18
#define | BOARD_CULV3 19
#define | BOARD_BLACKCAT 20
#define | BOARD_MAXIMUS 21
#define | BOARD_MINIMUS 22
#define | BOARD_ADAFRUITU4 23
#define | BOARD_MICROSIN162 24
#define | BOARD_USBFOO 25
#define | BOARD_SPARKFUN8U2 26
#define | BOARD_EVK1101 27
#define | BOARD_TUL 28
#define | BOARD_EVK1100 29
#define | BOARD_EVK1104 30
#define | BOARD_A3BU_XPLAINED 31
#define | BOARD_TEENSY2 32
#define | BOARD_USB2AX 33
#define | BOARD_USB2AX_V3 34
#define | BOARD_MICROPENDOUS_32U2 35
#define | BOARD_MICROPENDOUS_A 36
#define | BOARD_MICROPENDOUS_1 37
#define | BOARD_MICROPENDOUS_2 38
#define | BOARD_MICROPENDOUS_3 39
#define | BOARD_MICROPENDOUS_4 40
#define | BOARD_MICROPENDOUS_DIP 41
#define | BOARD_MICROPENDOUS_REV1 42
#define | BOARD_MICROPENDOUS_REV2 43
#define | BOARD_B1_XPLAINED 44
#define | BOARD_MULTIO 45
#define | BOARD_BIGMULTIO 46
#define | BOARD_DUCE 47
#define | BOARD_OLIMEX32U4 48
#define | BOARD_OLIMEXT32U4 49
#define | BOARD_OLIMEXISPMK2 50
#define | BOARD_LEONARDO 51
#define | BOARD_UC3A3_XPLAINED 52
#define | BOARD_USB2AX_V31 53
#define | BOARD_STANGE_ISP 54
#define | BOARD_C3_XPLAINED 55
#define | BOARD_U2S 56
#define | BOARD_YUN 57
#define | BOARD_MICRO 58
#define | BOARD_XPLAINED_MINI 59
#define | BOARD_ BOARD_NONE
#define | BOARD BOARD_NONE

Detailed Description

Supported pre-made board hardware defines.

Board macros for indicating the chosen physical board hardware to the library. These macros should be used when defining the BOARD token to the chosen hardware via the -D switch in the project makefile. If a custom board is used, the BOARD_NONE or BOARD_USER values should be selected.

Macro Definition Documentation

#define BOARD_A3BU_XPLAINED 31

Selects the Atmel XMEGA A3BU Xplained specific board drivers, including Dataflash, Button and LED drivers.

#define BOARD_ADAFRUITU4 23

Selects the Adafruit U4 specific board drivers, including the Button driver.

#define BOARD_ATAVRUSBRF01 6

Selects the ATAVRUSBRF01 specific board drivers, including the driver for the board LEDs.

#define BOARD_B1_XPLAINED 44

Selects the XMEGA B1 Xplained specific board drivers, including the Button and LED drivers.

#define BOARD_BENITO 13

Selects the Benito specific board drivers, including the Button and LEDs drivers.

#define BOARD_BIGMULTIO 46

Selects the Bitwizard Big-Multio specific board drivers, including the driver for the board LEDs.

#define BOARD_BLACKCAT 20

Selects the Blackcat USB JTAG specific board drivers, including the driver for the board LEDs.

#define BOARD_BUI 17

Selects the BUI specific board drivers, including the driver for the board LEDs.

#define BOARD_BUMBLEB 7

Selects the BUMBLEB specific board drivers, using the officially recommended peripheral layout.

#define BOARD_C3_XPLAINED 55

Selects the XMEGA C3 XPLAINED specific board drivers, including the Button and LEDs drivers.

#define BOARD_CULV3 19

Selects the Busware CUL V3 specific board drivers, including the Button and LEDs drivers.

#define BOARD_DUCE 47

Selects the DorkbotPDX Duce specific board drivers, including the driver for the board LEDs.

#define BOARD_EVK1100 29

Selects the Atmel EVK1100 specific board drivers, including the Button, Joystick and LED drivers.

#define BOARD_EVK1101 27

Selects the Atmel EVK1101 specific board drivers, including the Button, Joystick and LED drivers.

#define BOARD_EVK1104 30

Selects the Atmel EVK1104 specific board drivers, including the Button and LED drivers.

#define BOARD_EVK527 10

Selects the EVK527 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers.

#define BOARD_JMDBU2 14

Selects the JM-DB-U2 specific board drivers, including the Button and LEDs drivers.

#define BOARD_LEONARDO 51

Selects the Arduino Leonardo specific board drivers, including the driver for the board LEDs.

#define BOARD_MAXIMUS 21

Selects the Maximus specific board drivers, including the driver for the board LEDs.

#define BOARD_MICRO 58

Selects the Arduino Micro specific board drivers, including the driver for the board LEDs.

#define BOARD_MICROPENDOUS_1 37

Selects the Micropendous 1 specific board drivers, including the driver for the board Button.

#define BOARD_MICROPENDOUS_2 38

Selects the Micropendous 2 specific board drivers, including the driver for the board Button.

#define BOARD_MICROPENDOUS_3 39

Selects the Micropendous 3 specific board drivers, including the driver for the board Button.

#define BOARD_MICROPENDOUS_32U2 35

Selects the Micropendous 32U2 specific board drivers, including the Button and LED drivers.

#define BOARD_MICROPENDOUS_4 40

Selects the Micropendous 4 specific board drivers, including the driver for the board Button.

#define BOARD_MICROPENDOUS_A 36

Selects the Micropendous A specific board drivers, including the driver for the board Button.

#define BOARD_MICROPENDOUS_DIP 41

Selects the Micropendous DIP specific board drivers, including the driver for the board Button.

#define BOARD_MICROPENDOUS_REV1 42

Selects the Micropendous (Arduino-like) revision 1 specific board drivers, including the Button and LED drivers.

#define BOARD_MICROPENDOUS_REV2 43

Selects the Micropendous (Arduino-like) revision 2 specific board drivers, including the Button and LED drivers.

#define BOARD_MICROSIN162 24

Selects the Microsin AVR-USB162 specific board drivers, including the Button and LEDs drivers.

#define BOARD_MINIMUS 22

Selects the Minimus specific board drivers, including the Button and LEDs drivers.

#define BOARD_MULTIO 45

Selects the Bitwizard Multio specific board drivers, including the driver for the board LEDs.

#define BOARD_NONE 1

Disables board drivers when operation will not be adversely affected (e.g. LEDs) - use of board drivers such as the Joystick driver, where the removal would adversely affect the code's operation is still disallowed.

#define BOARD_OLIMEX162 15

Selects the Olimex AVR-USB-162 specific board drivers, including the Button and LEDs drivers.

#define BOARD_OLIMEX32U4 48

Selects the Olimex AVR-USB-32U4 specific board drivers, including the Button and LED drivers.

#define BOARD_OLIMEXISPMK2 50

Selects the Olimex AVR-ISP-MK2 specific board drivers, including the Button and LED drivers.

#define BOARD_OLIMEXT32U4 49

Selects the Olimex AVR-USB-T32U4 specific board drivers, including the Button and LED drivers.

#define BOARD_RZUSBSTICK 5

Selects the RZUSBSTICK specific board drivers, including the driver for the boards LEDs.

#define BOARD_SPARKFUN8U2 26

Selects the Sparkfun ATMEGA8U2 specific board drivers, including the driver for the board LEDs.

#define BOARD_STANGE_ISP 54

Selects the Stange-ISP specific board drivers, including the Button and LEDs drivers.

#define BOARD_STK525 3

Selects the STK525 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers.

#define BOARD_STK526 4

Selects the STK526 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers.

#define BOARD_TEENSY 11

Selects the Teensy version 1.x specific board drivers, including the driver for the board LEDs.

#define BOARD_TEENSY2 32

Selects the Teensy version 2.x specific board drivers, including the driver for the board LEDs.

#define BOARD_TUL 28

Selects the Busware TUL specific board drivers, including the Button and LED drivers.

#define BOARD_U2S 56

Selects the U2S specific board drivers, including the Button and LEDs drivers.

#define BOARD_UC3A3_XPLAINED 52

Selects the UC3-A3 Xplained specific board drivers, including the Button and LED drivers.

#define BOARD_UDIP 16

Selects the UDIP specific board drivers, including the Button and LEDs drivers.

#define BOARD_UNO 18

Selects the Arduino Uno specific board drivers, including the driver for the board LEDs.

#define BOARD_USB2AX 33

Selects the USB2AX version 1 and 2 specific board drivers, including the Button and LEDs drivers.

#define BOARD_USB2AX_V3 34

Selects the USB2AX version 3 specific board drivers, including the Button and LEDs drivers.

#define BOARD_USB2AX_V31 53

Selects the USB2AX version 3.1 specific board drivers, including the Button and LEDs drivers.

#define BOARD_USBFOO 25

Selects the Kernel Concepts USBFOO specific board drivers, including the Button and LEDs drivers.

#define BOARD_USBKEY 2

Selects the USBKEY specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers.

#define BOARD_USBTINYMKII 12

Selects the USBTINY MKII specific board drivers, including the Button and LEDs drivers.

#define BOARD_USER 0

Selects the user-defined board drivers, which should be placed in the user project's folder under a directory named /Board/. Each board driver should be named identically to the LUFA master board driver (i.e., driver in the LUFA/Drivers/Board directory) so that the library can correctly identify it.

#define BOARD_XPLAIN 8

Selects the XPLAIN (Revision 2 or newer) specific board drivers, including LED and Dataflash drivers.

#define BOARD_XPLAIN_REV1 9

Selects the XPLAIN (Revision 1) specific board drivers, including LED and Dataflash drivers.

#define BOARD_XPLAINED_MINI 59

Selects the Atmel Xplained-MINI specific board drivers, including the driver for the board LEDs.

#define BOARD_YUN 57

Selects the Arduino YUN specific board drivers, including the driver for the board LEDs.


XMC USB Library: Global Interrupt Macros

Macros
Global Interrupt Macros
Common Utility Headers - LUFA/Drivers/Common/Common.h

Convenience macros for the management of interrupts globally within the device. More...

Macros

#define ISR(Name, ...) void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)

Detailed Description

Convenience macros for the management of interrupts globally within the device.

Macros and functions to create and control global interrupts within the device.

Macro Definition Documentation

#define ISR | ( | Name,
 |  | ...
 | ) | void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)

Macro for the definition of interrupt service routines, so that the compiler can insert the required prologue and epilogue code to properly manage the interrupt routine without affecting the main thread's state with unintentional side-effects.

Interrupt handlers written using this macro may still need to be registered with the microcontroller's Interrupt Controller (if present) before they will properly handle incoming interrupt events.

Note
This macro is only supplied on some architectures, where the standard library does not include a valid definition. If an existing definition exists, the alternative definition here will be ignored.
Parameters
[in] Name Unique name of the interrupt service routine.


XMC USB Library: Compiler Specific Definitions

Macros
Compiler Specific Definitions
Common Utility Headers - LUFA/Drivers/Common/Common.h

Compiler specific definitions for code optimization and correctness. More...

Macros

#define | GCC_FORCE_POINTER_ACCESS(StructPtr)
#define | GCC_MEMORY_BARRIER()
#define | GCC_IS_COMPILE_CONST(x) 0

Detailed Description

Compiler specific definitions for code optimization and correctness.

Compiler specific definitions to expose certain compiler features which may increase the level of code optimization for a specific compiler, or correct certain issues that may be present such as memory barriers for use in conjunction with atomic variable access.

Where possible, on alternative compilers, these macros will either have no effect, or default to returning a sane value so that they can be used in existing code without the need for extra compiler checks in the user application code.


XMC USB Library: Endianness and Byte Ordering

Modules
Endianness and Byte Ordering
Common Utility Headers - LUFA/Drivers/Common/Common.h

Convenience macros and functions relating to byte (re-)ordering. More...

Modules

Byte Reordering
Macros and functions for forced byte reordering.
Endianness Conversion
Macros and functions for automatic endianness conversion.

Detailed Description

Convenience macros and functions relating to byte (re-)ordering.

Common library convenience macros and functions relating to byte (re-)ordering.


XMC USB Library: Byte Reordering

Macros
Byte Reordering
Common Utility Headers - LUFA/Drivers/Common/Common.h » Endianness and Byte Ordering

Macros and functions for forced byte reordering. More...

Macros

#define | SWAPENDIAN_16(x)
#define | SWAPENDIAN_32(x)

Detailed Description

Macros and functions for forced byte reordering.

Macro Definition Documentation

#define SWAPENDIAN_16 ( x )

Swaps the byte ordering of a 16-bit value at compile-time. Do not use this macro for swapping byte orderings of dynamic values computed at runtime, use SwapEndian_16() instead. The result of this macro can be used inside struct or other variable initializers outside of a function, something that is not possible with the inline function variant.

Parameters
[in] x 16-bit value whose byte ordering is to be swapped.
Returns
Input value with the byte ordering reversed.
#define SWAPENDIAN_32 ( x )

Swaps the byte ordering of a 32-bit value at compile-time. Do not use this macro for swapping byte orderings of dynamic values computed at runtime- use SwapEndian_32() instead. The result of this macro can be used inside struct or other variable initializers outside of a function, something that is not possible with the inline function variant.

Parameters
[in] x 32-bit value whose byte ordering is to be swapped.
Returns
Input value with the byte ordering reversed.


XMC USB Library: Endianness Conversion

Endianness Conversion
Common Utility Headers - LUFA/Drivers/Common/Common.h » Endianness and Byte Ordering

Macros and functions for automatic endianness conversion. More...

Run-time endianness conversion

#define | le16_to_cpu(x) (x)
#define | le32_to_cpu(x) (x)
#define | be16_to_cpu(x) SwapEndian_16(x)
#define | be32_to_cpu(x) SwapEndian_32(x)
#define | cpu_to_le16(x) (x)
#define | cpu_to_le32(x) (x)
#define | cpu_to_be16(x) SwapEndian_16(x)
#define | cpu_to_be32(x) SwapEndian_32(x)

Compile-time endianness conversion

#define | LE16_TO_CPU(x) (x)
#define | LE32_TO_CPU(x) (x)
#define | BE16_TO_CPU(x) SWAPENDIAN_16(x)
#define | BE32_TO_CPU(x) SWAPENDIAN_32(x)
#define | CPU_TO_LE16(x) (x)
#define | CPU_TO_LE32(x) (x)
#define | CPU_TO_BE16(x) SWAPENDIAN_16(x)
#define | CPU_TO_BE32(x) SWAPENDIAN_32(x)

Detailed Description

Macros and functions for automatic endianness conversion.

Macro Definition Documentation

#define be16_to_cpu ( x ) SwapEndian_16(x)

Performs a conversion between a Big Endian encoded 16-bit piece of data and the Endianness of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use BE16_TO_CPU instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define BE16_TO_CPU ( x ) SWAPENDIAN_16(x)

Performs a conversion between a Big Endian encoded 16-bit piece of data and the Endianness of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run-time endianness conversion, use be16_to_cpu instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define be32_to_cpu ( x ) SwapEndian_32(x)

Performs a conversion between a Big Endian encoded 32-bit piece of data and the Endianness of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use BE32_TO_CPU instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define BE32_TO_CPU ( x ) SWAPENDIAN_32(x)

Performs a conversion between a Big Endian encoded 32-bit piece of data and the Endianness of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run-time endianness conversion, use be32_to_cpu instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define cpu_to_be16 ( x ) SwapEndian_16(x)

Performs a conversion on a natively encoded 16-bit piece of data to ensure that it is in Big Endian format regardless of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use CPU_TO_BE16 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define CPU_TO_BE16 ( x ) SWAPENDIAN_16(x)

Performs a conversion on a natively encoded 16-bit piece of data to ensure that it is in Big Endian format regardless of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run-time endianness conversion, use cpu_to_be16 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define cpu_to_be32 ( x ) SwapEndian_32(x)

Performs a conversion on a natively encoded 32-bit piece of data to ensure that it is in Big Endian format regardless of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use CPU_TO_BE32 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define CPU_TO_BE32 ( x ) SWAPENDIAN_32(x)

Performs a conversion on a natively encoded 32-bit piece of data to ensure that it is in Big Endian format regardless of the currently selected CPU architecture.

On big endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run-time endianness conversion, use cpu_to_be32 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define cpu_to_le16 ( x ) (x)

Performs a conversion on a natively encoded 16-bit piece of data to ensure that it is in Little Endian format regardless of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use CPU_TO_LE16 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define CPU_TO_LE16 ( x ) (x)

Performs a conversion on a natively encoded 16-bit piece of data to ensure that it is in Little Endian format regardless of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run-time endianness conversion, use cpu_to_le16 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define cpu_to_le32 ( x ) (x)

Performs a conversion on a natively encoded 32-bit piece of data to ensure that it is in Little Endian format regardless of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use CPU_TO_LE32 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define CPU_TO_LE32 ( x ) (x)

Performs a conversion on a natively encoded 32-bit piece of data to ensure that it is in Little Endian format regardless of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run-time endianness conversion, use cpu_to_le32 instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define le16_to_cpu ( x ) (x)

Performs a conversion between a Little Endian encoded 16-bit piece of data and the Endianness of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use LE16_TO_CPU instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define LE16_TO_CPU ( x ) (x)

Performs a conversion between a Little Endian encoded 16-bit piece of data and the Endianness of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run time endianness conversion, use le16_to_cpu instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define le32_to_cpu ( x ) (x)

Performs a conversion between a Little Endian encoded 32-bit piece of data and the Endianness of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for run-time conversion of data - for compile-time endianness conversion, use LE32_TO_CPU instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.
#define LE32_TO_CPU ( x ) (x)

Performs a conversion between a Little Endian encoded 32-bit piece of data and the Endianness of the currently selected CPU architecture.

On little endian architectures, this macro does nothing.

Note
This macro is designed for compile-time conversion of data - for run time endianness conversion, use le32_to_cpu instead.
Parameters
[in] x Data to perform the endianness conversion on.
Returns
Endian corrected version of the input value.


XMC USB Library: Handling of EP0 Control Request

Functions
Handling of EP0 Control Request

Functions

void | USBD_HandleEP0_Stall ()
Handle protocol stall on EP0. More...
void | USB_Device_ProcessControlRequest ()
Handle device request on endpoint 0. More...
void | USBD_HandleEP0_IN ()
Handle complete IN transfer on EP0. More...
void | USBD_HandleEP0_OUT ()
Handle complete OUT transfer on EP0. More...
void | USBD_HandleEP0_SETUP ()
Handle SETUP packet on EP0. More...

Detailed Description

Function Documentation

void USB_Device_ProcessControlRequest ( void )

Handle device request on endpoint 0.

By default any USB device has to support a subset of device control request defiened by the USB specification. All request required by the spec are handle within this function. Before a handling of the request is done by this function, it dispatches it to the EVENT_USB_Device_ControlRequest function. There the user has the chance to complete some custom request or override the handling of this function. If the user has handled the request, he has to call Endpoint_ClearSETUP.

void USBD_HandleEP0_IN ( )

Handle complete IN transfer on EP0.

In IN_DATA state it starts a receive and switches to OUT_STATUS state. In IN_STATUS state its starts a new read of setup packets and switches to IDLE.

void USBD_HandleEP0_OUT ( )

Handle complete OUT transfer on EP0.

Handles the OUT packet based on the state of endpoint 0. Starts a new read for new SETUP packets, when in OUT_STATUS. When endpoint 0 is in OUT_DATA state, it handles the received data and starts a write transaction for IN_STATUS.

void USBD_HandleEP0_SETUP ( )

Handle SETUP packet on EP0.

Handles the setup package an switches to correct state. If data is send from host to device it switches into OUT_DATA state. When the hosts sends all data within the setup package and wLength equals zero, starts processing the request and sends a in status reponse including the switch to IN_STATUS. When the host expects data from the device, the function processes the control request and switches to IN_DATA state.

void USBD_HandleEP0_Stall ( )

Handle protocol stall on EP0.

Stalls EP0 and then restarts a new transfer including setting state to IDLE.


XMC USB Library: USB Core - LUFA/Drivers/USB/USB.h

Modules
USB Core - LUFA/Drivers/USB/USB.h

Core driver for the microcontroller hardware USB module. More...

Modules

HID Report Parser
USB Human Interface Device (HID) Class report descriptor parser.
Device Management
USB Device management definitions for USB device mode.
Endpoint Management
Endpoint management definitions.
USB Events
USB Event management definitions.
Host Management
USB Host management definitions for USB host mode.
USB On The Go (OTG) Management
USB OTG management definitions.
Pipe Management
Pipe management definitions.
USB Descriptors
Standard USB Descriptor definitions.
Standard USB Requests
USB control endpoint request definitions.
USB Interface Management
USB Controller definitions for general USB controller management.
USB Mode Tokens
USB mode and feature support definitions.

Detailed Description

Core driver for the microcontroller hardware USB module.

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Core/ConfigDescriptors.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/DeviceStandardReq.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/Events.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/HostStandardReq.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/USBTask.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/Device_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/Endpoint_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/EndpointStream_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/Host_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/Pipe_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/PipeStream_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/USBController_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Core/ARCH/USBInterrupt_ARCH.c (Makefile source module name: LUFA_SRC_USB)
  • LUFA/Drivers/USB/Class/Common/HIDParser.c (Makefile source module name: LUFA_SRC_USB)

Module Description

Driver and framework for the USB controller of the selected architecture and microcontroller model. This module consists of many submodules, and is designed to provide an easy way to configure and control USB host, device or OTG mode USB applications.

The USB stack requires the sole control over the USB controller in the microcontroller only; i.e. it does not require any additional timers or other peripherals to operate. This ensures that the USB stack requires as few resources as possible.

The USB stack can be used in Device Mode for connections to USB Hosts (see Device Management), in Host mode for hosting of other USB devices (see Host Management), or as a dual role device which can either act as a USB host or device depending on what peripheral is connected (see USB On The Go (OTG) Management). Both modes also require a common set of USB management functions found USB Interface Management.


XMC USB Library: HID Report Parser

Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
HID Report Parser
USB Core - LUFA/Drivers/USB/USB.h

USB Human Interface Device (HID) Class report descriptor parser. More...

Modules

HID Report Descriptor Item Constants

Data Structures

struct | HID_MinMax_t
HID Parser Report Item Min/Max Structure. More...
struct | HID_Unit_t
HID Parser Report Item Unit Structure. More...
struct | HID_Usage_t
HID Parser Report Item Usage Structure. More...
struct | HID_CollectionPath
HID Parser Report Item Collection Path Structure. More...
struct | HID_ReportItem_Attributes_t
HID Parser Report Item Attributes Structure. More...
struct | HID_ReportItem_t
HID Parser Report Item Details Structure. More...
struct | HID_ReportSizeInfo_t
HID Parser Report Size Structure. More...
struct | HID_ReportInfo_t
HID Parser State Structure. More...
struct | HID_StateTable_t

Macros

#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))

Typedefs

typedef struct HID_CollectionPath HID_CollectionPath_t
HID Parser Report Item Collection Path Structure. More...

Enumerations

enum HID_Parse_ErrorCodes_t {
HID_PARSE_Successful = 0, HID_PARSE_HIDStackOverflow = 1, HID_PARSE_HIDStackUnderflow = 2, HID_PARSE_InsufficientReportItems = 3,
HID_PARSE_UnexpectedEndCollection = 4, HID_PARSE_InsufficientCollectionPaths = 5, HID_PARSE_UsageListOverflow = 6, HID_PARSE_InsufficientReportIDItems = 7,
HID_PARSE_NoUnfilteredReportItems = 8
}

Functions

uint8_t | USB_ProcessHIDReport (const uint8_t *ReportData, uint16_t ReportSize, HID_ReportInfo_t *const ParserData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3)
bool | USB_GetHIDReportItemInfo (const uint8_t *ReportData, HID_ReportItem_t *const ReportItem) ATTR_NON_NULL_PTR_ARG(1)
void | USB_SetHIDReportItemInfo (uint8_t *ReportData, HID_ReportItem_t *const ReportItem) ATTR_NON_NULL_PTR_ARG(1)
uint16_t | USB_GetHIDReportSize (HID_ReportInfo_t *const ParserData, const uint8_t ReportID, const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1)
bool | CALLBACK_HIDParser_FilterHIDReportItem (HID_ReportItem_t *const CurrentItem)

Detailed Description

USB Human Interface Device (HID) Class report descriptor parser.

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Host/HIDParser.c (Makefile source module name: LUFA_SRC_USB)

Module Description

Human Interface Device (HID) class report descriptor parser. This module implements a parser than is capable of processing a complete HID report descriptor, and outputting a flat structure containing the contents of the report in an a more friendly format. The parsed data may then be further processed and used within an application to process sent and received HID reports to and from an attached HID device.

A HID report descriptor consists of a set of HID report items, which describe the function and layout of data exchanged between a HID device and a host, including both the physical encoding of each item (such as a button, key press or joystick axis) in the sent and received data packets - known as "reports" - as well as other information about each item such as the usages, data range, physical location and other characteristics. In this way a HID device can retain a high degree of flexibility in its capabilities, as it is not forced to comply with a given report layout or feature-set.

This module also contains routines for the processing of data in an actual HID report, using the parsed report descriptor data as a guide for the encoding.

Macro Definition Documentation

#define HID_ALIGN_DATA | ( | ReportItem,
 |  | Type
 | ) | ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))

Returns the value a given HID report item (once its value has been fetched via USB_GetHIDReportItemInfo()) left-aligned to the given data type. This allows for signed data to be interpreted correctly, by shifting the data leftwards until the data's sign bit is in the correct position.

Parameters
[in] | ReportItem | HID Report Item whose retrieved value is to be aligned.
[in] | Type | Data type to align the HID report item's value to.
Returns
Left-aligned data of the given report item's pre-retrieved value for the given datatype.

Typedef Documentation

typedef struct HID_CollectionPath HID_CollectionPath_t

HID Parser Report Item Collection Path Structure.

Type define for a COLLECTION object. Contains the collection attributes and a reference to the parent collection if any.

Enumeration Type Documentation

enum HID_Parse_ErrorCodes_t

Enum for the possible error codes in the return value of the USB_ProcessHIDReport() function.

Enumerator
HID_PARSE_Successful | Successful parse of the HID report descriptor, no error.
HID_PARSE_HIDStackOverflow | More than HID_STATETABLE_STACK_DEPTH nested PUSHes in the report.
HID_PARSE_HIDStackUnderflow | A POP was found when the state table stack was empty.
HID_PARSE_InsufficientReportItems | More than HID_MAX_REPORTITEMS report items in the report.
HID_PARSE_UnexpectedEndCollection | An END COLLECTION item found without matching COLLECTION item.
HID_PARSE_InsufficientCollectionPaths | More than HID_MAX_COLLECTIONS collections in the report.
HID_PARSE_UsageListOverflow | More than HID_USAGE_STACK_DEPTH usages listed in a row.
HID_PARSE_InsufficientReportIDItems | More than HID_MAX_REPORT_IDS report IDs in the device.
HID_PARSE_NoUnfilteredReportItems | All report items from the device were filtered by the filtering callback routine.

Function Documentation

bool CALLBACK_HIDParser_FilterHIDReportItem ( HID_ReportItem_t *const CurrentItem )

Callback routine for the HID Report Parser. This callback must be implemented by the user code when the parser is used, to determine what report IN, OUT and FEATURE item's information is stored into the user HID_ReportInfo_t structure. This can be used to filter only those items the application will be using, so that no RAM is wasted storing the attributes for report items which will never be referenced by the application.

Report item pointers passed to this callback function may be cached by the user application for later use when processing report items. This provides faster report processing in the user application than would a search of the entire parsed report item table for each received or sent report.

Parameters
[in] CurrentItem Pointer to the current report item for user checking.
Returns
Boolean true if the item should be stored into the HID_ReportInfo_t structure, false if it should be ignored.
bool USB_GetHIDReportItemInfo | ( | const uint8_t * | ReportData,
 |  | HID_ReportItem_t *const | ReportItem
 | ) |  |

Extracts the given report item's value out of the given HID report and places it into the Value member of the report item's HID_ReportItem_t structure.

When called on a report with an item that exists in that report, this copies the report item's Value to its PreviousValue element for easy checking to see if an item's value has changed before processing a report. If the given item does not exist in the report, the function does not modify the report item's data.

Parameters
[in] | ReportData | Buffer containing an IN or FEATURE report from an attached device.
[in,out] | ReportItem | Pointer to the report item of interest in a HID_ReportInfo_t ReportItem array.
Returns
Boolean true if the item to retrieve was located in the given report, false otherwise.
uint16_t USB_GetHIDReportSize | ( | HID_ReportInfo_t *const | ParserData,
 |  | const uint8_t | ReportID,
 |  | const uint8_t | ReportType
 | ) |  |

Retrieves the size of a given HID report in bytes from its Report ID.

Parameters
[in] | ParserData | Pointer to a HID_ReportInfo_t instance containing the parser output.
[in] | ReportID | Report ID of the report whose size is to be determined.
[in] | ReportType | Type of the report whose size is to be determined, a value from the HID_ReportItemTypes_t enum.
Returns
Size of the report in bytes, or 0 if the report does not exist.
uint8_t USB_ProcessHIDReport | ( | const uint8_t * | ReportData,
 |  | uint16_t | ReportSize,
 |  | HID_ReportInfo_t *const | ParserData
 | ) |  |

Function to process a given HID report returned from an attached device, and store it into a given HID_ReportInfo_t structure.

Parameters
[in] | ReportData | Buffer containing the device's HID report table.
[in] | ReportSize | Size in bytes of the HID report table.
[out] | ParserData | Pointer to a HID_ReportInfo_t instance for the parser output.
Returns
A value in the HID_Parse_ErrorCodes_t enum.
void USB_SetHIDReportItemInfo | ( | uint8_t * | ReportData,
 |  | HID_ReportItem_t *const | ReportItem
 | ) |  |

Retrieves the given report item's value out of the Value member of the report item's HID_ReportItem_t structure and places it into the correct position in the HID report buffer. The report buffer is assumed to have the appropriate bits cleared before calling this function (i.e., the buffer should be explicitly cleared before report values are added).

When called, this copies the report item's Value element to its PreviousValue element for easy checking to see if an item's value has changed before sending a report.

If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.

Parameters
[out] | ReportData | Buffer holding the current OUT or FEATURE report data.
[in] | ReportItem | Pointer to the report item of interest in a HID_ReportInfo_t ReportItem array.


XMC USB Library: HID Report Descriptor Item Constants

Macros
HID Report Descriptor Item Constants
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

Macros

#define | HID_RI_DATA_SIZE_MASK 0x03
#define | HID_RI_TYPE_MASK 0x0C
#define | HID_RI_TAG_MASK 0xF0
#define | HID_RI_TYPE_MAIN 0x00
#define | HID_RI_TYPE_GLOBAL 0x04
#define | HID_RI_TYPE_LOCAL 0x08
#define | HID_RI_DATA_BITS_0 0x00
#define | HID_RI_DATA_BITS_8 0x01
#define | HID_RI_DATA_BITS_16 0x02
#define | HID_RI_DATA_BITS_32 0x03
#define | HID_RI_DATA_BITS(DataBits) CONCAT_EXPANDED(HID_RI_DATA_BITS_, DataBits)
#define | _HID_RI_ENCODE_0(Data)
#define | _HID_RI_ENCODE_8(Data) , (Data & 0xFF)
#define | _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_8(Data) _HID_RI_ENCODE_8(Data >> 8)
#define | _HID_RI_ENCODE_32(Data) _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_16(Data >> 16)
#define | _HID_RI_ENCODE(DataBits, ...) CONCAT_EXPANDED(_HID_RI_ENCODE_, DataBits(__VA_ARGS__))
#define | _HID_RI_ENTRY(Type, Tag, DataBits, ...) (Type | Tag | HID_RI_DATA_BITS(DataBits)) _HID_RI_ENCODE(DataBits, (__VA_ARGS__))

HID Input, Output and Feature Report Descriptor Item Flags

#define | HID_IOF_CONSTANT (1 << 0)
#define | HID_IOF_DATA (0 << 0)
#define | HID_IOF_VARIABLE (1 << 1)
#define | HID_IOF_ARRAY (0 << 1)
#define | HID_IOF_RELATIVE (1 << 2)
#define | HID_IOF_ABSOLUTE (0 << 2)
#define | HID_IOF_WRAP (1 << 3)
#define | HID_IOF_NO_WRAP (0 << 3)
#define | HID_IOF_NON_LINEAR (1 << 4)
#define | HID_IOF_LINEAR (0 << 4)
#define | HID_IOF_NO_PREFERRED_STATE (1 << 5)
#define | HID_IOF_PREFERRED_STATE (0 << 5)
#define | HID_IOF_NULLSTATE (1 << 6)
#define | HID_IOF_NO_NULL_POSITION (0 << 6)
#define | HID_IOF_VOLATILE (1 << 7)
#define | HID_IOF_NON_VOLATILE (0 << 7)
#define | HID_IOF_BUFFERED_BYTES (1 << 8)
#define | HID_IOF_BITFIELD (0 << 8)

HID Report Descriptor Item Macros

#define | HID_RI_INPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x80, DataBits, __VA_ARGS__)
#define | HID_RI_OUTPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x90, DataBits, __VA_ARGS__)
#define | HID_RI_COLLECTION(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xA0, DataBits, __VA_ARGS__)
#define | HID_RI_FEATURE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xB0, DataBits, __VA_ARGS__)
#define | HID_RI_END_COLLECTION(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xC0, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE_PAGE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x00, DataBits, __VA_ARGS__)
#define | HID_RI_LOGICAL_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x10, DataBits, __VA_ARGS__)
#define | HID_RI_LOGICAL_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x20, DataBits, __VA_ARGS__)
#define | HID_RI_PHYSICAL_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x30, DataBits, __VA_ARGS__)
#define | HID_RI_PHYSICAL_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x40, DataBits, __VA_ARGS__)
#define | HID_RI_UNIT_EXPONENT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x50, DataBits, __VA_ARGS__)
#define | HID_RI_UNIT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x60, DataBits, __VA_ARGS__)
#define | HID_RI_REPORT_SIZE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x70, DataBits, __VA_ARGS__)
#define | HID_RI_REPORT_ID(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x80, DataBits, __VA_ARGS__)
#define | HID_RI_REPORT_COUNT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x90, DataBits, __VA_ARGS__)
#define | HID_RI_PUSH(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0xA0, DataBits, __VA_ARGS__)
#define | HID_RI_POP(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0xB0, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x00, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x10, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x20, DataBits, __VA_ARGS__)

Detailed Description

General HID constant definitions for HID Report Descriptor elements.


XMC USB Library: HID_MinMax_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_MinMax_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Item Min/Max Structure. More...

#include <HIDParser.h>

Data Fields

uint32_t | Minimum
uint32_t | Maximum

Detailed Description

HID Parser Report Item Min/Max Structure.

Type define for an attribute with both minimum and maximum values (e.g. Logical Min/Max).

Field Documentation

uint32_t Maximum

Maximum value for the attribute.

uint32_t Minimum

Minimum value for the attribute.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_Unit_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_Unit_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Item Unit Structure. More...

#include <HIDParser.h>

Data Fields

uint32_t | Type
uint8_t | Exponent

Detailed Description

HID Parser Report Item Unit Structure.

Type define for the Unit attributes of a report item.

Field Documentation

uint8_t Exponent

Unit exponent (refer to HID specifications for details).

uint32_t Type

Unit type (refer to HID specifications for details).

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_Usage_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_Usage_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Item Usage Structure. More...

#include <HIDParser.h>

Data Fields

uint16_t | Page
uint16_t | Usage

Detailed Description

HID Parser Report Item Usage Structure.

Type define for the Usage attributes of a report item.

Field Documentation

uint16_t Page

Usage page of the report item.

uint16_t Usage

Usage of the report item.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_CollectionPath Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_CollectionPath Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Item Collection Path Structure. More...

#include <HIDParser.h>

Data Fields

uint8_t | Type
HID_Usage_t Usage
struct HID_CollectionPath * | Parent

Detailed Description

HID Parser Report Item Collection Path Structure.

Type define for a COLLECTION object. Contains the collection attributes and a reference to the parent collection if any.

Field Documentation

struct HID_CollectionPath* Parent

Reference to parent collection, or NULL if root collection.

uint8_t Type

Collection type (e.g. "Generic Desktop").

HID_Usage_t Usage

Collection usage.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_ReportItem_Attributes_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_ReportItem_Attributes_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Item Attributes Structure. More...

#include <HIDParser.h>

Data Fields

uint8_t BitSize
HID_Usage_t Usage
HID_Unit_t Unit
HID_MinMax_t Logical
HID_MinMax_t Physical

Detailed Description

HID Parser Report Item Attributes Structure.

Type define for all the data attributes of a report item, except flags.

Field Documentation

uint8_t BitSize

Size in bits of the report item's data.

HID_MinMax_t Logical

Logical minimum and maximum of the report item.

HID_MinMax_t Physical

Physical minimum and maximum of the report item.

HID_Unit_t Unit

Unit type and exponent of the report item.

HID_Usage_t Usage

Usage of the report item.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_ReportItem_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_ReportItem_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Item Details Structure. More...

#include <HIDParser.h>

Data Fields

uint16_t | BitOffset
uint8_t | ItemType
uint16_t | ItemFlags
uint8_t | ReportID
HID_CollectionPath_t * CollectionPath
HID_ReportItem_Attributes_t Attributes
uint32_t | Value
uint32_t | PreviousValue

Detailed Description

HID Parser Report Item Details Structure.

Type define for a report item (IN, OUT or FEATURE) layout attributes and other details.

Field Documentation

HID_ReportItem_Attributes_t Attributes

Report item attributes.

uint16_t BitOffset

Bit offset in the IN, OUT or FEATURE report of the item.

HID_CollectionPath_t* CollectionPath

Collection path of the item.

uint16_t ItemFlags

Item data flags, a mask of HID_IOF_* constants.

uint8_t ItemType

Report item type, a value in HID_ReportItemTypes_t.

uint32_t PreviousValue

Previous value of the report item.

uint8_t ReportID

Report ID this item belongs to, or 0x00 if device has only one report

uint32_t Value

Current value of the report item - use HID_ALIGN_DATA() when processing a retrieved value so that it is aligned to a specific type.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_ReportSizeInfo_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_ReportSizeInfo_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser Report Size Structure. More...

#include <HIDParser.h>

Data Fields

uint8_t | ReportID
uint16_t | ReportSizeBits [3]

Detailed Description

HID Parser Report Size Structure.

Type define for a report item size information structure, to retain the size of a device's reports by ID.

Field Documentation

uint8_t ReportID

Report ID of the report within the HID interface.

uint16_t ReportSizeBits[3]

Total number of bits in each report type for the given Report ID, indexed by the HID_ReportItemTypes_t enum.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_ReportInfo_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_ReportInfo_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

HID Parser State Structure. More...

#include <HIDParser.h>

Data Fields

uint8_t | TotalReportItems
HID_ReportItem_t | ReportItems [HID_MAX_REPORTITEMS]
HID_CollectionPath_t | CollectionPaths [HID_MAX_COLLECTIONS]
uint8_t | TotalDeviceReports
HID_ReportSizeInfo_t | ReportIDSizes [HID_MAX_REPORT_IDS]
uint16_t | LargestReportSizeBits
bool | UsingReportIDs

Detailed Description

HID Parser State Structure.

Type define for a complete processed HID report, including all report item data and collections.

Field Documentation

HID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS]

All collection items, referenced by the report items.

uint16_t LargestReportSizeBits

Largest report that the attached device will generate, in bits

HID_ReportSizeInfo_t ReportIDSizes[HID_MAX_REPORT_IDS]

Report sizes for each report in the interface

HID_ReportItem_t ReportItems[HID_MAX_REPORTITEMS]

Report items array, including all IN, OUT and FEATURE items.

uint8_t TotalDeviceReports

Number of reports within the HID interface

uint8_t TotalReportItems

Total number of report items stored in the ReportItems array.

bool UsingReportIDs

Indicates if the device has at least one REPORT ID element in its HID report descriptor.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: HID_StateTable_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
HID_StateTable_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » HID Report Parser

Data Fields

HID_ReportItem_Attributes_t | Attributes
uint8_t | ReportCount
uint8_t | ReportID
The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h


XMC USB Library: Device Management

Modules | Enumerations | Functions | Variables
Device Management
USB Core - LUFA/Drivers/USB/USB.h

USB Device management definitions for USB device mode. More...

Modules

Device Management (XMC)
USB Device definitions for the Infineon XMC4000 microcontrollers.

Enumerations

enum USB_Device_States_t {
DEVICE_STATE_Unattached = 0, DEVICE_STATE_Powered = 1, DEVICE_STATE_Default = 2, DEVICE_STATE_Addressed = 3,
DEVICE_STATE_Configured = 4, DEVICE_STATE_Suspended = 5
}

Functions

uint16_t CALLBACK_USB_GetDescriptor (const uint16_t wValue, const uint8_t wIndex, const void **const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3)

Variables

uint8_t | USB_Device_ConfigurationNumber
bool | USB_Device_RemoteWakeupEnabled
bool | USB_Device_CurrentlySelfPowered
volatile uint8_t | USB_DeviceState

Detailed Description

USB Device management definitions for USB device mode.

USB Device mode related definitions common to all architectures. This module contains definitions which are used when the USB controller is initialized in device mode.

Enumeration Type Documentation

enum USB_Device_States_t

Enum for the various states of the USB Device state machine. Only some states are implemented in the LUFA library - other states are left to the user to implement.

For information on each possible USB device state, refer to the USB 2.0 specification.

See also
USB_DeviceState, which stores the current device state machine state.
Enumerator
DEVICE_STATE_Unattached | Internally implemented by the library. This state indicates that the device is not currently connected to a host.
DEVICE_STATE_Powered | Internally implemented by the library. This state indicates that the device is connected to a host, but enumeration has not yet begun.
DEVICE_STATE_Default | Internally implemented by the library. This state indicates that the device's USB bus has been reset by the host and it is now waiting for the host to begin the enumeration process.
DEVICE_STATE_Addressed | Internally implemented by the library. This state indicates that the device has been addressed by the USB Host, but is not yet configured.
DEVICE_STATE_Configured | May be implemented by the user project. This state indicates that the device has been enumerated by the host and is ready for USB communications to begin.
DEVICE_STATE_Suspended | May be implemented by the user project. This state indicates that the USB bus has been suspended by the host, and the device should power down to a minimal power level until the bus is resumed.

Function Documentation

uint16_t CALLBACK_USB_GetDescriptor | ( | const uint16_t | wValue,
 |  | const uint8_t | wIndex,
 |  | const void **const | DescriptorAddress
 | ) |  |

Function to retrieve a given descriptor's size and memory location from the given descriptor type value, index and language ID. This function MUST be overridden in the user application (added with full, identical prototype and name so that the library can call it to retrieve descriptor data.

Parameters
[in] | wValue | The type of the descriptor to retrieve in the upper byte, and the index in the lower byte (when more than one descriptor of the given type exists, such as the case of string descriptors). The type may be one of the standard types defined in the DescriptorTypes_t enum, or may be a class-specific descriptor type value.
[in] | wIndex | The language ID of the string to return if the wValue type indicates DTYPE_String, otherwise zero for standard descriptors, or as defined in a class-specific standards.
[out] | DescriptorAddress | Pointer to the descriptor in memory. This should be set by the routine to the address of the descriptor.
[out] | DescriptorMemorySpace | A value from the USB_DescriptorMemorySpaces_t enum to indicate the memory space in which the descriptor is stored. This parameter does not exist when one of the USE_*_DESCRIPTORS compile time options is used, or on architectures which use a unified address space.
Note
By default, the library expects all descriptors to be located in flash memory via the PROGMEM attribute. If descriptors should be located in RAM or EEPROM instead (to speed up access in the case of RAM, or to allow the descriptors to be changed dynamically at runtime) either the USE_RAM_DESCRIPTORS or the USE_EEPROM_DESCRIPTORS tokens may be defined in the project makefile and passed to the compiler by the -D switch.
Returns
Size in bytes of the descriptor if it exists, zero or NO_DESCRIPTOR otherwise.

Variable Documentation

uint8_t USB_Device_ConfigurationNumber

Indicates the currently set configuration number of the device. USB devices may have several different configurations which the host can select between; this indicates the currently selected value, or 0 if no configuration has been selected.

Attention
This variable should be treated as read-only in the user application, and never manually changed in value.
bool USB_Device_CurrentlySelfPowered

Indicates if the device is currently being powered by its own power supply, rather than being powered by the host's USB supply. This flag should remain cleared if the device does not support self powered mode, as indicated in the device descriptors.

bool USB_Device_RemoteWakeupEnabled

Indicates if the host is currently allowing the device to issue remote wakeup events. If this flag is cleared, the device should not issue remote wakeup events to the host.

Attention
This variable should be treated as read-only in the user application, and never manually changed in value.
Note
To reduce FLASH usage of the compiled applications where Remote Wakeup is not supported, this global and the underlying management code can be disabled by defining the NO_DEVICE_REMOTE_WAKEUP token in the project makefile and passing it to the compiler via the -D switch.
volatile uint8_t USB_DeviceState

Indicates the current device state machine state. When in device mode, this indicates the state via one of the values of the USB_Device_States_t enum values.

This value should not be altered by the user application as it is handled automatically by the library. The only exception to this rule is if the NO_LIMITED_CONTROLLER_CONNECT token is used (see EVENT_USB_Device_Connect() and EVENT_USB_Device_Disconnect() events).

Attention
This variable should be treated as read-only in the user application, and never manually changed in value except in the circumstances outlined above.
Note
This global is only present if the user application can be a USB device.

See also
USB_Device_States_t for a list of possible device states.


XMC USB Library: Device Management (XMC)

Macros
Device Management (XMC)
USB Core - LUFA/Drivers/USB/USB.h » Device Management

USB Device definitions for the Infineon XMC4000 microcontrollers. More...

Macros

#define | USE_INTERNAL_SERIAL NO_DESCRIPTOR
#define | INTERNAL_SERIAL_LENGTH_BITS 0
#define | INTERNAL_SERIAL_START_ADDRESS 0

Detailed Description

USB Device definitions for the Infineon XMC4000 microcontrollers.

Architecture specific USB Device definitions for the Infineon XMC4000 microcontrollers.


XMC USB Library: Endpoint Management

Modules | Data Structures | Macros
Endpoint Management
USB Core - LUFA/Drivers/USB/USB.h

Endpoint management definitions. More...

Modules

Endpoint Data Reading and Writing
Endpoint data read/write definitions.
Endpoint Packet Management
USB Endpoint package management definitions.

Data Structures

struct USB_Endpoint_Table_t

Macros

#define | ENDPOINT_EPNUM_MASK 0x0F
#define | ENDPOINT_CONTROLEP 0

Detailed Description

Endpoint management definitions.

Functions, macros and enums related to endpoint management when in USB Device mode. This module contains the endpoint management macros, as well as endpoint interrupt and data send/receive functions for various data types.

Macro Definition Documentation

#define ENDPOINT_CONTROLEP 0

Endpoint address for the default control endpoint, which always resides in address 0. This is defined for convenience to give more readable code when used with the endpoint macros.

#define ENDPOINT_EPNUM_MASK 0x0F

Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's numerical address in the device.


XMC USB Library: Endpoint Data Reading and Writing

Modules
Endpoint Data Reading and Writing
USB Core - LUFA/Drivers/USB/USB.h » Endpoint Management

Endpoint data read/write definitions. More...

Modules

Read/Write of Primitive Data Types
Endpoint data primitive read/write definitions.
Read/Write of Multi-Byte Streams
Endpoint data stream transmission and reception management.
enum Endpoint_WaitUntilReady_ErrorCodes_t {
ENDPOINT_READYWAIT_NoError = 0, ENDPOINT_READYWAIT_EndpointStalled = 1, ENDPOINT_READYWAIT_DeviceDisconnected = 2, ENDPOINT_READYWAIT_BusSuspended = 3,
ENDPOINT_READYWAIT_Timeout = 4
}
uint8_t | Endpoint_WaitUntilReady (void)
void | Endpoint_ClearOUT (void)
void | Endpoint_ClearIN (void)
bool | Endpoint_IsReadWriteAllowed (void)
bool | Endpoint_ConfigureEndpointTable (const USB_Endpoint_Table_t *const Table, const uint8_t Entries)
uint8_t | Endpoint_Read_8 (void)
void | Endpoint_Write_8 (const uint8_t data)
void | Endpoint_Write_32_LE (const uint32_t Data)
uint32_t | Endpoint_Read_32_LE (void)

Detailed Description

Endpoint data read/write definitions.

Functions, macros, variables, enums and types related to data reading and writing from and to endpoints.

Enumeration Type Documentation

enum Endpoint_WaitUntilReady_ErrorCodes_t

Functions, macros, variables, enums and types related to packet management of endpoints. Functions, macros and enums related to endpoint management when in USB Device mode. This module contains the endpoint management macros, as well as endpoint interrupt and data send/receive functions for various data types.Enum for the possible error return codes of the Endpoint_WaitUntilReady() function.

Enumerator
ENDPOINT_READYWAIT_NoError | Endpoint is ready for next packet, no error.
ENDPOINT_READYWAIT_EndpointStalled | The endpoint was stalled during the stream transfer by the host or device.
ENDPOINT_READYWAIT_DeviceDisconnected | Device was disconnected from the host while waiting for the endpoint to become ready.
ENDPOINT_READYWAIT_BusSuspended | The USB bus has been suspended by the host and no USB endpoint traffic can occur until the bus has resumed.
ENDPOINT_READYWAIT_Timeout | The host failed to accept or send the next packet within the software timeout period set by the USB_STREAM_TIMEOUT_MS macro.

Function Documentation

void Endpoint_ClearIN ( void )

Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.

void Endpoint_ClearOUT ( void )

Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.

bool Endpoint_ConfigureEndpointTable | ( | const USB_Endpoint_Table_t *const | Table,
 |  | const uint8_t | Entries
 | ) |  |

Configures a table of endpoint descriptions, in sequence. This function can be used to configure multiple endpoints at the same time.

Note
Endpoints with a zero address will be ignored, thus this function cannot be used to configure the control endpoint.
Parameters
[in] | Table | Pointer to a table of endpoint descriptions.
[in] | Entries | Number of entries in the endpoint table to configure.
Returns
Boolean true if all endpoints configured successfully, false otherwise.
bool Endpoint_IsReadWriteAllowed ( void )

Determines if the currently selected endpoint may be read from (if data is waiting in the endpoint bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an IN direction). This function will return false if an error has occurred in the endpoint, if the endpoint is an OUT direction and no packet (or an empty packet) has been received, or if the endpoint is an IN direction and the endpoint bank is full.

Returns
Boolean true if the currently selected endpoint may be read from or written to, depending on its direction.
uint32_t Endpoint_Read_32_LE ( void )

Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT direction endpoints.

Returns
Next four bytes in the currently selected endpoint's FIFO buffer.
uint8_t Endpoint_Read_8 ( void )

Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints.

Returns
Next byte in the currently selected endpoint's FIFO buffer.
uint8_t Endpoint_WaitUntilReady ( void )

Spin-loops until the currently selected non-control endpoint is ready for the next packet of data to be read or written to it.

Note
This routine should not be called on CONTROL type endpoints.
Returns
A value from the Endpoint_WaitUntilReady_ErrorCodes_t enum.
void Endpoint_Write_32_LE ( const uint32_t Data )

Writes four bytes to the currently selected endpoint's bank in little endian format, for IN direction endpoints.

Parameters
[in] Data Data to write to the currently selected endpoint's FIFO buffer.
void Endpoint_Write_8 ( const uint8_t data )

Writes one byte to the currently selected endpoint's bank, for IN direction endpoints.

Parameters
[in] Data Data to write into the the currently selected endpoint's FIFO buffer.


XMC USB Library: Read/Write of Primitive Data Types

Read/Write of Primitive Data Types
USB Core - LUFA/Drivers/USB/USB.h » Endpoint Management » Endpoint Data Reading and Writing

Endpoint data primitive read/write definitions. More...

uint8_t | Endpoint_Read_8 (void)
void | Endpoint_Write_8 (const uint8_t data)
void | Endpoint_Write_32_LE (const uint32_t Data)
uint32_t | Endpoint_Read_32_LE (void)

Detailed Description

Endpoint data primitive read/write definitions.

Functions, macros, variables, enums and types related to data reading and writing of primitive data types from and to endpoints.

Function Documentation

uint32_t Endpoint_Read_32_LE ( void )

Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT direction endpoints.

Returns
Next four bytes in the currently selected endpoint's FIFO buffer.
uint8_t Endpoint_Read_8 ( void )

Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints.

Returns
Next byte in the currently selected endpoint's FIFO buffer.
void Endpoint_Write_32_LE ( const uint32_t Data )

Writes four bytes to the currently selected endpoint's bank in little endian format, for IN direction endpoints.

Parameters
[in] Data Data to write to the currently selected endpoint's FIFO buffer.
void Endpoint_Write_8 ( const uint8_t data )

Writes one byte to the currently selected endpoint's bank, for IN direction endpoints.

Parameters
[in] Data Data to write into the the currently selected endpoint's FIFO buffer.


XMC USB Library: Read/Write of Multi-Byte Streams

Enumerations
Read/Write of Multi-Byte Streams
USB Core - LUFA/Drivers/USB/USB.h » Endpoint Management » Endpoint Data Reading and Writing

Endpoint data stream transmission and reception management. More...

Enumerations

enum Endpoint_Stream_RW_ErrorCodes_t {
ENDPOINT_RWSTREAM_NoError = 0, ENDPOINT_RWSTREAM_EndpointStalled = 1, ENDPOINT_RWSTREAM_DeviceDisconnected = 2, ENDPOINT_RWSTREAM_BusSuspended = 3,
ENDPOINT_RWSTREAM_Timeout = 4, ENDPOINT_RWSTREAM_IncompleteTransfer = 5
}
enum Endpoint_ControlStream_RW_ErrorCodes_t { ENDPOINT_RWCSTREAM_NoError = 0, ENDPOINT_RWCSTREAM_HostAborted = 1, ENDPOINT_RWCSTREAM_DeviceDisconnected = 2, ENDPOINT_RWCSTREAM_BusSuspended = 3 }

Stream functions for null data

uint8_t | Endpoint_Discard_Stream (uint16_t Length, uint16_t *const BytesProcessed)
uint8_t | Endpoint_Null_Stream (uint16_t Length, uint16_t *const BytesProcessed)

Stream functions for RAM source/destination data

uint8_t | Endpoint_Write_Stream_LE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Write_Stream_BE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Stream_LE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Stream_BE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Write_Control_Stream_LE (const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Write_Control_Stream_BE (const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Control_Stream_LE (void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Control_Stream_BE (void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)

Detailed Description

Endpoint data stream transmission and reception management.

Endpoint data stream transmission and reception management for the Infineon XMC architecture.

Functions, macros, variables, enums and types related to data reading and writing of data streams from and to endpoints.

Enumeration Type Documentation

enum Endpoint_ControlStream_RW_ErrorCodes_t

Enum for the possible error return codes of the Endpoint_*_Control_Stream_* functions.

Enumerator
ENDPOINT_RWCSTREAM_NoError | Command completed successfully, no error.
ENDPOINT_RWCSTREAM_HostAborted | The aborted the transfer prematurely.
ENDPOINT_RWCSTREAM_DeviceDisconnected | Device was disconnected from the host during the transfer.
ENDPOINT_RWCSTREAM_BusSuspended | The USB bus has been suspended by the host and no USB endpoint traffic can occur until the bus has resumed.
enum Endpoint_Stream_RW_ErrorCodes_t

Enum for the possible error return codes of the Endpoint_*_Stream_* functions.

Enumerator
ENDPOINT_RWSTREAM_NoError | Command completed successfully, no error.
ENDPOINT_RWSTREAM_EndpointStalled | The endpoint was stalled during the stream transfer by the host or device.
ENDPOINT_RWSTREAM_DeviceDisconnected | Device was disconnected from the host during the transfer.
ENDPOINT_RWSTREAM_BusSuspended | The USB bus has been suspended by the host and no USB endpoint traffic can occur until the bus has resumed.
ENDPOINT_RWSTREAM_Timeout | The host failed to accept or send the next packet within the software timeout period set by the USB_STREAM_TIMEOUT_MS macro.
ENDPOINT_RWSTREAM_IncompleteTransfer | Indicates that the endpoint bank became full or empty before the complete contents of the current stream could be transferred. The endpoint stream function should be called again to process the next chunk of data in the transfer.

Function Documentation

uint8_t Endpoint_Discard_Stream | ( | uint16_t | Length,
 |  | uint16_t *const | BytesProcessed
 | ) |  |

Reads and discards the given number of bytes from the currently selected endpoint's bank, discarding fully read packets from the host as needed. The last packet is not automatically discarded once the remaining bytes has been read; the user is responsible for manually discarding the last packet from the host via the Endpoint_ClearOUT() macro.

If the BytesProcessed parameter is NULL, the entire stream transfer is attempted at once, failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid storage location, the transfer will instead be performed as a series of chunks. Each time the endpoint bank becomes empty while there is still data to process (and after the current packet has been acknowledged) the BytesProcessed location will be updated with the total number of bytes processed in the stream, and the function will exit with an error code of ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed in the user code - to continue the transfer, call the function again with identical parameters and it will resume until the BytesProcessed value reaches the total transfer length.

Single Stream Transfer Example:

1 uint8_t ErrorCode;
2
3 if ((ErrorCode = Endpoint_Discard_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError)
4 {
5 // Stream failed to complete - check ErrorCode here
6 }

Partial Stream Transfers Example:

1 uint8_t ErrorCode;
2 uint16_t BytesProcessed;
3
4 BytesProcessed = 0;
5 while ((ErrorCode = Endpoint_Discard_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
6 {
7 // Stream not yet complete - do other actions here, abort if required
8 }
9
10 if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
11 {
12 // Stream failed to complete - check ErrorCode here
13 }
Note
This routine should not be used on CONTROL type endpoints.
Parameters
[in] | Length | Number of bytes to discard via the currently selected endpoint.
[in] | BytesProcessed | Pointer to a location where the total number of bytes processed in the current transaction should be updated, NULL if the entire stream should be read at once.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Null_Stream | ( | uint16_t | Length,
 |  | uint16_t *const | BytesProcessed
 | ) |  |

Writes a given number of zeroed bytes to the currently selected endpoint's bank, sending full packets to the host as needed. The last packet is not automatically sent once the remaining bytes have been written; the user is responsible for manually sending the last packet to the host via the Endpoint_ClearIN() macro.

If the BytesProcessed parameter is NULL, the entire stream transfer is attempted at once, failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid storage location, the transfer will instead be performed as a series of chunks. Each time the endpoint bank becomes full while there is still data to process (and after the current packet transmission has been initiated) the BytesProcessed location will be updated with the total number of bytes processed in the stream, and the function will exit with an error code of ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed in the user code - to continue the transfer, call the function again with identical parameters and it will resume until the BytesProcessed value reaches the total transfer length.

Single Stream Transfer Example:

1 uint8_t ErrorCode;
2
3 if ((ErrorCode = Endpoint_Null_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError)
4 {
5 // Stream failed to complete - check ErrorCode here
6 }

Partial Stream Transfers Example:

1 uint8_t ErrorCode;
2 uint16_t BytesProcessed;
3
4 BytesProcessed = 0;
5 while ((ErrorCode = Endpoint_Null_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
6 {
7 // Stream not yet complete - do other actions here, abort if required
8 }
9
10 if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
11 {
12 // Stream failed to complete - check ErrorCode here
13 }
Note
This routine should not be used on CONTROL type endpoints.
Parameters
[in] | Length | Number of zero bytes to send via the currently selected endpoint.
[in] | BytesProcessed | Pointer to a location where the total number of bytes processed in the current transaction should be updated, NULL if the entire stream should be read at once.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Read_Control_Stream_BE | ( | void *const | Buffer,
 |  | uint16_t | Length
 | ) |  |

Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian, discarding fully read packets from the host as needed. The device IN acknowledgement is not automatically sent after success or failure states; the user is responsible for manually sending the status IN packet to finalize the transfer's status stage via the Endpoint_ClearIN() macro.

Note
This function automatically sends the last packet in the data stage of the transaction; when the function returns, the user is responsible for clearing the status stage of the transaction. Note that the status stage packet is sent or received in the opposite direction of the data flow.

This routine should only be used on CONTROL type endpoints.
Warning
Unlike the standard stream read/write commands, the control stream commands cannot be chained together; i.e. the entire stream data must be read or written at the one time.
Parameters
[out] | Buffer | Pointer to the destination data buffer to write to.
[in] | Length | Number of bytes to send via the currently selected endpoint.
Returns
A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Read_Control_Stream_LE | ( | void *const | Buffer,
 |  | uint16_t | Length
 | ) |  |

Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian, discarding fully read packets from the host as needed. The device IN acknowledgement is not automatically sent after success or failure states; the user is responsible for manually sending the status IN packet to finalize the transfer's status stage via the Endpoint_ClearIN() macro.

Note
This function automatically sends the last packet in the data stage of the transaction; when the function returns, the user is responsible for clearing the status stage of the transaction. Note that the status stage packet is sent or received in the opposite direction of the data flow.

This routine should only be used on CONTROL type endpoints.
Warning
Unlike the standard stream read/write commands, the control stream commands cannot be chained together; i.e. the entire stream data must be read or written at the one time.
Parameters
[out] | Buffer | Pointer to the destination data buffer to write to.
[in] | Length | Number of bytes to send via the currently selected endpoint.
Returns
A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Read_Stream_BE | ( | void *const | Buffer,
 |  | uint16_t | Length,
 |  | uint16_t *const | BytesProcessed
 | ) |  |

Reads the given number of bytes from the endpoint from the given buffer in big endian, discarding fully read packets from the host as needed. The last packet is not automatically discarded once the remaining bytes has been read; the user is responsible for manually discarding the last packet from the host via the Endpoint_ClearOUT() macro.

Note
This routine should not be used on CONTROL type endpoints.
Parameters
[out] | Buffer | Pointer to the destination data buffer to write to.
[in] | Length | Number of bytes to send via the currently selected endpoint.
[in] | BytesProcessed | Pointer to a location where the total number of bytes processed in the current transaction should be updated, NULL if the entire stream should be read at once.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Read_Stream_LE | ( | void *const | Buffer,
 |  | uint16_t | Length,
 |  | uint16_t *const | BytesProcessed
 | ) |  |

Reads the given number of bytes from the endpoint from the given buffer in little endian, discarding fully read packets from the host as needed. The last packet is not automatically discarded once the remaining bytes has been read; the user is responsible for manually discarding the last packet from the host via the Endpoint_ClearOUT() macro.

If the BytesProcessed parameter is NULL, the entire stream transfer is attempted at once, failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid storage location, the transfer will instead be performed as a series of chunks. Each time the endpoint bank becomes empty while there is still data to process (and after the current packet has been acknowledged) the BytesProcessed location will be updated with the total number of bytes processed in the stream, and the function will exit with an error code of ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed in the user code - to continue the transfer, call the function again with identical parameters and it will resume until the BytesProcessed value reaches the total transfer length.

Single Stream Transfer Example:

1 uint8_t DataStream[512];
2 uint8_t ErrorCode;
3
4 if ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream),
5 NULL)) != ENDPOINT_RWSTREAM_NoError)
6 {
7 // Stream failed to complete - check ErrorCode here
8 }

Partial Stream Transfers Example:

1 uint8_t DataStream[512];
2 uint8_t ErrorCode;
3 uint16_t BytesProcessed;
4
5 BytesProcessed = 0;
6 while ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream),
7 &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
8 {
9 // Stream not yet complete - do other actions here, abort if required
10 }
11
12 if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
13 {
14 // Stream failed to complete - check ErrorCode here
15 }
Note
This routine should not be used on CONTROL type endpoints.
Parameters
[out] | Buffer | Pointer to the destination data buffer to write to.
[in] | Length | Number of bytes to send via the currently selected endpoint.
[in] | BytesProcessed | Pointer to a location where the total number of bytes processed in the current transaction should be updated, NULL if the entire stream should be read at once.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Write_Control_Stream_BE | ( | const void *const | Buffer,
 |  | uint16_t | Length
 | ) |  |

Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian, sending full packets to the host as needed. The host OUT acknowledgement is not automatically cleared in both failure and success states; the user is responsible for manually clearing the status OUT packet to finalize the transfer's status stage via the Endpoint_ClearOUT() macro.

Note
This function automatically sends the last packet in the data stage of the transaction; when the function returns, the user is responsible for clearing the status stage of the transaction. Note that the status stage packet is sent or received in the opposite direction of the data flow.

This routine should only be used on CONTROL type endpoints.
Warning
Unlike the standard stream read/write commands, the control stream commands cannot be chained together; i.e. the entire stream data must be read or written at the one time.
Parameters
[in] | Buffer | Pointer to the source data buffer to read from.
[in] | Length | Number of bytes to read for the currently selected endpoint into the buffer.
Returns
A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Write_Control_Stream_LE | ( | const void *const | Buffer,
 |  | uint16_t | Length
 | ) |  |

Writes the given number of bytes to the CONTROL type endpoint from the given buffer in little endian, sending full packets to the host as needed. The host OUT acknowledgement is not automatically cleared in both failure and success states; the user is responsible for manually clearing the status OUT packet to finalize the transfer's status stage via the Endpoint_ClearOUT() macro.

Note
This function automatically sends the last packet in the data stage of the transaction; when the function returns, the user is responsible for clearing the status stage of the transaction. Note that the status stage packet is sent or received in the opposite direction of the data flow.

This routine should only be used on CONTROL type endpoints.
Warning
Unlike the standard stream read/write commands, the control stream commands cannot be chained together; i.e. the entire stream data must be read or written at the one time.
Parameters
[in] | Buffer | Pointer to the source data buffer to read from.
[in] | Length | Number of bytes to read for the currently selected endpoint into the buffer.
Returns
A value from the Endpoint_ControlStream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Write_Stream_BE | ( | const void *const | Buffer,
 |  | uint16_t | Length,
 |  | uint16_t *const | BytesProcessed
 | ) |  |

Writes the given number of bytes to the endpoint from the given buffer in big endian, sending full packets to the host as needed. The last packet filled is not automatically sent; the user is responsible for manually sending the last written packet to the host via the Endpoint_ClearIN() macro.

Note
This routine should not be used on CONTROL type endpoints.
Parameters
[in] | Buffer | Pointer to the source data buffer to read from.
[in] | Length | Number of bytes to read for the currently selected endpoint into the buffer.
[in] | BytesProcessed | Pointer to a location where the total number of bytes processed in the current transaction should be updated, NULL if the entire stream should be written at once.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
uint8_t Endpoint_Write_Stream_LE | ( | const void *const | Buffer,
 |  | uint16_t | Length,
 |  | uint16_t *const | BytesProcessed
 | ) |  |

Writes the given number of bytes to the endpoint from the given buffer in little endian, sending full packets to the host as needed. The last packet filled is not automatically sent; the user is responsible for manually sending the last written packet to the host via the Endpoint_ClearIN() macro.

If the BytesProcessed parameter is NULL, the entire stream transfer is attempted at once, failing or succeeding as a single unit. If the BytesProcessed parameter points to a valid storage location, the transfer will instead be performed as a series of chunks. Each time the endpoint bank becomes full while there is still data to process (and after the current packet transmission has been initiated) the BytesProcessed location will be updated with the total number of bytes processed in the stream, and the function will exit with an error code of ENDPOINT_RWSTREAM_IncompleteTransfer. This allows for any abort checking to be performed in the user code - to continue the transfer, call the function again with identical parameters and it will resume until the BytesProcessed value reaches the total transfer length.

Single Stream Transfer Example:

1 uint8_t DataStream[512];
2 uint8_t ErrorCode;
3
4 if ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream),
5 NULL)) != ENDPOINT_RWSTREAM_NoError)
6 {
7 // Stream failed to complete - check ErrorCode here
8 }

Partial Stream Transfers Example:

1 uint8_t DataStream[512];
2 uint8_t ErrorCode;
3 uint16_t BytesProcessed;
4
5 BytesProcessed = 0;
6 while ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream),
7 &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer)
8 {
9 // Stream not yet complete - do other actions here, abort if required
10 }
11
12 if (ErrorCode != ENDPOINT_RWSTREAM_NoError)
13 {
14 // Stream failed to complete - check ErrorCode here
15 }
Note
This routine should not be used on CONTROL type endpoints.
Parameters
[in] | Buffer | Pointer to the source data buffer to read from.
[in] | Length | Number of bytes to read for the currently selected endpoint into the buffer.
[in] | BytesProcessed | Pointer to a location where the total number of bytes processed in the current transaction should be updated, NULL if the entire stream should be written at once.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.


XMC USB Library: Endpoint Packet Management

Endpoint Packet Management
USB Core - LUFA/Drivers/USB/USB.h » Endpoint Management

USB Endpoint package management definitions. More...

void | Endpoint_ClearOUT (void)
void | Endpoint_ClearIN (void)
bool | Endpoint_IsReadWriteAllowed (void)

Detailed Description

USB Endpoint package management definitions.

Functions, macros, variables, enums and types related to packet management of endpoints.

Function Documentation

void Endpoint_ClearIN ( void )

Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.

void Endpoint_ClearOUT ( void )

Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.

bool Endpoint_IsReadWriteAllowed ( void )

Determines if the currently selected endpoint may be read from (if data is waiting in the endpoint bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an IN direction). This function will return false if an error has occurred in the endpoint, if the endpoint is an OUT direction and no packet (or an empty packet) has been received, or if the endpoint is an IN direction and the endpoint bank is full.

Returns
Boolean true if the currently selected endpoint may be read from or written to, depending on its direction.


XMC USB Library: USB_Endpoint_Table_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
USB_Endpoint_Table_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » Endpoint Management

#include <EndPoint.h>

Data Fields

uint8_t | Address
uint16_t | Size
uint8_t | Type
uint8_t | Banks

Detailed Description

Type define for a endpoint table entry, used to configure endpoints in groups via Endpoint_ConfigureEndpointTable().

Field Documentation

uint8_t Address

Address of the endpoint to configure, or zero if the table entry is to be unused.

uint8_t Banks

Number of hardware banks to use for the endpoint.

uint16_t Size

Size of the endpoint bank, in bytes.

uint8_t Type

Type of the endpoint, a EP_TYPE_* mask.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Core/EndPoint.h


XMC USB Library: USB Events

Functions
USB Events
USB Core - LUFA/Drivers/USB/USB.h

USB Event management definitions. More...

Functions

void | EVENT_USB_UIDChange (void)
void | EVENT_USB_Host_HostError (const uint8_t ErrorCode)
void | EVENT_USB_Host_DeviceAttached (void)
void | EVENT_USB_Host_DeviceUnattached (void)
void | EVENT_USB_Host_DeviceEnumerationFailed (const uint8_t ErrorCode, const uint8_t SubErrorCode)
void | EVENT_USB_Host_DeviceEnumerationComplete (void)
void | EVENT_USB_Host_StartOfFrame (void)
void | EVENT_USB_Device_Connect (void)
void | EVENT_USB_Device_Disconnect (void)
void | EVENT_USB_Device_ControlRequest (void)
void | EVENT_USB_Device_ConfigurationChanged (void)
void | EVENT_USB_Device_Suspend (void)
void | EVENT_USB_Device_WakeUp (void)
void | EVENT_USB_Device_Reset (void)
void | EVENT_USB_Device_StartOfFrame (void)

Detailed Description

USB Event management definitions.

This module contains macros and functions relating to the management of library events, which are small pieces of code similar to ISRs which are run when a given condition is met. Each event can be fired from multiple places in the user or library code, which may or may not be inside an ISR, thus each handler should be written to be as small and fast as possible to prevent possible problems.

Events can be hooked by the user application by declaring a handler function with the same name and parameters listed here. If an event with no user-associated handler is fired within the library, it by default maps to an internal empty stub function.

Each event must only have one associated event handler, but can be raised by multiple sources by calling the event handler function (with any required event parameters).

Function Documentation

void EVENT_USB_Device_ConfigurationChanged ( void )

Event for USB configuration number changed. This event fires when a the USB host changes the selected configuration number while in device mode. This event should be hooked in device applications to create the endpoints and configure the device for the selected configuration.

This event is time-critical; exceeding OS-specific delays within this event handler (typically of around one second) will prevent the device from enumerating correctly.

This event fires after the value of USB_Device_ConfigurationNumber has been changed.

Note
This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_Device_Connect ( void )

Event for USB device connection. This event fires when the microcontroller is in USB Device mode and the device is connected to a USB host, beginning the enumeration process measured by a rising level on the microcontroller's VBUS sense pin.

This event is time-critical; exceeding OS-specific delays within this event handler (typically of around two seconds) will prevent the device from enumerating correctly.

Attention
This event may fire multiple times during device enumeration on the microcontrollers with limited USB controllers if NO_LIMITED_CONTROLLER_CONNECT is not defined.
Note
For the microcontrollers with limited USB controller functionality, VBUS sensing is not available. this means that the current connection state is derived from the bus suspension and wake up events by default, which is not always accurate (host may suspend the bus while still connected). If the actual connection state needs to be determined, VBUS should be routed to an external pin, and the auto-detect behavior turned off by passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection and disconnection events may be manually fired, and the USB_DeviceState global changed manually.

See also
USB Interface Management for more information on the USB management task and reducing CPU usage.
void EVENT_USB_Device_ControlRequest ( void )

Event for control requests. This event fires when a the USB host issues a control request to the mandatory device control endpoint (of address 0). This may either be a standard request that the library may have a handler code for internally, or a class specific request issued to the device which must be handled appropriately. If a request is not processed in the user application via this event, it will be passed to the library for processing internally if a suitable handler exists.

This event is time-critical; each packet within the request transaction must be acknowledged or sent within 50ms or the host will abort the transfer.

The library internally handles all standard control requests with the exceptions of SYNC FRAME, SET DESCRIPTOR and SET INTERFACE. These and all other non-standard control requests will be left for the user to process via this event if desired. If not handled in the user application or by the library internally, unknown requests are automatically STALLed.

Note
This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see USB Interface Management documentation).

Requests should be handled in the same manner as described in the USB 2.0 Specification, or appropriate class specification. In all instances, the library has already read the request SETUP parameters into the USB_ControlRequest structure which should then be used by the application to determine how to handle the issued request.
void EVENT_USB_Device_Disconnect ( void )

Event for USB device disconnection. This event fires when the microcontroller is in USB Device mode and the device is disconnected from a host, measured by a falling level on the microcontroller's VBUS sense pin.

Attention
This event may fire multiple times during device enumeration on the microcontrollers with limited USB controllers if NO_LIMITED_CONTROLLER_CONNECT is not defined.
Note
For the microcontrollers with limited USB controllers, VBUS sense is not available to the USB controller. this means that the current connection state is derived from the bus suspension and wake up events by default, which is not always accurate (host may suspend the bus while still connected). If the actual connection state needs to be determined, VBUS should be routed to an external pin, and the auto-detect behavior turned off by passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection and disconnection events may be manually fired, and the USB_DeviceState global changed manually.

See also
USB Interface Management for more information on the USB management task and reducing CPU usage.
void EVENT_USB_Device_Reset ( void )

Event for USB interface reset. This event fires when the USB interface is in device mode, and a the USB host requests that the device reset its interface. This event fires after the control endpoint has been automatically configured by the library.

This event is time-critical; exceeding OS-specific delays within this event handler (typically of around two seconds) will prevent the device from enumerating correctly.

Note
This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_Device_StartOfFrame ( void )

Event for USB Start Of Frame detection, when enabled. This event fires at the start of each USB frame, once per millisecond, and is synchronized to the USB bus. This can be used as an accurate millisecond timer source when the USB bus is enumerated in device mode to a USB host.

This event is time-critical; it is run once per millisecond and thus long handlers will significantly degrade device performance. This event should only be enabled when needed to reduce device wake-ups.

Precondition
This event is not normally active - it must be manually enabled and disabled via the USB_Device_EnableSOFEvents() and USB_Device_DisableSOFEvents() commands after enumeration.

Note
This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_Device_Suspend ( void )

Event for USB suspend. This event fires when a the USB host suspends the device by halting its transmission of Start Of Frame pulses to the device. This is generally hooked in order to move the device over to a low power state until the host wakes up the device. If the USB interface is enumerated with the USB_OPT_AUTO_PLL option set, the library will automatically suspend the USB PLL before the event is fired to save power.

Note
This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see USB Interface Management documentation).

This event does not exist on the microcontrollers with limited USB VBUS sensing abilities when the NO_LIMITED_CONTROLLER_CONNECT compile time token is not set - see EVENT_USB_Device_Disconnect.
See also
EVENT_USB_Device_WakeUp() event for accompanying Wake Up event.
void EVENT_USB_Device_WakeUp ( void )

Event for USB wake up. This event fires when a the USB interface is suspended while in device mode, and the host wakes up the device by supplying Start Of Frame pulses. This is generally hooked to pull the user application out of a low power state and back into normal operating mode. If the USB interface is enumerated with the USB_OPT_AUTO_PLL option set, the library will automatically restart the USB PLL before the event is fired.

Note
This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see USB Interface Management documentation).

This event does not exist on the microcontrollers with limited USB VBUS sensing abilities when the NO_LIMITED_CONTROLLER_CONNECT compile time token is not set - see EVENT_USB_Device_Disconnect.
See also
EVENT_USB_Device_Suspend() event for accompanying Suspend event.
void EVENT_USB_Host_DeviceAttached ( void )

Event for USB device attachment. This event fires when a the USB interface is in host mode, and a USB device has been connected to the USB interface. This is interrupt driven, thus fires before the standard EVENT_USB_Device_Connect() event and so can be used to programmatically start the USB management task to reduce CPU consumption.

Note
This event only exists on microcontrollers that supports USB host mode.

This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see USB Interface Management documentation).
See also
USB_USBTask() for more information on the USB management task and reducing CPU usage.
void EVENT_USB_Host_DeviceEnumerationComplete ( void )

Event for USB device enumeration completion. This event fires when a the USB interface is in host mode and an attached USB device has been completely enumerated and is ready to be controlled by the user application.

This event is time-critical; exceeding OS-specific delays within this event handler (typically of around 1 second) when a transaction is waiting to be processed by the device will prevent break communications and cause the host to reset the USB bus.

Note
This event only exists on microcontrollers that supports USB host mode.

This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_Host_DeviceEnumerationFailed | ( | const uint8_t | ErrorCode,
 |  | const uint8_t | SubErrorCode
 | ) |  |

Event for USB device enumeration failure. This event fires when a the USB interface is in host mode, and an attached USB device has failed to enumerate completely.

Parameters
[in] | ErrorCode | Error code indicating the failure reason, a value in USB_Host_EnumerationErrorCodes_t.
[in] | SubErrorCode | Sub error code indicating the reason for failure - for example, if the ErrorCode parameter indicates a control error, this will give the error code returned by the USB_Host_SendControlRequest() function.
Note
This event only exists on microcontrollers that supports USB host mode.

This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_Host_DeviceUnattached ( void )

Event for USB device removal. This event fires when a the USB interface is in host mode, and a USB device has been removed the USB interface whether or not it has been enumerated. This can be used to programmatically stop the USB management task to reduce CPU consumption.

Note
This event only exists on microcontrollers that supports USB host mode.

This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see USB Interface Management documentation).
See also
USB_USBTask() for more information on the USB management task and reducing CPU usage.
void EVENT_USB_Host_HostError ( const uint8_t ErrorCode )

Event for USB host error. This event fires when a hardware fault has occurred whilst the USB interface is in host mode.

Parameters
[in] ErrorCode Error code indicating the failure reason, a value in USB_Host_ErrorCodes_t.
Note
This event only exists on microcontrollers that supports USB host mode.

This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_Host_StartOfFrame ( void )

Event for USB Start Of Frame detection, when enabled. This event fires at the start of each USB frame, once per millisecond, and is synchronized to the USB bus. This can be used as an accurate millisecond timer source when the USB bus is not suspended while in host mode.

This event is time-critical; it is run once per millisecond and thus long handlers will significantly degrade device performance. This event should only be enabled when needed to reduce device wake-ups.

Note
This event is not normally active - it must be manually enabled and disabled via the USB_Host_EnableSOFEvents() and USB_Host_DisableSOFEvents() commands after enumeration of a USB device.

This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see USB Interface Management documentation).
void EVENT_USB_UIDChange ( void )

Event for USB mode pin level change. This event fires when the USB interface is set to dual role mode, and the UID pin level has changed to indicate a new mode (device or host). This event fires before the mode is switched to the newly indicated mode but after the EVENT_USB_Device_Disconnect event has fired (if disconnected before the role change).

Note
This event only exists on microcontrollers that support dual role USB modes.

This event does not exist if the USB_DEVICE_ONLY or USB_HOST_ONLY tokens have been supplied to the compiler (see USB Interface Management documentation).


XMC USB Library: Host Management

Enumerations | Variables
Host Management
USB Core - LUFA/Drivers/USB/USB.h

USB Host management definitions for USB host mode. More...

Enumerations

enum USB_Host_States_t {
HOST_STATE_WaitForDevice = 0, HOST_STATE_Unattached = 1, HOST_STATE_Powered = 2, HOST_STATE_Powered_WaitForDeviceSettle = 3,
HOST_STATE_Powered_WaitForConnect = 4, HOST_STATE_Powered_DoReset = 5, HOST_STATE_Powered_ConfigPipe = 6, HOST_STATE_Default = 7,
HOST_STATE_Default_PostReset = 8, HOST_STATE_Default_PostAddressSet = 9, HOST_STATE_Addressed = 10, HOST_STATE_Configured = 11
}

Variables

uint8_t USB_Host_ConfigurationNumber

Detailed Description

USB Host management definitions for USB host mode.

USB Host mode related macros and enums. This module contains macros and enums which are used when the USB controller is initialized in host mode.

Enumeration Type Documentation

enum USB_Host_States_t

Enum for the various states of the USB Host state machine.

For information on each possible USB host state, refer to the USB 2.0 specification. Several of the USB host states are broken up further into multiple smaller sub-states, so that they can be internally implemented inside the library in an efficient manner.

See also
USB_HostState, which stores the current host state machine state.
Enumerator
HOST_STATE_WaitForDevice | This state indicates that the stack is waiting for an interval to elapse before continuing with the next step of the device enumeration process.
HOST_STATE_Unattached | This state indicates that the host state machine is waiting for a device to be attached so that it can start the enumeration process.
HOST_STATE_Powered | This state indicates that a device has been attached, and the library's internals are being configured to begin the enumeration process.
HOST_STATE_Powered_WaitForDeviceSettle | This state indicates that the stack is waiting for the initial settling period to elapse before beginning the enumeration process.
HOST_STATE_Powered_WaitForConnect | This state indicates that the stack is waiting for a connection event from the USB controller to indicate a valid USB device has been attached to the bus and is ready to be enumerated.
HOST_STATE_Powered_DoReset | This state indicates that a valid USB device has been attached, and that it will now be reset to ensure it is ready for enumeration.
HOST_STATE_Powered_ConfigPipe | This state indicates that the attached device is currently powered and reset, and that the control pipe is now being configured by the stack.
HOST_STATE_Default | This state indicates that the stack is currently retrieving the control endpoint's size from the device, so that the control pipe can be altered to match.
HOST_STATE_Default_PostReset | This state indicates that the control pipe is being reconfigured to match the retrieved control endpoint size from the device, and the device's USB bus address is being set.
HOST_STATE_Default_PostAddressSet | This state indicates that the device's address has now been set, and the stack is has now completed the device enumeration process. This state causes the stack to change the current USB device address to that set for the connected device, before progressing to the HOST_STATE_Addressed state ready for use in the user application.
HOST_STATE_Addressed | Indicates that the device has been enumerated and addressed, and is now waiting for the user application to configure the device ready for use.
HOST_STATE_Configured | Indicates that the device has been configured into a valid device configuration, ready for general use by the user application.

Variable Documentation

uint8_t USB_Host_ConfigurationNumber

Indicates the currently set configuration number of the attached device. This indicates the currently selected configuration value if one has been set successfully, or 0 if no configuration has been selected.

To set a device configuration, call the USB_Host_SetDeviceConfiguration() function.

Attention
This variable should be treated as read-only in the user application, and never manually changed in value.


XMC USB Library: USB On The Go (OTG) Management

USB On The Go (OTG) Management
USB Core - LUFA/Drivers/USB/USB.h

USB OTG management definitions. More...

USB OTG management definitions.

This module contains macros for embedded USB hosts with dual role On The Go capabilities, for managing role exchange. OTG is a way for two USB dual role devices to talk to one another directly without fixed device/host roles.


XMC USB Library: Pipe Management

Modules | Data Structures | Macros
Pipe Management
USB Core - LUFA/Drivers/USB/USB.h

Pipe management definitions. More...

Modules

Pipe Data Reading and Writing
Pipe data read/write definitions.
Pipe Packet Management
Pipe packet management definitions.
Pipe Control Request Management
Pipe control request definitions.

Data Structures

struct USB_Pipe_Table_t

Macros

#define | PIPE_CONTROLPIPE 0
#define | PIPE_PIPENUM_MASK 0x0F
#define | PIPE_EPNUM_MASK 0x0F

Detailed Description

Pipe management definitions.

This module contains functions, macros and enums related to pipe management when in USB Host mode. This module contains the pipe management macros, as well as pipe interrupt and data send/receive functions for various data types.

Macro Definition Documentation

#define PIPE_CONTROLPIPE 0

Pipe address for the default control pipe, which always resides in address 0. This is defined for convenience to give more readable code when used with the pipe macros.

#define PIPE_EPNUM_MASK 0x0F

Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's numerical address in the attached device.

#define PIPE_PIPENUM_MASK 0x0F

Pipe number mask, for masking against pipe addresses to retrieve the pipe's numerical address in the device.


XMC USB Library: Pipe Data Reading and Writing

Modules
Pipe Data Reading and Writing
USB Core - LUFA/Drivers/USB/USB.h » Pipe Management

Pipe data read/write definitions. More...

Modules

Read/Write of Primitive Data Types
Pipe data primitive read/write definitions.
Read/Write of Multi-Byte Streams
Pipe data stream transmission and reception management.

Detailed Description

Pipe data read/write definitions.

Functions, macros, variables, enums and types related to data reading and writing from and to pipes.


XMC USB Library: Read/Write of Primitive Data Types

Read/Write of Primitive Data Types
USB Core - LUFA/Drivers/USB/USB.h » Pipe Management » Pipe Data Reading and Writing

Pipe data primitive read/write definitions. More...

Pipe data primitive read/write definitions.

Functions, macros, variables, enums and types related to data reading and writing of primitive data types from and to pipes.


XMC USB Library: Read/Write of Multi-Byte Streams

Enumerations
Read/Write of Multi-Byte Streams
USB Core - LUFA/Drivers/USB/USB.h » Pipe Management » Pipe Data Reading and Writing

Pipe data stream transmission and reception management. More...

Enumerations

enum Pipe_Stream_RW_ErrorCodes_t {
PIPE_RWSTREAM_NoError = 0, PIPE_RWSTREAM_PipeStalled = 1, PIPE_RWSTREAM_DeviceDisconnected = 2, PIPE_RWSTREAM_Timeout = 3,
PIPE_RWSTREAM_IncompleteTransfer = 4
}

Detailed Description

Pipe data stream transmission and reception management.

Functions, macros, variables, enums and types related to data reading and writing of data streams from and to pipes.

Enumeration Type Documentation

enum Pipe_Stream_RW_ErrorCodes_t

Enum for the possible error return codes of the Pipe_*_Stream_* functions.

Enumerator
PIPE_RWSTREAM_NoError | Command completed successfully, no error.
PIPE_RWSTREAM_PipeStalled | The device stalled the pipe during the transfer.
PIPE_RWSTREAM_DeviceDisconnected | Device was disconnected from the host during the transfer.
PIPE_RWSTREAM_Timeout | The device failed to accept or send the next packet within the software timeout period set by the USB_STREAM_TIMEOUT_MS macro.
PIPE_RWSTREAM_IncompleteTransfer | Indicates that the pipe bank became full/empty before the complete contents of the stream could be transferred.


XMC USB Library: Pipe Packet Management

Pipe Packet Management
USB Core - LUFA/Drivers/USB/USB.h » Pipe Management

Pipe packet management definitions. More...

Pipe packet management definitions.

Functions, macros, variables, enums and types related to packet management of pipes.


XMC USB Library: Pipe Control Request Management

Enumerations | Functions
Pipe Control Request Management
USB Core - LUFA/Drivers/USB/USB.h » Pipe Management

Pipe control request definitions. More...

Enumerations

enum USB_Host_SendControlErrorCodes_t {
HOST_SENDCONTROL_Successful = 0, HOST_SENDCONTROL_DeviceDisconnected = 1, HOST_SENDCONTROL_PipeError = 2, HOST_SENDCONTROL_SetupStalled = 3,
HOST_SENDCONTROL_SoftwareTimeOut = 4
}

Functions

uint8_t | USB_Host_SendControlRequest (void *const BufferPtr)
uint8_t | USB_Host_SetDeviceConfiguration (const uint8_t ConfigNumber)
uint8_t | USB_Host_GetDeviceConfiguration (uint8_t *const ConfigNumber) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | USB_Host_GetDescriptor (const uint8_t Type, const uint8_t Index, void *const Buffer, const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(3)
uint8_t | USB_Host_GetDeviceStatus (uint8_t *const FeatureStatus) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | USB_Host_ClearEndpointStall (const uint8_t EndpointAddress)
uint8_t | USB_Host_SetInterfaceAltSetting (const uint8_t InterfaceIndex, const uint8_t AltSetting)
uint8_t | USB_Host_GetInterfaceAltSetting (const uint8_t InterfaceIndex, uint8_t *const AltSetting) ATTR_NON_NULL_PTR_ARG(2)

Detailed Description

Pipe control request definitions.

Module for host mode request processing. This module allows for the transmission of standard, class and vendor control requests to the default control endpoint of an attached device while in host mode.

See also
Chapter 9 of the USB 2.0 specification.

Enumeration Type Documentation

enum USB_Host_SendControlErrorCodes_t

Enum for the USB_Host_SendControlRequest() return code, indicating the reason for the error if the transfer of the request is unsuccessful.

Enumerator
HOST_SENDCONTROL_Successful | No error occurred in the request transfer.
HOST_SENDCONTROL_DeviceDisconnected | The attached device was disconnected during the request transfer.
HOST_SENDCONTROL_PipeError | An error occurred in the pipe while sending the request.
HOST_SENDCONTROL_SetupStalled | The attached device stalled the request, usually indicating that the request is unsupported on the device.
HOST_SENDCONTROL_SoftwareTimeOut | The request or data transfer timed out.

Function Documentation

uint8_t USB_Host_ClearEndpointStall ( const uint8_t EndpointAddress )

Clears a stall condition on the given pipe, via a CLEAR FEATURE standard request to the attached device.

Note
After this routine returns, the control pipe will be selected.
Parameters
[in] EndpointAddress Address of the endpoint to clear, including the endpoint's direction.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_GetDescriptor | ( | const uint8_t | Type,
 |  | const uint8_t | Index,
 |  | void *const | Buffer,
 |  | const uint8_t | BufferLength
 | ) |  |

Sends a GET DESCRIPTOR standard request to the attached device, requesting the descriptor of the specified type and index.

Note
After this routine returns, the control pipe will be selected.
Parameters
[in] | Type | Type of descriptor to retrieve, a value from the USB_DescriptorTypes_t enum.
[in] | Index | Index of the descriptor to retrieve.
[out] | Buffer | Pointer to the destination buffer where the retrieved string descriptor is to be stored.
[in] | BufferLength | Maximum size of the string descriptor which can be stored into the buffer.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_GetDeviceConfiguration ( uint8_t *const ConfigNumber )

Sends a GET CONFIGURATION standard request to the attached device, to retrieve the currently selected device configuration index.

Note
After this routine returns, the control pipe will be selected.
Parameters
[out] ConfigNumber Pointer to a location where the retrieved configuration index should be stored.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_GetDeviceStatus ( uint8_t *const FeatureStatus )

Retrieves the current feature status of the attached device, via a GET STATUS standard request. The retrieved feature status can then be examined by masking the retrieved value with the various FEATURE_* masks for bus/self power information and remote wakeup support.

Note
After this routine returns, the control pipe will be selected.
Parameters
[out] FeatureStatus Location where the retrieved feature status should be stored.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_GetInterfaceAltSetting | ( | const uint8_t | InterfaceIndex,
 |  | uint8_t *const | AltSetting
 | ) |  |

Retrieves the current alternative setting for the specified interface, via a GET INTERFACE standard request to the attached device.

Note
After this routine returns, the control pipe will be selected.
Parameters
[in] | InterfaceIndex | Index of the interface whose alternative setting is to be altered.
[out] | AltSetting | Pointer to a location where the retrieved alternative setting value should be stored.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_SendControlRequest ( void *const BufferPtr )

Sends the request stored in the USB_ControlRequest global structure to the attached device, and transfers the data stored in the buffer to the device, or from the device to the buffer as requested. The transfer is made on the currently selected pipe.

Parameters
[in] BufferPtr Pointer to the start of the data buffer if the request has a data stage, or NULL if the request transfers no data to or from the device.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_SetDeviceConfiguration ( const uint8_t ConfigNumber )

Sends a SET CONFIGURATION standard request to the attached device, with the given configuration index.

This routine will automatically update the USB_HostState and USB_Host_ConfigurationNumber state variables according to the given function parameters and the result of the request.

Note
After this routine returns, the control pipe will be selected.
Parameters
[in] ConfigNumber Configuration index to send to the device.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.
uint8_t USB_Host_SetInterfaceAltSetting | ( | const uint8_t | InterfaceIndex,
 |  | const uint8_t | AltSetting
 | ) |  |

Selects a given alternative setting for the specified interface, via a SET INTERFACE standard request to the attached device.

Note
After this routine returns, the control pipe will be selected.
Parameters
[in] | InterfaceIndex | Index of the interface whose alternative setting is to be altered.
[in] | AltSetting | Index of the interface's alternative setting which is to be selected.
Returns
A value from the USB_Host_SendControlErrorCodes_t enum to indicate the result.


XMC USB Library: USB_Pipe_Table_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
USB_Pipe_Table_t Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » Pipe Management

#include <Pipe.h>

Data Fields

uint8_t | Address
uint16_t | Size
uint8_t | EndpointAddress
uint8_t | Type
uint8_t | Banks

Detailed Description

Type define for a pipe table entry, used to configure pipes in groups via Pipe_ConfigurePipeTable().

Field Documentation

uint8_t Address

Address of the pipe to configure, or zero if the table entry is to be unused.

uint8_t Banks

Number of hardware banks to use for the pipe.

uint8_t EndpointAddress

Address of the endpoint in the connected device.

uint16_t Size

Size of the pipe bank, in bytes.

uint8_t Type

Type of the endpoint, a EP_TYPE_* mask.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Core/Pipe.h


XMC USB Library: USB Descriptors

Modules | Macros | Typedefs | Enumerations
USB Descriptors
USB Core - LUFA/Drivers/USB/USB.h

Standard USB Descriptor definitions. More...

Modules

Configuration Descriptor Parser
USB Configuration Descriptor definitions.

Macros

#define | NO_DESCRIPTOR 0
#define | USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
#define | USB_STRING_LEN(UnicodeChars) (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1))
#define | USB_STRING_DESCRIPTOR(String) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String }
#define | USB_STRING_DESCRIPTOR_ARRAY(...) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} }
#define | VERSION_BCD(Major, Minor, Revision)
#define | LANGUAGE_ID_ENG 0x0409

Typedefs

struct {
uint8_t Size
uint8_t Type
} USB_Descriptor_Header_t
Standard USB Descriptor Header (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
} USB_StdDescriptor_Header_t
Standard USB Descriptor Header (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint16_t USBSpecification
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t Endpoint0Size
uint16_t VendorID
uint16_t ProductID
uint16_t ReleaseNumber
uint8_t ManufacturerStrIndex
uint8_t ProductStrIndex
uint8_t SerialNumStrIndex
uint8_t NumberOfConfigurations
} USB_Descriptor_Device_t
Standard USB Device Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdUSB
uint8_t bDeviceClass
uint8_t bDeviceSubClass
uint8_t bDeviceProtocol
uint8_t bMaxPacketSize0
uint16_t idVendor
uint16_t idProduct
uint16_t bcdDevice
uint8_t iManufacturer
uint8_t iProduct
uint8_t iSerialNumber
uint8_t bNumConfigurations
} USB_StdDescriptor_Device_t
Standard USB Device Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint16_t USBSpecification
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t Endpoint0Size
uint8_t NumberOfConfigurations
uint8_t Reserved
} USB_Descriptor_DeviceQualifier_t
Standard USB Device Qualifier Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdUSB
uint8_t bDeviceClass
uint8_t bDeviceSubClass
uint8_t bDeviceProtocol
uint8_t bMaxPacketSize0
uint8_t bNumConfigurations
uint8_t bReserved
} USB_StdDescriptor_DeviceQualifier_t
Standard USB Device Qualifier Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint16_t TotalConfigurationSize
uint8_t TotalInterfaces
uint8_t ConfigurationNumber
uint8_t ConfigurationStrIndex
uint8_t ConfigAttributes
uint8_t MaxPowerConsumption
} USB_Descriptor_Configuration_Header_t
Standard USB Configuration Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t wTotalLength
uint8_t bNumInterfaces
uint8_t bConfigurationValue
uint8_t iConfiguration
uint8_t bmAttributes
uint8_t bMaxPower
} USB_StdDescriptor_Configuration_Header_t
Standard USB Configuration Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t InterfaceNumber
uint8_t AlternateSetting
uint8_t TotalEndpoints
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t InterfaceStrIndex
} USB_Descriptor_Interface_t
Standard USB Interface Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bInterfaceNumber
uint8_t bAlternateSetting
uint8_t bNumEndpoints
uint8_t bInterfaceClass
uint8_t bInterfaceSubClass
uint8_t bInterfaceProtocol
uint8_t iInterface
} USB_StdDescriptor_Interface_t
Standard USB Interface Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t FirstInterfaceIndex
uint8_t TotalInterfaces
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t IADStrIndex
} USB_Descriptor_Interface_Association_t
Standard USB Interface Association Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bFirstInterface
uint8_t bInterfaceCount
uint8_t bFunctionClass
uint8_t bFunctionSubClass
uint8_t bFunctionProtocol
uint8_t iFunction
} USB_StdDescriptor_Interface_Association_t
Standard USB Interface Association Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t EndpointAddress
uint8_t Attributes
uint16_t EndpointSize
uint8_t PollingIntervalMS
} USB_Descriptor_Endpoint_t
Standard USB Endpoint Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bEndpointAddress
uint8_t bmAttributes
uint16_t wMaxPacketSize
uint8_t bInterval
} USB_StdDescriptor_Endpoint_t
Standard USB Endpoint Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
wchar_t UnicodeString [MAX_ALLOC]
} USB_Descriptor_String_t
Standard USB String Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bString []
} USB_StdDescriptor_String_t
Standard USB String Descriptor (USB-IF naming conventions). More...

Enumerations

enum USB_DescriptorTypes_t {
DTYPE_Device = 0x01, DTYPE_Configuration = 0x02, DTYPE_String = 0x03, DTYPE_Interface = 0x04,
DTYPE_Endpoint = 0x05, DTYPE_DeviceQualifier = 0x06, DTYPE_Other = 0x07, DTYPE_InterfacePower = 0x08,
DTYPE_InterfaceAssociation = 0x0B, DTYPE_CSInterface = 0x24, DTYPE_CSEndpoint = 0x25
}
enum USB_Descriptor_ClassSubclassProtocol_t {
USB_CSCP_NoDeviceClass = 0x00, USB_CSCP_NoDeviceSubclass = 0x00, USB_CSCP_NoDeviceProtocol = 0x00, USB_CSCP_VendorSpecificClass = 0xFF,
USB_CSCP_VendorSpecificSubclass = 0xFF, USB_CSCP_VendorSpecificProtocol = 0xFF, USB_CSCP_IADDeviceClass = 0xEF, USB_CSCP_IADDeviceSubclass = 0x02,
USB_CSCP_IADDeviceProtocol = 0x01
}

USB Configuration Descriptor Attribute Masks

#define | USB_CONFIG_ATTR_RESERVED 0x80
#define | USB_CONFIG_ATTR_SELFPOWERED 0x40
#define | USB_CONFIG_ATTR_REMOTEWAKEUP 0x20

Endpoint Descriptor Attribute Masks

#define | ENDPOINT_ATTR_NO_SYNC (0 << 2)
#define | ENDPOINT_ATTR_ASYNC (1 << 2)
#define | ENDPOINT_ATTR_ADAPTIVE (2 << 2)
#define | ENDPOINT_ATTR_SYNC (3 << 2)

Endpoint Descriptor Usage Masks

#define | ENDPOINT_USAGE_DATA (0 << 4)
#define | ENDPOINT_USAGE_FEEDBACK (1 << 4)
#define | ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)

Detailed Description

Standard USB Descriptor definitions.

Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains structures and macros for the easy creation of standard USB descriptors in USB device projects.

Macro Definition Documentation

#define ENDPOINT_ATTR_ADAPTIVE (2 << 2)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is adaptive.

See also
The USB specification for more details on the possible Endpoint attributes.
#define ENDPOINT_ATTR_ASYNC (1 << 2)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is asynchronous.

See also
The USB specification for more details on the possible Endpoint attributes.
#define ENDPOINT_ATTR_NO_SYNC (0 << 2)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is not synchronized.

See also
The USB specification for more details on the possible Endpoint attributes.
#define ENDPOINT_ATTR_SYNC (3 << 2)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is synchronized.

See also
The USB specification for more details on the possible Endpoint attributes.
#define ENDPOINT_USAGE_DATA (0 << 4)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is used for data transfers.

See also
The USB specification for more details on the possible Endpoint usage attributes.
#define ENDPOINT_USAGE_FEEDBACK (1 << 4)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is used for feedback.

See also
The USB specification for more details on the possible Endpoint usage attributes.
#define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)

Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's Attributes value to indicate that the specified endpoint is used for implicit feedback.

See also
The USB specification for more details on the possible Endpoint usage attributes.
#define LANGUAGE_ID_ENG 0x0409

String language ID for the English language. Should be used in USB_Descriptor_String_t descriptors to indicate that the English language is supported by the device in its string descriptors.

#define NO_DESCRIPTOR 0

Indicates that a given descriptor does not exist in the device. This can be used inside descriptors for string descriptor indexes, or may be use as a return value for GetDescriptor when the specified descriptor does not exist.

#define USB_CONFIG_ATTR_REMOTEWAKEUP 0x20

Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t descriptor's ConfigAttributes value to indicate that the specified configuration supports the remote wakeup feature of the USB standard, allowing a suspended USB device to wake up the host upon request.

#define USB_CONFIG_ATTR_RESERVED 0x80

Mask for the reserved bit in the Configuration Descriptor's ConfigAttributes field, which must be set on all devices for historical purposes.

#define USB_CONFIG_ATTR_SELFPOWERED 0x40

Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power from the device's own power source.

#define USB_CONFIG_POWER_MA ( mA ) ((mA) >> 1)

Macro to calculate the power value for the configuration descriptor, from a given number of milliamperes.

Parameters
[in] mA Maximum number of milliamps the device consumes when the given configuration is selected.
#define USB_STRING_DESCRIPTOR ( String ) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String }

Convenience macro to easily create USB_Descriptor_String_t instances from a wide character string.

Note
This macro is for little-endian systems only.
Parameters
[in] String String to initialize a USB String Descriptor structure with.
#define USB_STRING_DESCRIPTOR_ARRAY ( ... ) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} }

Convenience macro to easily create USB_Descriptor_String_t instances from an array of characters.

Parameters
[in] ... Characters to initialize a USB String Descriptor structure with.
#define USB_STRING_LEN ( UnicodeChars ) (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1))

Macro to calculate the Unicode length of a string with a given number of Unicode characters. Should be used in string descriptor's headers for giving the string descriptor's byte length.

Parameters
[in] UnicodeChars Number of Unicode characters in the string text.
#define VERSION_BCD | ( | Major,
 |  | Minor,
 |  | Revision
 | ) |
Value:
CPU_TO_LE16( ((Major & 0xFF) << 8) | \
((Minor & 0x0F) << 4) | \
(Revision & 0x0F) )
CPU_TO_LE16
#define CPU_TO_LE16(x)
Definition: Endianness.h:338

Macro to encode a given major/minor/revision version number into Binary Coded Decimal format for descriptor fields requiring BCD encoding, such as the USB version number in the standard device descriptor.

Note
This value is automatically converted into Little Endian, suitable for direct use inside device descriptors on all architectures without endianness conversion macros.
Parameters
[in] | Major | Major version number to encode.
[in] | Minor | Minor version number to encode.
[in] | Revision | Revision version number to encode.

Typedef Documentation

typedef { ... } USB_Descriptor_Configuration_Header_t

Standard USB Configuration Descriptor (LUFA naming conventions).

Type define for a standard Configuration Descriptor header. This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_Configuration_Header_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_Descriptor_Device_t

Standard USB Device Descriptor (LUFA naming conventions).

Type define for a standard Device Descriptor. This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_Device_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_Descriptor_DeviceQualifier_t

Standard USB Device Qualifier Descriptor (LUFA naming conventions).

Type define for a standard Device Qualifier Descriptor. This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_DeviceQualifier_t for the version of this type with standard element names.
typedef { ... } USB_Descriptor_Endpoint_t

Standard USB Endpoint Descriptor (LUFA naming conventions).

Type define for a standard Endpoint Descriptor. This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_Endpoint_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_Descriptor_Header_t

Standard USB Descriptor Header (LUFA naming conventions).

Type define for all descriptors' standard header, indicating the descriptor's length and type. This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_Header_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_Descriptor_Interface_Association_t

Standard USB Interface Association Descriptor (LUFA naming conventions).

Type define for a standard Interface Association Descriptor. This structure uses LUFA-specific element names to make each element's purpose clearer.

This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf. It allows composite devices with multiple interfaces related to the same function to have the multiple interfaces bound together at the point of enumeration, loading one generic driver for all the interfaces in the single function. Read the ECN for more information.

See also
USB_StdDescriptor_Interface_Association_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_Descriptor_Interface_t

Standard USB Interface Descriptor (LUFA naming conventions).

Type define for a standard Interface Descriptor. This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_Interface_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_Descriptor_String_t

Standard USB String Descriptor (LUFA naming conventions).

Type define for a standard string descriptor. Unlike other standard descriptors, the length of the descriptor for placement in the descriptor header must be determined by the USB_STRING_LEN() macro rather than by the size of the descriptor structure, as the length is not fixed.

This structure should also be used for string index 0, which contains the supported language IDs for the device as an array.

This structure uses LUFA-specific element names to make each element's purpose clearer.

See also
USB_StdDescriptor_String_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_Configuration_Header_t

Standard USB Configuration Descriptor (USB-IF naming conventions).

Type define for a standard Configuration Descriptor header. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_Device_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_Device_t

Standard USB Device Descriptor (USB-IF naming conventions).

Type define for a standard Device Descriptor. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_Device_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_DeviceQualifier_t

Standard USB Device Qualifier Descriptor (USB-IF naming conventions).

Type define for a standard Device Qualifier Descriptor. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_DeviceQualifier_t for the version of this type with non-standard LUFA specific element names.
typedef { ... } USB_StdDescriptor_Endpoint_t

Standard USB Endpoint Descriptor (USB-IF naming conventions).

Type define for a standard Endpoint Descriptor. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_Endpoint_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_Header_t

Standard USB Descriptor Header (USB-IF naming conventions).

Type define for all descriptors' standard header, indicating the descriptor's length and type. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_Header_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_Interface_Association_t

Standard USB Interface Association Descriptor (USB-IF naming conventions).

Type define for a standard Interface Association Descriptor. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf. It allows composite devices with multiple interfaces related to the same function to have the multiple interfaces bound together at the point of enumeration, loading one generic driver for all the interfaces in the single function. Read the ECN for more information.

See also
USB_Descriptor_Interface_Association_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_Interface_t

Standard USB Interface Descriptor (USB-IF naming conventions).

Type define for a standard Interface Descriptor. This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_Interface_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_StdDescriptor_String_t

Standard USB String Descriptor (USB-IF naming conventions).

Type define for a standard string descriptor. Unlike other standard descriptors, the length of the descriptor for placement in the descriptor header must be determined by the USB_STRING_LEN() macro rather than by the size of the descriptor structure, as the length is not fixed.

This structure should also be used for string index 0, which contains the supported language IDs for the device as an array.

This structure uses the relevant standard's given element names to ensure compatibility with the standard.

See also
USB_Descriptor_String_t for the version of this type with with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.

Enumeration Type Documentation

enum USB_Descriptor_ClassSubclassProtocol_t

Enum for possible Class, Subclass and Protocol values of device and interface descriptors.

Enumerator
USB_CSCP_NoDeviceClass | Descriptor Class value indicating that the device does not belong to a particular class at the device level.
USB_CSCP_NoDeviceSubclass | Descriptor Subclass value indicating that the device does not belong to a particular subclass at the device level.
USB_CSCP_NoDeviceProtocol | Descriptor Protocol value indicating that the device does not belong to a particular protocol at the device level.
USB_CSCP_VendorSpecificClass | Descriptor Class value indicating that the device/interface belongs to a vendor specific class.
USB_CSCP_VendorSpecificSubclass | Descriptor Subclass value indicating that the device/interface belongs to a vendor specific subclass.
USB_CSCP_VendorSpecificProtocol | Descriptor Protocol value indicating that the device/interface belongs to a vendor specific protocol.
USB_CSCP_IADDeviceClass | Descriptor Class value indicating that the device belongs to the Interface Association Descriptor class.
USB_CSCP_IADDeviceSubclass | Descriptor Subclass value indicating that the device belongs to the Interface Association Descriptor subclass.
USB_CSCP_IADDeviceProtocol | Descriptor Protocol value indicating that the device belongs to the Interface Association Descriptor protocol.
enum USB_DescriptorTypes_t

Enum for the possible standard descriptor types, as given in each descriptor's header.

Enumerator
DTYPE_Device | Indicates that the descriptor is a device descriptor.
DTYPE_Configuration | Indicates that the descriptor is a configuration descriptor.
DTYPE_String | Indicates that the descriptor is a string descriptor.
DTYPE_Interface | Indicates that the descriptor is an interface descriptor.
DTYPE_Endpoint | Indicates that the descriptor is an endpoint descriptor.
DTYPE_DeviceQualifier | Indicates that the descriptor is a device qualifier descriptor.
DTYPE_Other | Indicates that the descriptor is of other type.
DTYPE_InterfacePower | Indicates that the descriptor is an interface power descriptor.
DTYPE_InterfaceAssociation | Indicates that the descriptor is an interface association descriptor.
DTYPE_CSInterface | Indicates that the descriptor is a class specific interface descriptor.
DTYPE_CSEndpoint | Indicates that the descriptor is a class specific endpoint descriptor.


XMC USB Library: Configuration Descriptor Parser

Macros | Typedefs | Enumerations | Functions
Configuration Descriptor Parser
USB Core - LUFA/Drivers/USB/USB.h » USB Descriptors

USB Configuration Descriptor definitions. More...

Macros

#define | DESCRIPTOR_PCAST(DescriptorPtr, Type) ((Type*)(DescriptorPtr))
#define | DESCRIPTOR_CAST(DescriptorPtr, Type) (*DESCRIPTOR_PCAST(DescriptorPtr, Type))
#define | DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Type
#define | DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Size

Typedefs

typedef uint8_t(* ConfigComparatorPtr_t) (void *)

Enumerations

enum USB_Host_GetConfigDescriptor_ErrorCodes_t {
HOST_GETCONFIG_Successful = 0, HOST_GETCONFIG_DeviceDisconnect = 1, HOST_GETCONFIG_PipeError = 2, HOST_GETCONFIG_SetupStalled = 3,
HOST_GETCONFIG_SoftwareTimeOut = 4, HOST_GETCONFIG_BuffOverflow = 5, HOST_GETCONFIG_InvalidData = 6
}
enum | DSearch_Return_ErrorCodes_t { DESCRIPTOR_SEARCH_Found = 0, DESCRIPTOR_SEARCH_Fail = 1, DESCRIPTOR_SEARCH_NotFound = 2 }
enum | DSearch_Comp_Return_ErrorCodes_t { DESCRIPTOR_SEARCH_COMP_Found = 0, DESCRIPTOR_SEARCH_COMP_Fail = 1, DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2 }

Functions

uint8_t | USB_Host_GetDeviceConfigDescriptor (const uint8_t ConfigNumber, uint16_t *const ConfigSizePtr, void *const BufferPtr, const uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3)
void | USB_GetNextDescriptorOfType (uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
void | USB_GetNextDescriptorOfTypeBefore (uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type, const uint8_t BeforeType) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
void | USB_GetNextDescriptorOfTypeAfter (uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type, const uint8_t AfterType) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
uint8_t | USB_GetNextDescriptorComp (uint16_t *const BytesRem, void **const CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3)

Detailed Description

USB Configuration Descriptor definitions.

This section of the library gives a friendly API which can be used in host applications to easily parse an attached device's configuration descriptor so that endpoint, interface and other descriptor data can be extracted and used as needed.

Macro Definition Documentation

#define DESCRIPTOR_CAST | ( | DescriptorPtr,
 |  | Type
 | ) | (*DESCRIPTOR_PCAST(DescriptorPtr, Type))

Casts a pointer to a descriptor inside the configuration descriptor into the given descriptor type (as an actual struct instance rather than a pointer to a struct).

Usage Example:

1 uint8_t* CurrDescriptor = &ConfigDescriptor[0]; // Pointing to the configuration header
2 USB_Descriptor_Configuration_Header_t ConfigHeader = DESCRIPTOR_CAST(CurrDescriptor,
3 USB_Descriptor_Configuration_Header_t);
4
5 // Can now access elements of the configuration header struct using the . operator
#define DESCRIPTOR_PCAST | ( | DescriptorPtr,
 |  | Type
 | ) | ((Type*)(DescriptorPtr))

Casts a pointer to a descriptor inside the configuration descriptor into a pointer to the given descriptor type.

Usage Example:

1 uint8_t* CurrDescriptor = &ConfigDescriptor[0]; // Pointing to the configuration header
2 USB_Descriptor_Configuration_Header_t* ConfigHeaderPtr = DESCRIPTOR_PCAST(CurrDescriptor,
3 USB_Descriptor_Configuration_Header_t);
4
5 // Can now access elements of the configuration header struct using the -> indirection operator
#define DESCRIPTOR_SIZE ( DescriptorPtr ) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Size

Returns the descriptor's size, expressed as the 8-bit value indicating the number of bytes.

#define DESCRIPTOR_TYPE ( DescriptorPtr ) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Type

Returns the descriptor's type, expressed as the 8-bit type value in the header of the descriptor. This value's meaning depends on the descriptor's placement in the descriptor, but standard type values can be accessed in the USB_DescriptorTypes_t enum.

Typedef Documentation

typedef uint8_t(* ConfigComparatorPtr_t) (void *)

Type define for a Configuration Descriptor comparator function (function taking a pointer to an array of type void, returning a uint8_t value).

See also
USB_GetNextDescriptorComp function for more details.

Enumeration Type Documentation

enum DSearch_Comp_Return_ErrorCodes_t

Enum for return values of USB_GetNextDescriptorComp().

Enumerator
DESCRIPTOR_SEARCH_COMP_Found | Configuration descriptor now points to descriptor which matches search criteria of the given comparator function.
DESCRIPTOR_SEARCH_COMP_Fail | Comparator function returned DESCRIPTOR_SEARCH_Fail.
DESCRIPTOR_SEARCH_COMP_EndOfDescriptor | End of configuration descriptor reached before match found.
enum DSearch_Return_ErrorCodes_t

Enum for return values of a descriptor comparator function.

Enumerator
DESCRIPTOR_SEARCH_Found | Current descriptor matches comparator criteria.
DESCRIPTOR_SEARCH_Fail | No further descriptor could possibly match criteria, fail the search.
DESCRIPTOR_SEARCH_NotFound | Current descriptor does not match comparator criteria.
enum USB_Host_GetConfigDescriptor_ErrorCodes_t

Enum for the possible return codes of the USB_Host_GetDeviceConfigDescriptor() function.

Enumerator
HOST_GETCONFIG_Successful | No error occurred while retrieving the configuration descriptor.
HOST_GETCONFIG_DeviceDisconnect | The attached device was disconnected while retrieving the configuration descriptor.
HOST_GETCONFIG_PipeError | An error occurred in the pipe while sending the request.
HOST_GETCONFIG_SetupStalled | The attached device stalled the request to retrieve the configuration descriptor.
HOST_GETCONFIG_SoftwareTimeOut | The request or data transfer timed out.
HOST_GETCONFIG_BuffOverflow | The device's configuration descriptor is too large to fit into the allocated buffer.
HOST_GETCONFIG_InvalidData | The device returned invalid configuration descriptor data.

Function Documentation

uint8_t USB_GetNextDescriptorComp | ( | uint16_t *const | BytesRem,
 |  | void **const | CurrConfigLoc,
 |  | ConfigComparatorPtr_t const | ComparatorRoutine
 | ) |  |

Searches for the next descriptor in the given configuration descriptor using a pre-made comparator function. The routine updates the position and remaining configuration descriptor bytes values automatically. If a comparator routine fails a search, the descriptor pointer is retreated back so that the next descriptor search invocation will start from the descriptor which first caused the original search to fail. This behavior allows for one comparator to be used immediately after another has failed, starting the second search from the descriptor which failed the first.

Comparator functions should be standard functions which accept a pointer to the header of the current descriptor inside the configuration descriptor which is being compared, and should return a value from the DSearch_Return_ErrorCodes_t enum as a uint8_t value.

Note
This function is available in USB Host mode only.
Parameters
[in,out] | BytesRem | Pointer to an int storing the remaining bytes in the configuration descriptor.
[in,out] | CurrConfigLoc | Pointer to the current position in the configuration descriptor.
[in] | ComparatorRoutine | Name of the comparator search function to use on the configuration descriptor.
Returns
Value of one of the members of the DSearch_Comp_Return_ErrorCodes_t enum.

Usage Example:

1 uint8_t EndpointSearcher(void* CurrentDescriptor); // Comparator Prototype
2
3 uint8_t EndpointSearcher(void* CurrentDescriptor)
4 {
5 if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
6 return DESCRIPTOR_SEARCH_Found;
7 else
8 return DESCRIPTOR_SEARCH_NotFound;
9 }
10
11 //...
12
13 // After retrieving configuration descriptor:
14 if (USB_Host_GetNextDescriptorComp(&BytesRemaining, &CurrentConfigLoc, EndpointSearcher) ==
15 Descriptor_Search_Comp_Found)
16 {
17 // Do something with the endpoint descriptor
18 }
void USB_GetNextDescriptorOfType | ( | uint16_t *const | BytesRem,
 |  | void **const | CurrConfigLoc,
 |  | const uint8_t | Type
 | ) |  |

Skips to the next sub-descriptor inside the configuration descriptor of the specified type value. The bytes remaining value is automatically decremented.

Parameters
[in,out] | BytesRem | Pointer to the number of bytes remaining of the configuration descriptor.
[in,out] | CurrConfigLoc | Pointer to the current descriptor inside the configuration descriptor.
[in] | Type | Descriptor type value to search for.
void USB_GetNextDescriptorOfTypeAfter | ( | uint16_t *const | BytesRem,
 |  | void **const | CurrConfigLoc,
 |  | const uint8_t | Type,
 |  | const uint8_t | AfterType
 | ) |  |

Skips to the next sub-descriptor inside the configuration descriptor of the specified type value, which must come after a descriptor of the second given type value. The bytes remaining value is automatically decremented.

Parameters
[in,out] | BytesRem | Pointer to the number of bytes remaining of the configuration descriptor.
[in,out] | CurrConfigLoc | Pointer to the current descriptor inside the configuration descriptor.
[in] | Type | Descriptor type value to search for.
[in] | AfterType | Descriptor type value which must be reached before the given Type descriptor.
void USB_GetNextDescriptorOfTypeBefore | ( | uint16_t *const | BytesRem,
 |  | void **const | CurrConfigLoc,
 |  | const uint8_t | Type,
 |  | const uint8_t | BeforeType
 | ) |  |

Skips to the next sub-descriptor inside the configuration descriptor of the specified type value, which must come before a descriptor of the second given type value. If the BeforeType type descriptor is reached first, the number of bytes remaining to process is set to zero and the function exits. The bytes remaining value is automatically decremented.

Parameters
[in,out] | BytesRem | Pointer to the number of bytes remaining of the configuration descriptor.
[in,out] | CurrConfigLoc | Pointer to the current descriptor inside the configuration descriptor.
[in] | Type | Descriptor type value to search for.
[in] | BeforeType | Descriptor type value which must not be reached before the given Type descriptor.
uint8_t USB_Host_GetDeviceConfigDescriptor | ( | const uint8_t | ConfigNumber,
 |  | uint16_t *const | ConfigSizePtr,
 |  | void *const | BufferPtr,
 |  | const uint16_t | BufferSize
 | ) |  |

Retrieves the configuration descriptor data from an attached device via a standard request into a buffer, including validity and size checking to prevent a buffer overflow.

Parameters
[in] | ConfigNumber | Device configuration descriptor number to fetch from the device (usually set to 1 for single configuration devices).
[in,out] | ConfigSizePtr | Pointer to a location for storing the retrieved configuration descriptor size.
[out] | BufferPtr | Pointer to the buffer for storing the configuration descriptor data.
[out] | BufferSize | Size of the allocated buffer where the configuration descriptor is to be stored.
Returns
A value from the USB_Host_GetConfigDescriptor_ErrorCodes_t enum.


XMC USB Library: Standard USB Requests

Macros | Typedefs | Enumerations
Standard USB Requests
USB Core - LUFA/Drivers/USB/USB.h

USB control endpoint request definitions. More...

Macros

#define | CONTROL_REQTYPE_DIRECTION 0x80
#define | CONTROL_REQTYPE_TYPE 0x60
#define | CONTROL_REQTYPE_RECIPIENT 0x1F
#define | FEATURE_SELFPOWERED_ENABLED (1 << 0)
#define | FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1)

Typedefs

struct {
uint8_t bmRequestType
uint8_t bRequest
uint16_t wValue
uint16_t wIndex
uint16_t wLength
} USB_Request_Header_t
Standard USB Control Request. More...

Enumerations

enum USB_Control_Request_t {
REQ_GetStatus = 0, REQ_ClearFeature = 1, REQ_SetFeature = 3, REQ_SetAddress = 5,
REQ_GetDescriptor = 6, REQ_SetDescriptor = 7, REQ_GetConfiguration = 8, REQ_SetConfiguration = 9,
REQ_GetInterface = 10, REQ_SetInterface = 11, REQ_SynchFrame = 12
}
enum USB_Feature_Selectors_t { FEATURE_SEL_EndpointHalt = 0x00, FEATURE_SEL_DeviceRemoteWakeup = 0x01, FEATURE_SEL_TestMode = 0x02 }

Control Request Data Direction Masks

#define | REQDIR_HOSTTODEVICE (0 << 7)
#define | REQDIR_DEVICETOHOST (1 << 7)

Control Request Type Masks

#define | REQTYPE_STANDARD (0 << 5)
#define | REQTYPE_CLASS (1 << 5)
#define | REQTYPE_VENDOR (2 << 5)

Control Request Recipient Masks

#define | REQREC_DEVICE (0 << 0)
#define | REQREC_INTERFACE (1 << 0)
#define | REQREC_ENDPOINT (2 << 0)
#define | REQREC_OTHER (3 << 0)

Detailed Description

USB control endpoint request definitions.

This module contains definitions for the various control request parameters, so that the request details (such as data direction, request recipient, etc.) can be extracted via masking.

Macro Definition Documentation

#define CONTROL_REQTYPE_DIRECTION 0x80

Mask for the request type parameter, to indicate the direction of the request data (Host to Device or Device to Host). The result of this mask should then be compared to the request direction masks.

See also
REQDIR_* macros for masks indicating the request data direction.
#define CONTROL_REQTYPE_RECIPIENT 0x1F

Mask for the request type parameter, to indicate the recipient of the request (Device, Interface Endpoint or Other). The result of this mask should then be compared to the request recipient masks.

See also
REQREC_* macros for masks indicating the request recipient.
#define CONTROL_REQTYPE_TYPE 0x60

Mask for the request type parameter, to indicate the type of request (Device, Class or Vendor Specific). The result of this mask should then be compared to the request type masks.

See also
REQTYPE_* macros for masks indicating the request type.
#define REQDIR_DEVICETOHOST (1 << 7)

Request data direction mask, indicating that the request data will flow from device to host.

See also
CONTROL_REQTYPE_DIRECTION macro.
#define REQDIR_HOSTTODEVICE (0 << 7)

Request data direction mask, indicating that the request data will flow from host to device.

See also
CONTROL_REQTYPE_DIRECTION macro.
#define REQREC_DEVICE (0 << 0)

Request recipient mask, indicating that the request is to be issued to the device as a whole.

See also
CONTROL_REQTYPE_RECIPIENT macro.
#define REQREC_ENDPOINT (2 << 0)

Request recipient mask, indicating that the request is to be issued to an endpoint in the currently selected configuration.

See also
CONTROL_REQTYPE_RECIPIENT macro.
#define REQREC_INTERFACE (1 << 0)

Request recipient mask, indicating that the request is to be issued to an interface in the currently selected configuration.

See also
CONTROL_REQTYPE_RECIPIENT macro.
#define REQREC_OTHER (3 << 0)

Request recipient mask, indicating that the request is to be issued to an unspecified element in the currently selected configuration.

See also
CONTROL_REQTYPE_RECIPIENT macro.
#define REQTYPE_CLASS (1 << 5)

Request type mask, indicating that the request is a class-specific request.

See also
CONTROL_REQTYPE_TYPE macro.
#define REQTYPE_STANDARD (0 << 5)

Request type mask, indicating that the request is a standard request.

See also
CONTROL_REQTYPE_TYPE macro.
#define REQTYPE_VENDOR (2 << 5)

Request type mask, indicating that the request is a vendor specific request.

See also
CONTROL_REQTYPE_TYPE macro.

Typedef Documentation

typedef { ... } USB_Request_Header_t

Standard USB Control Request.

Type define for a standard USB control request.

See also
The USB 2.0 specification for more information on standard control requests.

Enumeration Type Documentation

enum USB_Control_Request_t

Enumeration for the various standard request commands. These commands are applicable when the request type is REQTYPE_STANDARD (with the exception of REQ_GetDescriptor, which is always handled regardless of the request type value).

See also
Chapter 9 of the USB 2.0 Specification.
Enumerator
REQ_GetStatus | Implemented in the library for device and endpoint recipients. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_ClearFeature | Implemented in the library for device and endpoint recipients. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_SetFeature | Implemented in the library for device and endpoint recipients. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_SetAddress | Implemented in the library for the device recipient. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_GetDescriptor | Implemented in the library for device and interface recipients. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_SetDescriptor | Not implemented in the library, passed to the user application via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_GetConfiguration | Implemented in the library for the device recipient. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_SetConfiguration | Implemented in the library for the device recipient. Passed to the user application for other recipients via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_GetInterface | Not implemented in the library, passed to the user application via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_SetInterface | Not implemented in the library, passed to the user application via the EVENT_USB_Device_ControlRequest() event when received in device mode.
REQ_SynchFrame | Not implemented in the library, passed to the user application via the EVENT_USB_Device_ControlRequest() event when received in device mode.
enum USB_Feature_Selectors_t

Feature Selector values for Set Feature and Clear Feature standard control requests directed to the device, interface and endpoint recipients.

Enumerator
FEATURE_SEL_EndpointHalt | Feature selector for Clear Feature or Set Feature commands. When used in a Set Feature or Clear Feature request this indicates that an endpoint (whose address is given elsewhere in the request) should have its stall condition changed.
FEATURE_SEL_DeviceRemoteWakeup | Feature selector for Device level Remote Wakeup enable set or clear. This feature can be controlled by the host on devices which indicate remote wakeup support in their descriptors to selectively disable or enable remote wakeup.
FEATURE_SEL_TestMode | Feature selector for Test Mode features, used to test the USB controller to check for incorrect operation.


XMC USB Library: USB Interface Management

Modules | Enumerations | Functions | Variables
USB Interface Management
USB Core - LUFA/Drivers/USB/USB.h

USB Controller definitions for general USB controller management. More...

Modules

USB Interface Management (XMC4000)
USB Controller definitions for the Infineon XMC4000 microcontrollers.

Enumerations

enum USB_Modes_t { USB_MODE_None = 0, USB_MODE_Device = 1, USB_MODE_Host = 2, USB_MODE_UID = 3 }

Functions

void USB_USBTask (void)

Variables

volatile bool USB_IsInitialized
USB_Request_Header_t USB_ControlRequest

Endpoint Direction Masks

#define | ENDPOINT_DIR_MASK 0x80
#define | ENDPOINT_DIR_OUT 0x00
#define | ENDPOINT_DIR_IN 0x80

Pipe Direction Masks

#define | PIPE_DIR_MASK 0x80
#define | PIPE_DIR_OUT 0x00
#define | PIPE_DIR_IN 0x80

Endpoint/Pipe Type Masks

#define | EP_TYPE_MASK 0x03
#define | EP_TYPE_CONTROL 0x00
#define | EP_TYPE_ISOCHRONOUS 0x01
#define | EP_TYPE_BULK 0x02
#define | EP_TYPE_INTERRUPT 0x03

Detailed Description

USB Controller definitions for general USB controller management.

Functions, macros, variables, enums and types related to the setup and management of the USB interface.

Macro Definition Documentation

#define ENDPOINT_DIR_IN 0x80

Endpoint address direction mask for an IN direction (Device to Host) endpoint. This may be ORed with the index of the address within a device to obtain the full endpoint address.

#define ENDPOINT_DIR_MASK 0x80

Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's direction for comparing with the ENDPOINT_DIR_* masks.

#define ENDPOINT_DIR_OUT 0x00

Endpoint address direction mask for an OUT direction (Host to Device) endpoint. This may be ORed with the index of the address within a device to obtain the full endpoint address.

#define EP_TYPE_BULK 0x02

Mask for a BULK type endpoint or pipe.

Note
See Endpoint Management and Pipe Management for endpoint/pipe functions.
#define EP_TYPE_CONTROL 0x00

Mask for a CONTROL type endpoint or pipe.

Note
See Endpoint Management and Pipe Management for endpoint/pipe functions.
#define EP_TYPE_INTERRUPT 0x03

Mask for an INTERRUPT type endpoint or pipe.

Note
See Endpoint Management and Pipe Management for endpoint/pipe functions.
#define EP_TYPE_ISOCHRONOUS 0x01

Mask for an ISOCHRONOUS type endpoint or pipe.

Note
See Endpoint Management and Pipe Management for endpoint/pipe functions.
#define EP_TYPE_MASK 0x03

Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared with the EP_TYPE_* masks to determine the exact type of the endpoint.

#define PIPE_DIR_IN 0x80

Endpoint address direction mask for an IN direction (Device to Host) endpoint. This may be ORed with the index of the address within a device to obtain the full endpoint address.

#define PIPE_DIR_MASK 0x80

Pipe direction mask, for masking against pipe addresses to retrieve the pipe's direction for comparing with the PIPE_DIR_* masks.

#define PIPE_DIR_OUT 0x00

Endpoint address direction mask for an OUT direction (Host to Device) endpoint. This may be ORed with the index of the address within a device to obtain the full endpoint address.

Enumeration Type Documentation

enum USB_Modes_t

Enum for the possible USB controller modes, for initialization via USB_Init() and indication back to the user application via USB_CurrentMode.

Enumerator
USB_MODE_None | Indicates that the controller is currently not initialized in any specific USB mode.
USB_MODE_Device | Indicates that the controller is currently initialized in USB Device mode.
USB_MODE_Host | Indicates that the controller is currently initialized in USB Host mode.
USB_MODE_UID | Indicates that the controller should determine the USB mode from the UID pin of the USB connector.

Function Documentation

void USB_USBTask ( void )

This is the main USB management task. The USB driver requires this task to be executed continuously when the USB system is active (device attached in host mode, or attached to a host in device mode) in order to manage USB communications. This task may be executed inside an RTOS, fast timer ISR or the main user application loop.

The USB task must be serviced within 30ms while in device mode, or within 1ms while in host mode. The task may be serviced at all times, or (for minimum CPU consumption):

  • In device mode, it may be disabled at start-up, enabled on the firing of the EVENT_USB_Device_Connect() event and disabled again on the firing of the EVENT_USB_Device_Disconnect() event.
  • In host mode, it may be disabled at start-up, enabled on the firing of the EVENT_USB_Host_DeviceAttached() event and disabled again on the firing of the EVENT_USB_Host_DeviceEnumerationComplete() or EVENT_USB_Host_DeviceEnumerationFailed() events.

If in device mode (only), the control endpoint can instead be managed via interrupts entirely by the library by defining the INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch.

See also
USB Events for more information on the USB events.

Variable Documentation

USB_Request_Header_t USB_ControlRequest

Structure containing the last received Control request when in Device mode (for use in user-applications inside of the EVENT_USB_Device_ControlRequest() event, or for filling up with a control request to issue when in Host mode before calling USB_Host_SendControlRequest().

Note
The contents of this structure is automatically endian-corrected for the current CPU architecture.
volatile bool USB_IsInitialized

Indicates if the USB interface is currently initialized but not necessarily connected to a host or device (i.e. if USB_Init() has been run). If this is false, all other library globals related to the USB driver are invalid.

Attention
This variable should be treated as read-only in the user application, and never manually changed in value.


XMC USB Library: USB Interface Management (XMC4000)

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
USB Interface Management (XMC4000)
USB Core - LUFA/Drivers/USB/USB.h » USB Interface Management

USB Controller definitions for the Infineon XMC4000 microcontrollers. More...

Data Structures

struct | USBD_Endpoint
USBD Endpoint. More...
struct | USBD_Device
USBD Device. More...

Macros

#define | NO_COPY_DRIVER 0
#define | NUM_INTERFACES 1
#define | ENDPOINT_TOTAL_ENDPOINTS 7

Typedefs

typedef enum EP0_State | EP0_State_t
State machine of Endpoint 0.
typedef struct USBD_Endpoint | USBD_Endpoint_t
USBD Endpoint. More...
typedef struct USBD_Device | USB_Device_t
USBD Device. More...

Enumerations

enum EP0_State {
DISCONNECT, IDLE, IN_DATA, IN_STATUS,
OUT_DATA, OUT_STATUS
}
State machine of Endpoint 0. More...

Functions

int | USBD_Initialize (XMC_USBD_t *usb_init)
Initialize the USB device core driver. More...
void | USBD_SignalDeviceEventHandler (XMC_USBD_EVENT_t event)
Device Event Handler for the device controller driver. More...
void | USBD_SignalEndpointEvent_Handler (uint8_t ep_addr, XMC_USBD_EP_EVENT_t ep_event)
Endpoint Event Handler for the device controller driver. More...
int | USB_IsEnumDone (void)
Is the enumeration done? More...
void | USBD_SetEndpointBuffer (uint8_t Address, uint8_t *Buffer, uint16_t Length)
Configure an USBD Endpoint. More...

Variables

USB_Device_t device

Detailed Description

USB Controller definitions for the Infineon XMC4000 microcontrollers.

Functions, macros, variables, enums and types related to the setup and management of the USB interface.

Macro Definition Documentation

#define ENDPOINT_TOTAL_ENDPOINTS 7

Total number of endpoints (including the default control endpoint at address 0) which may be used in the device.

Typedef Documentation

typedef struct USBD_Device USB_Device_t

USBD Device.

Type define for an USB Device. This structure contains the all data of the device for the USB Device Core Driver. Especially the data of the endpoints are stored inside.

typedef struct USBD_Endpoint USBD_Endpoint_t

USBD Endpoint.

Type define for a USBD Enpoint. This structure represents an endpoint. It contains all necessary data to:

  • control the state of the endpoint
  • manage the data buffer

Enumeration Type Documentation

enum EP0_State

State machine of Endpoint 0.

Enumerator
DISCONNECT | Device is disconnected
IDLE | Endpoint 0 is in IDLE state
IN_DATA | Endpoint 0 is sending data
IN_STATUS | Endpoint 0 sends a acknowledge to the host
OUT_DATA | Endpoint 0 is reading data from the host
OUT_STATUS | Endpoint 0 waits for an acknowledge from the host

Function Documentation

int USB_IsEnumDone ( void )

Is the enumeration done?

Returns 1 if the enumeration is done.

Is the enumeration done?

Tell the USB device controller driver if the enumeration interrupt have been reached

int USBD_Initialize ( XMC_USBD_t * usb_init )

Initialize the USB device core driver.

In preparation for using the USB device this function initializes the device core driver and the device controller driver. It executes all necessary tasks to start working as USB device and handle request from the host.

Note
To start working you need to call USBD_Connect to connect to the host.

Initialize the USB device core driver.

Intializes the USB driver core data structures and sets it into default state. Afterwards it initializes the USB device controller driver and prepare it for connection via USBD_Connect.

void USBD_SetEndpointBuffer | ( | uint8_t | addr,
 |  | uint8_t * | buf,
 |  | uint16_t | len
 | ) |  |

Configure an USBD Endpoint.

Convenience function to configure an endpoint. It sets the address, the transfer buffer and its size and the maximum packet size.

Parameters
[in] | Address | Endpoint address
[in] | Buffer | Endpoint buffer
[in] | Length | Buffer size

Configure an USBD Endpoint.

The user has to ensure the an endpoint has a valid buffer set in order to ensure proper work.

Parameters
[in] | addr | Endpoint address
[in] | buf | Buffer pointer
[in] | len | Buffer length
void USBD_SignalDeviceEventHandler ( XMC_USBD_EVENT_t event )

Device Event Handler for the device controller driver.

Handles device events send by the device controller driver. See USBD_SignalDeviceEvent

Device Event Handler for the device controller driver.

The device can have several events, where it notifies the application about.

Note
Not all events are available on all chip series. (Power Events are only supported on XMC4500)
See also
USB_USBD_EVENT
void USBD_SignalEndpointEvent_Handler | ( | uint8_t | ep_addr,
 |  | XMC_USBD_EP_EVENT_t | ep_event
 | ) |  |

Endpoint Event Handler for the device controller driver.

Handles endpoint events send by the device controller driver. See USBD_SignalEndpointEvent_Handler

Endpoint Event Handler for the device controller driver.

If the driver detects an event (See USB_USBD_EP_EVENT) for a specified endpoint it calls this function. Based on the event some further action is taken, e.g. process control request or update transfer information and read data from the driver into the core buffer.

Parameters
[in] | ep_addr | Endpoint address
[in] | ep_event | Endpoint event type


XMC USB Library: USBD_Endpoint Struct Reference

  • Data Structure Index
  • Data Fields
USBD_Endpoint Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » USB Interface Management » USB Interface Management (XMC4000)

USBD Endpoint. More...

#include <USBController_XMC4000.h>

Data Fields

uint32_t | Address:8
uint32_t | Number:4
uint32_t | __pad0__:3
uint32_t | Direction:1
Endpoint Parameters
union {
uint32_t Address:8
struct {
uint32_t Number:4
uint32_t __pad0__:3
uint32_t Direction:1
}
};
uint32_t | IsConfigured:1
uint32_t | IsEnabled:1
uint32_t | IsHalted:1
volatile uint32_t | OutInUse:1
volatile uint32_t | InInUse:1
volatile uint32_t | IsOutRecieved:1
uint32_t | MaxPacketSize:7
Out endpoint buffer management
uint32_t | OutBytesAvailable
uint32_t | OutOffset
uint8_t * | OutBuffer
uint32_t | OutBufferLength
In endpoint buffer management
uint32_t | InBytesAvailable
uint8_t * | InBuffer
uint32_t | InBufferLength
uint32_t | InDataLeft
uint8_t * | InDataBuffer

Detailed Description

USBD Endpoint.

Type define for a USBD Enpoint. This structure represents an endpoint. It contains all necessary data to:

  • control the state of the endpoint
  • manage the data buffer

Field Documentation

uint32_t Address

Full device address (including direction)

uint32_t Direction

Endpoint direction

uint8_t* InBuffer

Address of in Buffer

uint32_t InBufferLength

Length of the in buffer

uint32_t InBytesAvailable

Amount of data written into the buffer

uint8_t* InDataBuffer

Current start address of the in buffer

uint32_t InDataLeft

Data left in the in buffer to send

volatile uint32_t InInUse

Flag showing that the endpoint is in use as in

uint32_t IsConfigured

Flag showing that the endpoint is configured

uint32_t IsEnabled

Flag showing that the endpoint is enabled

uint32_t IsHalted

Flag showing that the endpoint is halted

volatile uint32_t IsOutRecieved

Flag showing that an out packet has been received for that endpoint

uint32_t MaxPacketSize

Maximum packet size for the endpoint

uint32_t Number

Endpoint number

uint8_t* OutBuffer

Address of the out buffer

uint32_t OutBufferLength

Length of the out buffer

uint32_t OutBytesAvailable

Amount of data in the out buffer

volatile uint32_t OutInUse

Flag showing that the endpoint is in use as out

uint32_t OutOffset

Amount of data that have been read from the buffer

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/USBController_XMC4000.h


XMC USB Library: USBD_Device Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
USBD_Device Struct Reference
USB Core - LUFA/Drivers/USB/USB.h » USB Interface Management » USB Interface Management (XMC4000)

USBD Device. More...

#include <USBController_XMC4000.h>

Data Fields

XMC_USBD_DRIVER_t * | Driver
USBD_Endpoint_t Endpoints [ENDPOINT_TOTAL_ENDPOINTS]
uint8_t | InterfaceSettings [NUM_INTERFACES]
uint8_t | Configuration
uint8_t | PreSuspendDeviceState
EP0_State_t EP0_State
uint8_t | CurrentEndpoint
uint8_t | CurrentDirection
uint8_t | IsConfigured:1
volatile uint8_t | IsSetupRecieved:1
uint8_t | RemoteWakeUp:1
uint8_t | SelfPowered:1

Detailed Description

USBD Device.

Type define for an USB Device. This structure contains the all data of the device for the USB Device Core Driver. Especially the data of the endpoints are stored inside.

Field Documentation

uint8_t Configuration

Current USB device configuration

uint8_t CurrentDirection

Direction selected for the LUFA stack

uint8_t CurrentEndpoint

Endpoint selected for the LUFA stack

XMC_USBD_DRIVER_t* Driver

USB device controller driver structure

USBD_Endpoint_t Endpoints[ENDPOINT_TOTAL_ENDPOINTS]

Endpoint structures describing each endpoint of the device

EP0_State_t EP0_State

Endpoint 0 state

uint8_t InterfaceSettings[NUM_INTERFACES]

Array of the currently selected AlternativeSetting of an interface

uint8_t IsConfigured

Flag showing if the device was successfully configured

volatile uint8_t IsSetupRecieved

Flag showing if a setup packet is received

uint8_t PreSuspendDeviceState

Device State bevor suspend is recieved to restore the old state, when resume is received

uint8_t RemoteWakeUp

Flag for feature Remote WakeUP signaling

uint8_t SelfPowered

Flag for feature Self Powered

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/USBController_XMC4000.h


XMC USB Library: USB Mode Tokens

Macros
USB Mode Tokens
USB Core - LUFA/Drivers/USB/USB.h

USB mode and feature support definitions. More...

Detailed Description

USB mode and feature support definitions.

This file defines macros indicating the type of USB controller the library is being compiled for, and its capabilities. These macros may then be referenced in the user application to selectively enable or disable code sections depending on if they are defined or not.

After the inclusion of the master USB driver header, one or more of the following tokens may be defined, to allow the user code to conditionally enable or disable code based on the USB controller family and allowable USB modes. These tokens may be tested against to eliminate code relating to a USB mode which is not enabled for the given compilation.


XMC USB Library: USB Class Drivers

Modules
USB Class Drivers

Drivers for the various standardized USB device classes. More...

Modules

CDC-ACM (Virtual Serial) Class Driver
USB class driver for the USB-IF CDC-ACM (Virtual Serial) class standard.
HID Class Driver
USB class driver for the USB-IF Human Interface Device (HID) class standard.
Mass Storage Class Driver
USB class driver for the USB-IF Bulk-Only Transport Mass Storage class standard.

Detailed Description

Drivers for the various standardized USB device classes.

Drivers for both host and device mode of the standard USB classes, for rapid application development. Class drivers give a framework which sits on top of the low level library API, allowing for standard USB classes to be implemented in a project with minimal user code. These drivers can be used in conjunction with the library low level APIs to implement interfaces both via the class drivers and via the standard library APIs.

Multiple device mode class drivers can be used within a project, including multiple instances of the same class driver. In this way, USB Hosts and Devices can be made quickly using the internal class drivers so that more time and effort can be put into the end application instead of the USB protocol.

The available class drivers and their modes are listed below.

USB Class | Device Mode | Host Mode
Android Open Accessory | No | Yes
Audio 1.0 | Yes | Yes
CDC-ACM | Yes | Yes
HID | Yes | Yes
MIDI | Yes | Yes
Mass Storage | Yes | Yes
Printer | Yes | Yes
RNDIS | Yes | Yes
Still Image | No | Yes

Using the Class Drivers

To make the Class drivers easy to integrate into a user application, they all implement a standardized design with similarly named/used function, enums, defines and types. The two different modes are implemented slightly differently, and thus will be explained separately. For information on a specific class driver, read the class driver's module documentation.

Device Mode Class Drivers

Implementing a Device Mode Class Driver in a user application requires a number of steps to be followed. Firstly, the module configuration and state structure must be added to the project source. These structures are named in a similar manner between classes, that of USB_ClassInfo_{Class Name}_Device_t, and are used to hold the complete state and configuration for each class instance. Multiple class instances is where the power of the class drivers lie; multiple interfaces of the same class simply require more instances of the Class Driver's USB_ClassInfo_* structure.

Inside the ClassInfo structure lies two sections, a Config section, and a State section. The Config section contains the instance's configuration parameters, and must have all fields set by the user application before the class driver is used. Each Device mode Class driver typically contains a set of configuration parameters for the endpoint size/number of the associated logical USB interface, plus any class-specific configuration parameters.

The following is an example of a properly initialized instance of the Audio Class Driver structure:

USB_ClassInfo_Audio_Device_t My_Audio_Interface =
{
.Config =
{
.StreamingInterfaceNumber = 1,
.DataINEndpoint =
{
.Address = (ENDPOINT_DIR_IN | 1),
.Size = 64,
.Banks = 1,
},
},
};
Note
The class driver's configuration parameters should match those used in the device's descriptors that are sent to the host.

To initialize the Class driver instance, the driver's {Class Name}_Device_ConfigureEndpoints() function should be called in response to the EVENT_USB_Device_ConfigurationChanged() event. This function will return a boolean true value if the driver successfully initialized the instance. Like all the class driver functions, this function takes in the address of the specific instance you wish to initialize - in this manner, multiple separate instances of the same class type can be initialized like this:

void EVENT_USB_Device_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(Audio_Device_ConfigureEndpoints(&My_Audio_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}

Once initialized, it is important to maintain the class driver's state by repeatedly calling the Class Driver's {Class Name}_Device_USBTask() function in the main program loop. The exact implementation of this function varies between class drivers, and can be used for any internal class driver purpose to maintain each instance. Again, this function uses the address of the instance to operate on, and thus needs to be called for each separate instance, just like the main USB maintenance routine USB_USBTask():

int main(void)
{
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
for (;;)
{
if (USB_DeviceState != DEVICE_STATE_Configured)
Create_And_Process_Samples();
Audio_Device_USBTask(&My_Audio_Interface);
USB_USBTask();
}
}

The final standardized Device Class Driver function is the Control Request handler function {Class Name}_Device_ProcessControlRequest(), which should be called when the EVENT_USB_Device_ControlRequest() event fires. This function should also be called for each class driver instance, using the address of the instance to operate on as the function's parameter. The request handler will abort if it is determined that the current request is not targeted at the given class driver instance, thus these methods can safely be called one-after-another in the event handler with no form of error checking:

void EVENT_USB_Device_ControlRequest(void)
{
Audio_Device_ProcessControlRequest(&My_Audio_Interface);
}

Each class driver may also define a set of callback functions (which are prefixed by CALLBACK_* in the function's name) which must also be added to the user application - refer to each individual class driver's documentation for mandatory callbacks. In addition, each class driver may also define a set of events (identifiable by their prefix of EVENT_* in the function's name), which the user application may choose to implement, or ignore if not needed.

The individual Device Mode Class Driver documentation contains more information on the non-standardized, class-specific functions which the user application can then use on the driver instances, such as data read and write routines. See each driver's individual documentation for more information on the class-specific functions.

Host Mode Class Drivers

Implementing a Host Mode Class Driver in a user application requires a number of steps to be followed. Firstly, the module configuration and state structure must be added to the project source. These structures are named in a similar manner between classes, that of USB_ClassInfo_{Class Name}_Host_t, and are used to hold the complete state and configuration for each class instance. Multiple class instances is where the power of the class drivers lie; multiple interfaces of the same class simply require more instances of the Class Driver's USB_ClassInfo_* structure.

Inside the USB_ClassInfo_* structure lies two sections, a Config section, and a State section. The Config section contains the instance's configuration parameters, and must have all fields set by the user application before the class driver is used. Each Device mode Class driver typically contains a set of configuration parameters for the endpoint size/number of the associated logical USB interface, plus any class-specific configuration parameters.

The following is an example of a properly initialized instance of the MIDI Host Class Driver structure:

USB_ClassInfo_MIDI_Host_t My_MIDI_Interface =
{
.Config =
{
.DataINPipe =
{
.Address = (PIPE_DIR_IN | 1),
.Size = 64,
.Banks = 1,
},
.DataOUTPipe =
{
.Address = (PIPE_DIR_OUT | 2),
.Size = 64,
.Banks = 1,
},
},
};

To initialize the Class driver instance, the driver's {Class Name}_Host_ConfigurePipes() function should be called in response to the EVENT_USB_Host_DeviceEnumerationComplete() event firing. This function will will return an error code from the class driver's {Class Name}_EnumerationFailure_ErrorCodes_t enum to indicate if the driver successfully initialized the instance and bound it to an interface in the attached device. Like all the class driver functions, this function takes in the address of the specific instance you wish to initialize - in this manner, multiple separate instances of the same class type can be initialized. A fragment of a Class Driver based Host mode application may look like the following:

void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
uint16_t ConfigDescriptorSize;
uint8_t ConfigDescriptorData[512];
if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData,
sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful)
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
return;
}
if (MIDI_Host_ConfigurePipes(&Keyboard_MIDI_Interface,
ConfigDescriptorSize, ConfigDescriptorData) != MIDI_ENUMERROR_NoError)
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
return;
}
if (USB_Host_SetDeviceConfiguration(1) != HOST_SENDCONTROL_Successful)
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
return;
}
LEDs_SetAllLEDs(LEDMASK_USB_READY);
}

Note that the function also requires the device's configuration descriptor so that it can determine which interface in the device to bind to - this can be retrieved as shown in the above fragment using the USB_Host_GetDeviceConfigDescriptor() function. If the device does not implement the interface the class driver is looking for, if all the matching interfaces are already bound to class driver instances or if an error occurs while binding to a device interface (for example, a device endpoint bank larger that the maximum supported bank size is used) the configuration will fail.

To complete the device enumeration after binding the host mode Class Drivers to the attached device, a call to USB_Host_SetDeviceConfiguration() must be made. If the device configuration is not set within the EVENT_USB_Host_DeviceEnumerationComplete() event, the host still will assume the device enumeration has failed.

Once initialized, it is important to maintain the class driver's state by repeatedly calling the Class Driver's {Class Name}_Host_USBTask() function in the main program loop. The exact implementation of this function varies between class drivers, and can be used for any internal class driver purpose to maintain each instance. Again, this function uses the address of the instance to operate on, and thus needs to be called for each separate instance, just like the main USB maintenance routine USB_USBTask():

int main(void)
{
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
for (;;)
{
if (USB_HostState != HOST_STATE_Configured)
Create_And_Process_Samples();
MIDI_Host_USBTask(&My_Audio_Interface);
USB_USBTask();
}
}

Each class driver may also define a set of callback functions (which are prefixed by CALLBACK_* in the function's name) which must also be added to the user application - refer to each individual class driver's documentation for mandatory callbacks. In addition, each class driver may also define a set of events (identifiable by their prefix of EVENT_* in the function's name), which the user application may choose to implement, or ignore if not needed.

The individual Host Mode Class Driver documentation contains more information on the non-standardized, class-specific functions which the user application can then use on the driver instances, such as data read and write routines. See each driver's individual documentation for more information on the class-specific functions.


XMC USB Library: CDC-ACM (Virtual Serial) Class Driver

Modules | Macros
CDC-ACM (Virtual Serial) Class Driver
USB Class Drivers

USB class driver for the USB-IF CDC-ACM (Virtual Serial) class standard. More...

Modules

Common Class Definitions
CDC Class Device Mode Driver

Detailed Description

USB class driver for the USB-IF CDC-ACM (Virtual Serial) class standard.

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Device/CDCClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS)
  • LUFA/Drivers/USB/Class/Host/CDCClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS)

Module Description

CDC Class Driver module. This module contains an internal implementation of the USB CDC-ACM class Virtual Serial Ports, for both Device and Host USB modes. User applications can use this class driver instead of implementing the CDC class manually via the low-level LUFA APIs.

This module is designed to simplify the user code by exposing only the required interface needed to interface with Hosts or Devices using the USB CDC Class.


XMC USB Library: Common Class Definitions

Macros | Typedefs | Enumerations
Common Class Definitions
USB Class Drivers » CDC-ACM (Virtual Serial) Class Driver

Macros

#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize)

Typedefs

struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint16_t CDCSpecification
} USB_CDC_Descriptor_FunctionalHeader_t
CDC class-specific Functional Header Descriptor (LUFA naming conventions). More...
struct {
uint8_t bFunctionLength
uint8_t bDescriptorType
uint8_t bDescriptorSubType
uint16_t bcdCDC
} USB_CDC_StdDescriptor_FunctionalHeader_t
CDC class-specific Functional Header Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t Capabilities
} USB_CDC_Descriptor_FunctionalACM_t
CDC class-specific Functional ACM Descriptor (LUFA naming conventions). More...
struct {
uint8_t bFunctionLength
uint8_t bDescriptorType
uint8_t bDescriptorSubType
uint8_t bmCapabilities
} USB_CDC_StdDescriptor_FunctionalACM_t
CDC class-specific Functional ACM Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t MasterInterfaceNumber
uint8_t SlaveInterfaceNumber
} USB_CDC_Descriptor_FunctionalUnion_t
CDC class-specific Functional Union Descriptor (LUFA naming conventions). More...
struct {
uint8_t bFunctionLength
uint8_t bDescriptorType
uint8_t bDescriptorSubType
uint8_t bMasterInterface
uint8_t bSlaveInterface0
} USB_CDC_StdDescriptor_FunctionalUnion_t
CDC class-specific Functional Union Descriptor (USB-IF naming conventions). More...
struct {
uint32_t BaudRateBPS
uint8_t CharFormat
uint8_t ParityType
uint8_t DataBits
} CDC_LineEncoding_t
CDC Virtual Serial Port Line Encoding Settings Structure. More...

Enumerations

enum CDC_Descriptor_ClassSubclassProtocol_t {
CDC_CSCP_CDCClass = 0x02, CDC_CSCP_NoSpecificSubclass = 0x00, CDC_CSCP_ACMSubclass = 0x02, CDC_CSCP_ATCommandProtocol = 0x01,
CDC_CSCP_NoSpecificProtocol = 0x00, CDC_CSCP_VendorSpecificProtocol = 0xFF, CDC_CSCP_CDCDataClass = 0x0A, CDC_CSCP_NoDataSubclass = 0x00,
CDC_CSCP_NoDataProtocol = 0x00
}
enum CDC_ClassRequests_t {
CDC_REQ_SendEncapsulatedCommand = 0x00, CDC_REQ_GetEncapsulatedResponse = 0x01, CDC_REQ_SetLineEncoding = 0x20, CDC_REQ_GetLineEncoding = 0x21,
CDC_REQ_SetControlLineState = 0x22, CDC_REQ_SendBreak = 0x23
}
enum | CDC_ClassNotifications_t { CDC_NOTIF_SerialState = 0x20 }
enum CDC_DescriptorSubtypes_t {
CDC_DSUBTYPE_CSInterface_Header = 0x00, CDC_DSUBTYPE_CSInterface_CallManagement = 0x01, CDC_DSUBTYPE_CSInterface_ACM = 0x02, CDC_DSUBTYPE_CSInterface_DirectLine = 0x03,
CDC_DSUBTYPE_CSInterface_TelephoneRinger = 0x04, CDC_DSUBTYPE_CSInterface_TelephoneCall = 0x05, CDC_DSUBTYPE_CSInterface_Union = 0x06, CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07,
CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08, CDC_DSUBTYPE_CSInterface_USBTerminal = 0x09, CDC_DSUBTYPE_CSInterface_NetworkChannel = 0x0A, CDC_DSUBTYPE_CSInterface_ProtocolUnit = 0x0B,
CDC_DSUBTYPE_CSInterface_ExtensionUnit = 0x0C, CDC_DSUBTYPE_CSInterface_MultiChannel = 0x0D, CDC_DSUBTYPE_CSInterface_CAPI = 0x0E, CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F,
CDC_DSUBTYPE_CSInterface_ATM = 0x10
}
enum | CDC_LineEncodingFormats_t { CDC_LINEENCODING_OneStopBit = 0, CDC_LINEENCODING_OneAndAHalfStopBits = 1, CDC_LINEENCODING_TwoStopBits = 2 }
enum CDC_LineEncodingParity_t {
CDC_PARITY_None = 0, CDC_PARITY_Odd = 1, CDC_PARITY_Even = 2, CDC_PARITY_Mark = 3,
CDC_PARITY_Space = 4
}

Virtual Control Line Masks

#define | CDC_CONTROL_LINE_OUT_DTR (1 << 0)
#define | CDC_CONTROL_LINE_OUT_RTS (1 << 1)
#define | CDC_CONTROL_LINE_IN_DCD (1 << 0)
#define | CDC_CONTROL_LINE_IN_DSR (1 << 1)
#define | CDC_CONTROL_LINE_IN_BREAK (1 << 2)
#define | CDC_CONTROL_LINE_IN_RING (1 << 3)
#define | CDC_CONTROL_LINE_IN_FRAMEERROR (1 << 4)
#define | CDC_CONTROL_LINE_IN_PARITYERROR (1 << 5)
#define | CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)

Detailed Description

Module Description

Constants, Types and Enum definitions that are common to both Device and Host modes for the USB CDC Class.

Macro Definition Documentation

#define CDC_CONTROL_LINE_IN_BREAK (1 << 2)

Mask for the BREAK handshake line for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that the BREAK line state is currently high.

#define CDC_CONTROL_LINE_IN_DCD (1 << 0)

Mask for the DCD handshake line for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that the DCD line state is currently high.

#define CDC_CONTROL_LINE_IN_DSR (1 << 1)

Mask for the DSR handshake line for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that the DSR line state is currently high.

#define CDC_CONTROL_LINE_IN_FRAMEERROR (1 << 4)

Mask for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that a framing error has occurred on the virtual serial port.

#define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)

Mask for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that a data overrun error has occurred on the virtual serial port.

#define CDC_CONTROL_LINE_IN_PARITYERROR (1 << 5)

Mask for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that a parity error has occurred on the virtual serial port.

#define CDC_CONTROL_LINE_IN_RING (1 << 3)

Mask for the RING handshake line for use with the CDC_NOTIF_SerialState class-specific notification from the device to the host, to indicate that the RING line state is currently high.

#define CDC_CONTROL_LINE_OUT_DTR (1 << 0)

Mask for the DTR handshake line for use with the CDC_REQ_SetControlLineState class-specific request from the host, to indicate that the DTR line state should be high.

#define CDC_CONTROL_LINE_OUT_RTS (1 << 1)

Mask for the RTS handshake line for use with the CDC_REQ_SetControlLineState class-specific request from the host, to indicate that the RTS line state should be high.

#define CDC_FUNCTIONAL_DESCRIPTOR ( DataSize )
Value:
struct \
{ \
USB_Descriptor_Header_t Header; \
uint8_t SubType; \
uint8_t Data[DataSize]; \
}
Header
USB_Descriptor_Header_t Header
Definition: CDCClassCommon.h:239

Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a uniform structure but variable sized data payloads, thus cannot be represented accurately by a single typedef struct. A macro is used instead so that functional descriptors can be created easily by specifying the size of the payload. This allows sizeof() to work correctly.

Parameters
[in] DataSize Size in bytes of the CDC functional descriptor's data payload.

Typedef Documentation

typedef { ... } CDC_LineEncoding_t

CDC Virtual Serial Port Line Encoding Settings Structure.

Type define for a CDC Line Encoding structure, used to hold the various encoding parameters for a virtual serial port.

Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_CDC_Descriptor_FunctionalACM_t

CDC class-specific Functional ACM Descriptor (LUFA naming conventions).

Type define for a CDC class-specific functional ACM descriptor. This indicates to the host that the CDC interface supports the CDC ACM subclass of the CDC specification. See the CDC class specification for more details.

See also
USB_CDC_StdDescriptor_FunctionalACM_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_CDC_Descriptor_FunctionalHeader_t

CDC class-specific Functional Header Descriptor (LUFA naming conventions).

Type define for a CDC class-specific functional header descriptor. This indicates to the host that the device contains one or more CDC functional data descriptors, which give the CDC interface's capabilities and configuration. See the CDC class specification for more details.

See also
USB_CDC_StdDescriptor_FunctionalHeader_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_CDC_Descriptor_FunctionalUnion_t

CDC class-specific Functional Union Descriptor (LUFA naming conventions).

Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific CDC control and data interfaces are related. See the CDC class specification for more details.

See also
USB_CDC_StdDescriptor_FunctionalUnion_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_CDC_StdDescriptor_FunctionalACM_t

CDC class-specific Functional ACM Descriptor (USB-IF naming conventions).

Type define for a CDC class-specific functional ACM descriptor. This indicates to the host that the CDC interface supports the CDC ACM subclass of the CDC specification. See the CDC class specification for more details.

See also
USB_CDC_Descriptor_FunctionalACM_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_CDC_StdDescriptor_FunctionalHeader_t

CDC class-specific Functional Header Descriptor (USB-IF naming conventions).

Type define for a CDC class-specific functional header descriptor. This indicates to the host that the device contains one or more CDC functional data descriptors, which give the CDC interface's capabilities and configuration. See the CDC class specification for more details.

See also
USB_CDC_Descriptor_FunctionalHeader_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_CDC_StdDescriptor_FunctionalUnion_t

CDC class-specific Functional Union Descriptor (USB-IF naming conventions).

Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific CDC control and data interfaces are related. See the CDC class specification for more details.

See also
USB_CDC_Descriptor_FunctionalUnion_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.

Enumeration Type Documentation

enum CDC_ClassNotifications_t

Enum for the CDC class specific notification requests that can be issued by a CDC device to a host.

Enumerator
CDC_NOTIF_SerialState

Notification type constant for a change in the virtual serial port handshake line states, for use with a USB_Request_Header_t notification structure when sent to the host via the CDC notification endpoint.

enum CDC_ClassRequests_t

Enum for the CDC class specific control requests that can be issued by the USB bus host.

Enumerator
CDC_REQ_SendEncapsulatedCommand | CDC class-specific request to send an encapsulated command to the device.
CDC_REQ_GetEncapsulatedResponse | CDC class-specific request to retrieve an encapsulated command response from the device.
CDC_REQ_SetLineEncoding | CDC class-specific request to set the current virtual serial port configuration settings.
CDC_REQ_GetLineEncoding | CDC class-specific request to get the current virtual serial port configuration settings.
CDC_REQ_SetControlLineState | CDC class-specific request to set the current virtual serial port handshake line states.
CDC_REQ_SendBreak | CDC class-specific request to send a break to the receiver via the carrier channel.
enum CDC_Descriptor_ClassSubclassProtocol_t

Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the CDC device class.

Enumerator
CDC_CSCP_CDCClass | Descriptor Class value indicating that the device or interface belongs to the CDC class.
CDC_CSCP_NoSpecificSubclass | Descriptor Subclass value indicating that the device or interface belongs to no specific subclass of the CDC class.
CDC_CSCP_ACMSubclass | Descriptor Subclass value indicating that the device or interface belongs to the Abstract Control Model CDC subclass.
CDC_CSCP_ATCommandProtocol | Descriptor Protocol value indicating that the device or interface belongs to the AT Command protocol of the CDC class.
CDC_CSCP_NoSpecificProtocol | Descriptor Protocol value indicating that the device or interface belongs to no specific protocol of the CDC class.
CDC_CSCP_VendorSpecificProtocol | Descriptor Protocol value indicating that the device or interface belongs to a vendor-specific protocol of the CDC class.
CDC_CSCP_CDCDataClass | Descriptor Class value indicating that the device or interface belongs to the CDC Data class.
CDC_CSCP_NoDataSubclass | Descriptor Subclass value indicating that the device or interface belongs to no specific subclass of the CDC data class.
CDC_CSCP_NoDataProtocol | Descriptor Protocol value indicating that the device or interface belongs to no specific protocol of the CDC data class.
enum CDC_DescriptorSubtypes_t

Enum for the CDC class specific interface descriptor subtypes.

Enumerator
CDC_DSUBTYPE_CSInterface_Header | CDC class-specific Header functional descriptor.
CDC_DSUBTYPE_CSInterface_CallManagement | CDC class-specific Call Management functional descriptor.
CDC_DSUBTYPE_CSInterface_ACM | CDC class-specific Abstract Control Model functional descriptor.
CDC_DSUBTYPE_CSInterface_DirectLine | CDC class-specific Direct Line functional descriptor.
CDC_DSUBTYPE_CSInterface_TelephoneRinger | CDC class-specific Telephone Ringer functional descriptor.
CDC_DSUBTYPE_CSInterface_TelephoneCall | CDC class-specific Telephone Call functional descriptor.
CDC_DSUBTYPE_CSInterface_Union | CDC class-specific Union functional descriptor.
CDC_DSUBTYPE_CSInterface_CountrySelection | CDC class-specific Country Selection functional descriptor.
CDC_DSUBTYPE_CSInterface_TelephoneOpModes | CDC class-specific Telephone Operation Modes functional descriptor.
CDC_DSUBTYPE_CSInterface_USBTerminal | CDC class-specific USB Terminal functional descriptor.
CDC_DSUBTYPE_CSInterface_NetworkChannel | CDC class-specific Network Channel functional descriptor.
CDC_DSUBTYPE_CSInterface_ProtocolUnit | CDC class-specific Protocol Unit functional descriptor.
CDC_DSUBTYPE_CSInterface_ExtensionUnit | CDC class-specific Extension Unit functional descriptor.
CDC_DSUBTYPE_CSInterface_MultiChannel | CDC class-specific Multi-Channel Management functional descriptor.
CDC_DSUBTYPE_CSInterface_CAPI | CDC class-specific Common ISDN API functional descriptor.
CDC_DSUBTYPE_CSInterface_Ethernet | CDC class-specific Ethernet functional descriptor.
CDC_DSUBTYPE_CSInterface_ATM | CDC class-specific Asynchronous Transfer Mode functional descriptor.
enum CDC_LineEncodingFormats_t

Enum for the possible line encoding formats of a virtual serial port.

Enumerator
CDC_LINEENCODING_OneStopBit | Each frame contains one stop bit.
CDC_LINEENCODING_OneAndAHalfStopBits | Each frame contains one and a half stop bits.
CDC_LINEENCODING_TwoStopBits | Each frame contains two stop bits.
enum CDC_LineEncodingParity_t

Enum for the possible line encoding parity settings of a virtual serial port.

Enumerator
CDC_PARITY_None | No parity bit mode on each frame.
CDC_PARITY_Odd | Odd parity bit mode on each frame.
CDC_PARITY_Even | Even parity bit mode on each frame.
CDC_PARITY_Mark | Mark parity bit mode on each frame.
CDC_PARITY_Space | Space parity bit mode on each frame.


XMC USB Library: CDC Class Device Mode Driver

Data Structures | Functions
CDC Class Device Mode Driver
USB Class Drivers » CDC-ACM (Virtual Serial) Class Driver

Data Structures

struct USB_ClassInfo_CDC_Device_t
CDC Class Device Mode Configuration and State Structure. More...

Functions

bool | CDC_Device_ConfigureEndpoints (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | CDC_Device_ProcessControlRequest (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | CDC_Device_USBTask (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | EVENT_CDC_Device_LineEncodingChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | EVENT_CDC_Device_ControLineStateChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | EVENT_CDC_Device_BreakSent (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | CDC_Device_SendData (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const void *const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
uint8_t | CDC_Device_SendString (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const char *const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
uint8_t | CDC_Device_SendByte (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1)
uint16_t | CDC_Device_BytesReceived (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
int16_t | CDC_Device_ReceiveByte (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | CDC_Device_Flush (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | CDC_Device_SendControlLineStateChange (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)

Detailed Description

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Device/CDCClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS)

Module Description

Device Mode USB Class driver framework interface, for the CDC USB Class driver.

Note
There are several major drawbacks to the CDC-ACM standard USB class, however it is very standardized and thus usually available as a built-in driver on most platforms, and so is a better choice than a proprietary serial class.

One major issue with CDC-ACM is that it requires two Interface descriptors, which will upset most hosts when part of a multi-function "Composite" USB device. This is because each interface will be loaded into a separate driver instance, causing the two interfaces be become unlinked. To prevent this, you should use the "Interface Association Descriptor" addendum to the USB 2.0 standard which is available on most OSes when creating Composite devices.

Another major oversight is that there is no mechanism for the host to notify the device that there is a data sink on the host side ready to accept data. This means that the device may try to send data while the host isn't listening, causing lengthy blocking timeouts in the transmission routines. It is thus highly recommended that the virtual serial line DTR (Data Terminal Ready) signal be used where possible to determine if a host application is ready for data.

Function Documentation

uint16_t CDC_Device_BytesReceived ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

Determines the number of bytes received by the CDC interface from the host, waiting to be read. This indicates the number of bytes in the OUT endpoint bank only, and thus the number of calls to CDC_Device_ReceiveByte() which are guaranteed to succeed immediately. If multiple bytes are to be received, they should be buffered by the user application, as the endpoint bank will not be released back to the USB controller until all bytes are read.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
Returns
Total number of buffered bytes received from the host.
bool CDC_Device_ConfigureEndpoints ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the given CDC interface is selected.

Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
Returns
Boolean true if the endpoints were successfully configured, false otherwise.
uint8_t CDC_Device_Flush ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

Flushes any data waiting to be sent, ensuring that the send buffer is cleared.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
Returns
A value from the Endpoint_WaitUntilReady_ErrorCodes_t enum.
void CDC_Device_ProcessControlRequest ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

Processes incoming control requests from the host, that are directed to the given CDC class interface. This should be linked to the library EVENT_USB_Device_ControlRequest() event.

Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
int16_t CDC_Device_ReceiveByte ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

Reads a byte of data from the host. If no data is waiting to be read of if a USB host is not connected, the function returns a negative value. The CDC_Device_BytesReceived() function may be queried in advance to determine how many bytes are currently buffered in the CDC interface's data receive endpoint bank, and thus how many repeated calls to this function which are guaranteed to succeed.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
Returns
Next received byte from the host, or a negative value if no data received.
uint8_t CDC_Device_SendByte | ( | USB_ClassInfo_CDC_Device_t *const | CDCInterfaceInfo,
 |  | const uint8_t | Data
 | ) |  |

Sends a given byte to the attached USB host, if connected. If a host is not connected when the function is called, the byte is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] | CDCInterfaceInfo | Pointer to a structure containing a CDC Class configuration and state.
[in] | Data | Byte of data to send to the host.
Returns
A value from the Endpoint_WaitUntilReady_ErrorCodes_t enum.
void CDC_Device_SendControlLineStateChange ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

Sends a Serial Control Line State Change notification to the host. This should be called when the virtual serial control lines (DCD, DSR, etc.) have changed states, or to give BREAK notifications to the host. Line states persist until they are cleared via a second notification. This should be called each time the CDC class driver's ControlLineStates.DeviceToHost value is updated to push the new states to the USB host.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
uint8_t CDC_Device_SendData | ( | USB_ClassInfo_CDC_Device_t *const | CDCInterfaceInfo,
 |  | const void *const | Buffer,
 |  | const uint16_t | Length
 | ) |  |

Sends a given data buffer to the attached USB host, if connected. If a host is not connected when the function is called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] | CDCInterfaceInfo | Pointer to a structure containing a CDC Class configuration and state.
[in] | Buffer | Pointer to a buffer containing the data to send to the device.
[in] | Length | Length of the data to send to the host.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
uint8_t CDC_Device_SendString | ( | USB_ClassInfo_CDC_Device_t *const | CDCInterfaceInfo,
 |  | const char *const | String
 | ) |  |

Sends a given null terminated string to the attached USB host, if connected. If a host is not connected when the function is called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput.

Precondition
This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.
Parameters
[in,out] | CDCInterfaceInfo | Pointer to a structure containing a CDC Class configuration and state.
[in] | String | Pointer to the null terminated string to send to the host.
Returns
A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
void CDC_Device_USBTask ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

General management task for a given CDC class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().

Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
void EVENT_CDC_Device_BreakSent | ( | USB_ClassInfo_CDC_Device_t *const | CDCInterfaceInfo,
 |  | const uint8_t | Duration
 | ) |  |

CDC class driver event for a send break request sent to the device from the host. This is generally used to separate data or to indicate a special condition to the receiving device.

Parameters
[in,out] | CDCInterfaceInfo | Pointer to a structure containing a CDC Class configuration and state.
[in] | Duration | Duration of the break that has been sent by the host, in milliseconds.
void EVENT_CDC_Device_ControLineStateChanged ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

CDC class driver event for a control line state change on a CDC interface. This event fires each time the host requests a control line state change (containing the virtual serial control line states, such as DTR) and may be hooked in the user program by declaring a handler function with the same name and parameters listed here. The new control line states are available in the ControlLineStates.HostToDevice value inside the CDC interface structure passed as a parameter, set as a mask of CDC_CONTROL_LINE_OUT_* masks.

Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
void EVENT_CDC_Device_LineEncodingChanged ( USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo )

CDC class driver event for a line encoding change on a CDC interface. This event fires each time the host requests a line encoding change (containing the serial parity, baud and other configuration information) and may be hooked in the user program by declaring a handler function with the same name and parameters listed here. The new line encoding settings are available in the LineEncoding structure inside the CDC interface structure passed as a parameter.

Parameters
[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.


XMC USB Library: USB_ClassInfo_CDC_Device_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
USB_ClassInfo_CDC_Device_t Struct Reference
USB Class Drivers » CDC-ACM (Virtual Serial) Class Driver » CDC Class Device Mode Driver

CDC Class Device Mode Configuration and State Structure. More...

#include <CDCClassDevice.h>

Data Fields

struct {
uint8_t ControlInterfaceNumber
USB_Endpoint_Table_t DataINEndpoint
USB_Endpoint_Table_t DataOUTEndpoint
USB_Endpoint_Table_t NotificationEndpoint
} Config
struct {
struct {
uint16_t HostToDevice
uint16_t DeviceToHost
} ControlLineStates
CDC_LineEncoding_t LineEncoding
} State

Detailed Description

CDC Class Device Mode Configuration and State Structure.

Class state structure. An instance of this structure should be made for each CDC interface within the user application, and passed to each of the CDC class driver functions as the CDCInterfaceInfo parameter. This stores each CDC interface's configuration and state information.

Field Documentation

struct { ... } Config

Config data for the USB class interface within the device. All elements in this section must be set or the interface will fail to enumerate and operate correctly.

uint8_t ControlInterfaceNumber

Interface number of the CDC control interface within the device.

struct { ... } ControlLineStates

Current states of the virtual serial port's control lines between the device and host.

USB_Endpoint_Table_t DataINEndpoint

Data IN endpoint configuration table.

USB_Endpoint_Table_t DataOUTEndpoint

Data OUT endpoint configuration table.

uint16_t DeviceToHost

Control line states from the device to host, as a set of CDC_CONTROL_LINE_IN_* masks - to notify the host of changes to these values, call the CDC_Device_SendControlLineStateChange() function.

uint16_t HostToDevice

Control line states from the host to device, as a set of CDC_CONTROL_LINE_OUT_* masks. This value is updated each time CDC_Device_USBTask() is called.

CDC_LineEncoding_t LineEncoding

Line encoding used in the virtual serial port, for the device's information. This is generally only used if the virtual serial port data is to be reconstructed on a physical UART.

USB_Endpoint_Table_t NotificationEndpoint

Notification IN Endpoint configuration table.

struct { ... } State

State data for the USB class interface within the device. All elements in this section are reset to their defaults when the interface is enumerated.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Device/CDCClassDevice.h


XMC USB Library: HID Class Driver

Modules | Macros
HID Class Driver
USB Class Drivers

USB class driver for the USB-IF Human Interface Device (HID) class standard. More...

Modules

Common Class Definitions
HID Class Device Mode Driver

Detailed Description

USB class driver for the USB-IF Human Interface Device (HID) class standard.

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Device/HIDClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS)
  • LUFA/Drivers/USB/Class/Host/HIDClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS)
  • LUFA/Drivers/USB/Class/Host/HIDParser.c (Makefile source module name: LUFA_SRC_USB)

Module Description

HID Class Driver module. This module contains an internal implementation of the USB HID Class, for both Device and Host USB modes. User applications can use this class driver instead of implementing the HID class manually via the low-level LUFA APIs.

This module is designed to simplify the user code by exposing only the required interface needed to interface with Hosts or Devices using the USB HID Class.


XMC USB Library: Common Class Definitions

Typedefs | Enumerations
Common Class Definitions
USB Class Drivers » HID Class Driver

Typedefs

struct {
USB_Descriptor_Header_t Header
uint16_t HIDSpec
uint8_t CountryCode
uint8_t TotalReportDescriptors
uint8_t HIDReportType
uint16_t HIDReportLength
} USB_HID_Descriptor_HID_t
HID class-specific HID Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdHID
uint8_t bCountryCode
uint8_t bNumDescriptors
uint8_t bDescriptorType2
uint16_t wDescriptorLength
} USB_HID_StdDescriptor_HID_t
HID class-specific HID Descriptor (USB-IF naming conventions). More...
struct {
uint8_t Button
int8_t X
int8_t Y
} USB_MouseReport_Data_t
Standard HID Boot Protocol Mouse Report. More...
struct {
uint8_t Modifier
uint8_t Reserved
uint8_t KeyCode [6]
} USB_KeyboardReport_Data_t
Standard HID Boot Protocol Keyboard Report. More...
typedef uint8_t USB_Descriptor_HIDReport_Datatype_t

Enumerations

enum HID_Descriptor_ClassSubclassProtocol_t {
HID_CSCP_HIDClass = 0x03, HID_CSCP_NonBootSubclass = 0x00, HID_CSCP_BootSubclass = 0x01, HID_CSCP_NonBootProtocol = 0x00,
HID_CSCP_KeyboardBootProtocol = 0x01, HID_CSCP_MouseBootProtocol = 0x02
}
enum HID_ClassRequests_t {
HID_REQ_GetReport = 0x01, HID_REQ_GetIdle = 0x02, HID_REQ_GetProtocol = 0x03, HID_REQ_SetReport = 0x09,
HID_REQ_SetIdle = 0x0A, HID_REQ_SetProtocol = 0x0B
}
enum | HID_DescriptorTypes_t { HID_DTYPE_HID = 0x21, HID_DTYPE_Report = 0x22 }
enum | HID_ReportItemTypes_t { HID_REPORT_ITEM_In = 0, HID_REPORT_ITEM_Out = 1, HID_REPORT_ITEM_Feature = 2 }

Keyboard Standard Report Modifier Masks

#define | HID_KEYBOARD_MODIFIER_LEFTCTRL (1 << 0)
#define | HID_KEYBOARD_MODIFIER_LEFTSHIFT (1 << 1)
#define | HID_KEYBOARD_MODIFIER_LEFTALT (1 << 2)
#define | HID_KEYBOARD_MODIFIER_LEFTGUI (1 << 3)
#define | HID_KEYBOARD_MODIFIER_RIGHTCTRL (1 << 4)
#define | HID_KEYBOARD_MODIFIER_RIGHTSHIFT (1 << 5)
#define | HID_KEYBOARD_MODIFIER_RIGHTALT (1 << 6)
#define | HID_KEYBOARD_MODIFIER_RIGHTGUI (1 << 7)

Keyboard Standard Report LED Masks

#define | HID_KEYBOARD_LED_NUMLOCK (1 << 0)
#define | HID_KEYBOARD_LED_CAPSLOCK (1 << 1)
#define | HID_KEYBOARD_LED_SCROLLLOCK (1 << 2)
#define | HID_KEYBOARD_LED_COMPOSE (1 << 3)
#define | HID_KEYBOARD_LED_KANA (1 << 4)

Keyboard Standard Report Key Scan-codes

#define | HID_KEYBOARD_SC_ERROR_ROLLOVER 0x01
#define | HID_KEYBOARD_SC_POST_FAIL 0x02
#define | HID_KEYBOARD_SC_ERROR_UNDEFINED 0x03
#define | HID_KEYBOARD_SC_A 0x04
#define | HID_KEYBOARD_SC_B 0x05
#define | HID_KEYBOARD_SC_C 0x06
#define | HID_KEYBOARD_SC_D 0x07
#define | HID_KEYBOARD_SC_E 0x08
#define | HID_KEYBOARD_SC_F 0x09
#define | HID_KEYBOARD_SC_G 0x0A
#define | HID_KEYBOARD_SC_H 0x0B
#define | HID_KEYBOARD_SC_I 0x0C
#define | HID_KEYBOARD_SC_J 0x0D
#define | HID_KEYBOARD_SC_K 0x0E
#define | HID_KEYBOARD_SC_L 0x0F
#define | HID_KEYBOARD_SC_M 0x10
#define | HID_KEYBOARD_SC_N 0x11
#define | HID_KEYBOARD_SC_O 0x12
#define | HID_KEYBOARD_SC_P 0x13
#define | HID_KEYBOARD_SC_Q 0x14
#define | HID_KEYBOARD_SC_R 0x15
#define | HID_KEYBOARD_SC_S 0x16
#define | HID_KEYBOARD_SC_T 0x17
#define | HID_KEYBOARD_SC_U 0x18
#define | HID_KEYBOARD_SC_V 0x19
#define | HID_KEYBOARD_SC_W 0x1A
#define | HID_KEYBOARD_SC_X 0x1B
#define | HID_KEYBOARD_SC_Y 0x1C
#define | HID_KEYBOARD_SC_Z 0x1D
#define | HID_KEYBOARD_SC_1_AND_EXCLAMATION 0x1E
#define | HID_KEYBOARD_SC_2_AND_AT 0x1F
#define | HID_KEYBOARD_SC_3_AND_HASHMARK 0x20
#define | HID_KEYBOARD_SC_4_AND_DOLLAR 0x21
#define | HID_KEYBOARD_SC_5_AND_PERCENTAGE 0x22
#define | HID_KEYBOARD_SC_6_AND_CARET 0x23
#define | HID_KEYBOARD_SC_7_AND_AMPERSAND 0x24
#define | HID_KEYBOARD_SC_8_AND_ASTERISK 0x25
#define | HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS 0x26
#define | HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS 0x27
#define | HID_KEYBOARD_SC_ENTER 0x28
#define | HID_KEYBOARD_SC_ESCAPE 0x29
#define | HID_KEYBOARD_SC_BACKSPACE 0x2A
#define | HID_KEYBOARD_SC_TAB 0x2B
#define | HID_KEYBOARD_SC_SPACE 0x2C
#define | HID_KEYBOARD_SC_MINUS_AND_UNDERSCORE 0x2D
#define | HID_KEYBOARD_SC_EQUAL_AND_PLUS 0x2E
#define | HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE 0x2F
#define | HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE 0x30
#define | HID_KEYBOARD_SC_BACKSLASH_AND_PIPE 0x31
#define | HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE 0x32
#define | HID_KEYBOARD_SC_SEMICOLON_AND_COLON 0x33
#define | HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE 0x34
#define | HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE 0x35
#define | HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN 0x36
#define | HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN 0x37
#define | HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK 0x38
#define | HID_KEYBOARD_SC_CAPS_LOCK 0x39
#define | HID_KEYBOARD_SC_F1 0x3A
#define | HID_KEYBOARD_SC_F2 0x3B
#define | HID_KEYBOARD_SC_F3 0x3C
#define | HID_KEYBOARD_SC_F4 0x3D
#define | HID_KEYBOARD_SC_F5 0x3E
#define | HID_KEYBOARD_SC_F6 0x3F
#define | HID_KEYBOARD_SC_F7 0x40
#define | HID_KEYBOARD_SC_F8 0x41
#define | HID_KEYBOARD_SC_F9 0x42
#define | HID_KEYBOARD_SC_F10 0x43
#define | HID_KEYBOARD_SC_F11 0x44
#define | HID_KEYBOARD_SC_F12 0x45
#define | HID_KEYBOARD_SC_PRINT_SCREEN 0x46
#define | HID_KEYBOARD_SC_SCROLL_LOCK 0x47
#define | HID_KEYBOARD_SC_PAUSE 0x48
#define | HID_KEYBOARD_SC_INSERT 0x49
#define | HID_KEYBOARD_SC_HOME 0x4A
#define | HID_KEYBOARD_SC_PAGE_UP 0x4B
#define | HID_KEYBOARD_SC_DELETE 0x4C
#define | HID_KEYBOARD_SC_END 0x4D
#define | HID_KEYBOARD_SC_PAGE_DOWN 0x4E
#define | HID_KEYBOARD_SC_RIGHT_ARROW 0x4F
#define | HID_KEYBOARD_SC_LEFT_ARROW 0x50
#define | HID_KEYBOARD_SC_DOWN_ARROW 0x51
#define | HID_KEYBOARD_SC_UP_ARROW 0x52
#define | HID_KEYBOARD_SC_NUM_LOCK 0x53
#define | HID_KEYBOARD_SC_KEYPAD_SLASH 0x54
#define | HID_KEYBOARD_SC_KEYPAD_ASTERISK 0x55
#define | HID_KEYBOARD_SC_KEYPAD_MINUS 0x56
#define | HID_KEYBOARD_SC_KEYPAD_PLUS 0x57
#define | HID_KEYBOARD_SC_KEYPAD_ENTER 0x58
#define | HID_KEYBOARD_SC_KEYPAD_1_AND_END 0x59
#define | HID_KEYBOARD_SC_KEYPAD_2_AND_DOWN_ARROW 0x5A
#define | HID_KEYBOARD_SC_KEYPAD_3_AND_PAGE_DOWN 0x5B
#define | HID_KEYBOARD_SC_KEYPAD_4_AND_LEFT_ARROW 0x5C
#define | HID_KEYBOARD_SC_KEYPAD_5 0x5D
#define | HID_KEYBOARD_SC_KEYPAD_6_AND_RIGHT_ARROW 0x5E
#define | HID_KEYBOARD_SC_KEYPAD_7_AND_HOME 0x5F
#define | HID_KEYBOARD_SC_KEYPAD_8_AND_UP_ARROW 0x60
#define | HID_KEYBOARD_SC_KEYPAD_9_AND_PAGE_UP 0x61
#define | HID_KEYBOARD_SC_KEYPAD_0_AND_INSERT 0x62
#define | HID_KEYBOARD_SC_KEYPAD_DOT_AND_DELETE 0x63
#define | HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE 0x64
#define | HID_KEYBOARD_SC_APPLICATION 0x65
#define | HID_KEYBOARD_SC_POWER 0x66
#define | HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN 0x67
#define | HID_KEYBOARD_SC_F13 0x68
#define | HID_KEYBOARD_SC_F14 0x69
#define | HID_KEYBOARD_SC_F15 0x6A
#define | HID_KEYBOARD_SC_F16 0x6B
#define | HID_KEYBOARD_SC_F17 0x6C
#define | HID_KEYBOARD_SC_F18 0x6D
#define | HID_KEYBOARD_SC_F19 0x6E
#define | HID_KEYBOARD_SC_F20 0x6F
#define | HID_KEYBOARD_SC_F21 0x70
#define | HID_KEYBOARD_SC_F22 0x71
#define | HID_KEYBOARD_SC_F23 0x72
#define | HID_KEYBOARD_SC_F24 0x73
#define | HID_KEYBOARD_SC_EXECUTE 0x74
#define | HID_KEYBOARD_SC_HELP 0x75
#define | HID_KEYBOARD_SC_MENU 0x76
#define | HID_KEYBOARD_SC_SELECT 0x77
#define | HID_KEYBOARD_SC_STOP 0x78
#define | HID_KEYBOARD_SC_AGAIN 0x79
#define | HID_KEYBOARD_SC_UNDO 0x7A
#define | HID_KEYBOARD_SC_CUT 0x7B
#define | HID_KEYBOARD_SC_COPY 0x7C
#define | HID_KEYBOARD_SC_PASTE 0x7D
#define | HID_KEYBOARD_SC_FIND 0x7E
#define | HID_KEYBOARD_SC_MUTE 0x7F
#define | HID_KEYBOARD_SC_VOLUME_UP 0x80
#define | HID_KEYBOARD_SC_VOLUME_DOWN 0x81
#define | HID_KEYBOARD_SC_LOCKING_CAPS_LOCK 0x82
#define | HID_KEYBOARD_SC_LOCKING_NUM_LOCK 0x83
#define | HID_KEYBOARD_SC_LOCKING_SCROLL_LOCK 0x84
#define | HID_KEYBOARD_SC_KEYPAD_COMMA 0x85
#define | HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN_AS400 0x86
#define | HID_KEYBOARD_SC_INTERNATIONAL1 0x87
#define | HID_KEYBOARD_SC_INTERNATIONAL2 0x88
#define | HID_KEYBOARD_SC_INTERNATIONAL3 0x89
#define | HID_KEYBOARD_SC_INTERNATIONAL4 0x8A
#define | HID_KEYBOARD_SC_INTERNATIONAL5 0x8B
#define | HID_KEYBOARD_SC_INTERNATIONAL6 0x8C
#define | HID_KEYBOARD_SC_INTERNATIONAL7 0x8D
#define | HID_KEYBOARD_SC_INTERNATIONAL8 0x8E
#define | HID_KEYBOARD_SC_INTERNATIONAL9 0x8F
#define | HID_KEYBOARD_SC_LANG1 0x90
#define | HID_KEYBOARD_SC_LANG2 0x91
#define | HID_KEYBOARD_SC_LANG3 0x92
#define | HID_KEYBOARD_SC_LANG4 0x93
#define | HID_KEYBOARD_SC_LANG5 0x94
#define | HID_KEYBOARD_SC_LANG6 0x95
#define | HID_KEYBOARD_SC_LANG7 0x96
#define | HID_KEYBOARD_SC_LANG8 0x97
#define | HID_KEYBOARD_SC_LANG9 0x98
#define | HID_KEYBOARD_SC_ALTERNATE_ERASE 0x99
#define | HID_KEYBOARD_SC_SYSREQ 0x9A
#define | HID_KEYBOARD_SC_CANCEL 0x9B
#define | HID_KEYBOARD_SC_CLEAR 0x9C
#define | HID_KEYBOARD_SC_PRIOR 0x9D
#define | HID_KEYBOARD_SC_RETURN 0x9E
#define | HID_KEYBOARD_SC_SEPARATOR 0x9F
#define | HID_KEYBOARD_SC_OUT 0xA0
#define | HID_KEYBOARD_SC_OPER 0xA1
#define | HID_KEYBOARD_SC_CLEAR_AND_AGAIN 0xA2
#define | HID_KEYBOARD_SC_CRSEL_AND_PROPS 0xA3
#define | HID_KEYBOARD_SC_EXSEL 0xA4
#define | HID_KEYBOARD_SC_KEYPAD_00 0xB0
#define | HID_KEYBOARD_SC_KEYPAD_000 0xB1
#define | HID_KEYBOARD_SC_THOUSANDS_SEPARATOR 0xB2
#define | HID_KEYBOARD_SC_DECIMAL_SEPARATOR 0xB3
#define | HID_KEYBOARD_SC_CURRENCY_UNIT 0xB4
#define | HID_KEYBOARD_SC_CURRENCY_SUB_UNIT 0xB5
#define | HID_KEYBOARD_SC_KEYPAD_OPENING_PARENTHESIS 0xB6
#define | HID_KEYBOARD_SC_KEYPAD_CLOSING_PARENTHESIS 0xB7
#define | HID_KEYBOARD_SC_KEYPAD_OPENING_BRACE 0xB8
#define | HID_KEYBOARD_SC_KEYPAD_CLOSING_BRACE 0xB9
#define | HID_KEYBOARD_SC_KEYPAD_TAB 0xBA
#define | HID_KEYBOARD_SC_KEYPAD_BACKSPACE 0xBB
#define | HID_KEYBOARD_SC_KEYPAD_A 0xBC
#define | HID_KEYBOARD_SC_KEYPAD_B 0xBD
#define | HID_KEYBOARD_SC_KEYPAD_C 0xBE
#define | HID_KEYBOARD_SC_KEYPAD_D 0xBF
#define | HID_KEYBOARD_SC_KEYPAD_E 0xC0
#define | HID_KEYBOARD_SC_KEYPAD_F 0xC1
#define | HID_KEYBOARD_SC_KEYPAD_XOR 0xC2
#define | HID_KEYBOARD_SC_KEYPAD_CARET 0xC3
#define | HID_KEYBOARD_SC_KEYPAD_PERCENTAGE 0xC4
#define | HID_KEYBOARD_SC_KEYPAD_LESS_THAN_SIGN 0xC5
#define | HID_KEYBOARD_SC_KEYPAD_GREATER_THAN_SIGN 0xC6
#define | HID_KEYBOARD_SC_KEYPAD_AMP 0xC7
#define | HID_KEYBOARD_SC_KEYPAD_AMP_AMP 0xC8
#define | HID_KEYBOARD_SC_KEYPAD_PIPE 0xC9
#define | HID_KEYBOARD_SC_KEYPAD_PIPE_PIPE 0xCA
#define | HID_KEYBOARD_SC_KEYPAD_COLON 0xCB
#define | HID_KEYBOARD_SC_KEYPAD_HASHMARK 0xCC
#define | HID_KEYBOARD_SC_KEYPAD_SPACE 0xCD
#define | HID_KEYBOARD_SC_KEYPAD_AT 0xCE
#define | HID_KEYBOARD_SC_KEYPAD_EXCLAMATION_SIGN 0xCF
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_STORE 0xD0
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_RECALL 0xD1
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_CLEAR 0xD2
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_ADD 0xD3
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_SUBTRACT 0xD4
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_MULTIPLY 0xD5
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_DIVIDE 0xD6
#define | HID_KEYBOARD_SC_KEYPAD_PLUS_AND_MINUS 0xD7
#define | HID_KEYBOARD_SC_KEYPAD_CLEAR 0xD8
#define | HID_KEYBOARD_SC_KEYPAD_CLEAR_ENTRY 0xD9
#define | HID_KEYBOARD_SC_KEYPAD_BINARY 0xDA
#define | HID_KEYBOARD_SC_KEYPAD_OCTAL 0xDB
#define | HID_KEYBOARD_SC_KEYPAD_DECIMAL 0xDC
#define | HID_KEYBOARD_SC_KEYPAD_HEXADECIMAL 0xDD
#define | HID_KEYBOARD_SC_LEFT_CONTROL 0xE0
#define | HID_KEYBOARD_SC_LEFT_SHIFT 0xE1
#define | HID_KEYBOARD_SC_LEFT_ALT 0xE2
#define | HID_KEYBOARD_SC_LEFT_GUI 0xE3
#define | HID_KEYBOARD_SC_RIGHT_CONTROL 0xE4
#define | HID_KEYBOARD_SC_RIGHT_SHIFT 0xE5
#define | HID_KEYBOARD_SC_RIGHT_ALT 0xE6
#define | HID_KEYBOARD_SC_RIGHT_GUI 0xE7
#define | HID_KEYBOARD_SC_MEDIA_PLAY 0xE8
#define | HID_KEYBOARD_SC_MEDIA_STOP 0xE9
#define | HID_KEYBOARD_SC_MEDIA_PREVIOUS_TRACK 0xEA
#define | HID_KEYBOARD_SC_MEDIA_NEXT_TRACK 0xEB
#define | HID_KEYBOARD_SC_MEDIA_EJECT 0xEC
#define | HID_KEYBOARD_SC_MEDIA_VOLUME_UP 0xED
#define | HID_KEYBOARD_SC_MEDIA_VOLUME_DOWN 0xEE
#define | HID_KEYBOARD_SC_MEDIA_MUTE 0xEF
#define | HID_KEYBOARD_SC_MEDIA_WWW 0xF0
#define | HID_KEYBOARD_SC_MEDIA_BACKWARD 0xF1
#define | HID_KEYBOARD_SC_MEDIA_FORWARD 0xF2
#define | HID_KEYBOARD_SC_MEDIA_CANCEL 0xF3
#define | HID_KEYBOARD_SC_MEDIA_SEARCH 0xF4
#define | HID_KEYBOARD_SC_MEDIA_SLEEP 0xF8
#define | HID_KEYBOARD_SC_MEDIA_LOCK 0xF9
#define | HID_KEYBOARD_SC_MEDIA_RELOAD 0xFA
#define | HID_KEYBOARD_SC_MEDIA_CALCULATOR 0xFB

Common HID Device Report Descriptors

#define | HID_DESCRIPTOR_JOYSTICK(MinAxisVal, MaxAxisVal, MinPhysicalVal, MaxPhysicalVal, Buttons)
#define | HID_DESCRIPTOR_KEYBOARD(MaxKeys)
#define | HID_DESCRIPTOR_MOUSE(MinAxisVal, MaxAxisVal, MinPhysicalVal, MaxPhysicalVal, Buttons, AbsoluteCoords)
#define | HID_DESCRIPTOR_VENDOR(VendorPageNum, CollectionUsage, DataINUsage, DataOUTUsage, NumBytes)

Detailed Description

Module Description

Constants, Types and Enum definitions that are common to both Device and Host modes for the USB HID Class.

Macro Definition Documentation

#define HID_DESCRIPTOR_JOYSTICK | ( | MinAxisVal,
 |  | MaxAxisVal,
 |  | MinPhysicalVal,
 |  | MaxPhysicalVal,
 |  | Buttons
 | ) |

A list of HID report item array elements that describe a typical HID USB Joystick. The resulting report descriptor is structured according to the following layout:

1 struct
2 {
3 intA_t X; // Signed X axis value
4 intA_t Y; // Signed Y axis value
5 intA_t Z; // Signed Z axis value
6 uintB_t Buttons; // Pressed buttons bitmask
7 } Joystick_Report;

Where uintA_t is a type large enough to hold the ranges of the signed MinAxisVal and MaxAxisVal values, and intB_t is a type large enough to hold one bit per button.

Parameters
[in] | MinAxisVal | Minimum logical axis value (16-bit).
[in] | MaxAxisVal | Maximum logical axis value (16-bit).
[in] | MinPhysicalVal | Minimum physical axis value, for movement resolution calculations (16-bit).
[in] | MaxPhysicalVal | Maximum physical axis value, for movement resolution calculations (16-bit).
[in] | Buttons | Total number of buttons in the device (8-bit).
#define HID_DESCRIPTOR_KEYBOARD ( MaxKeys )

A list of HID report item array elements that describe a typical HID USB keyboard. The resulting report descriptor is compatible with USB_KeyboardReport_Data_t when MaxKeys is equal to 6. For other values, the report will be structured according to the following layout:

1 struct
2 {
3 uint8_t Modifier; // Keyboard modifier byte indicating pressed modifier keys (\c HID_KEYBOARD_MODIFER_* masks)
4 uint8_t Reserved; // Reserved for OEM use, always set to 0.
5 uint8_t KeyCode[MaxKeys]; // Length determined by the number of keys that can be reported
6 } Keyboard_Report;
Parameters
[in] MaxKeys Number of simultaneous keys that can be reported at the one time (8-bit).
#define HID_DESCRIPTOR_MOUSE | ( | MinAxisVal,
 |  | MaxAxisVal,
 |  | MinPhysicalVal,
 |  | MaxPhysicalVal,
 |  | Buttons,
 |  | AbsoluteCoords
 | ) |

A list of HID report item array elements that describe a typical HID USB mouse. The resulting report descriptor is compatible with USB_MouseReport_Data_t if the MinAxisVal and MaxAxisVal values fit within a int8_t range and the number of Buttons is less than 8. For other values, the report is structured according to the following layout:

1 struct
2 {
3 uintA_t Buttons; // Pressed buttons bitmask
4 intB_t X; // X axis value
5 intB_t Y; // Y axis value
6 } Mouse_Report;

Where intA_t is a type large enough to hold one bit per button, and intB_t is a type large enough to hold the ranges of the signed MinAxisVal and MaxAxisVal values.

Parameters
[in] | MinAxisVal | Minimum X/Y logical axis value (16-bit).
[in] | MaxAxisVal | Maximum X/Y logical axis value (16-bit).
[in] | MinPhysicalVal | Minimum X/Y physical axis value, for movement resolution calculations (16-bit).
[in] | MaxPhysicalVal | Maximum X/Y physical axis value, for movement resolution calculations (16-bit).
[in] | Buttons | Total number of buttons in the device (8-bit).
[in] | AbsoluteCoords | Boolean true to use absolute X/Y coordinates (e.g. touchscreen).
#define HID_DESCRIPTOR_VENDOR | ( | VendorPageNum,
 |  | CollectionUsage,
 |  | DataINUsage,
 |  | DataOUTUsage,
 |  | NumBytes
 | ) |

A list of HID report item array elements that describe a typical Vendor Defined byte array HID report descriptor, used for transporting arbitrary data between the USB host and device via HID reports. The resulting report should be a uint8_t byte array of the specified length in both Device to Host (IN) and Host to Device (OUT) directions.

Parameters
[in] | VendorPageNum | Vendor Defined HID Usage Page index, ranging from 0x00 to 0xFF.
[in] | CollectionUsage | Vendor Usage for the encompassing report IN and OUT collection, ranging from 0x00 to 0xFF.
[in] | DataINUsage | Vendor Usage for the IN report data, ranging from 0x00 to 0xFF.
[in] | DataOUTUsage | Vendor Usage for the OUT report data, ranging from 0x00 to 0xFF.
[in] | NumBytes | Length of the data IN and OUT reports.
#define HID_KEYBOARD_LED_CAPSLOCK (1 << 1)

Constant for a keyboard output report LED byte, indicating that the host's CAPS LOCK mode is currently set.

#define HID_KEYBOARD_LED_COMPOSE (1 << 3)

Constant for a keyboard output report LED byte, indicating that the host's COMPOSE mode is currently set.

#define HID_KEYBOARD_LED_KANA (1 << 4)

Constant for a keyboard output report LED byte, indicating that the host's KANA mode is currently set.

#define HID_KEYBOARD_LED_NUMLOCK (1 << 0)

Constant for a keyboard output report LED byte, indicating that the host's NUM LOCK mode is currently set.

#define HID_KEYBOARD_LED_SCROLLLOCK (1 << 2)

Constant for a keyboard output report LED byte, indicating that the host's SCROLL LOCK mode is currently set.

#define HID_KEYBOARD_MODIFIER_LEFTALT (1 << 2)

Constant for a keyboard report modifier byte, indicating that the keyboard's left alt key is currently pressed.

#define HID_KEYBOARD_MODIFIER_LEFTCTRL (1 << 0)

Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed.

#define HID_KEYBOARD_MODIFIER_LEFTGUI (1 << 3)

Constant for a keyboard report modifier byte, indicating that the keyboard's left GUI key is currently pressed.

#define HID_KEYBOARD_MODIFIER_LEFTSHIFT (1 << 1)

Constant for a keyboard report modifier byte, indicating that the keyboard's left shift key is currently pressed.

#define HID_KEYBOARD_MODIFIER_RIGHTALT (1 << 6)

Constant for a keyboard report modifier byte, indicating that the keyboard's right alt key is currently pressed.

#define HID_KEYBOARD_MODIFIER_RIGHTCTRL (1 << 4)

Constant for a keyboard report modifier byte, indicating that the keyboard's right control key is currently pressed.

#define HID_KEYBOARD_MODIFIER_RIGHTGUI (1 << 7)

Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed.

#define HID_KEYBOARD_MODIFIER_RIGHTSHIFT (1 << 5)

Constant for a keyboard report modifier byte, indicating that the keyboard's right shift key is currently pressed.

Typedef Documentation

typedef uint8_t USB_Descriptor_HIDReport_Datatype_t

Type define for the data type used to store HID report descriptor elements.

typedef { ... } USB_HID_Descriptor_HID_t

HID class-specific HID Descriptor (LUFA naming conventions).

Type define for the HID class-specific HID descriptor, to describe the HID device's specifications. Refer to the HID specification for details on the structure elements.

See also
USB_HID_StdDescriptor_HID_t for the version of this type with standard element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_HID_StdDescriptor_HID_t

HID class-specific HID Descriptor (USB-IF naming conventions).

Type define for the HID class-specific HID descriptor, to describe the HID device's specifications. Refer to the HID specification for details on the structure elements.

See also
USB_HID_Descriptor_HID_t for the version of this type with non-standard LUFA specific element names.
Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } USB_KeyboardReport_Data_t

Standard HID Boot Protocol Keyboard Report.

Type define for a standard Boot Protocol Keyboard report

typedef { ... } USB_MouseReport_Data_t

Standard HID Boot Protocol Mouse Report.

Type define for a standard Boot Protocol Mouse report

Enumeration Type Documentation

enum HID_ClassRequests_t

Enum for the HID class specific control requests that can be issued by the USB bus host.

Enumerator
HID_REQ_GetReport | HID class-specific Request to get the current HID report from the device.
HID_REQ_GetIdle | HID class-specific Request to get the current device idle count.
HID_REQ_GetProtocol | HID class-specific Request to get the current HID report protocol mode.
HID_REQ_SetReport | HID class-specific Request to set the current HID report to the device.
HID_REQ_SetIdle | HID class-specific Request to set the device's idle count.
HID_REQ_SetProtocol | HID class-specific Request to set the current HID report protocol mode.
enum HID_Descriptor_ClassSubclassProtocol_t

Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the HID device class.

Enumerator
HID_CSCP_HIDClass | Descriptor Class value indicating that the device or interface belongs to the HID class.
HID_CSCP_NonBootSubclass | Descriptor Subclass value indicating that the device or interface does not implement a HID boot protocol.
HID_CSCP_BootSubclass | Descriptor Subclass value indicating that the device or interface implements a HID boot protocol.
HID_CSCP_NonBootProtocol | Descriptor Protocol value indicating that the device or interface does not belong to a HID boot protocol.
HID_CSCP_KeyboardBootProtocol | Descriptor Protocol value indicating that the device or interface belongs to the Keyboard HID boot protocol.
HID_CSCP_MouseBootProtocol | Descriptor Protocol value indicating that the device or interface belongs to the Mouse HID boot protocol.
enum HID_DescriptorTypes_t

Enum for the HID class specific descriptor types.

Enumerator
HID_DTYPE_HID | Descriptor header type value, to indicate a HID class HID descriptor.
HID_DTYPE_Report | Descriptor header type value, to indicate a HID class HID report descriptor.
enum HID_ReportItemTypes_t

Enum for the different types of HID reports.

Enumerator
HID_REPORT_ITEM_In | Indicates that the item is an IN report type.
HID_REPORT_ITEM_Out | Indicates that the item is an OUT report type.
HID_REPORT_ITEM_Feature | Indicates that the item is a FEATURE report type.


XMC USB Library: HID Class Device Mode Driver

Data Structures | Functions
HID Class Device Mode Driver
USB Class Drivers » HID Class Driver

Data Structures

struct USB_ClassInfo_HID_Device_t
HID Class Device Mode Configuration and State Structure. More...

Functions

bool | HID_Device_ConfigureEndpoints (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | HID_Device_ProcessControlRequest (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | HID_Device_USBTask (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
bool | CALLBACK_HID_Device_CreateHIDReport (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, uint8_t *const ReportID, const uint8_t ReportType, void *ReportData, uint16_t *const ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(4) ATTR_NON_NULL_PTR_ARG(5)
void | CALLBACK_HID_Device_ProcessHIDReport (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, const uint8_t ReportID, const uint8_t ReportType, const void *ReportData, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4)

Detailed Description

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Device/HIDClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS)

Module Description

Device Mode USB Class driver framework interface, for the HID USB Class driver.

Function Documentation

bool CALLBACK_HID_Device_CreateHIDReport | ( | USB_ClassInfo_HID_Device_t *const | HIDInterfaceInfo,
 |  | uint8_t *const | ReportID,
 |  | const uint8_t | ReportType,
 |  | void * | ReportData,
 |  | uint16_t *const | ReportSize
 | ) |  |

HID class driver callback for the user creation of a HID IN report. This callback may fire in response to either HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the user is responsible for the creation of the next HID input report to be sent to the host.

Parameters
[in,out] | HIDInterfaceInfo | Pointer to a structure containing a HID Class configuration and state.
[in,out] | ReportID | If preset to a non-zero value, this is the report ID being requested by the host. If zero, this should be set to the report ID of the generated HID input report (if any). If multiple reports are not sent via the given HID interface, this parameter should be ignored.
[in] | ReportType | Type of HID report to generate, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature.
[out] | ReportData | Pointer to a buffer where the generated HID report should be stored.
[out] | ReportSize | Number of bytes in the generated input report, or zero if no report is to be sent.
Returns
Boolean true to force the sending of the report even if it is identical to the previous report and still within the idle period (useful for devices which report relative movement), false otherwise.
void CALLBACK_HID_Device_ProcessHIDReport | ( | USB_ClassInfo_HID_Device_t *const | HIDInterfaceInfo,
 |  | const uint8_t | ReportID,
 |  | const uint8_t | ReportType,
 |  | const void * | ReportData,
 |  | const uint16_t | ReportSize
 | ) |  |

HID class driver callback for the user processing of a received HID OUT report. This callback may fire in response to either HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the user is responsible for the processing of the received HID output report from the host.

Parameters
[in,out] | HIDInterfaceInfo | Pointer to a structure containing a HID Class configuration and state.
[in] | ReportID | Report ID of the received output report. If multiple reports are not received via the given HID interface, this parameter should be ignored.
[in] | ReportType | Type of received HID report, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature.
[in] | ReportData | Pointer to a buffer where the received HID report is stored.
[in] | ReportSize | Size in bytes of the received report from the host.
bool HID_Device_ConfigureEndpoints ( USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo )

Configures the endpoints of a given HID interface, ready for use. This should be linked to the library EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the given HID interface is selected.

Parameters
[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
Returns
Boolean true if the endpoints were successfully configured, false otherwise.
void HID_Device_ProcessControlRequest ( USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo )

Processes incoming control requests from the host, that are directed to the given HID class interface. This should be linked to the library EVENT_USB_Device_ControlRequest() event.

Parameters
[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
void HID_Device_USBTask ( USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo )

General management task for a given HID class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().

Parameters
[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.


XMC USB Library: USB_ClassInfo_HID_Device_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
USB_ClassInfo_HID_Device_t Struct Reference
USB Class Drivers » HID Class Driver » HID Class Device Mode Driver

HID Class Device Mode Configuration and State Structure. More...

#include <HIDClassDevice.h>

Data Fields

struct {
uint8_t InterfaceNumber
USB_Endpoint_Table_t ReportINEndpoint
void * PrevReportINBuffer
uint8_t PrevReportINBufferSize
} Config
struct {
bool UsingReportProtocol
uint16_t PrevFrameNum
uint16_t IdleCount
uint16_t IdleMSRemaining
} State

Detailed Description

HID Class Device Mode Configuration and State Structure.

Class state structure. An instance of this structure should be made for each HID interface within the user application, and passed to each of the HID class driver functions as the HIDInterfaceInfo parameter. This stores each HID interface's configuration and state information.

Note
Due to technical limitations, the HID device class driver does not utilize a separate OUT endpoint for host->device communications. Instead, the host->device data (if any) is sent to the device via the control endpoint.

Field Documentation

struct { ... } Config

Config data for the USB class interface within the device. All elements in this section must be set or the interface will fail to enumerate and operate correctly.

uint16_t IdleCount

Report idle period, in milliseconds, set by the host.

uint16_t IdleMSRemaining

Total number of milliseconds remaining before the idle period elapsed - this should be decremented by the user application if non-zero each millisecond.

uint8_t InterfaceNumber

Interface number of the HID interface within the device.

uint16_t PrevFrameNum

Frame number of the previous HID report packet opportunity.

void* PrevReportINBuffer

Pointer to a buffer where the previously created HID input report can be stored by the driver, for comparison purposes to detect report changes that must be sent immediately to the host. This should point to a buffer big enough to hold the largest HID input report sent from the HID interface. If this is set to NULL, it is up to the user to force transfers when needed in the CALLBACK_HID_Device_CreateHIDReport() callback function.

Note
Due to the single buffer, the internal driver can only correctly compare subsequent reports with identical report IDs. In multiple report devices, this buffer should be set to NULL and the decision to send reports made by the user application instead.
uint8_t PrevReportINBufferSize

Size in bytes of the given input report buffer. This is used to create a second buffer of the same size within the driver so that subsequent reports can be compared. If the user app is to determine when reports are to be sent exclusively (i.e. PrevReportINBuffer is NULL) this value must still be set to the size of the largest report the device can issue to the host.

USB_Endpoint_Table_t ReportINEndpoint

Data IN HID report endpoint configuration table.

struct { ... } State

State data for the USB class interface within the device. All elements in this section are reset to their defaults when the interface is enumerated.

bool UsingReportProtocol

Indicates if the HID interface is set to Boot or Report protocol mode.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Device/HIDClassDevice.h


XMC USB Library: Mass Storage Class Driver

Modules | Macros
Mass Storage Class Driver
USB Class Drivers

USB class driver for the USB-IF Bulk-Only Transport Mass Storage class standard. More...

Modules

Common Class Definitions
Mass Storage Class Device Mode Driver

Detailed Description

USB class driver for the USB-IF Bulk-Only Transport Mass Storage class standard.

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS)
  • LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c (Makefile source module name: LUFA_SRC_USBCLASS)

Module Description

Mass Storage Class Driver module. This module contains an internal implementation of the USB Mass Storage Class, for both Device and Host USB modes. User applications can use this class driver instead of implementing the Mass Storage class manually via the low-level LUFA APIs.

This module is designed to simplify the user code by exposing only the required interface needed to interface with Hosts or Devices using the USB Mass Storage Class.


XMC USB Library: Common Class Definitions

Macros | Typedefs | Enumerations
Common Class Definitions
USB Class Drivers » Mass Storage Class Driver

Macros

#define | MS_CBW_SIGNATURE 0x43425355UL
#define | MS_CSW_SIGNATURE 0x53425355UL
#define | MS_COMMAND_DIR_DATA_OUT (0 << 7)
#define | MS_COMMAND_DIR_DATA_IN (1 << 7)

Typedefs

struct {
uint32_t Signature
uint32_t Tag
uint32_t DataTransferLength
uint8_t Flags
uint8_t LUN
uint8_t SCSICommandLength
uint8_t SCSICommandData [16]
} MS_CommandBlockWrapper_t
Mass Storage Class Command Block Wrapper. More...
struct {
uint32_t Signature
uint32_t Tag
uint32_t DataTransferResidue
uint8_t Status
} MS_CommandStatusWrapper_t
Mass Storage Class Command Status Wrapper. More...
struct {
uint8_t ResponseCode
uint8_t SegmentNumber
unsigned SenseKey: 4
unsigned Reserved: 1
unsigned ILI: 1
unsigned EOM: 1
unsigned FileMark: 1
uint8_t Information [4]
uint8_t AdditionalLength
uint8_t CmdSpecificInformation [4]
uint8_t AdditionalSenseCode
uint8_t AdditionalSenseQualifier
uint8_t FieldReplaceableUnitCode
uint8_t SenseKeySpecific [3]
} SCSI_Request_Sense_Response_t
Mass Storage Class SCSI Sense Structure. More...
struct {
unsigned DeviceType: 5
unsigned PeripheralQualifier: 3
unsigned Reserved: 7
unsigned Removable: 1
uint8_t Version
unsigned ResponseDataFormat: 4
unsigned Reserved2: 1
unsigned NormACA: 1
unsigned TrmTsk: 1
unsigned AERC: 1
uint8_t AdditionalLength
uint8_t Reserved3 [2]
unsigned SoftReset: 1
unsigned CmdQue: 1
unsigned Reserved4: 1
unsigned Linked: 1
unsigned Sync: 1
unsigned WideBus16Bit: 1
unsigned WideBus32Bit: 1
unsigned RelAddr: 1
uint8_t VendorID [8]
uint8_t ProductID [16]
uint8_t RevisionID [4]
} SCSI_Inquiry_Response_t
Mass Storage Class SCSI Inquiry Structure. More...

Enumerations

enum | MS_Descriptor_ClassSubclassProtocol_t { MS_CSCP_MassStorageClass = 0x08, MS_CSCP_SCSITransparentSubclass = 0x06, MS_CSCP_BulkOnlyTransportProtocol = 0x50 }
enum | MS_ClassRequests_t { MS_REQ_GetMaxLUN = 0xFE, MS_REQ_MassStorageReset = 0xFF }
enum | MS_CommandStatusCodes_t { MS_SCSI_COMMAND_Pass = 0, MS_SCSI_COMMAND_Fail = 1, MS_SCSI_COMMAND_PhaseError = 2 }

SCSI Commands

#define | SCSI_CMD_INQUIRY 0x12
#define | SCSI_CMD_REQUEST_SENSE 0x03
#define | SCSI_CMD_TEST_UNIT_READY 0x00
#define | SCSI_CMD_READ_CAPACITY_10 0x25
#define | SCSI_CMD_START_STOP_UNIT 0x1B
#define | SCSI_CMD_SEND_DIAGNOSTIC 0x1D
#define | SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E
#define | SCSI_CMD_WRITE_10 0x2A
#define | SCSI_CMD_READ_10 0x28
#define | SCSI_CMD_WRITE_6 0x0A
#define | SCSI_CMD_READ_6 0x08
#define | SCSI_CMD_VERIFY_10 0x2F
#define | SCSI_CMD_MODE_SENSE_6 0x1A
#define | SCSI_CMD_MODE_SENSE_10 0x5A

SCSI Sense Key Values

#define | SCSI_SENSE_KEY_GOOD 0x00
#define | SCSI_SENSE_KEY_RECOVERED_ERROR 0x01
#define | SCSI_SENSE_KEY_NOT_READY 0x02
#define | SCSI_SENSE_KEY_MEDIUM_ERROR 0x03
#define | SCSI_SENSE_KEY_HARDWARE_ERROR 0x04
#define | SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
#define | SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
#define | SCSI_SENSE_KEY_DATA_PROTECT 0x07
#define | SCSI_SENSE_KEY_BLANK_CHECK 0x08
#define | SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09
#define | SCSI_SENSE_KEY_COPY_ABORTED 0x0A
#define | SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B
#define | SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D
#define | SCSI_SENSE_KEY_MISCOMPARE 0x0E

SCSI Additional Sense Codes

#define | SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00
#define | SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04
#define | SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24
#define | SCSI_ASENSE_NOT_READY_TO_READY_CHANGE 0x28
#define | SCSI_ASENSE_WRITE_PROTECTED 0x27
#define | SCSI_ASENSE_FORMAT_ERROR 0x31
#define | SCSI_ASENSE_INVALID_COMMAND 0x20
#define | SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21
#define | SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A

SCSI Additional Sense Key Code Qualifiers

#define | SCSI_ASENSEQ_NO_QUALIFIER 0x00
#define | SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01
#define | SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02
#define | SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07

Detailed Description

Module Description

Constants, Types and Enum definitions that are common to both Device and Host modes for the USB Mass Storage Class.

Macro Definition Documentation

#define MS_CBW_SIGNATURE 0x43425355UL

Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol.

#define MS_COMMAND_DIR_DATA_IN (1 << 7)

Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from device-to-host.

#define MS_COMMAND_DIR_DATA_OUT (0 << 7)

Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from host-to-device.

#define MS_CSW_SIGNATURE 0x53425355UL

Magic signature for a Command Status Wrapper used in the Mass Storage Bulk-Only transport protocol.

#define SCSI_ASENSE_FORMAT_ERROR 0x31

SCSI Additional Sense Code to indicate an error whilst formatting the device medium.

#define SCSI_ASENSE_INVALID_COMMAND 0x20

SCSI Additional Sense Code to indicate an invalid command was issued.

#define SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24

SCSI Additional Sense Code to indicate an invalid field was encountered while processing the issued command.

#define SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21

SCSI Additional Sense Code to indicate a write to a block out outside of the medium's range was issued.

#define SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04

SCSI Additional Sense Code to indicate that the logical unit (LUN) addressed is not ready.

#define SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A

SCSI Additional Sense Code to indicate that no removable medium is inserted into the device.

#define SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00

SCSI Additional Sense Code to indicate no additional sense information is available.

#define SCSI_ASENSE_NOT_READY_TO_READY_CHANGE 0x28

SCSI Additional Sense Code to indicate that a medium that was previously indicated as not ready has now become ready for use.

#define SCSI_ASENSE_WRITE_PROTECTED 0x27

SCSI Additional Sense Code to indicate that an attempt to write to a protected area was made.

#define SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01

SCSI Additional Sense Qualifier Code to indicate that a medium format command failed to complete.

#define SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02

SCSI Additional Sense Qualifier Code to indicate that an initializing command must be issued before the issued command can be executed.

#define SCSI_ASENSEQ_NO_QUALIFIER 0x00

SCSI Additional Sense Qualifier Code to indicate no additional sense qualifier information is available.

#define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07

SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress.

#define SCSI_CMD_INQUIRY 0x12

SCSI Command Code for an INQUIRY command.

#define SCSI_CMD_MODE_SENSE_10 0x5A

SCSI Command Code for a MODE SENSE (10) command.

#define SCSI_CMD_MODE_SENSE_6 0x1A

SCSI Command Code for a MODE SENSE (6) command.

#define SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E

SCSI Command Code for a PREVENT ALLOW MEDIUM REMOVAL command.

#define SCSI_CMD_READ_10 0x28

SCSI Command Code for a READ (10) command.

#define SCSI_CMD_READ_6 0x08

SCSI Command Code for a READ (6) command.

#define SCSI_CMD_READ_CAPACITY_10 0x25

SCSI Command Code for a READ CAPACITY (10) command.

#define SCSI_CMD_REQUEST_SENSE 0x03

SCSI Command Code for a REQUEST SENSE command.

#define SCSI_CMD_SEND_DIAGNOSTIC 0x1D

SCSI Command Code for a SEND DIAGNOSTIC command.

#define SCSI_CMD_START_STOP_UNIT 0x1B

SCSI Command Code for a START STOP UNIT command.

#define SCSI_CMD_TEST_UNIT_READY 0x00

SCSI Command Code for a TEST UNIT READY command.

#define SCSI_CMD_VERIFY_10 0x2F

SCSI Command Code for a VERIFY (10) command.

#define SCSI_CMD_WRITE_10 0x2A

SCSI Command Code for a WRITE (10) command.

#define SCSI_CMD_WRITE_6 0x0A

SCSI Command Code for a WRITE (6) command.

#define SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B

SCSI Sense Code to indicate that the device has aborted the issued command.

#define SCSI_SENSE_KEY_BLANK_CHECK 0x08

SCSI Sense Code to indicate an error while trying to write to a write-once medium.

#define SCSI_SENSE_KEY_COPY_ABORTED 0x0A

SCSI Sense Code to indicate that an EXTENDED COPY command has aborted due to an error.

#define SCSI_SENSE_KEY_DATA_PROTECT 0x07

SCSI Sense Code to indicate that a write attempt on a protected block has been made.

#define SCSI_SENSE_KEY_GOOD 0x00

SCSI Sense Code to indicate no error has occurred.

#define SCSI_SENSE_KEY_HARDWARE_ERROR 0x04

SCSI Sense Code to indicate a hardware error has occurred.

#define SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05

SCSI Sense Code to indicate that an illegal request has been issued.

#define SCSI_SENSE_KEY_MEDIUM_ERROR 0x03

SCSI Sense Code to indicate an error whilst accessing the medium.

#define SCSI_SENSE_KEY_MISCOMPARE 0x0E

SCSI Sense Code to indicate that the source data did not match the data read from the medium.

#define SCSI_SENSE_KEY_NOT_READY 0x02

SCSI Sense Code to indicate that the device is not ready for a new command.

#define SCSI_SENSE_KEY_RECOVERED_ERROR 0x01

SCSI Sense Code to indicate that the device has recovered from an error.

#define SCSI_SENSE_KEY_UNIT_ATTENTION 0x06

SCSI Sense Code to indicate that the unit requires attention from the host to indicate a reset event, medium removal or other condition.

#define SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09

SCSI Sense Code to indicate a vendor specific error has occurred.

#define SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D

SCSI Sense Code to indicate an attempt to write past the end of a partition has been made.

Typedef Documentation

typedef { ... } MS_CommandBlockWrapper_t

Mass Storage Class Command Block Wrapper.

Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol.

Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } MS_CommandStatusWrapper_t

Mass Storage Class Command Status Wrapper.

Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol.

Note
Regardless of CPU architecture, these values should be stored as little endian.
typedef { ... } SCSI_Inquiry_Response_t

Mass Storage Class SCSI Inquiry Structure.

Type define for a SCSI Inquiry structure. Structures of this type are filled out by the device via the MS_Host_GetInquiryData() function, retrieving the attached device's information.

For details of the structure contents, refer to the SCSI specifications.

typedef { ... } SCSI_Request_Sense_Response_t

Mass Storage Class SCSI Sense Structure.

Type define for a SCSI Sense structure. Structures of this type are filled out by the device via the MS_Host_RequestSense() function, indicating the current sense data of the device (giving explicit error codes for the last issued command). For details of the structure contents, refer to the SCSI specifications.

Enumeration Type Documentation

enum MS_ClassRequests_t

Enum for the Mass Storage class specific control requests that can be issued by the USB bus host.

Enumerator
MS_REQ_GetMaxLUN | Mass Storage class-specific request to retrieve the total number of Logical Units (drives) in the SCSI device.
MS_REQ_MassStorageReset | Mass Storage class-specific request to reset the Mass Storage interface, ready for the next command.
enum MS_CommandStatusCodes_t

Enum for the possible command status wrapper return status codes.

Enumerator
MS_SCSI_COMMAND_Pass | Command completed with no error
MS_SCSI_COMMAND_Fail | Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command.
MS_SCSI_COMMAND_PhaseError | Command failed due to being invalid in the current phase.
enum MS_Descriptor_ClassSubclassProtocol_t

Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Mass Storage device class.

Enumerator
MS_CSCP_MassStorageClass | Descriptor Class value indicating that the device or interface belongs to the Mass Storage class.
MS_CSCP_SCSITransparentSubclass | Descriptor Subclass value indicating that the device or interface belongs to the SCSI Transparent Command Set subclass of the Mass storage class.
MS_CSCP_BulkOnlyTransportProtocol | Descriptor Protocol value indicating that the device or interface belongs to the Bulk Only Transport protocol of the Mass Storage class.


XMC USB Library: Mass Storage Class Device Mode Driver

Data Structures | Functions
Mass Storage Class Device Mode Driver
USB Class Drivers » Mass Storage Class Driver

Data Structures

struct USB_ClassInfo_MS_Device_t
Mass Storage Class Device Mode Configuration and State Structure. More...

Functions

bool | MS_Device_ConfigureEndpoints (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | MS_Device_ProcessControlRequest (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | MS_Device_USBTask (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
bool | CALLBACK_MS_Device_SCSICommandReceived (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)

Detailed Description

Module Source Dependencies

The following files must be built with any user project that uses this module:

  • LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c (Makefile source module name: LUFA_SRC_USBCLASS)

Module Description

Device Mode USB Class driver framework interface, for the Mass Storage USB Class driver.

Function Documentation

bool CALLBACK_MS_Device_SCSICommandReceived ( USB_ClassInfo_MS_Device_t *const MSInterfaceInfo )

Mass Storage class driver callback for the user processing of a received SCSI command. This callback will fire each time the host sends a SCSI command which requires processing by the user application. Inside this callback the user is responsible for the processing of the received SCSI command from the host. The SCSI command is available in the CommandBlock structure inside the Mass Storage class state structure passed as a parameter to the callback function.

Parameters
[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
Returns
Boolean true if the SCSI command was successfully processed, false otherwise.
bool MS_Device_ConfigureEndpoints ( USB_ClassInfo_MS_Device_t *const MSInterfaceInfo )

Configures the endpoints of a given Mass Storage interface, ready for use. This should be linked to the library EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the given Mass Storage interface is selected.

Parameters
[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
Returns
Boolean true if the endpoints were successfully configured, false otherwise.
void MS_Device_ProcessControlRequest ( USB_ClassInfo_MS_Device_t *const MSInterfaceInfo )

Processes incoming control requests from the host, that are directed to the given Mass Storage class interface. This should be linked to the library EVENT_USB_Device_ControlRequest() event.

Parameters
[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
void MS_Device_USBTask ( USB_ClassInfo_MS_Device_t *const MSInterfaceInfo )

General management task for a given Mass Storage class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().

Parameters
[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage configuration and state.


XMC USB Library: USB_ClassInfo_MS_Device_t Struct Reference

  • Data Structure Index
  • Data Fields
Data Fields
USB_ClassInfo_MS_Device_t Struct Reference
USB Class Drivers » Mass Storage Class Driver » Mass Storage Class Device Mode Driver

Mass Storage Class Device Mode Configuration and State Structure. More...

#include <MassStorageClassDevice.h>

Data Fields

struct {
uint8_t InterfaceNumber
USB_Endpoint_Table_t DataINEndpoint
USB_Endpoint_Table_t DataOUTEndpoint
uint8_t TotalLUNs
} Config
struct {
MS_CommandBlockWrapper_t CommandBlock
MS_CommandStatusWrapper_t CommandStatus
volatile bool IsMassStoreReset
} State

Detailed Description

Mass Storage Class Device Mode Configuration and State Structure.

Class state structure. An instance of this structure should be made for each Mass Storage interface within the user application, and passed to each of the Mass Storage class driver functions as the MSInterfaceInfo parameter. This stores each Mass Storage interface's configuration and state information.

Field Documentation

MS_CommandBlockWrapper_t CommandBlock

Mass Storage class command block structure, stores the received SCSI command from the host which is to be processed.

MS_CommandStatusWrapper_t CommandStatus

Mass Storage class command status structure, set elements to indicate the issued command's success or failure to the host.

struct { ... } Config

Config data for the USB class interface within the device. All elements in this section must be set or the interface will fail to enumerate and operate correctly.

USB_Endpoint_Table_t DataINEndpoint

Data IN endpoint configuration table.

USB_Endpoint_Table_t DataOUTEndpoint

Data OUT endpoint configuration table.

uint8_t InterfaceNumber

Interface number of the Mass Storage interface within the device.

volatile bool IsMassStoreReset

Flag indicating that the host has requested that the Mass Storage interface be reset and that all current Mass Storage operations should immediately abort.

struct { ... } State

State data for the USB class interface within the device. All elements in this section are reset to their defaults when the interface is enumerated.

uint8_t TotalLUNs

Total number of logical drives in the Mass Storage interface.

The documentation for this struct was generated from the following file:
  • C:/LLDWork/LLD/USBlib/USB/Class/Device/MassStorageClassDevice.h


XMC USB Library: Data Structures

  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
C HID_CollectionPath | HID Parser Report Item Collection Path Structure
C HID_MinMax_t | HID Parser Report Item Min/Max Structure
C HID_ReportInfo_t | HID Parser State Structure
C HID_ReportItem_Attributes_t | HID Parser Report Item Attributes Structure
C HID_ReportItem_t | HID Parser Report Item Details Structure
C HID_ReportSizeInfo_t | HID Parser Report Size Structure
C HID_StateTable_t |
C HID_Unit_t | HID Parser Report Item Unit Structure
C HID_Usage_t | HID Parser Report Item Usage Structure
C USB_ClassInfo_CDC_Device_t | CDC Class Device Mode Configuration and State Structure
C USB_ClassInfo_HID_Device_t | HID Class Device Mode Configuration and State Structure
C USB_ClassInfo_MS_Device_t | Mass Storage Class Device Mode Configuration and State Structure
C USB_Endpoint_Table_t |
C USB_Pipe_Table_t |
C USBD_Device | USBD Device
C USBD_Endpoint | USBD Endpoint


XMC USB Library: Data Structure Index

  • Data Structure Index
  • Data Fields
Data Structure Index
H | U
H
HID_ReportInfo_t HID_StateTable_t USB_ClassInfo_HID_Device_t USBD_Device
HID_ReportItem_Attributes_t HID_Unit_t USB_ClassInfo_MS_Device_t USBD_Endpoint
HID_CollectionPath HID_ReportItem_t HID_Usage_t USB_Endpoint_Table_t
HID_MinMax_t HID_ReportSizeInfo_t
U
USB_Pipe_Table_t
USB_ClassInfo_CDC_Device_t
H | U


XMC USB Library: Data Fields

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

- a -

  • Address : USB_Endpoint_Table_t , USB_Pipe_Table_t , USBD_Endpoint
  • Attributes : HID_ReportItem_t

- b -

  • Banks : USB_Endpoint_Table_t , USB_Pipe_Table_t
  • BitOffset : HID_ReportItem_t
  • BitSize : HID_ReportItem_Attributes_t

- c -

  • CollectionPath : HID_ReportItem_t
  • CollectionPaths : HID_ReportInfo_t
  • CommandBlock : USB_ClassInfo_MS_Device_t
  • CommandStatus : USB_ClassInfo_MS_Device_t
  • Config : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_HID_Device_t , USB_ClassInfo_MS_Device_t
  • Configuration : USBD_Device
  • ControlInterfaceNumber : USB_ClassInfo_CDC_Device_t
  • ControlLineStates : USB_ClassInfo_CDC_Device_t
  • CurrentDirection : USBD_Device
  • CurrentEndpoint : USBD_Device

- d -

  • DataINEndpoint : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_MS_Device_t
  • DataOUTEndpoint : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_MS_Device_t
  • DeviceToHost : USB_ClassInfo_CDC_Device_t
  • Direction : USBD_Endpoint
  • Driver : USBD_Device

- e -

  • EndpointAddress : USB_Pipe_Table_t
  • Endpoints : USBD_Device
  • EP0_State : USBD_Device
  • Exponent : HID_Unit_t

- h -

  • HostToDevice : USB_ClassInfo_CDC_Device_t

- i -

  • IdleCount : USB_ClassInfo_HID_Device_t
  • IdleMSRemaining : USB_ClassInfo_HID_Device_t
  • InBuffer : USBD_Endpoint
  • InBufferLength : USBD_Endpoint
  • InBytesAvailable : USBD_Endpoint
  • InDataBuffer : USBD_Endpoint
  • InDataLeft : USBD_Endpoint
  • InInUse : USBD_Endpoint
  • InterfaceNumber : USB_ClassInfo_HID_Device_t , USB_ClassInfo_MS_Device_t
  • InterfaceSettings : USBD_Device
  • IsConfigured : USBD_Device , USBD_Endpoint
  • IsEnabled : USBD_Endpoint
  • IsHalted : USBD_Endpoint
  • IsMassStoreReset : USB_ClassInfo_MS_Device_t
  • IsOutRecieved : USBD_Endpoint
  • IsSetupRecieved : USBD_Device
  • ItemFlags : HID_ReportItem_t
  • ItemType : HID_ReportItem_t

- l -

  • LargestReportSizeBits : HID_ReportInfo_t
  • LineEncoding : USB_ClassInfo_CDC_Device_t
  • Logical : HID_ReportItem_Attributes_t

- m -

  • Maximum : HID_MinMax_t
  • MaxPacketSize : USBD_Endpoint
  • Minimum : HID_MinMax_t

- n -

  • NotificationEndpoint : USB_ClassInfo_CDC_Device_t
  • Number : USBD_Endpoint

- o -

  • OutBuffer : USBD_Endpoint
  • OutBufferLength : USBD_Endpoint
  • OutBytesAvailable : USBD_Endpoint
  • OutInUse : USBD_Endpoint
  • OutOffset : USBD_Endpoint

- p -

  • Page : HID_Usage_t
  • Parent : HID_CollectionPath
  • Physical : HID_ReportItem_Attributes_t
  • PreSuspendDeviceState : USBD_Device
  • PrevFrameNum : USB_ClassInfo_HID_Device_t
  • PreviousValue : HID_ReportItem_t
  • PrevReportINBuffer : USB_ClassInfo_HID_Device_t
  • PrevReportINBufferSize : USB_ClassInfo_HID_Device_t

- r -

  • RemoteWakeUp : USBD_Device
  • ReportID : HID_ReportItem_t , HID_ReportSizeInfo_t
  • ReportIDSizes : HID_ReportInfo_t
  • ReportINEndpoint : USB_ClassInfo_HID_Device_t
  • ReportItems : HID_ReportInfo_t
  • ReportSizeBits : HID_ReportSizeInfo_t

- s -

  • SelfPowered : USBD_Device
  • Size : USB_Endpoint_Table_t , USB_Pipe_Table_t
  • State : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_HID_Device_t , USB_ClassInfo_MS_Device_t

- t -

  • TotalDeviceReports : HID_ReportInfo_t
  • TotalLUNs : USB_ClassInfo_MS_Device_t
  • TotalReportItems : HID_ReportInfo_t
  • Type : HID_CollectionPath , HID_Unit_t , USB_Endpoint_Table_t , USB_Pipe_Table_t

- u -

  • Unit : HID_ReportItem_Attributes_t
  • Usage : HID_CollectionPath , HID_ReportItem_Attributes_t , HID_Usage_t
  • UsingReportIDs : HID_ReportInfo_t
  • UsingReportProtocol : USB_ClassInfo_HID_Device_t

- v -

  • Value : HID_ReportItem_t


XMC USB Library: Data Fields - Variables

  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v

- a -

  • Address : USB_Endpoint_Table_t , USB_Pipe_Table_t , USBD_Endpoint
  • Attributes : HID_ReportItem_t

- b -

  • Banks : USB_Endpoint_Table_t , USB_Pipe_Table_t
  • BitOffset : HID_ReportItem_t
  • BitSize : HID_ReportItem_Attributes_t

- c -

  • CollectionPath : HID_ReportItem_t
  • CollectionPaths : HID_ReportInfo_t
  • CommandBlock : USB_ClassInfo_MS_Device_t
  • CommandStatus : USB_ClassInfo_MS_Device_t
  • Config : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_HID_Device_t , USB_ClassInfo_MS_Device_t
  • Configuration : USBD_Device
  • ControlInterfaceNumber : USB_ClassInfo_CDC_Device_t
  • ControlLineStates : USB_ClassInfo_CDC_Device_t
  • CurrentDirection : USBD_Device
  • CurrentEndpoint : USBD_Device

- d -

  • DataINEndpoint : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_MS_Device_t
  • DataOUTEndpoint : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_MS_Device_t
  • DeviceToHost : USB_ClassInfo_CDC_Device_t
  • Direction : USBD_Endpoint
  • Driver : USBD_Device

- e -

  • EndpointAddress : USB_Pipe_Table_t
  • Endpoints : USBD_Device
  • EP0_State : USBD_Device
  • Exponent : HID_Unit_t

- h -

  • HostToDevice : USB_ClassInfo_CDC_Device_t

- i -

  • IdleCount : USB_ClassInfo_HID_Device_t
  • IdleMSRemaining : USB_ClassInfo_HID_Device_t
  • InBuffer : USBD_Endpoint
  • InBufferLength : USBD_Endpoint
  • InBytesAvailable : USBD_Endpoint
  • InDataBuffer : USBD_Endpoint
  • InDataLeft : USBD_Endpoint
  • InInUse : USBD_Endpoint
  • InterfaceNumber : USB_ClassInfo_HID_Device_t , USB_ClassInfo_MS_Device_t
  • InterfaceSettings : USBD_Device
  • IsConfigured : USBD_Device , USBD_Endpoint
  • IsEnabled : USBD_Endpoint
  • IsHalted : USBD_Endpoint
  • IsMassStoreReset : USB_ClassInfo_MS_Device_t
  • IsOutRecieved : USBD_Endpoint
  • IsSetupRecieved : USBD_Device
  • ItemFlags : HID_ReportItem_t
  • ItemType : HID_ReportItem_t

- l -

  • LargestReportSizeBits : HID_ReportInfo_t
  • LineEncoding : USB_ClassInfo_CDC_Device_t
  • Logical : HID_ReportItem_Attributes_t

- m -

  • Maximum : HID_MinMax_t
  • MaxPacketSize : USBD_Endpoint
  • Minimum : HID_MinMax_t

- n -

  • NotificationEndpoint : USB_ClassInfo_CDC_Device_t
  • Number : USBD_Endpoint

- o -

  • OutBuffer : USBD_Endpoint
  • OutBufferLength : USBD_Endpoint
  • OutBytesAvailable : USBD_Endpoint
  • OutInUse : USBD_Endpoint
  • OutOffset : USBD_Endpoint

- p -

  • Page : HID_Usage_t
  • Parent : HID_CollectionPath
  • Physical : HID_ReportItem_Attributes_t
  • PreSuspendDeviceState : USBD_Device
  • PrevFrameNum : USB_ClassInfo_HID_Device_t
  • PreviousValue : HID_ReportItem_t
  • PrevReportINBuffer : USB_ClassInfo_HID_Device_t
  • PrevReportINBufferSize : USB_ClassInfo_HID_Device_t

- r -

  • RemoteWakeUp : USBD_Device
  • ReportID : HID_ReportItem_t , HID_ReportSizeInfo_t
  • ReportIDSizes : HID_ReportInfo_t
  • ReportINEndpoint : USB_ClassInfo_HID_Device_t
  • ReportItems : HID_ReportInfo_t
  • ReportSizeBits : HID_ReportSizeInfo_t

- s -

  • SelfPowered : USBD_Device
  • Size : USB_Endpoint_Table_t , USB_Pipe_Table_t
  • State : USB_ClassInfo_CDC_Device_t , USB_ClassInfo_HID_Device_t , USB_ClassInfo_MS_Device_t

- t -

  • TotalDeviceReports : HID_ReportInfo_t
  • TotalLUNs : USB_ClassInfo_MS_Device_t
  • TotalReportItems : HID_ReportInfo_t
  • Type : HID_CollectionPath , HID_Unit_t , USB_Endpoint_Table_t , USB_Pipe_Table_t

- u -

  • Unit : HID_ReportItem_Attributes_t
  • Usage : HID_CollectionPath , HID_ReportItem_Attributes_t , HID_Usage_t
  • UsingReportIDs : HID_ReportInfo_t
  • UsingReportProtocol : USB_ClassInfo_HID_Device_t

- v -

  • Value : HID_ReportItem_t


XMC USB Library: File List

  • File List
  • Globals
File List
Here is a list of all documented files with brief descriptions:
[detail level 1234]
▼ USB |
▼ Class |
▼ Common |
CDCClassCommon.h | Common definitions and declarations for the library USB CDC Class driver
HIDClassCommon.h | Common definitions and declarations for the library USB HID Class driver
HIDParser.h | USB Human Interface Device (HID) Class report descriptor parser
HIDReportData.h | Constants for HID report item attributes
MassStorageClassCommon.h | Common definitions and declarations for the library USB Mass Storage Class driver
▼ Device |
CDCClassDevice.h | Device mode driver for the library USB CDC Class driver
HIDClassDevice.h | Device mode driver for the library USB HID Class driver
MassStorageClassDevice.h | Device mode driver for the library USB Mass Storage Class driver
CDCClass.h | Master include file for the library USB CDC-ACM Class driver
HIDClass.h | Master include file for the library USB HID Class driver
MassStorageClass.h | Master include file for the library USB Mass Storage Class driver
▼ Common | Common library header files
Architectures.h | Supported library architecture defines
ArchitectureSpecific.h | Architecture specific definitions relating to specific processor architectures
Attributes.h | Special function/variable attribute macros
BoardTypes.h | Supported pre-made board hardware defines
Common.h | Common library convenience headers, macros and functions
CompilerSpecific.h | Compiler specific definitions for code optimization and correctness
Endianness.h | Endianness and Byte Ordering macros and functions
▼ Core |
▼ XMC4000 |
Device_XMC4000.h | USB Device definitions for the Infineon XMC4000 microcontrollers
Endpoint_XMC4000.c | Source file for LUFA endpoint functions
Endpoint_XMC4000.h |
EndpointStream_XMC4000.c | Source file for LUFA Endpoint Streaming functions
EndpointStream_XMC4000.h | Endpoint data stream transmission and reception management for the XMC microcontrollers
USBController_XMC4000.h | USB Controller definitions for the Infineon XMC4000 microcontrollers
ConfigDescriptors.h | USB Configuration Descriptor definitions
Device.h | Common USB Device definitions for all architectures
DeviceStandardReq.h | USB device standard request management
EndPoint.h | USB Endpoint definitions for all architectures
EndpointStream.h | Endpoint data stream transmission and reception management
Events.h | USB Event management definitions
Host.h | Common USB Host definitions for all architectures
HostStandardReq.h | USB host standard request management
OTG.h | Common USB OTG definitions for all architectures
Pipe.h | Common USB Pipe definitions for all architectures
PipeStream.h | Pipe data stream transmission and reception management
StdDescriptors.h | Common standard USB Descriptor definitions for all architectures
StdRequestType.h | USB control endpoint request definitions
USBController.h | Common USB Controller definitions for all architectures
USBInterrupt.h | USB controller interrupt service routine management
USBMode.h | USB mode and feature support definitions
USBTask.h | Main USB service task management
USB.h | Master include file for the library USB functionality


XMC USB Library: C:/LLDWork/LLD/USBlib/USB Directory Reference

  • USB
USB Directory Reference

Directories

directory | Class
directory | Common
Common library header files.
directory | Core

Files

file USB.h [code]
Master include file for the library USB functionality.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class Directory Reference

  • USB
  • Class
Class Directory Reference

Directories

directory | Common
directory | Device

Files

file | CDCClass.h [code]
Master include file for the library USB CDC-ACM Class driver.
file | HIDClass.h [code]
Master include file for the library USB HID Class driver.
file | MassStorageClass.h [code]
Master include file for the library USB Mass Storage Class driver.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common Directory Reference

  • USB
  • Class
  • Common
Common Directory Reference

Files

file | CDCClassCommon.h [code]
Common definitions and declarations for the library USB CDC Class driver.
file | HIDClassCommon.h [code]
Common definitions and declarations for the library USB HID Class driver.
file | HIDParser.c
file | HIDParser.h [code]
USB Human Interface Device (HID) Class report descriptor parser.
file | HIDReportData.h [code]
Constants for HID report item attributes.
file | MassStorageClassCommon.h [code]
Common definitions and declarations for the library USB Mass Storage Class driver.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/CDCClassCommon.h File Reference

  • USB
  • Class
  • Common
Macros | Typedefs | Enumerations
CDCClassCommon.h File Reference

Common definitions and declarations for the library USB CDC Class driver. More...

#include "../../Core/StdDescriptors.h"

Go to the source code of this file.

Macros

#define | CDC_FUNCTIONAL_DESCRIPTOR(DataSize)
Virtual Control Line Masks
#define | CDC_CONTROL_LINE_OUT_DTR (1 << 0)
#define | CDC_CONTROL_LINE_OUT_RTS (1 << 1)
#define | CDC_CONTROL_LINE_IN_DCD (1 << 0)
#define | CDC_CONTROL_LINE_IN_DSR (1 << 1)
#define | CDC_CONTROL_LINE_IN_BREAK (1 << 2)
#define | CDC_CONTROL_LINE_IN_RING (1 << 3)
#define | CDC_CONTROL_LINE_IN_FRAMEERROR (1 << 4)
#define | CDC_CONTROL_LINE_IN_PARITYERROR (1 << 5)
#define | CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)

Typedefs

struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint16_t CDCSpecification
} USB_CDC_Descriptor_FunctionalHeader_t
CDC class-specific Functional Header Descriptor (LUFA naming conventions). More...
struct {
uint8_t bFunctionLength
uint8_t bDescriptorType
uint8_t bDescriptorSubType
uint16_t bcdCDC
} USB_CDC_StdDescriptor_FunctionalHeader_t
CDC class-specific Functional Header Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t Capabilities
} USB_CDC_Descriptor_FunctionalACM_t
CDC class-specific Functional ACM Descriptor (LUFA naming conventions). More...
struct {
uint8_t bFunctionLength
uint8_t bDescriptorType
uint8_t bDescriptorSubType
uint8_t bmCapabilities
} USB_CDC_StdDescriptor_FunctionalACM_t
CDC class-specific Functional ACM Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t Subtype
uint8_t MasterInterfaceNumber
uint8_t SlaveInterfaceNumber
} USB_CDC_Descriptor_FunctionalUnion_t
CDC class-specific Functional Union Descriptor (LUFA naming conventions). More...
struct {
uint8_t bFunctionLength
uint8_t bDescriptorType
uint8_t bDescriptorSubType
uint8_t bMasterInterface
uint8_t bSlaveInterface0
} USB_CDC_StdDescriptor_FunctionalUnion_t
CDC class-specific Functional Union Descriptor (USB-IF naming conventions). More...
struct {
uint32_t BaudRateBPS
uint8_t CharFormat
uint8_t ParityType
uint8_t DataBits
} CDC_LineEncoding_t
CDC Virtual Serial Port Line Encoding Settings Structure. More...

Enumerations

enum CDC_Descriptor_ClassSubclassProtocol_t {
CDC_CSCP_CDCClass = 0x02, CDC_CSCP_NoSpecificSubclass = 0x00, CDC_CSCP_ACMSubclass = 0x02, CDC_CSCP_ATCommandProtocol = 0x01,
CDC_CSCP_NoSpecificProtocol = 0x00, CDC_CSCP_VendorSpecificProtocol = 0xFF, CDC_CSCP_CDCDataClass = 0x0A, CDC_CSCP_NoDataSubclass = 0x00,
CDC_CSCP_NoDataProtocol = 0x00
}
enum CDC_ClassRequests_t {
CDC_REQ_SendEncapsulatedCommand = 0x00, CDC_REQ_GetEncapsulatedResponse = 0x01, CDC_REQ_SetLineEncoding = 0x20, CDC_REQ_GetLineEncoding = 0x21,
CDC_REQ_SetControlLineState = 0x22, CDC_REQ_SendBreak = 0x23
}
enum | CDC_ClassNotifications_t { CDC_NOTIF_SerialState = 0x20 }
enum CDC_DescriptorSubtypes_t {
CDC_DSUBTYPE_CSInterface_Header = 0x00, CDC_DSUBTYPE_CSInterface_CallManagement = 0x01, CDC_DSUBTYPE_CSInterface_ACM = 0x02, CDC_DSUBTYPE_CSInterface_DirectLine = 0x03,
CDC_DSUBTYPE_CSInterface_TelephoneRinger = 0x04, CDC_DSUBTYPE_CSInterface_TelephoneCall = 0x05, CDC_DSUBTYPE_CSInterface_Union = 0x06, CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07,
CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08, CDC_DSUBTYPE_CSInterface_USBTerminal = 0x09, CDC_DSUBTYPE_CSInterface_NetworkChannel = 0x0A, CDC_DSUBTYPE_CSInterface_ProtocolUnit = 0x0B,
CDC_DSUBTYPE_CSInterface_ExtensionUnit = 0x0C, CDC_DSUBTYPE_CSInterface_MultiChannel = 0x0D, CDC_DSUBTYPE_CSInterface_CAPI = 0x0E, CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F,
CDC_DSUBTYPE_CSInterface_ATM = 0x10
}
enum | CDC_LineEncodingFormats_t { CDC_LINEENCODING_OneStopBit = 0, CDC_LINEENCODING_OneAndAHalfStopBits = 1, CDC_LINEENCODING_TwoStopBits = 2 }
enum CDC_LineEncodingParity_t {
CDC_PARITY_None = 0, CDC_PARITY_Odd = 1, CDC_PARITY_Even = 2, CDC_PARITY_Mark = 3,
CDC_PARITY_Space = 4
}

Detailed Description

Common definitions and declarations for the library USB CDC Class driver.

Common definitions and declarations for the library USB CDC Class driver.

Note
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.

Variable Documentation

uint32_t BaudRateBPS

Baud rate of the virtual serial port, in bits per second.

uint16_t bcdCDC

Version number of the CDC specification implemented by the device, encoded in BCD format.

See also
VERSION_BCD() utility macro.
uint8_t bDescriptorSubType

Sub type value used to distinguish between CDC class-specific descriptors, must be CDC_DSUBTYPE_CSInterface_Header.

Sub type value used to distinguish between CDC class-specific descriptors, must be CDC_DSUBTYPE_CSInterface_ACM.

Sub type value used to distinguish between CDC class-specific descriptors, must be CDC_DSUBTYPE_CSInterface_Union.

uint8_t bDescriptorType

Type of the descriptor, either a value in USB_DescriptorTypes_t or a value given by the specific class.

uint8_t bFunctionLength

Size of the descriptor, in bytes.

uint8_t bMasterInterface

Interface number of the CDC Control interface.

uint8_t bmCapabilities

Capabilities of the ACM interface, given as a bit mask. For most devices, this should be set to a fixed value of 0x06 - for other capabilities, refer to the CDC ACM specification.

uint8_t bSlaveInterface0

Interface number of the CDC Data interface.

uint8_t Capabilities

Capabilities of the ACM interface, given as a bit mask. For most devices, this should be set to a fixed value of 0x06 - for other capabilities, refer to the CDC ACM specification.

uint16_t CDCSpecification

Version number of the CDC specification implemented by the device, encoded in BCD format.

See also
VERSION_BCD() utility macro.
uint8_t CharFormat

Character format of the virtual serial port, a value from the CDC_LineEncodingFormats_t enum.

uint8_t DataBits

Bits of data per character of the virtual serial port.

USB_Descriptor_Header_t Header

Regular descriptor header containing the descriptor's type and length.

uint8_t MasterInterfaceNumber

Interface number of the CDC Control interface.

uint8_t ParityType

Parity setting of the virtual serial port, a value from the CDC_LineEncodingParity_t enum.

uint8_t SlaveInterfaceNumber

Interface number of the CDC Data interface.

uint8_t Subtype

Sub type value used to distinguish between CDC class-specific descriptors, must be CDC_DSUBTYPE_CSInterface_Header.

Sub type value used to distinguish between CDC class-specific descriptors, must be CDC_DSUBTYPE_CSInterface_ACM.

Sub type value used to distinguish between CDC class-specific descriptors, must be CDC_DSUBTYPE_CSInterface_Union.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDClassCommon.h File Reference

  • USB
  • Class
  • Common
Typedefs | Enumerations
HIDClassCommon.h File Reference

Common definitions and declarations for the library USB HID Class driver. More...

#include "../../Core/StdDescriptors.h"
#include "HIDParser.h"

Go to the source code of this file.

Macros

Keyboard Standard Report Modifier Masks
#define | HID_KEYBOARD_MODIFIER_LEFTCTRL (1 << 0)
#define | HID_KEYBOARD_MODIFIER_LEFTSHIFT (1 << 1)
#define | HID_KEYBOARD_MODIFIER_LEFTALT (1 << 2)
#define | HID_KEYBOARD_MODIFIER_LEFTGUI (1 << 3)
#define | HID_KEYBOARD_MODIFIER_RIGHTCTRL (1 << 4)
#define | HID_KEYBOARD_MODIFIER_RIGHTSHIFT (1 << 5)
#define | HID_KEYBOARD_MODIFIER_RIGHTALT (1 << 6)
#define | HID_KEYBOARD_MODIFIER_RIGHTGUI (1 << 7)
Keyboard Standard Report LED Masks
#define | HID_KEYBOARD_LED_NUMLOCK (1 << 0)
#define | HID_KEYBOARD_LED_CAPSLOCK (1 << 1)
#define | HID_KEYBOARD_LED_SCROLLLOCK (1 << 2)
#define | HID_KEYBOARD_LED_COMPOSE (1 << 3)
#define | HID_KEYBOARD_LED_KANA (1 << 4)
Keyboard Standard Report Key Scan-codes
#define | HID_KEYBOARD_SC_ERROR_ROLLOVER 0x01
#define | HID_KEYBOARD_SC_POST_FAIL 0x02
#define | HID_KEYBOARD_SC_ERROR_UNDEFINED 0x03
#define | HID_KEYBOARD_SC_A 0x04
#define | HID_KEYBOARD_SC_B 0x05
#define | HID_KEYBOARD_SC_C 0x06
#define | HID_KEYBOARD_SC_D 0x07
#define | HID_KEYBOARD_SC_E 0x08
#define | HID_KEYBOARD_SC_F 0x09
#define | HID_KEYBOARD_SC_G 0x0A
#define | HID_KEYBOARD_SC_H 0x0B
#define | HID_KEYBOARD_SC_I 0x0C
#define | HID_KEYBOARD_SC_J 0x0D
#define | HID_KEYBOARD_SC_K 0x0E
#define | HID_KEYBOARD_SC_L 0x0F
#define | HID_KEYBOARD_SC_M 0x10
#define | HID_KEYBOARD_SC_N 0x11
#define | HID_KEYBOARD_SC_O 0x12
#define | HID_KEYBOARD_SC_P 0x13
#define | HID_KEYBOARD_SC_Q 0x14
#define | HID_KEYBOARD_SC_R 0x15
#define | HID_KEYBOARD_SC_S 0x16
#define | HID_KEYBOARD_SC_T 0x17
#define | HID_KEYBOARD_SC_U 0x18
#define | HID_KEYBOARD_SC_V 0x19
#define | HID_KEYBOARD_SC_W 0x1A
#define | HID_KEYBOARD_SC_X 0x1B
#define | HID_KEYBOARD_SC_Y 0x1C
#define | HID_KEYBOARD_SC_Z 0x1D
#define | HID_KEYBOARD_SC_1_AND_EXCLAMATION 0x1E
#define | HID_KEYBOARD_SC_2_AND_AT 0x1F
#define | HID_KEYBOARD_SC_3_AND_HASHMARK 0x20
#define | HID_KEYBOARD_SC_4_AND_DOLLAR 0x21
#define | HID_KEYBOARD_SC_5_AND_PERCENTAGE 0x22
#define | HID_KEYBOARD_SC_6_AND_CARET 0x23
#define | HID_KEYBOARD_SC_7_AND_AMPERSAND 0x24
#define | HID_KEYBOARD_SC_8_AND_ASTERISK 0x25
#define | HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS 0x26
#define | HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS 0x27
#define | HID_KEYBOARD_SC_ENTER 0x28
#define | HID_KEYBOARD_SC_ESCAPE 0x29
#define | HID_KEYBOARD_SC_BACKSPACE 0x2A
#define | HID_KEYBOARD_SC_TAB 0x2B
#define | HID_KEYBOARD_SC_SPACE 0x2C
#define | HID_KEYBOARD_SC_MINUS_AND_UNDERSCORE 0x2D
#define | HID_KEYBOARD_SC_EQUAL_AND_PLUS 0x2E
#define | HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE 0x2F
#define | HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE 0x30
#define | HID_KEYBOARD_SC_BACKSLASH_AND_PIPE 0x31
#define | HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE 0x32
#define | HID_KEYBOARD_SC_SEMICOLON_AND_COLON 0x33
#define | HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE 0x34
#define | HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE 0x35
#define | HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN 0x36
#define | HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN 0x37
#define | HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK 0x38
#define | HID_KEYBOARD_SC_CAPS_LOCK 0x39
#define | HID_KEYBOARD_SC_F1 0x3A
#define | HID_KEYBOARD_SC_F2 0x3B
#define | HID_KEYBOARD_SC_F3 0x3C
#define | HID_KEYBOARD_SC_F4 0x3D
#define | HID_KEYBOARD_SC_F5 0x3E
#define | HID_KEYBOARD_SC_F6 0x3F
#define | HID_KEYBOARD_SC_F7 0x40
#define | HID_KEYBOARD_SC_F8 0x41
#define | HID_KEYBOARD_SC_F9 0x42
#define | HID_KEYBOARD_SC_F10 0x43
#define | HID_KEYBOARD_SC_F11 0x44
#define | HID_KEYBOARD_SC_F12 0x45
#define | HID_KEYBOARD_SC_PRINT_SCREEN 0x46
#define | HID_KEYBOARD_SC_SCROLL_LOCK 0x47
#define | HID_KEYBOARD_SC_PAUSE 0x48
#define | HID_KEYBOARD_SC_INSERT 0x49
#define | HID_KEYBOARD_SC_HOME 0x4A
#define | HID_KEYBOARD_SC_PAGE_UP 0x4B
#define | HID_KEYBOARD_SC_DELETE 0x4C
#define | HID_KEYBOARD_SC_END 0x4D
#define | HID_KEYBOARD_SC_PAGE_DOWN 0x4E
#define | HID_KEYBOARD_SC_RIGHT_ARROW 0x4F
#define | HID_KEYBOARD_SC_LEFT_ARROW 0x50
#define | HID_KEYBOARD_SC_DOWN_ARROW 0x51
#define | HID_KEYBOARD_SC_UP_ARROW 0x52
#define | HID_KEYBOARD_SC_NUM_LOCK 0x53
#define | HID_KEYBOARD_SC_KEYPAD_SLASH 0x54
#define | HID_KEYBOARD_SC_KEYPAD_ASTERISK 0x55
#define | HID_KEYBOARD_SC_KEYPAD_MINUS 0x56
#define | HID_KEYBOARD_SC_KEYPAD_PLUS 0x57
#define | HID_KEYBOARD_SC_KEYPAD_ENTER 0x58
#define | HID_KEYBOARD_SC_KEYPAD_1_AND_END 0x59
#define | HID_KEYBOARD_SC_KEYPAD_2_AND_DOWN_ARROW 0x5A
#define | HID_KEYBOARD_SC_KEYPAD_3_AND_PAGE_DOWN 0x5B
#define | HID_KEYBOARD_SC_KEYPAD_4_AND_LEFT_ARROW 0x5C
#define | HID_KEYBOARD_SC_KEYPAD_5 0x5D
#define | HID_KEYBOARD_SC_KEYPAD_6_AND_RIGHT_ARROW 0x5E
#define | HID_KEYBOARD_SC_KEYPAD_7_AND_HOME 0x5F
#define | HID_KEYBOARD_SC_KEYPAD_8_AND_UP_ARROW 0x60
#define | HID_KEYBOARD_SC_KEYPAD_9_AND_PAGE_UP 0x61
#define | HID_KEYBOARD_SC_KEYPAD_0_AND_INSERT 0x62
#define | HID_KEYBOARD_SC_KEYPAD_DOT_AND_DELETE 0x63
#define | HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE 0x64
#define | HID_KEYBOARD_SC_APPLICATION 0x65
#define | HID_KEYBOARD_SC_POWER 0x66
#define | HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN 0x67
#define | HID_KEYBOARD_SC_F13 0x68
#define | HID_KEYBOARD_SC_F14 0x69
#define | HID_KEYBOARD_SC_F15 0x6A
#define | HID_KEYBOARD_SC_F16 0x6B
#define | HID_KEYBOARD_SC_F17 0x6C
#define | HID_KEYBOARD_SC_F18 0x6D
#define | HID_KEYBOARD_SC_F19 0x6E
#define | HID_KEYBOARD_SC_F20 0x6F
#define | HID_KEYBOARD_SC_F21 0x70
#define | HID_KEYBOARD_SC_F22 0x71
#define | HID_KEYBOARD_SC_F23 0x72
#define | HID_KEYBOARD_SC_F24 0x73
#define | HID_KEYBOARD_SC_EXECUTE 0x74
#define | HID_KEYBOARD_SC_HELP 0x75
#define | HID_KEYBOARD_SC_MENU 0x76
#define | HID_KEYBOARD_SC_SELECT 0x77
#define | HID_KEYBOARD_SC_STOP 0x78
#define | HID_KEYBOARD_SC_AGAIN 0x79
#define | HID_KEYBOARD_SC_UNDO 0x7A
#define | HID_KEYBOARD_SC_CUT 0x7B
#define | HID_KEYBOARD_SC_COPY 0x7C
#define | HID_KEYBOARD_SC_PASTE 0x7D
#define | HID_KEYBOARD_SC_FIND 0x7E
#define | HID_KEYBOARD_SC_MUTE 0x7F
#define | HID_KEYBOARD_SC_VOLUME_UP 0x80
#define | HID_KEYBOARD_SC_VOLUME_DOWN 0x81
#define | HID_KEYBOARD_SC_LOCKING_CAPS_LOCK 0x82
#define | HID_KEYBOARD_SC_LOCKING_NUM_LOCK 0x83
#define | HID_KEYBOARD_SC_LOCKING_SCROLL_LOCK 0x84
#define | HID_KEYBOARD_SC_KEYPAD_COMMA 0x85
#define | HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN_AS400 0x86
#define | HID_KEYBOARD_SC_INTERNATIONAL1 0x87
#define | HID_KEYBOARD_SC_INTERNATIONAL2 0x88
#define | HID_KEYBOARD_SC_INTERNATIONAL3 0x89
#define | HID_KEYBOARD_SC_INTERNATIONAL4 0x8A
#define | HID_KEYBOARD_SC_INTERNATIONAL5 0x8B
#define | HID_KEYBOARD_SC_INTERNATIONAL6 0x8C
#define | HID_KEYBOARD_SC_INTERNATIONAL7 0x8D
#define | HID_KEYBOARD_SC_INTERNATIONAL8 0x8E
#define | HID_KEYBOARD_SC_INTERNATIONAL9 0x8F
#define | HID_KEYBOARD_SC_LANG1 0x90
#define | HID_KEYBOARD_SC_LANG2 0x91
#define | HID_KEYBOARD_SC_LANG3 0x92
#define | HID_KEYBOARD_SC_LANG4 0x93
#define | HID_KEYBOARD_SC_LANG5 0x94
#define | HID_KEYBOARD_SC_LANG6 0x95
#define | HID_KEYBOARD_SC_LANG7 0x96
#define | HID_KEYBOARD_SC_LANG8 0x97
#define | HID_KEYBOARD_SC_LANG9 0x98
#define | HID_KEYBOARD_SC_ALTERNATE_ERASE 0x99
#define | HID_KEYBOARD_SC_SYSREQ 0x9A
#define | HID_KEYBOARD_SC_CANCEL 0x9B
#define | HID_KEYBOARD_SC_CLEAR 0x9C
#define | HID_KEYBOARD_SC_PRIOR 0x9D
#define | HID_KEYBOARD_SC_RETURN 0x9E
#define | HID_KEYBOARD_SC_SEPARATOR 0x9F
#define | HID_KEYBOARD_SC_OUT 0xA0
#define | HID_KEYBOARD_SC_OPER 0xA1
#define | HID_KEYBOARD_SC_CLEAR_AND_AGAIN 0xA2
#define | HID_KEYBOARD_SC_CRSEL_AND_PROPS 0xA3
#define | HID_KEYBOARD_SC_EXSEL 0xA4
#define | HID_KEYBOARD_SC_KEYPAD_00 0xB0
#define | HID_KEYBOARD_SC_KEYPAD_000 0xB1
#define | HID_KEYBOARD_SC_THOUSANDS_SEPARATOR 0xB2
#define | HID_KEYBOARD_SC_DECIMAL_SEPARATOR 0xB3
#define | HID_KEYBOARD_SC_CURRENCY_UNIT 0xB4
#define | HID_KEYBOARD_SC_CURRENCY_SUB_UNIT 0xB5
#define | HID_KEYBOARD_SC_KEYPAD_OPENING_PARENTHESIS 0xB6
#define | HID_KEYBOARD_SC_KEYPAD_CLOSING_PARENTHESIS 0xB7
#define | HID_KEYBOARD_SC_KEYPAD_OPENING_BRACE 0xB8
#define | HID_KEYBOARD_SC_KEYPAD_CLOSING_BRACE 0xB9
#define | HID_KEYBOARD_SC_KEYPAD_TAB 0xBA
#define | HID_KEYBOARD_SC_KEYPAD_BACKSPACE 0xBB
#define | HID_KEYBOARD_SC_KEYPAD_A 0xBC
#define | HID_KEYBOARD_SC_KEYPAD_B 0xBD
#define | HID_KEYBOARD_SC_KEYPAD_C 0xBE
#define | HID_KEYBOARD_SC_KEYPAD_D 0xBF
#define | HID_KEYBOARD_SC_KEYPAD_E 0xC0
#define | HID_KEYBOARD_SC_KEYPAD_F 0xC1
#define | HID_KEYBOARD_SC_KEYPAD_XOR 0xC2
#define | HID_KEYBOARD_SC_KEYPAD_CARET 0xC3
#define | HID_KEYBOARD_SC_KEYPAD_PERCENTAGE 0xC4
#define | HID_KEYBOARD_SC_KEYPAD_LESS_THAN_SIGN 0xC5
#define | HID_KEYBOARD_SC_KEYPAD_GREATER_THAN_SIGN 0xC6
#define | HID_KEYBOARD_SC_KEYPAD_AMP 0xC7
#define | HID_KEYBOARD_SC_KEYPAD_AMP_AMP 0xC8
#define | HID_KEYBOARD_SC_KEYPAD_PIPE 0xC9
#define | HID_KEYBOARD_SC_KEYPAD_PIPE_PIPE 0xCA
#define | HID_KEYBOARD_SC_KEYPAD_COLON 0xCB
#define | HID_KEYBOARD_SC_KEYPAD_HASHMARK 0xCC
#define | HID_KEYBOARD_SC_KEYPAD_SPACE 0xCD
#define | HID_KEYBOARD_SC_KEYPAD_AT 0xCE
#define | HID_KEYBOARD_SC_KEYPAD_EXCLAMATION_SIGN 0xCF
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_STORE 0xD0
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_RECALL 0xD1
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_CLEAR 0xD2
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_ADD 0xD3
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_SUBTRACT 0xD4
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_MULTIPLY 0xD5
#define | HID_KEYBOARD_SC_KEYPAD_MEMORY_DIVIDE 0xD6
#define | HID_KEYBOARD_SC_KEYPAD_PLUS_AND_MINUS 0xD7
#define | HID_KEYBOARD_SC_KEYPAD_CLEAR 0xD8
#define | HID_KEYBOARD_SC_KEYPAD_CLEAR_ENTRY 0xD9
#define | HID_KEYBOARD_SC_KEYPAD_BINARY 0xDA
#define | HID_KEYBOARD_SC_KEYPAD_OCTAL 0xDB
#define | HID_KEYBOARD_SC_KEYPAD_DECIMAL 0xDC
#define | HID_KEYBOARD_SC_KEYPAD_HEXADECIMAL 0xDD
#define | HID_KEYBOARD_SC_LEFT_CONTROL 0xE0
#define | HID_KEYBOARD_SC_LEFT_SHIFT 0xE1
#define | HID_KEYBOARD_SC_LEFT_ALT 0xE2
#define | HID_KEYBOARD_SC_LEFT_GUI 0xE3
#define | HID_KEYBOARD_SC_RIGHT_CONTROL 0xE4
#define | HID_KEYBOARD_SC_RIGHT_SHIFT 0xE5
#define | HID_KEYBOARD_SC_RIGHT_ALT 0xE6
#define | HID_KEYBOARD_SC_RIGHT_GUI 0xE7
#define | HID_KEYBOARD_SC_MEDIA_PLAY 0xE8
#define | HID_KEYBOARD_SC_MEDIA_STOP 0xE9
#define | HID_KEYBOARD_SC_MEDIA_PREVIOUS_TRACK 0xEA
#define | HID_KEYBOARD_SC_MEDIA_NEXT_TRACK 0xEB
#define | HID_KEYBOARD_SC_MEDIA_EJECT 0xEC
#define | HID_KEYBOARD_SC_MEDIA_VOLUME_UP 0xED
#define | HID_KEYBOARD_SC_MEDIA_VOLUME_DOWN 0xEE
#define | HID_KEYBOARD_SC_MEDIA_MUTE 0xEF
#define | HID_KEYBOARD_SC_MEDIA_WWW 0xF0
#define | HID_KEYBOARD_SC_MEDIA_BACKWARD 0xF1
#define | HID_KEYBOARD_SC_MEDIA_FORWARD 0xF2
#define | HID_KEYBOARD_SC_MEDIA_CANCEL 0xF3
#define | HID_KEYBOARD_SC_MEDIA_SEARCH 0xF4
#define | HID_KEYBOARD_SC_MEDIA_SLEEP 0xF8
#define | HID_KEYBOARD_SC_MEDIA_LOCK 0xF9
#define | HID_KEYBOARD_SC_MEDIA_RELOAD 0xFA
#define | HID_KEYBOARD_SC_MEDIA_CALCULATOR 0xFB
Common HID Device Report Descriptors
#define | HID_DESCRIPTOR_JOYSTICK(MinAxisVal, MaxAxisVal, MinPhysicalVal, MaxPhysicalVal, Buttons)
#define | HID_DESCRIPTOR_KEYBOARD(MaxKeys)
#define | HID_DESCRIPTOR_MOUSE(MinAxisVal, MaxAxisVal, MinPhysicalVal, MaxPhysicalVal, Buttons, AbsoluteCoords)
#define | HID_DESCRIPTOR_VENDOR(VendorPageNum, CollectionUsage, DataINUsage, DataOUTUsage, NumBytes)

Typedefs

struct {
USB_Descriptor_Header_t Header
uint16_t HIDSpec
uint8_t CountryCode
uint8_t TotalReportDescriptors
uint8_t HIDReportType
uint16_t HIDReportLength
} USB_HID_Descriptor_HID_t
HID class-specific HID Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdHID
uint8_t bCountryCode
uint8_t bNumDescriptors
uint8_t bDescriptorType2
uint16_t wDescriptorLength
} USB_HID_StdDescriptor_HID_t
HID class-specific HID Descriptor (USB-IF naming conventions). More...
struct {
uint8_t Button
int8_t X
int8_t Y
} USB_MouseReport_Data_t
Standard HID Boot Protocol Mouse Report. More...
struct {
uint8_t Modifier
uint8_t Reserved
uint8_t KeyCode [6]
} USB_KeyboardReport_Data_t
Standard HID Boot Protocol Keyboard Report. More...
typedef uint8_t USB_Descriptor_HIDReport_Datatype_t

Enumerations

enum HID_Descriptor_ClassSubclassProtocol_t {
HID_CSCP_HIDClass = 0x03, HID_CSCP_NonBootSubclass = 0x00, HID_CSCP_BootSubclass = 0x01, HID_CSCP_NonBootProtocol = 0x00,
HID_CSCP_KeyboardBootProtocol = 0x01, HID_CSCP_MouseBootProtocol = 0x02
}
enum HID_ClassRequests_t {
HID_REQ_GetReport = 0x01, HID_REQ_GetIdle = 0x02, HID_REQ_GetProtocol = 0x03, HID_REQ_SetReport = 0x09,
HID_REQ_SetIdle = 0x0A, HID_REQ_SetProtocol = 0x0B
}
enum | HID_DescriptorTypes_t { HID_DTYPE_HID = 0x21, HID_DTYPE_Report = 0x22 }
enum | HID_ReportItemTypes_t { HID_REPORT_ITEM_In = 0, HID_REPORT_ITEM_Out = 1, HID_REPORT_ITEM_Feature = 2 }

Detailed Description

Common definitions and declarations for the library USB HID Class driver.

Common definitions and declarations for the library USB HID Class driver.

Note
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.

Variable Documentation

uint16_t bcdHID

BCD encoded version that the HID descriptor and device complies to.

See also
VERSION_BCD() utility macro.
uint8_t bCountryCode

Country code of the localized device, or zero if universal.

uint8_t bDescriptorType

Type of the descriptor, either a value in USB_DescriptorTypes_t or a value given by the specific class.

uint8_t bDescriptorType2

Type of HID report, set to HID_DTYPE_Report.

uint8_t bLength

Size of the descriptor, in bytes.

uint8_t bNumDescriptors

Total number of HID report descriptors for the interface.

uint8_t Button

Button mask for currently pressed buttons in the mouse.

uint8_t CountryCode

Country code of the localized device, or zero if universal.

USB_Descriptor_Header_t Header

Regular descriptor header containing the descriptor's type and length.

uint16_t HIDReportLength

Length of the associated HID report descriptor, in bytes.

uint8_t HIDReportType

Type of HID report, set to HID_DTYPE_Report.

uint16_t HIDSpec

BCD encoded version that the HID descriptor and device complies to.

See also
VERSION_BCD() utility macro.
uint8_t KeyCode[6]

Key codes of the currently pressed keys.

uint8_t Modifier

Keyboard modifier byte, indicating pressed modifier keys (a combination of HID_KEYBOARD_MODIFER_* masks).

uint8_t Reserved

Reserved for OEM use, always set to 0.

uint8_t TotalReportDescriptors

Total number of HID report descriptors for the interface.

uint16_t wDescriptorLength

Length of the associated HID report descriptor, in bytes.

int8_t X

Current delta X movement of the mouse.

int8_t Y

Current delta Y movement on the mouse.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h File Reference

  • USB
  • Class
  • Common
Data Structures | Macros | Typedefs | Enumerations | Functions
HIDParser.h File Reference

USB Human Interface Device (HID) Class report descriptor parser. More...

#include "../../Common/Common.h"
#include "HIDReportData.h"
#include "HIDClassCommon.h"

Go to the source code of this file.

Data Structures

struct | HID_MinMax_t
HID Parser Report Item Min/Max Structure. More...
struct | HID_Unit_t
HID Parser Report Item Unit Structure. More...
struct | HID_Usage_t
HID Parser Report Item Usage Structure. More...
struct | HID_CollectionPath
HID Parser Report Item Collection Path Structure. More...
struct | HID_ReportItem_Attributes_t
HID Parser Report Item Attributes Structure. More...
struct | HID_ReportItem_t
HID Parser Report Item Details Structure. More...
struct | HID_ReportSizeInfo_t
HID Parser Report Size Structure. More...
struct | HID_ReportInfo_t
HID Parser State Structure. More...
struct | HID_StateTable_t

Macros

#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))

Typedefs

typedef struct HID_CollectionPath HID_CollectionPath_t
HID Parser Report Item Collection Path Structure. More...

Enumerations

enum HID_Parse_ErrorCodes_t {
HID_PARSE_Successful = 0, HID_PARSE_HIDStackOverflow = 1, HID_PARSE_HIDStackUnderflow = 2, HID_PARSE_InsufficientReportItems = 3,
HID_PARSE_UnexpectedEndCollection = 4, HID_PARSE_InsufficientCollectionPaths = 5, HID_PARSE_UsageListOverflow = 6, HID_PARSE_InsufficientReportIDItems = 7,
HID_PARSE_NoUnfilteredReportItems = 8
}

Functions

uint8_t | USB_ProcessHIDReport (const uint8_t *ReportData, uint16_t ReportSize, HID_ReportInfo_t *const ParserData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3)
bool | USB_GetHIDReportItemInfo (const uint8_t *ReportData, HID_ReportItem_t *const ReportItem) ATTR_NON_NULL_PTR_ARG(1)
void | USB_SetHIDReportItemInfo (uint8_t *ReportData, HID_ReportItem_t *const ReportItem) ATTR_NON_NULL_PTR_ARG(1)
uint16_t | USB_GetHIDReportSize (HID_ReportInfo_t *const ParserData, const uint8_t ReportID, const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1)
bool | CALLBACK_HIDParser_FilterHIDReportItem (HID_ReportItem_t *const CurrentItem)

Detailed Description

USB Human Interface Device (HID) Class report descriptor parser.

This file allows for the easy parsing of complex HID report descriptors, which describes the data that a HID device transmits to the host. It also provides an easy API for extracting and processing the data elements inside a HID report sent from an attached HID device.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDReportData.h File Reference

  • USB
  • Class
  • Common
Macros
HIDReportData.h File Reference

Constants for HID report item attributes. More...

Go to the source code of this file.

Macros

#define | HID_RI_DATA_SIZE_MASK 0x03
#define | HID_RI_TYPE_MASK 0x0C
#define | HID_RI_TAG_MASK 0xF0
#define | HID_RI_TYPE_MAIN 0x00
#define | HID_RI_TYPE_GLOBAL 0x04
#define | HID_RI_TYPE_LOCAL 0x08
#define | HID_RI_DATA_BITS_0 0x00
#define | HID_RI_DATA_BITS_8 0x01
#define | HID_RI_DATA_BITS_16 0x02
#define | HID_RI_DATA_BITS_32 0x03
#define | HID_RI_DATA_BITS(DataBits) CONCAT_EXPANDED(HID_RI_DATA_BITS_, DataBits)
#define | _HID_RI_ENCODE_0(Data)
#define | _HID_RI_ENCODE_8(Data) , (Data & 0xFF)
#define | _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_8(Data) _HID_RI_ENCODE_8(Data >> 8)
#define | _HID_RI_ENCODE_32(Data) _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_16(Data >> 16)
#define | _HID_RI_ENCODE(DataBits, ...) CONCAT_EXPANDED(_HID_RI_ENCODE_, DataBits(__VA_ARGS__))
#define | _HID_RI_ENTRY(Type, Tag, DataBits, ...) (Type | Tag | HID_RI_DATA_BITS(DataBits)) _HID_RI_ENCODE(DataBits, (__VA_ARGS__))
HID Input, Output and Feature Report Descriptor Item Flags
#define | HID_IOF_CONSTANT (1 << 0)
#define | HID_IOF_DATA (0 << 0)
#define | HID_IOF_VARIABLE (1 << 1)
#define | HID_IOF_ARRAY (0 << 1)
#define | HID_IOF_RELATIVE (1 << 2)
#define | HID_IOF_ABSOLUTE (0 << 2)
#define | HID_IOF_WRAP (1 << 3)
#define | HID_IOF_NO_WRAP (0 << 3)
#define | HID_IOF_NON_LINEAR (1 << 4)
#define | HID_IOF_LINEAR (0 << 4)
#define | HID_IOF_NO_PREFERRED_STATE (1 << 5)
#define | HID_IOF_PREFERRED_STATE (0 << 5)
#define | HID_IOF_NULLSTATE (1 << 6)
#define | HID_IOF_NO_NULL_POSITION (0 << 6)
#define | HID_IOF_VOLATILE (1 << 7)
#define | HID_IOF_NON_VOLATILE (0 << 7)
#define | HID_IOF_BUFFERED_BYTES (1 << 8)
#define | HID_IOF_BITFIELD (0 << 8)
HID Report Descriptor Item Macros
#define | HID_RI_INPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x80, DataBits, __VA_ARGS__)
#define | HID_RI_OUTPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x90, DataBits, __VA_ARGS__)
#define | HID_RI_COLLECTION(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xA0, DataBits, __VA_ARGS__)
#define | HID_RI_FEATURE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xB0, DataBits, __VA_ARGS__)
#define | HID_RI_END_COLLECTION(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xC0, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE_PAGE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x00, DataBits, __VA_ARGS__)
#define | HID_RI_LOGICAL_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x10, DataBits, __VA_ARGS__)
#define | HID_RI_LOGICAL_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x20, DataBits, __VA_ARGS__)
#define | HID_RI_PHYSICAL_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x30, DataBits, __VA_ARGS__)
#define | HID_RI_PHYSICAL_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x40, DataBits, __VA_ARGS__)
#define | HID_RI_UNIT_EXPONENT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x50, DataBits, __VA_ARGS__)
#define | HID_RI_UNIT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x60, DataBits, __VA_ARGS__)
#define | HID_RI_REPORT_SIZE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x70, DataBits, __VA_ARGS__)
#define | HID_RI_REPORT_ID(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x80, DataBits, __VA_ARGS__)
#define | HID_RI_REPORT_COUNT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x90, DataBits, __VA_ARGS__)
#define | HID_RI_PUSH(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0xA0, DataBits, __VA_ARGS__)
#define | HID_RI_POP(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0xB0, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x00, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x10, DataBits, __VA_ARGS__)
#define | HID_RI_USAGE_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x20, DataBits, __VA_ARGS__)

Detailed Description

Constants for HID report item attributes.

HID report item constants for report item attributes. Refer to the HID specification for details on each flag's meaning when applied to an IN, OUT or FEATURE item.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/MassStorageClassCommon.h File Reference

  • USB
  • Class
  • Common
Macros | Typedefs | Enumerations
MassStorageClassCommon.h File Reference

Common definitions and declarations for the library USB Mass Storage Class driver. More...

#include "../../Core/StdDescriptors.h"

Go to the source code of this file.

Macros

#define | MS_CBW_SIGNATURE 0x43425355UL
#define | MS_CSW_SIGNATURE 0x53425355UL
#define | MS_COMMAND_DIR_DATA_OUT (0 << 7)
#define | MS_COMMAND_DIR_DATA_IN (1 << 7)
SCSI Commands
#define | SCSI_CMD_INQUIRY 0x12
#define | SCSI_CMD_REQUEST_SENSE 0x03
#define | SCSI_CMD_TEST_UNIT_READY 0x00
#define | SCSI_CMD_READ_CAPACITY_10 0x25
#define | SCSI_CMD_START_STOP_UNIT 0x1B
#define | SCSI_CMD_SEND_DIAGNOSTIC 0x1D
#define | SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E
#define | SCSI_CMD_WRITE_10 0x2A
#define | SCSI_CMD_READ_10 0x28
#define | SCSI_CMD_WRITE_6 0x0A
#define | SCSI_CMD_READ_6 0x08
#define | SCSI_CMD_VERIFY_10 0x2F
#define | SCSI_CMD_MODE_SENSE_6 0x1A
#define | SCSI_CMD_MODE_SENSE_10 0x5A
SCSI Sense Key Values
#define | SCSI_SENSE_KEY_GOOD 0x00
#define | SCSI_SENSE_KEY_RECOVERED_ERROR 0x01
#define | SCSI_SENSE_KEY_NOT_READY 0x02
#define | SCSI_SENSE_KEY_MEDIUM_ERROR 0x03
#define | SCSI_SENSE_KEY_HARDWARE_ERROR 0x04
#define | SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
#define | SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
#define | SCSI_SENSE_KEY_DATA_PROTECT 0x07
#define | SCSI_SENSE_KEY_BLANK_CHECK 0x08
#define | SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09
#define | SCSI_SENSE_KEY_COPY_ABORTED 0x0A
#define | SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B
#define | SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D
#define | SCSI_SENSE_KEY_MISCOMPARE 0x0E
SCSI Additional Sense Codes
#define | SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00
#define | SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04
#define | SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24
#define | SCSI_ASENSE_NOT_READY_TO_READY_CHANGE 0x28
#define | SCSI_ASENSE_WRITE_PROTECTED 0x27
#define | SCSI_ASENSE_FORMAT_ERROR 0x31
#define | SCSI_ASENSE_INVALID_COMMAND 0x20
#define | SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21
#define | SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A
SCSI Additional Sense Key Code Qualifiers
#define | SCSI_ASENSEQ_NO_QUALIFIER 0x00
#define | SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01
#define | SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02
#define | SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07

Typedefs

struct {
uint32_t Signature
uint32_t Tag
uint32_t DataTransferLength
uint8_t Flags
uint8_t LUN
uint8_t SCSICommandLength
uint8_t SCSICommandData [16]
} MS_CommandBlockWrapper_t
Mass Storage Class Command Block Wrapper. More...
struct {
uint32_t Signature
uint32_t Tag
uint32_t DataTransferResidue
uint8_t Status
} MS_CommandStatusWrapper_t
Mass Storage Class Command Status Wrapper. More...
struct {
uint8_t ResponseCode
uint8_t SegmentNumber
unsigned SenseKey: 4
unsigned Reserved: 1
unsigned ILI: 1
unsigned EOM: 1
unsigned FileMark: 1
uint8_t Information [4]
uint8_t AdditionalLength
uint8_t CmdSpecificInformation [4]
uint8_t AdditionalSenseCode
uint8_t AdditionalSenseQualifier
uint8_t FieldReplaceableUnitCode
uint8_t SenseKeySpecific [3]
} SCSI_Request_Sense_Response_t
Mass Storage Class SCSI Sense Structure. More...
struct {
unsigned DeviceType: 5
unsigned PeripheralQualifier: 3
unsigned Reserved: 7
unsigned Removable: 1
uint8_t Version
unsigned ResponseDataFormat: 4
unsigned Reserved2: 1
unsigned NormACA: 1
unsigned TrmTsk: 1
unsigned AERC: 1
uint8_t AdditionalLength
uint8_t Reserved3 [2]
unsigned SoftReset: 1
unsigned CmdQue: 1
unsigned Reserved4: 1
unsigned Linked: 1
unsigned Sync: 1
unsigned WideBus16Bit: 1
unsigned WideBus32Bit: 1
unsigned RelAddr: 1
uint8_t VendorID [8]
uint8_t ProductID [16]
uint8_t RevisionID [4]
} SCSI_Inquiry_Response_t
Mass Storage Class SCSI Inquiry Structure. More...

Enumerations

enum | MS_Descriptor_ClassSubclassProtocol_t { MS_CSCP_MassStorageClass = 0x08, MS_CSCP_SCSITransparentSubclass = 0x06, MS_CSCP_BulkOnlyTransportProtocol = 0x50 }
enum | MS_ClassRequests_t { MS_REQ_GetMaxLUN = 0xFE, MS_REQ_MassStorageReset = 0xFF }
enum | MS_CommandStatusCodes_t { MS_SCSI_COMMAND_Pass = 0, MS_SCSI_COMMAND_Fail = 1, MS_SCSI_COMMAND_PhaseError = 2 }

Detailed Description

Common definitions and declarations for the library USB Mass Storage Class driver.

Common definitions and declarations for the library USB Mass Storage Class driver.

Note
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.

Variable Documentation

uint32_t DataTransferLength

Length of the optional data portion of the issued command, in bytes.

uint32_t DataTransferResidue

Number of bytes of data not processed in the SCSI command.

uint8_t Flags

Command block flags, indicating command data direction.

uint8_t LUN

Logical Unit number this command is issued to.

uint8_t SCSICommandData[16]

Issued SCSI command in the Command Block.

uint8_t SCSICommandLength

Length of the issued SCSI command within the SCSI command data array.

uint32_t Signature

Command block signature, must be MS_CBW_SIGNATURE to indicate a valid Command Block.

Status block signature, must be MS_CSW_SIGNATURE to indicate a valid Command Status.

uint8_t Status

Status code of the issued command - a value from the MS_CommandStatusCodes_t enum.

uint32_t Tag

Unique command ID value, to associate a command block wrapper with its command status wrapper.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device Directory Reference

  • USB
  • Class
  • Device
Device Directory Reference

Files

file | CDCClassDevice.c
file | CDCClassDevice.h [code]
Device mode driver for the library USB CDC Class driver.
file | HIDClassDevice.c
file | HIDClassDevice.h [code]
Device mode driver for the library USB HID Class driver.
file | MassStorageClassDevice.c
file | MassStorageClassDevice.h [code]
Device mode driver for the library USB Mass Storage Class driver.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device/CDCClassDevice.h File Reference

  • USB
  • Class
  • Device
Data Structures | Functions
CDCClassDevice.h File Reference

Device mode driver for the library USB CDC Class driver. More...

#include "../../USB.h"
#include "../Common/CDCClassCommon.h"
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct USB_ClassInfo_CDC_Device_t
CDC Class Device Mode Configuration and State Structure. More...

Functions

bool | CDC_Device_ConfigureEndpoints (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | CDC_Device_ProcessControlRequest (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | CDC_Device_USBTask (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | EVENT_CDC_Device_LineEncodingChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | EVENT_CDC_Device_ControLineStateChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | EVENT_CDC_Device_BreakSent (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | CDC_Device_SendData (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const void *const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
uint8_t | CDC_Device_SendString (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const char *const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
uint8_t | CDC_Device_SendByte (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1)
uint16_t | CDC_Device_BytesReceived (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
int16_t | CDC_Device_ReceiveByte (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | CDC_Device_Flush (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | CDC_Device_SendControlLineStateChange (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)

Detailed Description

Device mode driver for the library USB CDC Class driver.

Device mode driver for the library USB CDC Class driver.

Note
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device/HIDClassDevice.h File Reference

  • USB
  • Class
  • Device
Data Structures | Functions
HIDClassDevice.h File Reference

Device mode driver for the library USB HID Class driver. More...

#include "../../USB.h"
#include "../Common/HIDClassCommon.h"

Go to the source code of this file.

Data Structures

struct USB_ClassInfo_HID_Device_t
HID Class Device Mode Configuration and State Structure. More...

Functions

bool | HID_Device_ConfigureEndpoints (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | HID_Device_ProcessControlRequest (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | HID_Device_USBTask (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
bool | CALLBACK_HID_Device_CreateHIDReport (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, uint8_t *const ReportID, const uint8_t ReportType, void *ReportData, uint16_t *const ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(4) ATTR_NON_NULL_PTR_ARG(5)
void | CALLBACK_HID_Device_ProcessHIDReport (USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, const uint8_t ReportID, const uint8_t ReportType, const void *ReportData, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4)

Detailed Description

Device mode driver for the library USB HID Class driver.

Device mode driver for the library USB HID Class driver.

Note
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device/MassStorageClassDevice.h File Reference

  • USB
  • Class
  • Device
Data Structures | Functions
MassStorageClassDevice.h File Reference

Device mode driver for the library USB Mass Storage Class driver. More...

#include "../../USB.h"
#include "../Common/MassStorageClassCommon.h"

Go to the source code of this file.

Data Structures

struct USB_ClassInfo_MS_Device_t
Mass Storage Class Device Mode Configuration and State Structure. More...

Functions

bool | MS_Device_ConfigureEndpoints (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | MS_Device_ProcessControlRequest (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
void | MS_Device_USBTask (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
bool | CALLBACK_MS_Device_SCSICommandReceived (USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)

Detailed Description

Device mode driver for the library USB Mass Storage Class driver.

Device mode driver for the library USB Mass Storage Class driver.

Note
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/CDCClass.h File Reference

  • USB
  • Class
Macros
CDCClass.h File Reference

Master include file for the library USB CDC-ACM Class driver. More...

#include "../Core/USBMode.h"
#include "Device/CDCClassDevice.h"

Go to the source code of this file.

Detailed Description

Master include file for the library USB CDC-ACM Class driver.

Master include file for the library USB CDC Class driver, for both host and device modes, where available.

This file should be included in all user projects making use of this optional class driver, instead of including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/HIDClass.h File Reference

  • USB
  • Class
Macros
HIDClass.h File Reference

Master include file for the library USB HID Class driver. More...

#include "../Core/USBMode.h"
#include "Device/HIDClassDevice.h"

Go to the source code of this file.

Detailed Description

Master include file for the library USB HID Class driver.

Master include file for the library USB HID Class driver, for both host and device modes, where available.

This file should be included in all user projects making use of this optional class driver, instead of including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/MassStorageClass.h File Reference

  • USB
  • Class
Macros
MassStorageClass.h File Reference

Master include file for the library USB Mass Storage Class driver. More...

#include "../Core/USBMode.h"
#include "Device/MassStorageClassDevice.h"

Go to the source code of this file.

Detailed Description

Master include file for the library USB Mass Storage Class driver.

Master include file for the library USB Mass Storage Class driver, for both host and device modes, where available.

This file should be included in all user projects making use of this optional class driver, instead of including any headers in the USB/ClassDriver/Device, USB/ClassDriver/Host or USB/ClassDriver/Common subdirectories.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common Directory Reference

  • USB
  • Common
Common Directory Reference

Common library header files.

More...

Files

file | Architectures.h [code]
Supported library architecture defines.
file | ArchitectureSpecific.h [code]
Architecture specific definitions relating to specific processor architectures.
file | Attributes.h [code]
Special function/variable attribute macros.
file | BoardTypes.h [code]
Supported pre-made board hardware defines.
file | Common.h [code]
Common library convenience headers, macros and functions.
file | CompilerSpecific.h [code]
Compiler specific definitions for code optimization and correctness.
file | Endianness.h [code]
Endianness and Byte Ordering macros and functions.

Detailed Description

Common library header files.

This folder contains header files which are common to all parts of the LUFA library. They may be used freely in user applications.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Architectures.h File Reference

  • USB
  • Common
Architectures.h File Reference

Supported library architecture defines. More...

Go to the source code of this file.

Detailed Description

Supported library architecture defines.

Architecture macros for selecting the desired target microcontroller architecture. One of these values should be defined as the value of ARCH in the user project makefile via the -D compiler switch to GCC, to select the target architecture.

The selected architecture should remain consistent with the makefile ARCH value, which is used to select the underlying driver source files for each architecture.

Note
Do not include this file directly, rather include the Common.h header file instead to gain this file's functionality.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/ArchitectureSpecific.h File Reference

  • USB
  • Common
ArchitectureSpecific.h File Reference

Architecture specific definitions relating to specific processor architectures. More...

Go to the source code of this file.

Detailed Description

Architecture specific definitions relating to specific processor architectures.

Architecture specific macros, functions and other definitions, which relate to specific architectures. This definitions may or may not be available in some form on other architectures, and thus should be protected by preprocessor checks in portable code to prevent compile errors.

Note
Do not include this file directly, rather include the Common.h header file instead to gain this file's functionality.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Attributes.h File Reference

  • USB
  • Common
Attributes.h File Reference

Special function/variable attribute macros. More...

Go to the source code of this file.

Detailed Description

Special function/variable attribute macros.

This module contains macros for applying specific attributes to functions and variables to control various optimizer and code generation features of the compiler. Attributes may be placed in the function prototype or variable declaration in any order, and multiple attributes can be specified for a single item via a space separated list.

On incompatible versions of GCC or on other compilers, these macros evaluate to nothing unless they are critical to the code's function and thus must throw a compile error when used.

Note
Do not include this file directly, rather include the Common.h header file instead to gain this file's functionality.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/BoardTypes.h File Reference

  • USB
  • Common
Macros
BoardTypes.h File Reference

Supported pre-made board hardware defines. More...

Go to the source code of this file.

Macros

#define | BOARD_USER 0
#define | BOARD_NONE 1
#define | BOARD_USBKEY 2
#define | BOARD_STK525 3
#define | BOARD_STK526 4
#define | BOARD_RZUSBSTICK 5
#define | BOARD_ATAVRUSBRF01 6
#define | BOARD_BUMBLEB 7
#define | BOARD_XPLAIN 8
#define | BOARD_XPLAIN_REV1 9
#define | BOARD_EVK527 10
#define | BOARD_TEENSY 11
#define | BOARD_USBTINYMKII 12
#define | BOARD_BENITO 13
#define | BOARD_JMDBU2 14
#define | BOARD_OLIMEX162 15
#define | BOARD_UDIP 16
#define | BOARD_BUI 17
#define | BOARD_UNO 18
#define | BOARD_CULV3 19
#define | BOARD_BLACKCAT 20
#define | BOARD_MAXIMUS 21
#define | BOARD_MINIMUS 22
#define | BOARD_ADAFRUITU4 23
#define | BOARD_MICROSIN162 24
#define | BOARD_USBFOO 25
#define | BOARD_SPARKFUN8U2 26
#define | BOARD_EVK1101 27
#define | BOARD_TUL 28
#define | BOARD_EVK1100 29
#define | BOARD_EVK1104 30
#define | BOARD_A3BU_XPLAINED 31
#define | BOARD_TEENSY2 32
#define | BOARD_USB2AX 33
#define | BOARD_USB2AX_V3 34
#define | BOARD_MICROPENDOUS_32U2 35
#define | BOARD_MICROPENDOUS_A 36
#define | BOARD_MICROPENDOUS_1 37
#define | BOARD_MICROPENDOUS_2 38
#define | BOARD_MICROPENDOUS_3 39
#define | BOARD_MICROPENDOUS_4 40
#define | BOARD_MICROPENDOUS_DIP 41
#define | BOARD_MICROPENDOUS_REV1 42
#define | BOARD_MICROPENDOUS_REV2 43
#define | BOARD_B1_XPLAINED 44
#define | BOARD_MULTIO 45
#define | BOARD_BIGMULTIO 46
#define | BOARD_DUCE 47
#define | BOARD_OLIMEX32U4 48
#define | BOARD_OLIMEXT32U4 49
#define | BOARD_OLIMEXISPMK2 50
#define | BOARD_LEONARDO 51
#define | BOARD_UC3A3_XPLAINED 52
#define | BOARD_USB2AX_V31 53
#define | BOARD_STANGE_ISP 54
#define | BOARD_C3_XPLAINED 55
#define | BOARD_U2S 56
#define | BOARD_YUN 57
#define | BOARD_MICRO 58
#define | BOARD_XPLAINED_MINI 59
#define | BOARD_ BOARD_NONE
#define | BOARD BOARD_NONE

Detailed Description

Supported pre-made board hardware defines.

Board macros for indicating the chosen physical board hardware to the library. These macros should be used when defining the BOARD token to the chosen hardware via the -D switch in the project makefile. If a custom board is used, the BOARD_NONE or BOARD_USER values should be selected.

Note
Do not include this file directly, rather include the Common.h header file instead to gain this file's functionality.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Common.h File Reference

  • USB
  • Common
Macros
Common.h File Reference

Common library convenience headers, macros and functions. More...

#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stddef.h>
#include "Architectures.h"
#include "BoardTypes.h"
#include "ArchitectureSpecific.h"
#include "CompilerSpecific.h"
#include "Attributes.h"
#include <xmc_common.h>
#include "Endianness.h"

Go to the source code of this file.

Macros

#define | __INCLUDE_FROM_COMMON_H
#define | ARCH_LITTLE_ENDIAN
#define | MACROS do
#define | MACROE while (0)
#define | MAX(x, y) (((x) > (y)) ? (x) : (y))
#define | MIN(x, y) (((x) < (y)) ? (x) : (y))
#define | STRINGIFY(x) #x
#define | STRINGIFY_EXPANDED(x) STRINGIFY(x)
#define | CONCAT(x, y) x ## y
#define | CONCAT_EXPANDED(x, y) CONCAT(x, y)
#define | ISR(Name, ...) void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)

Detailed Description

Common library convenience headers, macros and functions.

Common utility headers containing macros, functions, enums and types which are common to all aspects of the library.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/CompilerSpecific.h File Reference

  • USB
  • Common
Macros
CompilerSpecific.h File Reference

Compiler specific definitions for code optimization and correctness. More...

Go to the source code of this file.

Macros

#define | GCC_FORCE_POINTER_ACCESS(StructPtr)
#define | GCC_MEMORY_BARRIER()
#define | GCC_IS_COMPILE_CONST(x) 0

Detailed Description

Compiler specific definitions for code optimization and correctness.

Compiler specific definitions to expose certain compiler features which may increase the level of code optimization for a specific compiler, or correct certain issues that may be present such as memory barriers for use in conjunction with atomic variable access.

Where possible, on alternative compilers, these macros will either have no effect, or default to returning a sane value so that they can be used in existing code without the need for extra compiler checks in the user application code.

Note
Do not include this file directly, rather include the Common.h header file instead to gain this file's functionality.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Endianness.h File Reference

  • USB
  • Common
Macros
Endianness.h File Reference

Endianness and Byte Ordering macros and functions. More...

Go to the source code of this file.

Macros

#define | SWAPENDIAN_16(x)
#define | SWAPENDIAN_32(x)
Run-time endianness conversion
#define | le16_to_cpu(x) (x)
#define | le32_to_cpu(x) (x)
#define | be16_to_cpu(x) SwapEndian_16(x)
#define | be32_to_cpu(x) SwapEndian_32(x)
#define | cpu_to_le16(x) (x)
#define | cpu_to_le32(x) (x)
#define | cpu_to_be16(x) SwapEndian_16(x)
#define | cpu_to_be32(x) SwapEndian_32(x)
Compile-time endianness conversion
#define | LE16_TO_CPU(x) (x)
#define | LE32_TO_CPU(x) (x)
#define | BE16_TO_CPU(x) SWAPENDIAN_16(x)
#define | BE32_TO_CPU(x) SWAPENDIAN_32(x)
#define | CPU_TO_LE16(x) (x)
#define | CPU_TO_LE32(x) (x)
#define | CPU_TO_BE16(x) SWAPENDIAN_16(x)
#define | CPU_TO_BE32(x) SWAPENDIAN_32(x)

Detailed Description

Endianness and Byte Ordering macros and functions.

Common library convenience macros and functions relating to byte (re-)ordering.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core Directory Reference

  • USB
  • Core
Core Directory Reference

Directories

directory XMC4000

Files

file | ConfigDescriptors.c
file | ConfigDescriptors.h [code]
USB Configuration Descriptor definitions.
file | Device.h [code]
Common USB Device definitions for all architectures.
file | DeviceStandardReq.h [code]
USB device standard request management.
file | EndPoint.h [code]
USB Endpoint definitions for all architectures.
file | EndpointStream.h [code]
Endpoint data stream transmission and reception management.
file | Events.c
file | Events.h [code]
USB Event management definitions.
file | Host.h [code]
Common USB Host definitions for all architectures.
file | HostStandardReq.c
file | HostStandardReq.h [code]
USB host standard request management.
file | OTG.h [code]
Common USB OTG definitions for all architectures.
file | Pipe.h [code]
Common USB Pipe definitions for all architectures.
file | PipeStream.h [code]
Pipe data stream transmission and reception management.
file | StdDescriptors.h [code]
Common standard USB Descriptor definitions for all architectures.
file | StdRequestType.h [code]
USB control endpoint request definitions.
file | USBController.h [code]
Common USB Controller definitions for all architectures.
file | USBInterrupt.h [code]
USB controller interrupt service routine management.
file | USBMode.h [code]
USB mode and feature support definitions.
file | USBTask.c
file | USBTask.h [code]
Main USB service task management.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000 Directory Reference

  • USB
  • Core
  • XMC4000
XMC4000 Directory Reference

Files

file | Device_XMC4000.h [code]
USB Device definitions for the Infineon XMC4000 microcontrollers.
file | Endpoint_XMC4000.c
Source file for LUFA endpoint functions.
file | Endpoint_XMC4000.h [code]
file | EndpointStream_XMC4000.c
Source file for LUFA Endpoint Streaming functions.
file | EndpointStream_XMC4000.h [code]
Endpoint data stream transmission and reception management for the XMC microcontrollers.
file | USBController_XMC4000.c
file | USBController_XMC4000.h [code]
USB Controller definitions for the Infineon XMC4000 microcontrollers.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/Device_XMC4000.h File Reference

  • USB
  • Core
  • XMC4000
Macros
Device_XMC4000.h File Reference

USB Device definitions for the Infineon XMC4000 microcontrollers. More...

#include "../../Common/Common.h"
#include "../USBController.h"
#include "../StdDescriptors.h"
#include "../USBInterrupt.h"
#include "../Endpoint.h"

Go to the source code of this file.

Macros

#define | USE_INTERNAL_SERIAL NO_DESCRIPTOR
#define | INTERNAL_SERIAL_LENGTH_BITS 0
#define | INTERNAL_SERIAL_START_ADDRESS 0

Detailed Description

USB Device definitions for the Infineon XMC4000 microcontrollers.

Architecture specific USB Device definitions for the Infineon XMC4000 microcontrollers.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/Endpoint_XMC4000.c File Reference

  • USB
  • Core
  • XMC4000
Macros | Functions | Variables
Endpoint_XMC4000.c File Reference

Source file for LUFA endpoint functions. More...

#include "../../Common/Common.h"
#include "../USBmode.h"
#include "../EndPoint.h"

Macros

#define | __INCLUDE_FROM_USB_DRIVER
#define | USB_STREAM_TIMEOUT_MS 100

Functions

uint8_t | Endpoint_WaitUntilReady (void)
void | Endpoint_ClearOUT (void)
void | Endpoint_ClearIN (void)
bool | Endpoint_IsReadWriteAllowed (void)
void | Endpoint_Write_8 (const uint8_t Data)
uint8_t | Endpoint_Read_8 (void)
void | Endpoint_Write_32_LE (const uint32_t Data)
uint32_t | Endpoint_Read_32_LE (void)
bool | Endpoint_ConfigureEndpointTable (const USB_Endpoint_Table_t *const Table, const uint8_t Entries)

Variables

volatile uint8_t zlp_flag

Detailed Description

Source file for LUFA endpoint functions.

Version internal release for evaluation, no public release!

Function Documentation

bool Endpoint_ConfigureEndpointTable | ( | const USB_Endpoint_Table_t *const | Table,
 |  | const uint8_t | Entries
 | ) |  |

Configures a table of endpoint descriptions, in sequence. This function can be used to configure multiple endpoints at the same time.

Note
Endpoints with a zero address will be ignored, thus this function cannot be used to configure the control endpoint.
Parameters
[in] | Table | Pointer to a table of endpoint descriptions.
[in] | Entries | Number of entries in the endpoint table to configure.
Returns
Boolean true if all endpoints configured successfully, false otherwise.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/Endpoint_XMC4000.h File Reference

  • USB
  • Core
  • XMC4000
Endpoint_XMC4000.h File Reference
#include "../../Common/Common.h"
#include "../USBTask.h"
#include "../USBInterrupt.h"
#include "../USBController.h"

Go to the source code of this file.

enum | Endpoint_WaitUntilReady_ErrorCodes_t { ENDPOINT_READYWAIT_NoError = 0, ENDPOINT_READYWAIT_EndpointStalled = 1, ENDPOINT_READYWAIT_DeviceDisconnected = 2, ENDPOINT_READYWAIT_BusSuspended = 3, ENDPOINT_READYWAIT_Timeout = 4 }
void | Endpoint_ClearOUT (void)
void | Endpoint_ClearIN (void)
bool | Endpoint_IsReadWriteAllowed (void)
bool | Endpoint_ConfigureEndpointTable (const USB_Endpoint_Table_t *const Table, const uint8_t Entries)
uint8_t | Endpoint_WaitUntilReady (void)
uint8_t | Endpoint_Read_8 (void)
void | Endpoint_Write_8 (const uint8_t data)
void | Endpoint_Write_32_LE (const uint32_t Data)
uint32_t | Endpoint_Read_32_LE (void)

Detailed Description

Functions, macros, variables, enums and types related to data reading and writing of primitive data types from and to endpoints.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/EndpointStream_XMC4000.c File Reference

  • USB
  • Core
  • XMC4000
Macros | Functions | Variables
EndpointStream_XMC4000.c File Reference

Source file for LUFA Endpoint Streaming functions. More...

#include "../../Common/Common.h"
#include "../USBMode.h"
#include "EndpointStream_XMC4000.h"

Functions

uint8_t | Endpoint_Write_Stream_LE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed)
void | SwapCopy (void *const Dest, const void *const Src, uint32_t Length)
uint8_t | Endpoint_Write_Stream_BE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed)
uint8_t | Endpoint_Read_Stream_LE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed)
uint8_t | Endpoint_Read_Stream_BE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed)
uint8_t | Endpoint_Write_Control_Stream_LE (const void *const Buffer, uint16_t Length)
uint8_t | Endpoint_Write_Control_Stream_BE (const void *const Buffer, uint16_t Length)
uint8_t | Endpoint_Read_Control_Stream_LE (void *const Buffer, uint16_t Length)
uint8_t | Endpoint_Read_Control_Stream_BE (void *const Buffer, uint16_t Length)
uint8_t | Endpoint_Null_Stream (uint16_t Length, uint16_t *const BytesProcessed)

Variables

volatile uint8_t zlp_flag = 0

Detailed Description

Source file for LUFA Endpoint Streaming functions.

Version internal release for evaluation, no public release!


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/EndpointStream_XMC4000.h File Reference

  • USB
  • Core
  • XMC4000
EndpointStream_XMC4000.h File Reference

Endpoint data stream transmission and reception management for the XMC microcontrollers. More...

#include "../../Common/Common.h"
#include "../USBMode.h"
#include "../USBTask.h"

Go to the source code of this file.

Functions

Stream functions for null data
uint8_t | Endpoint_Discard_Stream (uint16_t Length, uint16_t *const BytesProcessed)
uint8_t | Endpoint_Null_Stream (uint16_t Length, uint16_t *const BytesProcessed)
Stream functions for RAM source/destination data
uint8_t | Endpoint_Write_Stream_LE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Write_Stream_BE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Stream_LE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Stream_BE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Write_Control_Stream_LE (const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Write_Control_Stream_BE (const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Control_Stream_LE (void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | Endpoint_Read_Control_Stream_BE (void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)

Detailed Description

Endpoint data stream transmission and reception management for the XMC microcontrollers.

Endpoint data stream transmission and reception management for the Infineon XMC architecture.

Functions, macros, variables, enums and types related to data reading and writing of data streams from and to endpoints.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/USBController_XMC4000.h File Reference

  • USB
  • Core
  • XMC4000
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
USBController_XMC4000.h File Reference

USB Controller definitions for the Infineon XMC4000 microcontrollers. More...

#include <xmc_usbd.h>
#include "../../Common/Common.h"
#include "../USBMode.h"
#include "../Events.h"
#include "../USBTask.h"
#include "../USBInterrupt.h"
#include "../Device.h"
#include "../Endpoint.h"
#include "../DeviceStandardReq.h"
#include "../EndpointStream.h"

Go to the source code of this file.

Data Structures

struct | USBD_Endpoint
USBD Endpoint. More...
struct | USBD_Device
USBD Device. More...

Macros

#define | NO_COPY_DRIVER 0
#define | NUM_INTERFACES 1
#define | ENDPOINT_TOTAL_ENDPOINTS 7

Typedefs

typedef enum EP0_State | EP0_State_t
State machine of Endpoint 0.
typedef struct USBD_Endpoint | USBD_Endpoint_t
USBD Endpoint. More...
typedef struct USBD_Device | USB_Device_t
USBD Device. More...

Enumerations

enum EP0_State {
DISCONNECT, IDLE, IN_DATA, IN_STATUS,
OUT_DATA, OUT_STATUS
}
State machine of Endpoint 0. More...

Functions

int | USBD_Initialize (XMC_USBD_t *usb_init)
Initialize the USB device core driver. More...
void | USBD_SignalDeviceEventHandler (XMC_USBD_EVENT_t event)
Device Event Handler for the device controller driver. More...
void | USBD_SignalEndpointEvent_Handler (uint8_t ep_addr, XMC_USBD_EP_EVENT_t ep_event)
Endpoint Event Handler for the device controller driver. More...
int | USB_IsEnumDone (void)
Is the enumeration done? More...
void | USBD_SetEndpointBuffer (uint8_t Address, uint8_t *Buffer, uint16_t Length)
Configure an USBD Endpoint. More...

Variables

USB_Device_t device

Detailed Description

USB Controller definitions for the Infineon XMC4000 microcontrollers.

Functions, macros, variables, enums and types related to the setup and management of the USB interface.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/ConfigDescriptors.h File Reference

  • USB
  • Core
Macros | Typedefs | Enumerations | Functions
ConfigDescriptors.h File Reference

USB Configuration Descriptor definitions. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "StdDescriptors.h"

Go to the source code of this file.

Macros

#define | DESCRIPTOR_PCAST(DescriptorPtr, Type) ((Type*)(DescriptorPtr))
#define | DESCRIPTOR_CAST(DescriptorPtr, Type) (*DESCRIPTOR_PCAST(DescriptorPtr, Type))
#define | DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Type
#define | DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Size

Typedefs

typedef uint8_t(* ConfigComparatorPtr_t) (void *)

Enumerations

enum USB_Host_GetConfigDescriptor_ErrorCodes_t {
HOST_GETCONFIG_Successful = 0, HOST_GETCONFIG_DeviceDisconnect = 1, HOST_GETCONFIG_PipeError = 2, HOST_GETCONFIG_SetupStalled = 3,
HOST_GETCONFIG_SoftwareTimeOut = 4, HOST_GETCONFIG_BuffOverflow = 5, HOST_GETCONFIG_InvalidData = 6
}
enum | DSearch_Return_ErrorCodes_t { DESCRIPTOR_SEARCH_Found = 0, DESCRIPTOR_SEARCH_Fail = 1, DESCRIPTOR_SEARCH_NotFound = 2 }
enum | DSearch_Comp_Return_ErrorCodes_t { DESCRIPTOR_SEARCH_COMP_Found = 0, DESCRIPTOR_SEARCH_COMP_Fail = 1, DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2 }

Functions

uint8_t | USB_Host_GetDeviceConfigDescriptor (const uint8_t ConfigNumber, uint16_t *const ConfigSizePtr, void *const BufferPtr, const uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3)
void | USB_GetNextDescriptorOfType (uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
void | USB_GetNextDescriptorOfTypeBefore (uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type, const uint8_t BeforeType) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
void | USB_GetNextDescriptorOfTypeAfter (uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type, const uint8_t AfterType) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
uint8_t | USB_GetNextDescriptorComp (uint16_t *const BytesRem, void **const CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3)

Detailed Description

USB Configuration Descriptor definitions.

This section of the library gives a friendly API which can be used in host applications to easily parse an attached device's configuration descriptor so that endpoint, interface and other descriptor data can be extracted and used as needed.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Device.h File Reference

  • USB
  • Core
Enumerations | Functions
Device.h File Reference

Common USB Device definitions for all architectures. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "StdDescriptors.h"
#include "USBInterrupt.h"
#include "Endpoint.h"
#include "XMC4000/Device_XMC4000.h"

Go to the source code of this file.

Enumerations

enum USB_Device_States_t {
DEVICE_STATE_Unattached = 0, DEVICE_STATE_Powered = 1, DEVICE_STATE_Default = 2, DEVICE_STATE_Addressed = 3,
DEVICE_STATE_Configured = 4, DEVICE_STATE_Suspended = 5
}

Functions

uint16_t CALLBACK_USB_GetDescriptor (const uint16_t wValue, const uint8_t wIndex, const void **const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3)

Detailed Description

Common USB Device definitions for all architectures.

USB Device mode related definitions common to all architectures. This module contains definitions which are used when the USB controller is initialized in device mode.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/DeviceStandardReq.h File Reference

  • USB
  • Core
Functions | Variables
DeviceStandardReq.h File Reference

USB device standard request management. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "StdDescriptors.h"
#include "Events.h"
#include "StdRequestType.h"
#include "USBTask.h"
#include "USBController.h"

Go to the source code of this file.

Functions

void USB_Device_ProcessControlRequest (void)
Handle device request on endpoint 0. More...

Variables

uint8_t | USB_Device_ConfigurationNumber
bool | USB_Device_RemoteWakeupEnabled
bool | USB_Device_CurrentlySelfPowered

Detailed Description

USB device standard request management.

This file contains the function prototypes necessary for the processing of incoming standard control requests when the library is in USB device mode.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/EndPoint.h File Reference

  • USB
  • Core
Data Structures | Macros
EndPoint.h File Reference

USB Endpoint definitions for all architectures. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "XMC4000/Endpoint_XMC4000.h"

Go to the source code of this file.

Data Structures

struct USB_Endpoint_Table_t

Macros

#define | ENDPOINT_EPNUM_MASK 0x0F
#define | ENDPOINT_CONTROLEP 0

Detailed Description

USB Endpoint definitions for all architectures.

Functions, macros and enums related to endpoint management when in USB Device mode. This module contains the endpoint management macros, as well as endpoint interrupt and data send/receive functions for various data types.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/EndpointStream.h File Reference

  • USB
  • Core
Enumerations
EndpointStream.h File Reference

Endpoint data stream transmission and reception management. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "XMC4000/EndpointStream_XMC4000.h"

Go to the source code of this file.

Enumerations

enum Endpoint_Stream_RW_ErrorCodes_t {
ENDPOINT_RWSTREAM_NoError = 0, ENDPOINT_RWSTREAM_EndpointStalled = 1, ENDPOINT_RWSTREAM_DeviceDisconnected = 2, ENDPOINT_RWSTREAM_BusSuspended = 3,
ENDPOINT_RWSTREAM_Timeout = 4, ENDPOINT_RWSTREAM_IncompleteTransfer = 5
}
enum Endpoint_ControlStream_RW_ErrorCodes_t { ENDPOINT_RWCSTREAM_NoError = 0, ENDPOINT_RWCSTREAM_HostAborted = 1, ENDPOINT_RWCSTREAM_DeviceDisconnected = 2, ENDPOINT_RWCSTREAM_BusSuspended = 3 }

Detailed Description

Endpoint data stream transmission and reception management.

Endpoint data stream transmission and reception management for the Infineon XMC architecture.

Functions, macros, variables, enums and types related to data reading and writing of data streams from and to endpoints.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Events.h File Reference

  • USB
  • Core
Functions
Events.h File Reference

USB Event management definitions. More...

#include "../Common/Common.h"
#include "USBMode.h"

Go to the source code of this file.

Functions

void | EVENT_USB_UIDChange (void)
void | EVENT_USB_Host_HostError (const uint8_t ErrorCode)
void | EVENT_USB_Host_DeviceAttached (void)
void | EVENT_USB_Host_DeviceUnattached (void)
void | EVENT_USB_Host_DeviceEnumerationFailed (const uint8_t ErrorCode, const uint8_t SubErrorCode)
void | EVENT_USB_Host_DeviceEnumerationComplete (void)
void | EVENT_USB_Host_StartOfFrame (void)
void | EVENT_USB_Device_Connect (void)
void | EVENT_USB_Device_Disconnect (void)
void | EVENT_USB_Device_ControlRequest (void)
void | EVENT_USB_Device_ConfigurationChanged (void)
void | EVENT_USB_Device_Suspend (void)
void | EVENT_USB_Device_WakeUp (void)
void | EVENT_USB_Device_Reset (void)
void | EVENT_USB_Device_StartOfFrame (void)

Detailed Description

USB Event management definitions.

This module contains macros and functions relating to the management of library events, which are small pieces of code similar to ISRs which are run when a given condition is met. Each event can be fired from multiple places in the user or library code, which may or may not be inside an ISR, thus each handler should be written to be as small and fast as possible to prevent possible problems.

Events can be hooked by the user application by declaring a handler function with the same name and parameters listed here. If an event with no user-associated handler is fired within the library, it by default maps to an internal empty stub function.

Each event must only have one associated event handler, but can be raised by multiple sources by calling the event handler function (with any required event parameters).

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Host.h File Reference

  • USB
  • Core
Enumerations
Host.h File Reference

Common USB Host definitions for all architectures. More...

#include "../../../Common/Common.h"
#include "USBMode.h"
#include "AVR8/Host_AVR8.h"

Go to the source code of this file.

Enumerations

enum USB_Host_States_t {
HOST_STATE_WaitForDevice = 0, HOST_STATE_Unattached = 1, HOST_STATE_Powered = 2, HOST_STATE_Powered_WaitForDeviceSettle = 3,
HOST_STATE_Powered_WaitForConnect = 4, HOST_STATE_Powered_DoReset = 5, HOST_STATE_Powered_ConfigPipe = 6, HOST_STATE_Default = 7,
HOST_STATE_Default_PostReset = 8, HOST_STATE_Default_PostAddressSet = 9, HOST_STATE_Addressed = 10, HOST_STATE_Configured = 11
}

Detailed Description

Common USB Host definitions for all architectures.

USB Host mode related macros and enums. This module contains macros and enums which are used when the USB controller is initialized in host mode.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/HostStandardReq.h File Reference

  • USB
  • Core
Macros | Enumerations | Functions | Variables
HostStandardReq.h File Reference

USB host standard request management. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "StdRequestType.h"
#include "USBController.h"

Go to the source code of this file.

Macros

#define USB_HOST_TIMEOUT_MS 1000

Enumerations

enum USB_Host_SendControlErrorCodes_t {
HOST_SENDCONTROL_Successful = 0, HOST_SENDCONTROL_DeviceDisconnected = 1, HOST_SENDCONTROL_PipeError = 2, HOST_SENDCONTROL_SetupStalled = 3,
HOST_SENDCONTROL_SoftwareTimeOut = 4
}
enum USB_WaitForTypes_t { USB_HOST_WAITFOR_SetupSent, USB_HOST_WAITFOR_InReceived, USB_HOST_WAITFOR_OutReady }

Functions

uint8_t | USB_Host_SendControlRequest (void *const BufferPtr)
uint8_t | USB_Host_SetDeviceConfiguration (const uint8_t ConfigNumber)
uint8_t | USB_Host_GetDeviceConfiguration (uint8_t *const ConfigNumber) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | USB_Host_GetDescriptor (const uint8_t Type, const uint8_t Index, void *const Buffer, const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(3)
uint8_t | USB_Host_GetDeviceStatus (uint8_t *const FeatureStatus) ATTR_NON_NULL_PTR_ARG(1)
uint8_t | USB_Host_ClearEndpointStall (const uint8_t EndpointAddress)
uint8_t | USB_Host_SetInterfaceAltSetting (const uint8_t InterfaceIndex, const uint8_t AltSetting)
uint8_t | USB_Host_GetInterfaceAltSetting (const uint8_t InterfaceIndex, uint8_t *const AltSetting) ATTR_NON_NULL_PTR_ARG(2)

Variables

uint8_t USB_Host_ConfigurationNumber

Detailed Description

USB host standard request management.

This file contains the function prototypes necessary for the issuing of outgoing standard control requests when the library is in USB host mode.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.

Macro Definition Documentation

#define USB_HOST_TIMEOUT_MS 1000

Constant for the maximum software timeout period of sent USB control transactions to an attached device. If a device fails to respond to a sent control request within this period, the library will return a timeout error code.

This value may be overridden in the user project makefile as the value of the USB_HOST_TIMEOUT_MS token, and passed to the compiler using the -D switch.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/OTG.h File Reference

  • USB
  • Core
OTG.h File Reference

Common USB OTG definitions for all architectures. More...

#include "../Common/Common.h"
#include "USBMode.h"

Go to the source code of this file.

Detailed Description

Common USB OTG definitions for all architectures.

This module contains macros for embedded USB hosts with dual role On The Go capabilities, for managing role exchange. OTG is a way for two USB dual role devices to talk to one another directly without fixed device/host roles.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Pipe.h File Reference

  • USB
  • Core
Data Structures | Macros
Pipe.h File Reference

Common USB Pipe definitions for all architectures. More...

#include "../Common/Common.h"
#include "USBMode.h"

Go to the source code of this file.

Data Structures

struct USB_Pipe_Table_t

Macros

#define | PIPE_CONTROLPIPE 0
#define | PIPE_PIPENUM_MASK 0x0F
#define | PIPE_EPNUM_MASK 0x0F

Detailed Description

Common USB Pipe definitions for all architectures.

This module contains functions, macros and enums related to pipe management when in USB Host mode. This module contains the pipe management macros, as well as pipe interrupt and data send/receive functions for various data types.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/PipeStream.h File Reference

  • USB
  • Core
Enumerations
PipeStream.h File Reference

Pipe data stream transmission and reception management. More...

#include "../Common/Common.h"
#include "USBMode.h"

Go to the source code of this file.

Enumerations

enum Pipe_Stream_RW_ErrorCodes_t {
PIPE_RWSTREAM_NoError = 0, PIPE_RWSTREAM_PipeStalled = 1, PIPE_RWSTREAM_DeviceDisconnected = 2, PIPE_RWSTREAM_Timeout = 3,
PIPE_RWSTREAM_IncompleteTransfer = 4
}

Detailed Description

Pipe data stream transmission and reception management.

Functions, macros, variables, enums and types related to data reading and writing of data streams from and to pipes.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/StdDescriptors.h File Reference

  • USB
  • Core
Macros | Typedefs | Enumerations
StdDescriptors.h File Reference

Common standard USB Descriptor definitions for all architectures. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "Events.h"

Go to the source code of this file.

Macros

#define | NO_DESCRIPTOR 0
#define | USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
#define | USB_STRING_LEN(UnicodeChars) (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1))
#define | USB_STRING_DESCRIPTOR(String) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String }
#define | USB_STRING_DESCRIPTOR_ARRAY(...) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} }
#define | VERSION_BCD(Major, Minor, Revision)
#define | LANGUAGE_ID_ENG 0x0409
#define | MAX_ALLOC
USB Configuration Descriptor Attribute Masks
#define | USB_CONFIG_ATTR_RESERVED 0x80
#define | USB_CONFIG_ATTR_SELFPOWERED 0x40
#define | USB_CONFIG_ATTR_REMOTEWAKEUP 0x20
Endpoint Descriptor Attribute Masks
#define | ENDPOINT_ATTR_NO_SYNC (0 << 2)
#define | ENDPOINT_ATTR_ASYNC (1 << 2)
#define | ENDPOINT_ATTR_ADAPTIVE (2 << 2)
#define | ENDPOINT_ATTR_SYNC (3 << 2)
Endpoint Descriptor Usage Masks
#define | ENDPOINT_USAGE_DATA (0 << 4)
#define | ENDPOINT_USAGE_FEEDBACK (1 << 4)
#define | ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)

Typedefs

struct {
uint8_t Size
uint8_t Type
} USB_Descriptor_Header_t
Standard USB Descriptor Header (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
} USB_StdDescriptor_Header_t
Standard USB Descriptor Header (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint16_t USBSpecification
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t Endpoint0Size
uint16_t VendorID
uint16_t ProductID
uint16_t ReleaseNumber
uint8_t ManufacturerStrIndex
uint8_t ProductStrIndex
uint8_t SerialNumStrIndex
uint8_t NumberOfConfigurations
} USB_Descriptor_Device_t
Standard USB Device Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdUSB
uint8_t bDeviceClass
uint8_t bDeviceSubClass
uint8_t bDeviceProtocol
uint8_t bMaxPacketSize0
uint16_t idVendor
uint16_t idProduct
uint16_t bcdDevice
uint8_t iManufacturer
uint8_t iProduct
uint8_t iSerialNumber
uint8_t bNumConfigurations
} USB_StdDescriptor_Device_t
Standard USB Device Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint16_t USBSpecification
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t Endpoint0Size
uint8_t NumberOfConfigurations
uint8_t Reserved
} USB_Descriptor_DeviceQualifier_t
Standard USB Device Qualifier Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdUSB
uint8_t bDeviceClass
uint8_t bDeviceSubClass
uint8_t bDeviceProtocol
uint8_t bMaxPacketSize0
uint8_t bNumConfigurations
uint8_t bReserved
} USB_StdDescriptor_DeviceQualifier_t
Standard USB Device Qualifier Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint16_t TotalConfigurationSize
uint8_t TotalInterfaces
uint8_t ConfigurationNumber
uint8_t ConfigurationStrIndex
uint8_t ConfigAttributes
uint8_t MaxPowerConsumption
} USB_Descriptor_Configuration_Header_t
Standard USB Configuration Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t wTotalLength
uint8_t bNumInterfaces
uint8_t bConfigurationValue
uint8_t iConfiguration
uint8_t bmAttributes
uint8_t bMaxPower
} USB_StdDescriptor_Configuration_Header_t
Standard USB Configuration Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t InterfaceNumber
uint8_t AlternateSetting
uint8_t TotalEndpoints
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t InterfaceStrIndex
} USB_Descriptor_Interface_t
Standard USB Interface Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bInterfaceNumber
uint8_t bAlternateSetting
uint8_t bNumEndpoints
uint8_t bInterfaceClass
uint8_t bInterfaceSubClass
uint8_t bInterfaceProtocol
uint8_t iInterface
} USB_StdDescriptor_Interface_t
Standard USB Interface Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t FirstInterfaceIndex
uint8_t TotalInterfaces
uint8_t Class
uint8_t SubClass
uint8_t Protocol
uint8_t IADStrIndex
} USB_Descriptor_Interface_Association_t
Standard USB Interface Association Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bFirstInterface
uint8_t bInterfaceCount
uint8_t bFunctionClass
uint8_t bFunctionSubClass
uint8_t bFunctionProtocol
uint8_t iFunction
} USB_StdDescriptor_Interface_Association_t
Standard USB Interface Association Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
uint8_t EndpointAddress
uint8_t Attributes
uint16_t EndpointSize
uint8_t PollingIntervalMS
} USB_Descriptor_Endpoint_t
Standard USB Endpoint Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint8_t bEndpointAddress
uint8_t bmAttributes
uint16_t wMaxPacketSize
uint8_t bInterval
} USB_StdDescriptor_Endpoint_t
Standard USB Endpoint Descriptor (USB-IF naming conventions). More...
struct {
USB_Descriptor_Header_t Header
wchar_t UnicodeString [MAX_ALLOC]
} USB_Descriptor_String_t
Standard USB String Descriptor (LUFA naming conventions). More...
struct {
uint8_t bLength
uint8_t bDescriptorType
uint16_t bString []
} USB_StdDescriptor_String_t
Standard USB String Descriptor (USB-IF naming conventions). More...

Enumerations

enum USB_DescriptorTypes_t {
DTYPE_Device = 0x01, DTYPE_Configuration = 0x02, DTYPE_String = 0x03, DTYPE_Interface = 0x04,
DTYPE_Endpoint = 0x05, DTYPE_DeviceQualifier = 0x06, DTYPE_Other = 0x07, DTYPE_InterfacePower = 0x08,
DTYPE_InterfaceAssociation = 0x0B, DTYPE_CSInterface = 0x24, DTYPE_CSEndpoint = 0x25
}
enum USB_Descriptor_ClassSubclassProtocol_t {
USB_CSCP_NoDeviceClass = 0x00, USB_CSCP_NoDeviceSubclass = 0x00, USB_CSCP_NoDeviceProtocol = 0x00, USB_CSCP_VendorSpecificClass = 0xFF,
USB_CSCP_VendorSpecificSubclass = 0xFF, USB_CSCP_VendorSpecificProtocol = 0xFF, USB_CSCP_IADDeviceClass = 0xEF, USB_CSCP_IADDeviceSubclass = 0x02,
USB_CSCP_IADDeviceProtocol = 0x01
}

Detailed Description

Common standard USB Descriptor definitions for all architectures.

Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains structures and macros for the easy creation of standard USB descriptors in USB device projects.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.

Variable Documentation

uint8_t AlternateSetting

Alternate setting for the interface number. The same interface number can have multiple alternate settings with different endpoint configurations, which can be selected by the host.

uint8_t Attributes

Endpoint attributes, comprised of a mask of the endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*) masks.

uint8_t bAlternateSetting

Alternate setting for the interface number. The same interface number can have multiple alternate settings with different endpoint configurations, which can be selected by the host.

uint16_t bcdDevice

Product release (version) number.

See also
VERSION_BCD() utility macro.
uint16_t bcdUSB

BCD of the supported USB specification.

See also
VERSION_BCD() utility macro.
uint8_t bConfigurationValue

Configuration index of the current configuration.

uint8_t bDescriptorType

Type of the descriptor, either a value in USB_DescriptorTypes_t or a value given by the specific class.

uint8_t bDeviceClass

USB device class.

uint8_t bDeviceProtocol

USB device protocol.

uint8_t bDeviceSubClass

USB device subclass.

uint8_t bEndpointAddress

Logical address of the endpoint within the device for the current configuration, including direction mask.

uint8_t bFirstInterface

Index of the first associated interface.

uint8_t bFunctionClass

Interface class ID.

uint8_t bFunctionProtocol

Interface protocol ID.

uint8_t bFunctionSubClass

Interface subclass ID.

uint8_t bInterfaceClass

Interface class ID.

uint8_t bInterfaceCount

Total number of associated interfaces.

uint8_t bInterfaceNumber

Index of the interface in the current configuration.

uint8_t bInterfaceProtocol

Interface protocol ID.

uint8_t bInterfaceSubClass

Interface subclass ID.

uint8_t bInterval

Polling interval in milliseconds for the endpoint if it is an INTERRUPT or ISOCHRONOUS type.

uint8_t bLength

Size of the descriptor, in bytes.

uint8_t bmAttributes

Configuration attributes, comprised of a mask of USB_CONFIG_ATTR_* masks. On all devices, this should include USB_CONFIG_ATTR_RESERVED at a minimum.

Endpoint attributes, comprised of a mask of the endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*) masks.

uint8_t bMaxPacketSize0

Size of the control (address 0) endpoint's bank in bytes.

uint8_t bMaxPower

Maximum power consumption of the device while in the current configuration, calculated by the USB_CONFIG_POWER_MA() macro.

uint8_t bNumConfigurations

Total number of configurations supported by the device.

uint8_t bNumEndpoints

Total number of endpoints in the interface.

uint8_t bNumInterfaces

Total number of interfaces in the configuration.

uint8_t bReserved

Reserved for future use, must be 0.

uint16_t bString[]

String data, as unicode characters (alternatively, string language IDs). If normal ASCII characters are to be used, they must be added as an array of characters rather than a normal C string so that they are widened to Unicode size.

Under GCC, strings prefixed with the "L" character (before the opening string quotation mark) are considered to be Unicode strings, and may be used instead of an explicit array of ASCII characters.

uint8_t Class

USB device class.

Interface class ID.

uint8_t ConfigAttributes

Configuration attributes, comprised of a mask of USB_CONFIG_ATTR_* masks. On all devices, this should include USB_CONFIG_ATTR_RESERVED at a minimum.

uint8_t ConfigurationNumber

Configuration index of the current configuration.

uint8_t ConfigurationStrIndex

Index of a string descriptor describing the configuration.

uint8_t Endpoint0Size

Size of the control (address 0) endpoint's bank in bytes.

uint8_t EndpointAddress

Logical address of the endpoint within the device for the current configuration, including direction mask.

uint16_t EndpointSize

Size of the endpoint bank, in bytes. This indicates the maximum packet size that the endpoint can receive at a time.

uint8_t FirstInterfaceIndex

Index of the first associated interface.

USB_Descriptor_Header_t Header

Descriptor header, including type and size.

uint8_t IADStrIndex

Index of the string descriptor describing the interface association.

uint8_t iConfiguration

Index of a string descriptor describing the configuration.

uint16_t idProduct

Unique product ID for the USB product.

uint16_t idVendor

Vendor ID for the USB product.

uint8_t iFunction

Index of the string descriptor describing the interface association.

uint8_t iInterface

Index of the string descriptor describing the interface.

uint8_t iManufacturer

String index for the manufacturer's name. The host will request this string via a separate control request for the string descriptor.

Note
If no string supplied, use NO_DESCRIPTOR.
uint8_t InterfaceNumber

Index of the interface in the current configuration.

uint8_t InterfaceStrIndex

Index of the string descriptor describing the interface.

uint8_t iProduct

String index for the product name/details.

See also
ManufacturerStrIndex structure entry.
uint8_t iSerialNumber

String index for the product's globally unique hexadecimal serial number, in uppercase Unicode ASCII.

Note
On some microcontroller models, there is an embedded serial number in the chip which can be used for the device serial number. To use this serial number, set this to USE_INTERNAL_SERIAL. On unsupported devices, this will evaluate to NO_DESCRIPTOR and will cause the host to generate a pseudo-unique value for the device upon insertion.
See also
ManufacturerStrIndex structure entry.
uint8_t ManufacturerStrIndex

String index for the manufacturer's name. The host will request this string via a separate control request for the string descriptor.

Note
If no string supplied, use NO_DESCRIPTOR.
uint8_t MaxPowerConsumption

Maximum power consumption of the device while in the current configuration, calculated by the USB_CONFIG_POWER_MA() macro.

uint8_t NumberOfConfigurations

Total number of configurations supported by the device.

uint8_t PollingIntervalMS

Polling interval in milliseconds for the endpoint if it is an INTERRUPT or ISOCHRONOUS type.

uint16_t ProductID

Unique product ID for the USB product.

uint8_t ProductStrIndex

String index for the product name/details.

See also
ManufacturerStrIndex structure entry.
uint8_t Protocol

USB device protocol.

Interface protocol ID.

uint16_t ReleaseNumber

Product release (version) number.

See also
VERSION_BCD() utility macro.
uint8_t Reserved

Reserved for future use, must be 0.

uint8_t SerialNumStrIndex

String index for the product's globally unique hexadecimal serial number, in uppercase Unicode ASCII.

Note
On some microcontroller models, there is an embedded serial number in the chip which can be used for the device serial number. To use this serial number, set this to USE_INTERNAL_SERIAL. On unsupported devices, this will evaluate to NO_DESCRIPTOR and will cause the host to generate a pseudo-unique value for the device upon insertion.
See also
ManufacturerStrIndex structure entry.
uint8_t Size

Size of the descriptor, in bytes.

uint8_t SubClass

USB device subclass.

Interface subclass ID.

uint16_t TotalConfigurationSize

Size of the configuration descriptor header, and all sub descriptors inside the configuration.

uint8_t TotalEndpoints

Total number of endpoints in the interface.

uint8_t TotalInterfaces

Total number of interfaces in the configuration.

Total number of associated interfaces.

uint8_t Type

Type of the descriptor, either a value in USB_DescriptorTypes_t or a value given by the specific class.

uint16_t USBSpecification

BCD of the supported USB specification.

See also
VERSION_BCD() utility macro.
uint16_t VendorID

Vendor ID for the USB product.

uint16_t wMaxPacketSize

Size of the endpoint bank, in bytes. This indicates the maximum packet size that the endpoint can receive at a time.

uint16_t wTotalLength

Size of the configuration descriptor header, and all sub descriptors inside the configuration.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/StdRequestType.h File Reference

  • USB
  • Core
Macros | Typedefs | Enumerations
StdRequestType.h File Reference

USB control endpoint request definitions. More...

#include "../Common/Common.h"
#include "USBMode.h"

Go to the source code of this file.

Macros

#define | CONTROL_REQTYPE_DIRECTION 0x80
#define | CONTROL_REQTYPE_TYPE 0x60
#define | CONTROL_REQTYPE_RECIPIENT 0x1F
#define | FEATURE_SELFPOWERED_ENABLED (1 << 0)
#define | FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1)
Control Request Data Direction Masks
#define | REQDIR_HOSTTODEVICE (0 << 7)
#define | REQDIR_DEVICETOHOST (1 << 7)
Control Request Type Masks
#define | REQTYPE_STANDARD (0 << 5)
#define | REQTYPE_CLASS (1 << 5)
#define | REQTYPE_VENDOR (2 << 5)
Control Request Recipient Masks
#define | REQREC_DEVICE (0 << 0)
#define | REQREC_INTERFACE (1 << 0)
#define | REQREC_ENDPOINT (2 << 0)
#define | REQREC_OTHER (3 << 0)

Typedefs

struct {
uint8_t bmRequestType
uint8_t bRequest
uint16_t wValue
uint16_t wIndex
uint16_t wLength
} USB_Request_Header_t
Standard USB Control Request. More...

Enumerations

enum USB_Control_Request_t {
REQ_GetStatus = 0, REQ_ClearFeature = 1, REQ_SetFeature = 3, REQ_SetAddress = 5,
REQ_GetDescriptor = 6, REQ_SetDescriptor = 7, REQ_GetConfiguration = 8, REQ_SetConfiguration = 9,
REQ_GetInterface = 10, REQ_SetInterface = 11, REQ_SynchFrame = 12
}
enum USB_Feature_Selectors_t { FEATURE_SEL_EndpointHalt = 0x00, FEATURE_SEL_DeviceRemoteWakeup = 0x01, FEATURE_SEL_TestMode = 0x02 }

Detailed Description

USB control endpoint request definitions.

This module contains definitions for the various control request parameters, so that the request details (such as data direction, request recipient, etc.) can be extracted via masking.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.

Variable Documentation

uint8_t bmRequestType

Type of the request.

uint8_t bRequest

Request command code.

uint16_t wIndex

wIndex parameter of the request.

uint16_t wLength

Length of the data to transfer in bytes.

uint16_t wValue

wValue parameter of the request.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBController.h File Reference

  • USB
  • Core
Enumerations
USBController.h File Reference

Common USB Controller definitions for all architectures. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "XMC4000/USBController_XMC4000.h"

Go to the source code of this file.

Macros

Endpoint Direction Masks
#define | ENDPOINT_DIR_MASK 0x80
#define | ENDPOINT_DIR_OUT 0x00
#define | ENDPOINT_DIR_IN 0x80
Pipe Direction Masks
#define | PIPE_DIR_MASK 0x80
#define | PIPE_DIR_OUT 0x00
#define | PIPE_DIR_IN 0x80
Endpoint/Pipe Type Masks
#define | EP_TYPE_MASK 0x03
#define | EP_TYPE_CONTROL 0x00
#define | EP_TYPE_ISOCHRONOUS 0x01
#define | EP_TYPE_BULK 0x02
#define | EP_TYPE_INTERRUPT 0x03

Enumerations

enum USB_Modes_t { USB_MODE_None = 0, USB_MODE_Device = 1, USB_MODE_Host = 2, USB_MODE_UID = 3 }

Detailed Description

Common USB Controller definitions for all architectures.

Functions, macros, variables, enums and types related to the setup and management of the USB interface.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBInterrupt.h File Reference

  • USB
  • Core
USBInterrupt.h File Reference

USB controller interrupt service routine management. More...

#include "../Common/Common.h"
#include "USBMode.h"

Go to the source code of this file.

Detailed Description

USB controller interrupt service routine management.

This file contains definitions required for the correct handling of low level USB service routine interrupts from the USB controller.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBMode.h File Reference

  • USB
  • Core
Macros
USBMode.h File Reference

USB mode and feature support definitions. More...

#include "../Common/Common.h"

Go to the source code of this file.

Detailed Description

USB mode and feature support definitions.

This file defines macros indicating the type of USB controller the library is being compiled for, and its capabilities. These macros may then be referenced in the user application to selectively enable or disable code sections depending on if they are defined or not.

After the inclusion of the master USB driver header, one or more of the following tokens may be defined, to allow the user code to conditionally enable or disable code based on the USB controller family and allowable USB modes. These tokens may be tested against to eliminate code relating to a USB mode which is not enabled for the given compilation.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBTask.h File Reference

  • USB
  • Core
Macros | Functions | Variables
USBTask.h File Reference

Main USB service task management. More...

#include "../Common/Common.h"
#include "USBMode.h"
#include "USBController.h"
#include "Events.h"
#include "StdRequestType.h"
#include "StdDescriptors.h"
#include "DeviceStandardReq.h"

Go to the source code of this file.

Macros

#define HOST_TASK_NONBLOCK_WAIT(Duration, NextState)

Functions

void USB_USBTask (void)

Variables

volatile bool | USB_IsInitialized
USB_Request_Header_t USB_ControlRequest
volatile uint8_t | USB_DeviceState

Detailed Description

Main USB service task management.

This file contains the function definitions required for the main USB service task, which must be called from the user application to ensure that the USB connection to or from a connected USB device is maintained.

Note
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.

Macro Definition Documentation

#define HOST_TASK_NONBLOCK_WAIT | ( | Duration,
 |  | NextState
 | ) |
Value:
do { USB_HostState = HOST_STATE_WaitForDevice; \
WaitMSRemaining = (Duration); \
PostWaitState = (NextState); } while (0)
HOST_STATE_WaitForDevice
Definition: Host.h:78


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/USB.h File Reference

  • USB
Macros
USB.h File Reference

Master include file for the library USB functionality. More...

#include "Common/Common.h"
#include "Core/USBMode.h"
#include "Core/USBTask.h"
#include "Core/Events.h"
#include "Core/StdDescriptors.h"
#include "Core/ConfigDescriptors.h"
#include "Core/USBController.h"
#include "Core/Device.h"
#include "Core/Endpoint.h"
#include "Core/DeviceStandardReq.h"
#include "Core/EndpointStream.h"
#include "Class/CDCClass.h"
#include "Class/HIDClass.h"
#include "Class/MassStorageClass.h"

Go to the source code of this file.

Detailed Description

Master include file for the library USB functionality.

Master include file for the library USB functionality.

This file should be included in all user projects making use of the USB portions of the library, instead of the individual USB driver submodule headers.


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- a -

  • AlternateSetting : StdDescriptors.h
  • Attributes : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- b -

  • bAlternateSetting : StdDescriptors.h
  • BaudRateBPS : CDCClassCommon.h
  • bcdCDC : CDCClassCommon.h
  • bcdDevice : StdDescriptors.h
  • bcdHID : HIDClassCommon.h
  • bcdUSB : StdDescriptors.h
  • bConfigurationValue : StdDescriptors.h
  • bCountryCode : HIDClassCommon.h
  • bDescriptorSubType : CDCClassCommon.h
  • bDescriptorType : CDCClassCommon.h , HIDClassCommon.h , StdDescriptors.h
  • bDescriptorType2 : HIDClassCommon.h
  • bDeviceClass : StdDescriptors.h
  • bDeviceProtocol : StdDescriptors.h
  • bDeviceSubClass : StdDescriptors.h
  • be16_to_cpu : Endianness.h
  • BE16_TO_CPU : Endianness.h
  • be32_to_cpu : Endianness.h
  • BE32_TO_CPU : Endianness.h
  • bEndpointAddress : StdDescriptors.h
  • bFirstInterface : StdDescriptors.h
  • bFunctionClass : StdDescriptors.h
  • bFunctionLength : CDCClassCommon.h
  • bFunctionProtocol : StdDescriptors.h
  • bFunctionSubClass : StdDescriptors.h
  • bInterfaceClass : StdDescriptors.h
  • bInterfaceCount : StdDescriptors.h
  • bInterfaceNumber : StdDescriptors.h
  • bInterfaceProtocol : StdDescriptors.h
  • bInterfaceSubClass : StdDescriptors.h
  • bInterval : StdDescriptors.h
  • bLength : HIDClassCommon.h , StdDescriptors.h
  • bMasterInterface : CDCClassCommon.h
  • bmAttributes : StdDescriptors.h
  • bMaxPacketSize0 : StdDescriptors.h
  • bMaxPower : StdDescriptors.h
  • bmCapabilities : CDCClassCommon.h
  • bmRequestType : StdRequestType.h
  • bNumConfigurations : StdDescriptors.h
  • bNumDescriptors : HIDClassCommon.h
  • bNumEndpoints : StdDescriptors.h
  • bNumInterfaces : StdDescriptors.h
  • BOARD_A3BU_XPLAINED : BoardTypes.h
  • BOARD_ADAFRUITU4 : BoardTypes.h
  • BOARD_ATAVRUSBRF01 : BoardTypes.h
  • BOARD_B1_XPLAINED : BoardTypes.h
  • BOARD_BENITO : BoardTypes.h
  • BOARD_BIGMULTIO : BoardTypes.h
  • BOARD_BLACKCAT : BoardTypes.h
  • BOARD_BUI : BoardTypes.h
  • BOARD_BUMBLEB : BoardTypes.h
  • BOARD_C3_XPLAINED : BoardTypes.h
  • BOARD_CULV3 : BoardTypes.h
  • BOARD_DUCE : BoardTypes.h
  • BOARD_EVK1100 : BoardTypes.h
  • BOARD_EVK1101 : BoardTypes.h
  • BOARD_EVK1104 : BoardTypes.h
  • BOARD_EVK527 : BoardTypes.h
  • BOARD_JMDBU2 : BoardTypes.h
  • BOARD_LEONARDO : BoardTypes.h
  • BOARD_MAXIMUS : BoardTypes.h
  • BOARD_MICRO : BoardTypes.h
  • BOARD_MICROPENDOUS_1 : BoardTypes.h
  • BOARD_MICROPENDOUS_2 : BoardTypes.h
  • BOARD_MICROPENDOUS_3 : BoardTypes.h
  • BOARD_MICROPENDOUS_32U2 : BoardTypes.h
  • BOARD_MICROPENDOUS_4 : BoardTypes.h
  • BOARD_MICROPENDOUS_A : BoardTypes.h
  • BOARD_MICROPENDOUS_DIP : BoardTypes.h
  • BOARD_MICROPENDOUS_REV1 : BoardTypes.h
  • BOARD_MICROPENDOUS_REV2 : BoardTypes.h
  • BOARD_MICROSIN162 : BoardTypes.h
  • BOARD_MINIMUS : BoardTypes.h
  • BOARD_MULTIO : BoardTypes.h
  • BOARD_NONE : BoardTypes.h
  • BOARD_OLIMEX162 : BoardTypes.h
  • BOARD_OLIMEX32U4 : BoardTypes.h
  • BOARD_OLIMEXISPMK2 : BoardTypes.h
  • BOARD_OLIMEXT32U4 : BoardTypes.h
  • BOARD_RZUSBSTICK : BoardTypes.h
  • BOARD_SPARKFUN8U2 : BoardTypes.h
  • BOARD_STANGE_ISP : BoardTypes.h
  • BOARD_STK525 : BoardTypes.h
  • BOARD_STK526 : BoardTypes.h
  • BOARD_TEENSY : BoardTypes.h
  • BOARD_TEENSY2 : BoardTypes.h
  • BOARD_TUL : BoardTypes.h
  • BOARD_U2S : BoardTypes.h
  • BOARD_UC3A3_XPLAINED : BoardTypes.h
  • BOARD_UDIP : BoardTypes.h
  • BOARD_UNO : BoardTypes.h
  • BOARD_USB2AX : BoardTypes.h
  • BOARD_USB2AX_V3 : BoardTypes.h
  • BOARD_USB2AX_V31 : BoardTypes.h
  • BOARD_USBFOO : BoardTypes.h
  • BOARD_USBKEY : BoardTypes.h
  • BOARD_USBTINYMKII : BoardTypes.h
  • BOARD_USER : BoardTypes.h
  • BOARD_XPLAIN : BoardTypes.h
  • BOARD_XPLAIN_REV1 : BoardTypes.h
  • BOARD_XPLAINED_MINI : BoardTypes.h
  • BOARD_YUN : BoardTypes.h
  • bRequest : StdRequestType.h
  • bReserved : StdDescriptors.h
  • bSlaveInterface0 : CDCClassCommon.h
  • bString : StdDescriptors.h
  • Button : HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- c -

  • CALLBACK_HID_Device_CreateHIDReport() : HIDClassDevice.h
  • CALLBACK_HID_Device_ProcessHIDReport() : HIDClassDevice.h
  • CALLBACK_HIDParser_FilterHIDReportItem() : HIDParser.h
  • CALLBACK_MS_Device_SCSICommandReceived() : MassStorageClassDevice.h
  • CALLBACK_USB_GetDescriptor() : Device.h
  • Capabilities : CDCClassCommon.h
  • CDC_ClassNotifications_t : CDCClassCommon.h
  • CDC_ClassRequests_t : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_BREAK : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_DCD : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_DSR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_FRAMEERROR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_OVERRUNERROR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_PARITYERROR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_RING : CDCClassCommon.h
  • CDC_CONTROL_LINE_OUT_DTR : CDCClassCommon.h
  • CDC_CONTROL_LINE_OUT_RTS : CDCClassCommon.h
  • CDC_CSCP_ACMSubclass : CDCClassCommon.h
  • CDC_CSCP_ATCommandProtocol : CDCClassCommon.h
  • CDC_CSCP_CDCClass : CDCClassCommon.h
  • CDC_CSCP_CDCDataClass : CDCClassCommon.h
  • CDC_CSCP_NoDataProtocol : CDCClassCommon.h
  • CDC_CSCP_NoDataSubclass : CDCClassCommon.h
  • CDC_CSCP_NoSpecificProtocol : CDCClassCommon.h
  • CDC_CSCP_NoSpecificSubclass : CDCClassCommon.h
  • CDC_CSCP_VendorSpecificProtocol : CDCClassCommon.h
  • CDC_Descriptor_ClassSubclassProtocol_t : CDCClassCommon.h
  • CDC_DescriptorSubtypes_t : CDCClassCommon.h
  • CDC_Device_BytesReceived() : CDCClassDevice.h
  • CDC_Device_ConfigureEndpoints() : CDCClassDevice.h
  • CDC_Device_Flush() : CDCClassDevice.h
  • CDC_Device_ProcessControlRequest() : CDCClassDevice.h
  • CDC_Device_ReceiveByte() : CDCClassDevice.h
  • CDC_Device_SendByte() : CDCClassDevice.h
  • CDC_Device_SendControlLineStateChange() : CDCClassDevice.h
  • CDC_Device_SendData() : CDCClassDevice.h
  • CDC_Device_SendString() : CDCClassDevice.h
  • CDC_Device_USBTask() : CDCClassDevice.h
  • CDC_DSUBTYPE_CSInterface_ACM : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ATM : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_CallManagement : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_CAPI : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_CountrySelection : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_DirectLine : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_Ethernet : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ExtensionUnit : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_Header : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_MultiChannel : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_NetworkChannel : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ProtocolUnit : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_TelephoneCall : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_TelephoneOpModes : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_TelephoneRinger : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_Union : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_USBTerminal : CDCClassCommon.h
  • CDC_FUNCTIONAL_DESCRIPTOR : CDCClassCommon.h
  • CDC_LINEENCODING_OneAndAHalfStopBits : CDCClassCommon.h
  • CDC_LINEENCODING_OneStopBit : CDCClassCommon.h
  • CDC_LineEncoding_t : CDCClassCommon.h
  • CDC_LINEENCODING_TwoStopBits : CDCClassCommon.h
  • CDC_LineEncodingFormats_t : CDCClassCommon.h
  • CDC_LineEncodingParity_t : CDCClassCommon.h
  • CDC_NOTIF_SerialState : CDCClassCommon.h
  • CDC_PARITY_Even : CDCClassCommon.h
  • CDC_PARITY_Mark : CDCClassCommon.h
  • CDC_PARITY_None : CDCClassCommon.h
  • CDC_PARITY_Odd : CDCClassCommon.h
  • CDC_PARITY_Space : CDCClassCommon.h
  • CDC_REQ_GetEncapsulatedResponse : CDCClassCommon.h
  • CDC_REQ_GetLineEncoding : CDCClassCommon.h
  • CDC_REQ_SendBreak : CDCClassCommon.h
  • CDC_REQ_SendEncapsulatedCommand : CDCClassCommon.h
  • CDC_REQ_SetControlLineState : CDCClassCommon.h
  • CDC_REQ_SetLineEncoding : CDCClassCommon.h
  • CDCSpecification : CDCClassCommon.h
  • CharFormat : CDCClassCommon.h
  • Class : StdDescriptors.h
  • CONCAT : Common.h
  • CONCAT_EXPANDED : Common.h
  • ConfigAttributes : StdDescriptors.h
  • ConfigComparatorPtr_t : ConfigDescriptors.h
  • ConfigurationNumber : StdDescriptors.h
  • ConfigurationStrIndex : StdDescriptors.h
  • CONTROL_REQTYPE_DIRECTION : StdRequestType.h
  • CONTROL_REQTYPE_RECIPIENT : StdRequestType.h
  • CONTROL_REQTYPE_TYPE : StdRequestType.h
  • CountryCode : HIDClassCommon.h
  • CPU_TO_BE16 : Endianness.h
  • cpu_to_be16 : Endianness.h
  • CPU_TO_BE32 : Endianness.h
  • cpu_to_be32 : Endianness.h
  • cpu_to_le16 : Endianness.h
  • CPU_TO_LE16 : Endianness.h
  • CPU_TO_LE32 : Endianness.h
  • cpu_to_le32 : Endianness.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- d -

  • DataBits : CDCClassCommon.h
  • DataTransferLength : MassStorageClassCommon.h
  • DataTransferResidue : MassStorageClassCommon.h
  • DESCRIPTOR_CAST : ConfigDescriptors.h
  • DESCRIPTOR_PCAST : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_COMP_EndOfDescriptor : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_COMP_Fail : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_COMP_Found : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_Fail : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_Found : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_NotFound : ConfigDescriptors.h
  • DESCRIPTOR_SIZE : ConfigDescriptors.h
  • DESCRIPTOR_TYPE : ConfigDescriptors.h
  • DEVICE_STATE_Addressed : Device.h
  • DEVICE_STATE_Configured : Device.h
  • DEVICE_STATE_Default : Device.h
  • DEVICE_STATE_Powered : Device.h
  • DEVICE_STATE_Suspended : Device.h
  • DEVICE_STATE_Unattached : Device.h
  • DISCONNECT : USBController_XMC4000.h
  • DSearch_Comp_Return_ErrorCodes_t : ConfigDescriptors.h
  • DSearch_Return_ErrorCodes_t : ConfigDescriptors.h
  • DTYPE_Configuration : StdDescriptors.h
  • DTYPE_CSEndpoint : StdDescriptors.h
  • DTYPE_CSInterface : StdDescriptors.h
  • DTYPE_Device : StdDescriptors.h
  • DTYPE_DeviceQualifier : StdDescriptors.h
  • DTYPE_Endpoint : StdDescriptors.h
  • DTYPE_Interface : StdDescriptors.h
  • DTYPE_InterfaceAssociation : StdDescriptors.h
  • DTYPE_InterfacePower : StdDescriptors.h
  • DTYPE_Other : StdDescriptors.h
  • DTYPE_String : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- e -

  • Endpoint0Size : StdDescriptors.h
  • ENDPOINT_ATTR_ADAPTIVE : StdDescriptors.h
  • ENDPOINT_ATTR_ASYNC : StdDescriptors.h
  • ENDPOINT_ATTR_NO_SYNC : StdDescriptors.h
  • ENDPOINT_ATTR_SYNC : StdDescriptors.h
  • Endpoint_ClearIN() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_ClearOUT() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_ConfigureEndpointTable() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • ENDPOINT_CONTROLEP : EndPoint.h
  • Endpoint_ControlStream_RW_ErrorCodes_t : EndpointStream.h
  • ENDPOINT_DIR_IN : USBController.h
  • ENDPOINT_DIR_MASK : USBController.h
  • ENDPOINT_DIR_OUT : USBController.h
  • Endpoint_Discard_Stream() : EndpointStream_XMC4000.h
  • ENDPOINT_EPNUM_MASK : EndPoint.h
  • Endpoint_IsReadWriteAllowed() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Null_Stream() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_32_LE() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Read_8() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Read_Control_Stream_BE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_Control_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_Stream_BE() : EndpointStream_XMC4000.h , EndpointStream_XMC4000.c
  • Endpoint_Read_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • ENDPOINT_READYWAIT_BusSuspended : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_DeviceDisconnected : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_EndpointStalled : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_NoError : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_Timeout : Endpoint_XMC4000.h
  • ENDPOINT_RWCSTREAM_BusSuspended : EndpointStream.h
  • ENDPOINT_RWCSTREAM_DeviceDisconnected : EndpointStream.h
  • ENDPOINT_RWCSTREAM_HostAborted : EndpointStream.h
  • ENDPOINT_RWCSTREAM_NoError : EndpointStream.h
  • ENDPOINT_RWSTREAM_BusSuspended : EndpointStream.h
  • ENDPOINT_RWSTREAM_DeviceDisconnected : EndpointStream.h
  • ENDPOINT_RWSTREAM_EndpointStalled : EndpointStream.h
  • ENDPOINT_RWSTREAM_IncompleteTransfer : EndpointStream.h
  • ENDPOINT_RWSTREAM_NoError : EndpointStream.h
  • ENDPOINT_RWSTREAM_Timeout : EndpointStream.h
  • Endpoint_Stream_RW_ErrorCodes_t : EndpointStream.h
  • ENDPOINT_TOTAL_ENDPOINTS : USBController_XMC4000.h
  • ENDPOINT_USAGE_DATA : StdDescriptors.h
  • ENDPOINT_USAGE_FEEDBACK : StdDescriptors.h
  • ENDPOINT_USAGE_IMPLICIT_FEEDBACK : StdDescriptors.h
  • Endpoint_WaitUntilReady() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_WaitUntilReady_ErrorCodes_t : Endpoint_XMC4000.h
  • Endpoint_Write_32_LE() : Endpoint_XMC4000.h , Endpoint_XMC4000.c
  • Endpoint_Write_8() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Write_Control_Stream_BE() : EndpointStream_XMC4000.h , EndpointStream_XMC4000.c
  • Endpoint_Write_Control_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Write_Stream_BE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Write_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • EndpointAddress : StdDescriptors.h
  • EndpointSize : StdDescriptors.h
  • EP0_State : USBController_XMC4000.h
  • EP0_State_t : USBController_XMC4000.h
  • EP_TYPE_BULK : USBController.h
  • EP_TYPE_CONTROL : USBController.h
  • EP_TYPE_INTERRUPT : USBController.h
  • EP_TYPE_ISOCHRONOUS : USBController.h
  • EP_TYPE_MASK : USBController.h
  • EVENT_CDC_Device_BreakSent() : CDCClassDevice.h
  • EVENT_CDC_Device_ControLineStateChanged() : CDCClassDevice.h
  • EVENT_CDC_Device_LineEncodingChanged() : CDCClassDevice.h
  • EVENT_USB_Device_ConfigurationChanged() : Events.h
  • EVENT_USB_Device_Connect() : Events.h
  • EVENT_USB_Device_ControlRequest() : Events.h
  • EVENT_USB_Device_Disconnect() : Events.h
  • EVENT_USB_Device_Reset() : Events.h
  • EVENT_USB_Device_StartOfFrame() : Events.h
  • EVENT_USB_Device_Suspend() : Events.h
  • EVENT_USB_Device_WakeUp() : Events.h
  • EVENT_USB_Host_DeviceAttached() : Events.h
  • EVENT_USB_Host_DeviceEnumerationComplete() : Events.h
  • EVENT_USB_Host_DeviceEnumerationFailed() : Events.h
  • EVENT_USB_Host_DeviceUnattached() : Events.h
  • EVENT_USB_Host_HostError() : Events.h
  • EVENT_USB_Host_StartOfFrame() : Events.h
  • EVENT_USB_UIDChange() : Events.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- f -

  • FEATURE_SEL_DeviceRemoteWakeup : StdRequestType.h
  • FEATURE_SEL_EndpointHalt : StdRequestType.h
  • FEATURE_SEL_TestMode : StdRequestType.h
  • FirstInterfaceIndex : StdDescriptors.h
  • Flags : MassStorageClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- h -

  • Header : CDCClassCommon.h , HIDClassCommon.h , StdDescriptors.h
  • HID_ALIGN_DATA : HIDParser.h
  • HID_ClassRequests_t : HIDClassCommon.h
  • HID_CollectionPath_t : HIDParser.h
  • HID_CSCP_BootSubclass : HIDClassCommon.h
  • HID_CSCP_HIDClass : HIDClassCommon.h
  • HID_CSCP_KeyboardBootProtocol : HIDClassCommon.h
  • HID_CSCP_MouseBootProtocol : HIDClassCommon.h
  • HID_CSCP_NonBootProtocol : HIDClassCommon.h
  • HID_CSCP_NonBootSubclass : HIDClassCommon.h
  • HID_Descriptor_ClassSubclassProtocol_t : HIDClassCommon.h
  • HID_DESCRIPTOR_JOYSTICK : HIDClassCommon.h
  • HID_DESCRIPTOR_KEYBOARD : HIDClassCommon.h
  • HID_DESCRIPTOR_MOUSE : HIDClassCommon.h
  • HID_DESCRIPTOR_VENDOR : HIDClassCommon.h
  • HID_DescriptorTypes_t : HIDClassCommon.h
  • HID_Device_ConfigureEndpoints() : HIDClassDevice.h
  • HID_Device_ProcessControlRequest() : HIDClassDevice.h
  • HID_Device_USBTask() : HIDClassDevice.h
  • HID_DTYPE_HID : HIDClassCommon.h
  • HID_DTYPE_Report : HIDClassCommon.h
  • HID_KEYBOARD_LED_CAPSLOCK : HIDClassCommon.h
  • HID_KEYBOARD_LED_COMPOSE : HIDClassCommon.h
  • HID_KEYBOARD_LED_KANA : HIDClassCommon.h
  • HID_KEYBOARD_LED_NUMLOCK : HIDClassCommon.h
  • HID_KEYBOARD_LED_SCROLLLOCK : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTALT : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTCTRL : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTGUI : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTSHIFT : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTALT : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTCTRL : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTGUI : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTSHIFT : HIDClassCommon.h
  • HID_Parse_ErrorCodes_t : HIDParser.h
  • HID_PARSE_HIDStackOverflow : HIDParser.h
  • HID_PARSE_HIDStackUnderflow : HIDParser.h
  • HID_PARSE_InsufficientCollectionPaths : HIDParser.h
  • HID_PARSE_InsufficientReportIDItems : HIDParser.h
  • HID_PARSE_InsufficientReportItems : HIDParser.h
  • HID_PARSE_NoUnfilteredReportItems : HIDParser.h
  • HID_PARSE_Successful : HIDParser.h
  • HID_PARSE_UnexpectedEndCollection : HIDParser.h
  • HID_PARSE_UsageListOverflow : HIDParser.h
  • HID_REPORT_ITEM_Feature : HIDClassCommon.h
  • HID_REPORT_ITEM_In : HIDClassCommon.h
  • HID_REPORT_ITEM_Out : HIDClassCommon.h
  • HID_ReportItemTypes_t : HIDClassCommon.h
  • HID_REQ_GetIdle : HIDClassCommon.h
  • HID_REQ_GetProtocol : HIDClassCommon.h
  • HID_REQ_GetReport : HIDClassCommon.h
  • HID_REQ_SetIdle : HIDClassCommon.h
  • HID_REQ_SetProtocol : HIDClassCommon.h
  • HID_REQ_SetReport : HIDClassCommon.h
  • HIDReportLength : HIDClassCommon.h
  • HIDReportType : HIDClassCommon.h
  • HIDSpec : HIDClassCommon.h
  • HOST_GETCONFIG_BuffOverflow : ConfigDescriptors.h
  • HOST_GETCONFIG_DeviceDisconnect : ConfigDescriptors.h
  • HOST_GETCONFIG_InvalidData : ConfigDescriptors.h
  • HOST_GETCONFIG_PipeError : ConfigDescriptors.h
  • HOST_GETCONFIG_SetupStalled : ConfigDescriptors.h
  • HOST_GETCONFIG_SoftwareTimeOut : ConfigDescriptors.h
  • HOST_GETCONFIG_Successful : ConfigDescriptors.h
  • HOST_SENDCONTROL_DeviceDisconnected : HostStandardReq.h
  • HOST_SENDCONTROL_PipeError : HostStandardReq.h
  • HOST_SENDCONTROL_SetupStalled : HostStandardReq.h
  • HOST_SENDCONTROL_SoftwareTimeOut : HostStandardReq.h
  • HOST_SENDCONTROL_Successful : HostStandardReq.h
  • HOST_STATE_Addressed : Host.h
  • HOST_STATE_Configured : Host.h
  • HOST_STATE_Default : Host.h
  • HOST_STATE_Default_PostAddressSet : Host.h
  • HOST_STATE_Default_PostReset : Host.h
  • HOST_STATE_Powered : Host.h
  • HOST_STATE_Powered_ConfigPipe : Host.h
  • HOST_STATE_Powered_DoReset : Host.h
  • HOST_STATE_Powered_WaitForConnect : Host.h
  • HOST_STATE_Powered_WaitForDeviceSettle : Host.h
  • HOST_STATE_Unattached : Host.h
  • HOST_STATE_WaitForDevice : Host.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- i -

  • IADStrIndex : StdDescriptors.h
  • iConfiguration : StdDescriptors.h
  • IDLE : USBController_XMC4000.h
  • idProduct : StdDescriptors.h
  • idVendor : StdDescriptors.h
  • iFunction : StdDescriptors.h
  • iInterface : StdDescriptors.h
  • iManufacturer : StdDescriptors.h
  • IN_DATA : USBController_XMC4000.h
  • IN_STATUS : USBController_XMC4000.h
  • InterfaceNumber : StdDescriptors.h
  • InterfaceStrIndex : StdDescriptors.h
  • iProduct : StdDescriptors.h
  • iSerialNumber : StdDescriptors.h
  • ISR : Common.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- k -

  • KeyCode : HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- l -

  • LANGUAGE_ID_ENG : StdDescriptors.h
  • le16_to_cpu : Endianness.h
  • LE16_TO_CPU : Endianness.h
  • le32_to_cpu : Endianness.h
  • LE32_TO_CPU : Endianness.h
  • LUN : MassStorageClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- m -

  • ManufacturerStrIndex : StdDescriptors.h
  • MasterInterfaceNumber : CDCClassCommon.h
  • MAX : Common.h
  • MaxPowerConsumption : StdDescriptors.h
  • MIN : Common.h
  • Modifier : HIDClassCommon.h
  • MS_CBW_SIGNATURE : MassStorageClassCommon.h
  • MS_ClassRequests_t : MassStorageClassCommon.h
  • MS_COMMAND_DIR_DATA_IN : MassStorageClassCommon.h
  • MS_COMMAND_DIR_DATA_OUT : MassStorageClassCommon.h
  • MS_CommandBlockWrapper_t : MassStorageClassCommon.h
  • MS_CommandStatusCodes_t : MassStorageClassCommon.h
  • MS_CommandStatusWrapper_t : MassStorageClassCommon.h
  • MS_CSCP_BulkOnlyTransportProtocol : MassStorageClassCommon.h
  • MS_CSCP_MassStorageClass : MassStorageClassCommon.h
  • MS_CSCP_SCSITransparentSubclass : MassStorageClassCommon.h
  • MS_CSW_SIGNATURE : MassStorageClassCommon.h
  • MS_Descriptor_ClassSubclassProtocol_t : MassStorageClassCommon.h
  • MS_Device_ConfigureEndpoints() : MassStorageClassDevice.h
  • MS_Device_ProcessControlRequest() : MassStorageClassDevice.h
  • MS_Device_USBTask() : MassStorageClassDevice.h
  • MS_REQ_GetMaxLUN : MassStorageClassCommon.h
  • MS_REQ_MassStorageReset : MassStorageClassCommon.h
  • MS_SCSI_COMMAND_Fail : MassStorageClassCommon.h
  • MS_SCSI_COMMAND_Pass : MassStorageClassCommon.h
  • MS_SCSI_COMMAND_PhaseError : MassStorageClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- n -

  • NO_DESCRIPTOR : StdDescriptors.h
  • NumberOfConfigurations : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- o -

  • OUT_DATA : USBController_XMC4000.h
  • OUT_STATUS : USBController_XMC4000.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- p -

  • ParityType : CDCClassCommon.h
  • PIPE_CONTROLPIPE : Pipe.h
  • PIPE_DIR_IN : USBController.h
  • PIPE_DIR_MASK : USBController.h
  • PIPE_DIR_OUT : USBController.h
  • PIPE_EPNUM_MASK : Pipe.h
  • PIPE_PIPENUM_MASK : Pipe.h
  • PIPE_RWSTREAM_DeviceDisconnected : PipeStream.h
  • PIPE_RWSTREAM_IncompleteTransfer : PipeStream.h
  • PIPE_RWSTREAM_NoError : PipeStream.h
  • PIPE_RWSTREAM_PipeStalled : PipeStream.h
  • PIPE_RWSTREAM_Timeout : PipeStream.h
  • Pipe_Stream_RW_ErrorCodes_t : PipeStream.h
  • PollingIntervalMS : StdDescriptors.h
  • ProductID : StdDescriptors.h
  • ProductStrIndex : StdDescriptors.h
  • Protocol : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- r -

  • ReleaseNumber : StdDescriptors.h
  • REQ_ClearFeature : StdRequestType.h
  • REQ_GetConfiguration : StdRequestType.h
  • REQ_GetDescriptor : StdRequestType.h
  • REQ_GetInterface : StdRequestType.h
  • REQ_GetStatus : StdRequestType.h
  • REQ_SetAddress : StdRequestType.h
  • REQ_SetConfiguration : StdRequestType.h
  • REQ_SetDescriptor : StdRequestType.h
  • REQ_SetFeature : StdRequestType.h
  • REQ_SetInterface : StdRequestType.h
  • REQ_SynchFrame : StdRequestType.h
  • REQDIR_DEVICETOHOST : StdRequestType.h
  • REQDIR_HOSTTODEVICE : StdRequestType.h
  • REQREC_DEVICE : StdRequestType.h
  • REQREC_ENDPOINT : StdRequestType.h
  • REQREC_INTERFACE : StdRequestType.h
  • REQREC_OTHER : StdRequestType.h
  • REQTYPE_CLASS : StdRequestType.h
  • REQTYPE_STANDARD : StdRequestType.h
  • REQTYPE_VENDOR : StdRequestType.h
  • Reserved : StdDescriptors.h , HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- s -

  • SCSI_ASENSE_FORMAT_ERROR : MassStorageClassCommon.h
  • SCSI_ASENSE_INVALID_COMMAND : MassStorageClassCommon.h
  • SCSI_ASENSE_INVALID_FIELD_IN_CDB : MassStorageClassCommon.h
  • SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE : MassStorageClassCommon.h
  • SCSI_ASENSE_LOGICAL_UNIT_NOT_READY : MassStorageClassCommon.h
  • SCSI_ASENSE_MEDIUM_NOT_PRESENT : MassStorageClassCommon.h
  • SCSI_ASENSE_NO_ADDITIONAL_INFORMATION : MassStorageClassCommon.h
  • SCSI_ASENSE_NOT_READY_TO_READY_CHANGE : MassStorageClassCommon.h
  • SCSI_ASENSE_WRITE_PROTECTED : MassStorageClassCommon.h
  • SCSI_ASENSEQ_FORMAT_COMMAND_FAILED : MassStorageClassCommon.h
  • SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED : MassStorageClassCommon.h
  • SCSI_ASENSEQ_NO_QUALIFIER : MassStorageClassCommon.h
  • SCSI_ASENSEQ_OPERATION_IN_PROGRESS : MassStorageClassCommon.h
  • SCSI_CMD_INQUIRY : MassStorageClassCommon.h
  • SCSI_CMD_MODE_SENSE_10 : MassStorageClassCommon.h
  • SCSI_CMD_MODE_SENSE_6 : MassStorageClassCommon.h
  • SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL : MassStorageClassCommon.h
  • SCSI_CMD_READ_10 : MassStorageClassCommon.h
  • SCSI_CMD_READ_6 : MassStorageClassCommon.h
  • SCSI_CMD_READ_CAPACITY_10 : MassStorageClassCommon.h
  • SCSI_CMD_REQUEST_SENSE : MassStorageClassCommon.h
  • SCSI_CMD_SEND_DIAGNOSTIC : MassStorageClassCommon.h
  • SCSI_CMD_START_STOP_UNIT : MassStorageClassCommon.h
  • SCSI_CMD_TEST_UNIT_READY : MassStorageClassCommon.h
  • SCSI_CMD_VERIFY_10 : MassStorageClassCommon.h
  • SCSI_CMD_WRITE_10 : MassStorageClassCommon.h
  • SCSI_CMD_WRITE_6 : MassStorageClassCommon.h
  • SCSI_Inquiry_Response_t : MassStorageClassCommon.h
  • SCSI_Request_Sense_Response_t : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_ABORTED_COMMAND : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_BLANK_CHECK : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_COPY_ABORTED : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_DATA_PROTECT : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_GOOD : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_HARDWARE_ERROR : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_ILLEGAL_REQUEST : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_MEDIUM_ERROR : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_MISCOMPARE : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_NOT_READY : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_RECOVERED_ERROR : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_UNIT_ATTENTION : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_VENDOR_SPECIFIC : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_VOLUME_OVERFLOW : MassStorageClassCommon.h
  • SCSICommandData : MassStorageClassCommon.h
  • SCSICommandLength : MassStorageClassCommon.h
  • SerialNumStrIndex : StdDescriptors.h
  • Signature : MassStorageClassCommon.h
  • Size : StdDescriptors.h
  • SlaveInterfaceNumber : CDCClassCommon.h
  • Status : MassStorageClassCommon.h
  • STRINGIFY : Common.h
  • STRINGIFY_EXPANDED : Common.h
  • SubClass : StdDescriptors.h
  • Subtype : CDCClassCommon.h
  • SWAPENDIAN_16 : Endianness.h
  • SWAPENDIAN_32 : Endianness.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- t -

  • Tag : MassStorageClassCommon.h
  • TotalConfigurationSize : StdDescriptors.h
  • TotalEndpoints : StdDescriptors.h
  • TotalInterfaces : StdDescriptors.h
  • TotalReportDescriptors : HIDClassCommon.h
  • Type : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- u -

  • USB_CDC_Descriptor_FunctionalACM_t : CDCClassCommon.h
  • USB_CDC_Descriptor_FunctionalHeader_t : CDCClassCommon.h
  • USB_CDC_Descriptor_FunctionalUnion_t : CDCClassCommon.h
  • USB_CDC_StdDescriptor_FunctionalACM_t : CDCClassCommon.h
  • USB_CDC_StdDescriptor_FunctionalHeader_t : CDCClassCommon.h
  • USB_CDC_StdDescriptor_FunctionalUnion_t : CDCClassCommon.h
  • USB_CONFIG_ATTR_REMOTEWAKEUP : StdDescriptors.h
  • USB_CONFIG_ATTR_RESERVED : StdDescriptors.h
  • USB_CONFIG_ATTR_SELFPOWERED : StdDescriptors.h
  • USB_CONFIG_POWER_MA : StdDescriptors.h
  • USB_Control_Request_t : StdRequestType.h
  • USB_ControlRequest : USBTask.h
  • USB_CSCP_IADDeviceClass : StdDescriptors.h
  • USB_CSCP_IADDeviceProtocol : StdDescriptors.h
  • USB_CSCP_IADDeviceSubclass : StdDescriptors.h
  • USB_CSCP_NoDeviceClass : StdDescriptors.h
  • USB_CSCP_NoDeviceProtocol : StdDescriptors.h
  • USB_CSCP_NoDeviceSubclass : StdDescriptors.h
  • USB_CSCP_VendorSpecificClass : StdDescriptors.h
  • USB_CSCP_VendorSpecificProtocol : StdDescriptors.h
  • USB_CSCP_VendorSpecificSubclass : StdDescriptors.h
  • USB_Descriptor_ClassSubclassProtocol_t : StdDescriptors.h
  • USB_Descriptor_Configuration_Header_t : StdDescriptors.h
  • USB_Descriptor_Device_t : StdDescriptors.h
  • USB_Descriptor_DeviceQualifier_t : StdDescriptors.h
  • USB_Descriptor_Endpoint_t : StdDescriptors.h
  • USB_Descriptor_Header_t : StdDescriptors.h
  • USB_Descriptor_HIDReport_Datatype_t : HIDClassCommon.h
  • USB_Descriptor_Interface_Association_t : StdDescriptors.h
  • USB_Descriptor_Interface_t : StdDescriptors.h
  • USB_Descriptor_String_t : StdDescriptors.h
  • USB_DescriptorTypes_t : StdDescriptors.h
  • USB_Device_ConfigurationNumber : DeviceStandardReq.h
  • USB_Device_CurrentlySelfPowered : DeviceStandardReq.h
  • USB_Device_ProcessControlRequest() : DeviceStandardReq.h
  • USB_Device_RemoteWakeupEnabled : DeviceStandardReq.h
  • USB_Device_States_t : Device.h
  • USB_Device_t : USBController_XMC4000.h
  • USB_DeviceState : USBTask.h
  • USB_Feature_Selectors_t : StdRequestType.h
  • USB_GetHIDReportItemInfo() : HIDParser.h
  • USB_GetHIDReportSize() : HIDParser.h
  • USB_GetNextDescriptorComp() : ConfigDescriptors.h
  • USB_GetNextDescriptorOfType() : ConfigDescriptors.h
  • USB_GetNextDescriptorOfTypeAfter() : ConfigDescriptors.h
  • USB_GetNextDescriptorOfTypeBefore() : ConfigDescriptors.h
  • USB_HID_Descriptor_HID_t : HIDClassCommon.h
  • USB_HID_StdDescriptor_HID_t : HIDClassCommon.h
  • USB_Host_ClearEndpointStall() : HostStandardReq.h
  • USB_Host_ConfigurationNumber : HostStandardReq.h
  • USB_Host_GetConfigDescriptor_ErrorCodes_t : ConfigDescriptors.h
  • USB_Host_GetDescriptor() : HostStandardReq.h
  • USB_Host_GetDeviceConfigDescriptor() : ConfigDescriptors.h
  • USB_Host_GetDeviceConfiguration() : HostStandardReq.h
  • USB_Host_GetDeviceStatus() : HostStandardReq.h
  • USB_Host_GetInterfaceAltSetting() : HostStandardReq.h
  • USB_Host_SendControlErrorCodes_t : HostStandardReq.h
  • USB_Host_SendControlRequest() : HostStandardReq.h
  • USB_Host_SetDeviceConfiguration() : HostStandardReq.h
  • USB_Host_SetInterfaceAltSetting() : HostStandardReq.h
  • USB_Host_States_t : Host.h
  • USB_HOST_TIMEOUT_MS : HostStandardReq.h
  • USB_IsEnumDone() : USBController_XMC4000.h
  • USB_IsInitialized : USBTask.h
  • USB_KeyboardReport_Data_t : HIDClassCommon.h
  • USB_MODE_Device : USBController.h
  • USB_MODE_Host : USBController.h
  • USB_MODE_None : USBController.h
  • USB_MODE_UID : USBController.h
  • USB_Modes_t : USBController.h
  • USB_MouseReport_Data_t : HIDClassCommon.h
  • USB_ProcessHIDReport() : HIDParser.h
  • USB_Request_Header_t : StdRequestType.h
  • USB_SetHIDReportItemInfo() : HIDParser.h
  • USB_StdDescriptor_Configuration_Header_t : StdDescriptors.h
  • USB_StdDescriptor_Device_t : StdDescriptors.h
  • USB_StdDescriptor_DeviceQualifier_t : StdDescriptors.h
  • USB_StdDescriptor_Endpoint_t : StdDescriptors.h
  • USB_StdDescriptor_Header_t : StdDescriptors.h
  • USB_StdDescriptor_Interface_Association_t : StdDescriptors.h
  • USB_StdDescriptor_Interface_t : StdDescriptors.h
  • USB_StdDescriptor_String_t : StdDescriptors.h
  • USB_STRING_DESCRIPTOR : StdDescriptors.h
  • USB_STRING_DESCRIPTOR_ARRAY : StdDescriptors.h
  • USB_STRING_LEN : StdDescriptors.h
  • USB_USBTask() : USBTask.h
  • USBD_Endpoint_t : USBController_XMC4000.h
  • USBD_Initialize() : USBController_XMC4000.h
  • USBD_SetEndpointBuffer() : USBController_XMC4000.h
  • USBD_SignalDeviceEventHandler() : USBController_XMC4000.h
  • USBD_SignalEndpointEvent_Handler() : USBController_XMC4000.h
  • USBSpecification : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- v -

  • VendorID : StdDescriptors.h
  • VERSION_BCD : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- w -

  • wDescriptorLength : HIDClassCommon.h
  • wIndex : StdRequestType.h
  • wLength : StdRequestType.h
  • wMaxPacketSize : StdDescriptors.h
  • wTotalLength : StdDescriptors.h
  • wValue : StdRequestType.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- x -

  • X : HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- y -

  • Y : HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • c
  • e
  • h
  • m
  • u

- c -

  • CALLBACK_HID_Device_CreateHIDReport() : HIDClassDevice.h
  • CALLBACK_HID_Device_ProcessHIDReport() : HIDClassDevice.h
  • CALLBACK_HIDParser_FilterHIDReportItem() : HIDParser.h
  • CALLBACK_MS_Device_SCSICommandReceived() : MassStorageClassDevice.h
  • CALLBACK_USB_GetDescriptor() : Device.h
  • CDC_Device_BytesReceived() : CDCClassDevice.h
  • CDC_Device_ConfigureEndpoints() : CDCClassDevice.h
  • CDC_Device_Flush() : CDCClassDevice.h
  • CDC_Device_ProcessControlRequest() : CDCClassDevice.h
  • CDC_Device_ReceiveByte() : CDCClassDevice.h
  • CDC_Device_SendByte() : CDCClassDevice.h
  • CDC_Device_SendControlLineStateChange() : CDCClassDevice.h
  • CDC_Device_SendData() : CDCClassDevice.h
  • CDC_Device_SendString() : CDCClassDevice.h
  • CDC_Device_USBTask() : CDCClassDevice.h

- e -

  • Endpoint_ClearIN() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_ClearOUT() : Endpoint_XMC4000.h , Endpoint_XMC4000.c
  • Endpoint_ConfigureEndpointTable() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Discard_Stream() : EndpointStream_XMC4000.h
  • Endpoint_IsReadWriteAllowed() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Null_Stream() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_32_LE() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Read_8() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Read_Control_Stream_BE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_Control_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_Stream_BE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Read_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_WaitUntilReady() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Write_32_LE() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Write_8() : Endpoint_XMC4000.c , Endpoint_XMC4000.h
  • Endpoint_Write_Control_Stream_BE() : EndpointStream_XMC4000.h , EndpointStream_XMC4000.c
  • Endpoint_Write_Control_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Write_Stream_BE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • Endpoint_Write_Stream_LE() : EndpointStream_XMC4000.c , EndpointStream_XMC4000.h
  • EVENT_CDC_Device_BreakSent() : CDCClassDevice.h
  • EVENT_CDC_Device_ControLineStateChanged() : CDCClassDevice.h
  • EVENT_CDC_Device_LineEncodingChanged() : CDCClassDevice.h
  • EVENT_USB_Device_ConfigurationChanged() : Events.h
  • EVENT_USB_Device_Connect() : Events.h
  • EVENT_USB_Device_ControlRequest() : Events.h
  • EVENT_USB_Device_Disconnect() : Events.h
  • EVENT_USB_Device_Reset() : Events.h
  • EVENT_USB_Device_StartOfFrame() : Events.h
  • EVENT_USB_Device_Suspend() : Events.h
  • EVENT_USB_Device_WakeUp() : Events.h
  • EVENT_USB_Host_DeviceAttached() : Events.h
  • EVENT_USB_Host_DeviceEnumerationComplete() : Events.h
  • EVENT_USB_Host_DeviceEnumerationFailed() : Events.h
  • EVENT_USB_Host_DeviceUnattached() : Events.h
  • EVENT_USB_Host_HostError() : Events.h
  • EVENT_USB_Host_StartOfFrame() : Events.h
  • EVENT_USB_UIDChange() : Events.h

- h -

  • HID_Device_ConfigureEndpoints() : HIDClassDevice.h
  • HID_Device_ProcessControlRequest() : HIDClassDevice.h
  • HID_Device_USBTask() : HIDClassDevice.h

- m -

  • MS_Device_ConfigureEndpoints() : MassStorageClassDevice.h
  • MS_Device_ProcessControlRequest() : MassStorageClassDevice.h
  • MS_Device_USBTask() : MassStorageClassDevice.h

- u -

  • USB_Device_ProcessControlRequest() : DeviceStandardReq.h
  • USB_GetHIDReportItemInfo() : HIDParser.h
  • USB_GetHIDReportSize() : HIDParser.h
  • USB_GetNextDescriptorComp() : ConfigDescriptors.h
  • USB_GetNextDescriptorOfType() : ConfigDescriptors.h
  • USB_GetNextDescriptorOfTypeAfter() : ConfigDescriptors.h
  • USB_GetNextDescriptorOfTypeBefore() : ConfigDescriptors.h
  • USB_Host_ClearEndpointStall() : HostStandardReq.h
  • USB_Host_GetDescriptor() : HostStandardReq.h
  • USB_Host_GetDeviceConfigDescriptor() : ConfigDescriptors.h
  • USB_Host_GetDeviceConfiguration() : HostStandardReq.h
  • USB_Host_GetDeviceStatus() : HostStandardReq.h
  • USB_Host_GetInterfaceAltSetting() : HostStandardReq.h
  • USB_Host_SendControlRequest() : HostStandardReq.h
  • USB_Host_SetDeviceConfiguration() : HostStandardReq.h
  • USB_Host_SetInterfaceAltSetting() : HostStandardReq.h
  • USB_IsEnumDone() : USBController_XMC4000.h
  • USB_ProcessHIDReport() : HIDParser.h
  • USB_SetHIDReportItemInfo() : HIDParser.h
  • USB_USBTask() : USBTask.h
  • USBD_Initialize() : USBController_XMC4000.h
  • USBD_SetEndpointBuffer() : USBController_XMC4000.h
  • USBD_SignalDeviceEventHandler() : USBController_XMC4000.h
  • USBD_SignalEndpointEvent_Handler() : USBController_XMC4000.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • k
  • l
  • m
  • n
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- a -

  • AlternateSetting : StdDescriptors.h
  • Attributes : StdDescriptors.h

- b -

  • bAlternateSetting : StdDescriptors.h
  • BaudRateBPS : CDCClassCommon.h
  • bcdCDC : CDCClassCommon.h
  • bcdDevice : StdDescriptors.h
  • bcdHID : HIDClassCommon.h
  • bcdUSB : StdDescriptors.h
  • bConfigurationValue : StdDescriptors.h
  • bCountryCode : HIDClassCommon.h
  • bDescriptorSubType : CDCClassCommon.h
  • bDescriptorType : CDCClassCommon.h , HIDClassCommon.h , StdDescriptors.h
  • bDescriptorType2 : HIDClassCommon.h
  • bDeviceClass : StdDescriptors.h
  • bDeviceProtocol : StdDescriptors.h
  • bDeviceSubClass : StdDescriptors.h
  • bEndpointAddress : StdDescriptors.h
  • bFirstInterface : StdDescriptors.h
  • bFunctionClass : StdDescriptors.h
  • bFunctionLength : CDCClassCommon.h
  • bFunctionProtocol : StdDescriptors.h
  • bFunctionSubClass : StdDescriptors.h
  • bInterfaceClass : StdDescriptors.h
  • bInterfaceCount : StdDescriptors.h
  • bInterfaceNumber : StdDescriptors.h
  • bInterfaceProtocol : StdDescriptors.h
  • bInterfaceSubClass : StdDescriptors.h
  • bInterval : StdDescriptors.h
  • bLength : HIDClassCommon.h , StdDescriptors.h
  • bMasterInterface : CDCClassCommon.h
  • bmAttributes : StdDescriptors.h
  • bMaxPacketSize0 : StdDescriptors.h
  • bMaxPower : StdDescriptors.h
  • bmCapabilities : CDCClassCommon.h
  • bmRequestType : StdRequestType.h
  • bNumConfigurations : StdDescriptors.h
  • bNumDescriptors : HIDClassCommon.h
  • bNumEndpoints : StdDescriptors.h
  • bNumInterfaces : StdDescriptors.h
  • bRequest : StdRequestType.h
  • bReserved : StdDescriptors.h
  • bSlaveInterface0 : CDCClassCommon.h
  • bString : StdDescriptors.h
  • Button : HIDClassCommon.h

- c -

  • Capabilities : CDCClassCommon.h
  • CDCSpecification : CDCClassCommon.h
  • CharFormat : CDCClassCommon.h
  • Class : StdDescriptors.h
  • ConfigAttributes : StdDescriptors.h
  • ConfigurationNumber : StdDescriptors.h
  • ConfigurationStrIndex : StdDescriptors.h
  • CountryCode : HIDClassCommon.h

- d -

  • DataBits : CDCClassCommon.h
  • DataTransferLength : MassStorageClassCommon.h
  • DataTransferResidue : MassStorageClassCommon.h

- e -

  • Endpoint0Size : StdDescriptors.h
  • EndpointAddress : StdDescriptors.h
  • EndpointSize : StdDescriptors.h

- f -

  • FirstInterfaceIndex : StdDescriptors.h
  • Flags : MassStorageClassCommon.h

- h -

  • Header : CDCClassCommon.h , HIDClassCommon.h , StdDescriptors.h
  • HIDReportLength : HIDClassCommon.h
  • HIDReportType : HIDClassCommon.h
  • HIDSpec : HIDClassCommon.h

- i -

  • IADStrIndex : StdDescriptors.h
  • iConfiguration : StdDescriptors.h
  • idProduct : StdDescriptors.h
  • idVendor : StdDescriptors.h
  • iFunction : StdDescriptors.h
  • iInterface : StdDescriptors.h
  • iManufacturer : StdDescriptors.h
  • InterfaceNumber : StdDescriptors.h
  • InterfaceStrIndex : StdDescriptors.h
  • iProduct : StdDescriptors.h
  • iSerialNumber : StdDescriptors.h

- k -

  • KeyCode : HIDClassCommon.h

- l -

  • LUN : MassStorageClassCommon.h

- m -

  • ManufacturerStrIndex : StdDescriptors.h
  • MasterInterfaceNumber : CDCClassCommon.h
  • MaxPowerConsumption : StdDescriptors.h
  • Modifier : HIDClassCommon.h

- n -

  • NumberOfConfigurations : StdDescriptors.h

- p -

  • ParityType : CDCClassCommon.h
  • PollingIntervalMS : StdDescriptors.h
  • ProductID : StdDescriptors.h
  • ProductStrIndex : StdDescriptors.h
  • Protocol : StdDescriptors.h

- r -

  • ReleaseNumber : StdDescriptors.h
  • Reserved : StdDescriptors.h , HIDClassCommon.h

- s -

  • SCSICommandData : MassStorageClassCommon.h
  • SCSICommandLength : MassStorageClassCommon.h
  • SerialNumStrIndex : StdDescriptors.h
  • Signature : MassStorageClassCommon.h
  • Size : StdDescriptors.h
  • SlaveInterfaceNumber : CDCClassCommon.h
  • Status : MassStorageClassCommon.h
  • SubClass : StdDescriptors.h
  • Subtype : CDCClassCommon.h

- t -

  • Tag : MassStorageClassCommon.h
  • TotalConfigurationSize : StdDescriptors.h
  • TotalEndpoints : StdDescriptors.h
  • TotalInterfaces : StdDescriptors.h
  • TotalReportDescriptors : HIDClassCommon.h
  • Type : StdDescriptors.h

- u -

  • USB_ControlRequest : USBTask.h
  • USB_Device_ConfigurationNumber : DeviceStandardReq.h
  • USB_Device_CurrentlySelfPowered : DeviceStandardReq.h
  • USB_Device_RemoteWakeupEnabled : DeviceStandardReq.h
  • USB_DeviceState : USBTask.h
  • USB_Host_ConfigurationNumber : HostStandardReq.h
  • USB_IsInitialized : USBTask.h
  • USBSpecification : StdDescriptors.h

- v -

  • VendorID : StdDescriptors.h

- w -

  • wDescriptorLength : HIDClassCommon.h
  • wIndex : StdRequestType.h
  • wLength : StdRequestType.h
  • wMaxPacketSize : StdDescriptors.h
  • wTotalLength : StdDescriptors.h
  • wValue : StdRequestType.h

- x -

  • X : HIDClassCommon.h

- y -

  • Y : HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • c
  • e
  • h
  • m
  • s
  • u

- c -

  • CDC_LineEncoding_t : CDCClassCommon.h
  • ConfigComparatorPtr_t : ConfigDescriptors.h

- e -

  • EP0_State_t : USBController_XMC4000.h

- h -

  • HID_CollectionPath_t : HIDParser.h

- m -

  • MS_CommandBlockWrapper_t : MassStorageClassCommon.h
  • MS_CommandStatusWrapper_t : MassStorageClassCommon.h

- s -

  • SCSI_Inquiry_Response_t : MassStorageClassCommon.h
  • SCSI_Request_Sense_Response_t : MassStorageClassCommon.h

- u -

  • USB_CDC_Descriptor_FunctionalACM_t : CDCClassCommon.h
  • USB_CDC_Descriptor_FunctionalHeader_t : CDCClassCommon.h
  • USB_CDC_Descriptor_FunctionalUnion_t : CDCClassCommon.h
  • USB_CDC_StdDescriptor_FunctionalACM_t : CDCClassCommon.h
  • USB_CDC_StdDescriptor_FunctionalHeader_t : CDCClassCommon.h
  • USB_CDC_StdDescriptor_FunctionalUnion_t : CDCClassCommon.h
  • USB_Descriptor_Configuration_Header_t : StdDescriptors.h
  • USB_Descriptor_Device_t : StdDescriptors.h
  • USB_Descriptor_DeviceQualifier_t : StdDescriptors.h
  • USB_Descriptor_Endpoint_t : StdDescriptors.h
  • USB_Descriptor_Header_t : StdDescriptors.h
  • USB_Descriptor_HIDReport_Datatype_t : HIDClassCommon.h
  • USB_Descriptor_Interface_Association_t : StdDescriptors.h
  • USB_Descriptor_Interface_t : StdDescriptors.h
  • USB_Descriptor_String_t : StdDescriptors.h
  • USB_Device_t : USBController_XMC4000.h
  • USB_HID_Descriptor_HID_t : HIDClassCommon.h
  • USB_HID_StdDescriptor_HID_t : HIDClassCommon.h
  • USB_KeyboardReport_Data_t : HIDClassCommon.h
  • USB_MouseReport_Data_t : HIDClassCommon.h
  • USB_Request_Header_t : StdRequestType.h
  • USB_StdDescriptor_Configuration_Header_t : StdDescriptors.h
  • USB_StdDescriptor_Device_t : StdDescriptors.h
  • USB_StdDescriptor_DeviceQualifier_t : StdDescriptors.h
  • USB_StdDescriptor_Endpoint_t : StdDescriptors.h
  • USB_StdDescriptor_Header_t : StdDescriptors.h
  • USB_StdDescriptor_Interface_Association_t : StdDescriptors.h
  • USB_StdDescriptor_Interface_t : StdDescriptors.h
  • USB_StdDescriptor_String_t : StdDescriptors.h
  • USBD_Endpoint_t : USBController_XMC4000.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • CDC_ClassNotifications_t : CDCClassCommon.h
  • CDC_ClassRequests_t : CDCClassCommon.h
  • CDC_Descriptor_ClassSubclassProtocol_t : CDCClassCommon.h
  • CDC_DescriptorSubtypes_t : CDCClassCommon.h
  • CDC_LineEncodingFormats_t : CDCClassCommon.h
  • CDC_LineEncodingParity_t : CDCClassCommon.h
  • DSearch_Comp_Return_ErrorCodes_t : ConfigDescriptors.h
  • DSearch_Return_ErrorCodes_t : ConfigDescriptors.h
  • Endpoint_ControlStream_RW_ErrorCodes_t : EndpointStream.h
  • Endpoint_Stream_RW_ErrorCodes_t : EndpointStream.h
  • Endpoint_WaitUntilReady_ErrorCodes_t : Endpoint_XMC4000.h
  • EP0_State : USBController_XMC4000.h
  • HID_ClassRequests_t : HIDClassCommon.h
  • HID_Descriptor_ClassSubclassProtocol_t : HIDClassCommon.h
  • HID_DescriptorTypes_t : HIDClassCommon.h
  • HID_Parse_ErrorCodes_t : HIDParser.h
  • HID_ReportItemTypes_t : HIDClassCommon.h
  • MS_ClassRequests_t : MassStorageClassCommon.h
  • MS_CommandStatusCodes_t : MassStorageClassCommon.h
  • MS_Descriptor_ClassSubclassProtocol_t : MassStorageClassCommon.h
  • Pipe_Stream_RW_ErrorCodes_t : PipeStream.h
  • USB_Control_Request_t : StdRequestType.h
  • USB_Descriptor_ClassSubclassProtocol_t : StdDescriptors.h
  • USB_DescriptorTypes_t : StdDescriptors.h
  • USB_Device_States_t : Device.h
  • USB_Feature_Selectors_t : StdRequestType.h
  • USB_Host_GetConfigDescriptor_ErrorCodes_t : ConfigDescriptors.h
  • USB_Host_SendControlErrorCodes_t : HostStandardReq.h
  • USB_Host_States_t : Host.h
  • USB_Modes_t : USBController.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • c
  • d
  • e
  • f
  • h
  • i
  • m
  • o
  • p
  • r
  • u

- c -

  • CDC_CSCP_ACMSubclass : CDCClassCommon.h
  • CDC_CSCP_ATCommandProtocol : CDCClassCommon.h
  • CDC_CSCP_CDCClass : CDCClassCommon.h
  • CDC_CSCP_CDCDataClass : CDCClassCommon.h
  • CDC_CSCP_NoDataProtocol : CDCClassCommon.h
  • CDC_CSCP_NoDataSubclass : CDCClassCommon.h
  • CDC_CSCP_NoSpecificProtocol : CDCClassCommon.h
  • CDC_CSCP_NoSpecificSubclass : CDCClassCommon.h
  • CDC_CSCP_VendorSpecificProtocol : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ACM : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ATM : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_CallManagement : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_CAPI : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_CountrySelection : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_DirectLine : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_Ethernet : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ExtensionUnit : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_Header : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_MultiChannel : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_NetworkChannel : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_ProtocolUnit : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_TelephoneCall : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_TelephoneOpModes : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_TelephoneRinger : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_Union : CDCClassCommon.h
  • CDC_DSUBTYPE_CSInterface_USBTerminal : CDCClassCommon.h
  • CDC_LINEENCODING_OneAndAHalfStopBits : CDCClassCommon.h
  • CDC_LINEENCODING_OneStopBit : CDCClassCommon.h
  • CDC_LINEENCODING_TwoStopBits : CDCClassCommon.h
  • CDC_NOTIF_SerialState : CDCClassCommon.h
  • CDC_PARITY_Even : CDCClassCommon.h
  • CDC_PARITY_Mark : CDCClassCommon.h
  • CDC_PARITY_None : CDCClassCommon.h
  • CDC_PARITY_Odd : CDCClassCommon.h
  • CDC_PARITY_Space : CDCClassCommon.h
  • CDC_REQ_GetEncapsulatedResponse : CDCClassCommon.h
  • CDC_REQ_GetLineEncoding : CDCClassCommon.h
  • CDC_REQ_SendBreak : CDCClassCommon.h
  • CDC_REQ_SendEncapsulatedCommand : CDCClassCommon.h
  • CDC_REQ_SetControlLineState : CDCClassCommon.h
  • CDC_REQ_SetLineEncoding : CDCClassCommon.h

- d -

  • DESCRIPTOR_SEARCH_COMP_EndOfDescriptor : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_COMP_Fail : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_COMP_Found : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_Fail : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_Found : ConfigDescriptors.h
  • DESCRIPTOR_SEARCH_NotFound : ConfigDescriptors.h
  • DEVICE_STATE_Addressed : Device.h
  • DEVICE_STATE_Configured : Device.h
  • DEVICE_STATE_Default : Device.h
  • DEVICE_STATE_Powered : Device.h
  • DEVICE_STATE_Suspended : Device.h
  • DEVICE_STATE_Unattached : Device.h
  • DISCONNECT : USBController_XMC4000.h
  • DTYPE_Configuration : StdDescriptors.h
  • DTYPE_CSEndpoint : StdDescriptors.h
  • DTYPE_CSInterface : StdDescriptors.h
  • DTYPE_Device : StdDescriptors.h
  • DTYPE_DeviceQualifier : StdDescriptors.h
  • DTYPE_Endpoint : StdDescriptors.h
  • DTYPE_Interface : StdDescriptors.h
  • DTYPE_InterfaceAssociation : StdDescriptors.h
  • DTYPE_InterfacePower : StdDescriptors.h
  • DTYPE_Other : StdDescriptors.h
  • DTYPE_String : StdDescriptors.h

- e -

  • ENDPOINT_READYWAIT_BusSuspended : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_DeviceDisconnected : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_EndpointStalled : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_NoError : Endpoint_XMC4000.h
  • ENDPOINT_READYWAIT_Timeout : Endpoint_XMC4000.h
  • ENDPOINT_RWCSTREAM_BusSuspended : EndpointStream.h
  • ENDPOINT_RWCSTREAM_DeviceDisconnected : EndpointStream.h
  • ENDPOINT_RWCSTREAM_HostAborted : EndpointStream.h
  • ENDPOINT_RWCSTREAM_NoError : EndpointStream.h
  • ENDPOINT_RWSTREAM_BusSuspended : EndpointStream.h
  • ENDPOINT_RWSTREAM_DeviceDisconnected : EndpointStream.h
  • ENDPOINT_RWSTREAM_EndpointStalled : EndpointStream.h
  • ENDPOINT_RWSTREAM_IncompleteTransfer : EndpointStream.h
  • ENDPOINT_RWSTREAM_NoError : EndpointStream.h
  • ENDPOINT_RWSTREAM_Timeout : EndpointStream.h

- f -

  • FEATURE_SEL_DeviceRemoteWakeup : StdRequestType.h
  • FEATURE_SEL_EndpointHalt : StdRequestType.h
  • FEATURE_SEL_TestMode : StdRequestType.h

- h -

  • HID_CSCP_BootSubclass : HIDClassCommon.h
  • HID_CSCP_HIDClass : HIDClassCommon.h
  • HID_CSCP_KeyboardBootProtocol : HIDClassCommon.h
  • HID_CSCP_MouseBootProtocol : HIDClassCommon.h
  • HID_CSCP_NonBootProtocol : HIDClassCommon.h
  • HID_CSCP_NonBootSubclass : HIDClassCommon.h
  • HID_DTYPE_HID : HIDClassCommon.h
  • HID_DTYPE_Report : HIDClassCommon.h
  • HID_PARSE_HIDStackOverflow : HIDParser.h
  • HID_PARSE_HIDStackUnderflow : HIDParser.h
  • HID_PARSE_InsufficientCollectionPaths : HIDParser.h
  • HID_PARSE_InsufficientReportIDItems : HIDParser.h
  • HID_PARSE_InsufficientReportItems : HIDParser.h
  • HID_PARSE_NoUnfilteredReportItems : HIDParser.h
  • HID_PARSE_Successful : HIDParser.h
  • HID_PARSE_UnexpectedEndCollection : HIDParser.h
  • HID_PARSE_UsageListOverflow : HIDParser.h
  • HID_REPORT_ITEM_Feature : HIDClassCommon.h
  • HID_REPORT_ITEM_In : HIDClassCommon.h
  • HID_REPORT_ITEM_Out : HIDClassCommon.h
  • HID_REQ_GetIdle : HIDClassCommon.h
  • HID_REQ_GetProtocol : HIDClassCommon.h
  • HID_REQ_GetReport : HIDClassCommon.h
  • HID_REQ_SetIdle : HIDClassCommon.h
  • HID_REQ_SetProtocol : HIDClassCommon.h
  • HID_REQ_SetReport : HIDClassCommon.h
  • HOST_GETCONFIG_BuffOverflow : ConfigDescriptors.h
  • HOST_GETCONFIG_DeviceDisconnect : ConfigDescriptors.h
  • HOST_GETCONFIG_InvalidData : ConfigDescriptors.h
  • HOST_GETCONFIG_PipeError : ConfigDescriptors.h
  • HOST_GETCONFIG_SetupStalled : ConfigDescriptors.h
  • HOST_GETCONFIG_SoftwareTimeOut : ConfigDescriptors.h
  • HOST_GETCONFIG_Successful : ConfigDescriptors.h
  • HOST_SENDCONTROL_DeviceDisconnected : HostStandardReq.h
  • HOST_SENDCONTROL_PipeError : HostStandardReq.h
  • HOST_SENDCONTROL_SetupStalled : HostStandardReq.h
  • HOST_SENDCONTROL_SoftwareTimeOut : HostStandardReq.h
  • HOST_SENDCONTROL_Successful : HostStandardReq.h
  • HOST_STATE_Addressed : Host.h
  • HOST_STATE_Configured : Host.h
  • HOST_STATE_Default : Host.h
  • HOST_STATE_Default_PostAddressSet : Host.h
  • HOST_STATE_Default_PostReset : Host.h
  • HOST_STATE_Powered : Host.h
  • HOST_STATE_Powered_ConfigPipe : Host.h
  • HOST_STATE_Powered_DoReset : Host.h
  • HOST_STATE_Powered_WaitForConnect : Host.h
  • HOST_STATE_Powered_WaitForDeviceSettle : Host.h
  • HOST_STATE_Unattached : Host.h
  • HOST_STATE_WaitForDevice : Host.h

- i -

  • IDLE : USBController_XMC4000.h
  • IN_DATA : USBController_XMC4000.h
  • IN_STATUS : USBController_XMC4000.h

- m -

  • MS_CSCP_BulkOnlyTransportProtocol : MassStorageClassCommon.h
  • MS_CSCP_MassStorageClass : MassStorageClassCommon.h
  • MS_CSCP_SCSITransparentSubclass : MassStorageClassCommon.h
  • MS_REQ_GetMaxLUN : MassStorageClassCommon.h
  • MS_REQ_MassStorageReset : MassStorageClassCommon.h
  • MS_SCSI_COMMAND_Fail : MassStorageClassCommon.h
  • MS_SCSI_COMMAND_Pass : MassStorageClassCommon.h
  • MS_SCSI_COMMAND_PhaseError : MassStorageClassCommon.h

- o -

  • OUT_DATA : USBController_XMC4000.h
  • OUT_STATUS : USBController_XMC4000.h

- p -

  • PIPE_RWSTREAM_DeviceDisconnected : PipeStream.h
  • PIPE_RWSTREAM_IncompleteTransfer : PipeStream.h
  • PIPE_RWSTREAM_NoError : PipeStream.h
  • PIPE_RWSTREAM_PipeStalled : PipeStream.h
  • PIPE_RWSTREAM_Timeout : PipeStream.h

- r -

  • REQ_ClearFeature : StdRequestType.h
  • REQ_GetConfiguration : StdRequestType.h
  • REQ_GetDescriptor : StdRequestType.h
  • REQ_GetInterface : StdRequestType.h
  • REQ_GetStatus : StdRequestType.h
  • REQ_SetAddress : StdRequestType.h
  • REQ_SetConfiguration : StdRequestType.h
  • REQ_SetDescriptor : StdRequestType.h
  • REQ_SetFeature : StdRequestType.h
  • REQ_SetInterface : StdRequestType.h
  • REQ_SynchFrame : StdRequestType.h

- u -

  • USB_CSCP_IADDeviceClass : StdDescriptors.h
  • USB_CSCP_IADDeviceProtocol : StdDescriptors.h
  • USB_CSCP_IADDeviceSubclass : StdDescriptors.h
  • USB_CSCP_NoDeviceClass : StdDescriptors.h
  • USB_CSCP_NoDeviceProtocol : StdDescriptors.h
  • USB_CSCP_NoDeviceSubclass : StdDescriptors.h
  • USB_CSCP_VendorSpecificClass : StdDescriptors.h
  • USB_CSCP_VendorSpecificProtocol : StdDescriptors.h
  • USB_CSCP_VendorSpecificSubclass : StdDescriptors.h
  • USB_MODE_Device : USBController.h
  • USB_MODE_Host : USBController.h
  • USB_MODE_None : USBController.h
  • USB_MODE_UID : USBController.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- b -

  • be16_to_cpu : Endianness.h
  • BE16_TO_CPU : Endianness.h
  • BE32_TO_CPU : Endianness.h
  • be32_to_cpu : Endianness.h
  • BOARD_A3BU_XPLAINED : BoardTypes.h
  • BOARD_ADAFRUITU4 : BoardTypes.h
  • BOARD_ATAVRUSBRF01 : BoardTypes.h
  • BOARD_B1_XPLAINED : BoardTypes.h
  • BOARD_BENITO : BoardTypes.h
  • BOARD_BIGMULTIO : BoardTypes.h
  • BOARD_BLACKCAT : BoardTypes.h
  • BOARD_BUI : BoardTypes.h
  • BOARD_BUMBLEB : BoardTypes.h
  • BOARD_C3_XPLAINED : BoardTypes.h
  • BOARD_CULV3 : BoardTypes.h
  • BOARD_DUCE : BoardTypes.h
  • BOARD_EVK1100 : BoardTypes.h
  • BOARD_EVK1101 : BoardTypes.h
  • BOARD_EVK1104 : BoardTypes.h
  • BOARD_EVK527 : BoardTypes.h
  • BOARD_JMDBU2 : BoardTypes.h
  • BOARD_LEONARDO : BoardTypes.h
  • BOARD_MAXIMUS : BoardTypes.h
  • BOARD_MICRO : BoardTypes.h
  • BOARD_MICROPENDOUS_1 : BoardTypes.h
  • BOARD_MICROPENDOUS_2 : BoardTypes.h
  • BOARD_MICROPENDOUS_3 : BoardTypes.h
  • BOARD_MICROPENDOUS_32U2 : BoardTypes.h
  • BOARD_MICROPENDOUS_4 : BoardTypes.h
  • BOARD_MICROPENDOUS_A : BoardTypes.h
  • BOARD_MICROPENDOUS_DIP : BoardTypes.h
  • BOARD_MICROPENDOUS_REV1 : BoardTypes.h
  • BOARD_MICROPENDOUS_REV2 : BoardTypes.h
  • BOARD_MICROSIN162 : BoardTypes.h
  • BOARD_MINIMUS : BoardTypes.h
  • BOARD_MULTIO : BoardTypes.h
  • BOARD_NONE : BoardTypes.h
  • BOARD_OLIMEX162 : BoardTypes.h
  • BOARD_OLIMEX32U4 : BoardTypes.h
  • BOARD_OLIMEXISPMK2 : BoardTypes.h
  • BOARD_OLIMEXT32U4 : BoardTypes.h
  • BOARD_RZUSBSTICK : BoardTypes.h
  • BOARD_SPARKFUN8U2 : BoardTypes.h
  • BOARD_STANGE_ISP : BoardTypes.h
  • BOARD_STK525 : BoardTypes.h
  • BOARD_STK526 : BoardTypes.h
  • BOARD_TEENSY : BoardTypes.h
  • BOARD_TEENSY2 : BoardTypes.h
  • BOARD_TUL : BoardTypes.h
  • BOARD_U2S : BoardTypes.h
  • BOARD_UC3A3_XPLAINED : BoardTypes.h
  • BOARD_UDIP : BoardTypes.h
  • BOARD_UNO : BoardTypes.h
  • BOARD_USB2AX : BoardTypes.h
  • BOARD_USB2AX_V3 : BoardTypes.h
  • BOARD_USB2AX_V31 : BoardTypes.h
  • BOARD_USBFOO : BoardTypes.h
  • BOARD_USBKEY : BoardTypes.h
  • BOARD_USBTINYMKII : BoardTypes.h
  • BOARD_USER : BoardTypes.h
  • BOARD_XPLAIN : BoardTypes.h
  • BOARD_XPLAIN_REV1 : BoardTypes.h
  • BOARD_XPLAINED_MINI : BoardTypes.h
  • BOARD_YUN : BoardTypes.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- c -

  • CDC_CONTROL_LINE_IN_BREAK : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_DCD : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_DSR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_FRAMEERROR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_OVERRUNERROR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_PARITYERROR : CDCClassCommon.h
  • CDC_CONTROL_LINE_IN_RING : CDCClassCommon.h
  • CDC_CONTROL_LINE_OUT_DTR : CDCClassCommon.h
  • CDC_CONTROL_LINE_OUT_RTS : CDCClassCommon.h
  • CDC_FUNCTIONAL_DESCRIPTOR : CDCClassCommon.h
  • CONCAT : Common.h
  • CONCAT_EXPANDED : Common.h
  • CONTROL_REQTYPE_DIRECTION : StdRequestType.h
  • CONTROL_REQTYPE_RECIPIENT : StdRequestType.h
  • CONTROL_REQTYPE_TYPE : StdRequestType.h
  • CPU_TO_BE16 : Endianness.h
  • cpu_to_be16 : Endianness.h
  • cpu_to_be32 : Endianness.h
  • CPU_TO_BE32 : Endianness.h
  • CPU_TO_LE16 : Endianness.h
  • cpu_to_le16 : Endianness.h
  • CPU_TO_LE32 : Endianness.h
  • cpu_to_le32 : Endianness.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- d -

  • DESCRIPTOR_CAST : ConfigDescriptors.h
  • DESCRIPTOR_PCAST : ConfigDescriptors.h
  • DESCRIPTOR_SIZE : ConfigDescriptors.h
  • DESCRIPTOR_TYPE : ConfigDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- e -

  • ENDPOINT_ATTR_ADAPTIVE : StdDescriptors.h
  • ENDPOINT_ATTR_ASYNC : StdDescriptors.h
  • ENDPOINT_ATTR_NO_SYNC : StdDescriptors.h
  • ENDPOINT_ATTR_SYNC : StdDescriptors.h
  • ENDPOINT_CONTROLEP : EndPoint.h
  • ENDPOINT_DIR_IN : USBController.h
  • ENDPOINT_DIR_MASK : USBController.h
  • ENDPOINT_DIR_OUT : USBController.h
  • ENDPOINT_EPNUM_MASK : EndPoint.h
  • ENDPOINT_TOTAL_ENDPOINTS : USBController_XMC4000.h
  • ENDPOINT_USAGE_DATA : StdDescriptors.h
  • ENDPOINT_USAGE_FEEDBACK : StdDescriptors.h
  • ENDPOINT_USAGE_IMPLICIT_FEEDBACK : StdDescriptors.h
  • EP_TYPE_BULK : USBController.h
  • EP_TYPE_CONTROL : USBController.h
  • EP_TYPE_INTERRUPT : USBController.h
  • EP_TYPE_ISOCHRONOUS : USBController.h
  • EP_TYPE_MASK : USBController.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- h -

  • HID_ALIGN_DATA : HIDParser.h
  • HID_DESCRIPTOR_JOYSTICK : HIDClassCommon.h
  • HID_DESCRIPTOR_KEYBOARD : HIDClassCommon.h
  • HID_DESCRIPTOR_MOUSE : HIDClassCommon.h
  • HID_DESCRIPTOR_VENDOR : HIDClassCommon.h
  • HID_KEYBOARD_LED_CAPSLOCK : HIDClassCommon.h
  • HID_KEYBOARD_LED_COMPOSE : HIDClassCommon.h
  • HID_KEYBOARD_LED_KANA : HIDClassCommon.h
  • HID_KEYBOARD_LED_NUMLOCK : HIDClassCommon.h
  • HID_KEYBOARD_LED_SCROLLLOCK : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTALT : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTCTRL : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTGUI : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_LEFTSHIFT : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTALT : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTCTRL : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTGUI : HIDClassCommon.h
  • HID_KEYBOARD_MODIFIER_RIGHTSHIFT : HIDClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- i -

  • ISR : Common.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- l -

  • LANGUAGE_ID_ENG : StdDescriptors.h
  • le16_to_cpu : Endianness.h
  • LE16_TO_CPU : Endianness.h
  • le32_to_cpu : Endianness.h
  • LE32_TO_CPU : Endianness.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- m -

  • MAX : Common.h
  • MIN : Common.h
  • MS_CBW_SIGNATURE : MassStorageClassCommon.h
  • MS_COMMAND_DIR_DATA_IN : MassStorageClassCommon.h
  • MS_COMMAND_DIR_DATA_OUT : MassStorageClassCommon.h
  • MS_CSW_SIGNATURE : MassStorageClassCommon.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- n -

  • NO_DESCRIPTOR : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- p -

  • PIPE_CONTROLPIPE : Pipe.h
  • PIPE_DIR_IN : USBController.h
  • PIPE_DIR_MASK : USBController.h
  • PIPE_DIR_OUT : USBController.h
  • PIPE_EPNUM_MASK : Pipe.h
  • PIPE_PIPENUM_MASK : Pipe.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- r -

  • REQDIR_DEVICETOHOST : StdRequestType.h
  • REQDIR_HOSTTODEVICE : StdRequestType.h
  • REQREC_DEVICE : StdRequestType.h
  • REQREC_ENDPOINT : StdRequestType.h
  • REQREC_INTERFACE : StdRequestType.h
  • REQREC_OTHER : StdRequestType.h
  • REQTYPE_CLASS : StdRequestType.h
  • REQTYPE_STANDARD : StdRequestType.h
  • REQTYPE_VENDOR : StdRequestType.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- s -

  • SCSI_ASENSE_FORMAT_ERROR : MassStorageClassCommon.h
  • SCSI_ASENSE_INVALID_COMMAND : MassStorageClassCommon.h
  • SCSI_ASENSE_INVALID_FIELD_IN_CDB : MassStorageClassCommon.h
  • SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE : MassStorageClassCommon.h
  • SCSI_ASENSE_LOGICAL_UNIT_NOT_READY : MassStorageClassCommon.h
  • SCSI_ASENSE_MEDIUM_NOT_PRESENT : MassStorageClassCommon.h
  • SCSI_ASENSE_NO_ADDITIONAL_INFORMATION : MassStorageClassCommon.h
  • SCSI_ASENSE_NOT_READY_TO_READY_CHANGE : MassStorageClassCommon.h
  • SCSI_ASENSE_WRITE_PROTECTED : MassStorageClassCommon.h
  • SCSI_ASENSEQ_FORMAT_COMMAND_FAILED : MassStorageClassCommon.h
  • SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED : MassStorageClassCommon.h
  • SCSI_ASENSEQ_NO_QUALIFIER : MassStorageClassCommon.h
  • SCSI_ASENSEQ_OPERATION_IN_PROGRESS : MassStorageClassCommon.h
  • SCSI_CMD_INQUIRY : MassStorageClassCommon.h
  • SCSI_CMD_MODE_SENSE_10 : MassStorageClassCommon.h
  • SCSI_CMD_MODE_SENSE_6 : MassStorageClassCommon.h
  • SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL : MassStorageClassCommon.h
  • SCSI_CMD_READ_10 : MassStorageClassCommon.h
  • SCSI_CMD_READ_6 : MassStorageClassCommon.h
  • SCSI_CMD_READ_CAPACITY_10 : MassStorageClassCommon.h
  • SCSI_CMD_REQUEST_SENSE : MassStorageClassCommon.h
  • SCSI_CMD_SEND_DIAGNOSTIC : MassStorageClassCommon.h
  • SCSI_CMD_START_STOP_UNIT : MassStorageClassCommon.h
  • SCSI_CMD_TEST_UNIT_READY : MassStorageClassCommon.h
  • SCSI_CMD_VERIFY_10 : MassStorageClassCommon.h
  • SCSI_CMD_WRITE_10 : MassStorageClassCommon.h
  • SCSI_CMD_WRITE_6 : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_ABORTED_COMMAND : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_BLANK_CHECK : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_COPY_ABORTED : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_DATA_PROTECT : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_GOOD : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_HARDWARE_ERROR : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_ILLEGAL_REQUEST : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_MEDIUM_ERROR : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_MISCOMPARE : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_NOT_READY : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_RECOVERED_ERROR : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_UNIT_ATTENTION : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_VENDOR_SPECIFIC : MassStorageClassCommon.h
  • SCSI_SENSE_KEY_VOLUME_OVERFLOW : MassStorageClassCommon.h
  • STRINGIFY : Common.h
  • STRINGIFY_EXPANDED : Common.h
  • SWAPENDIAN_16 : Endianness.h
  • SWAPENDIAN_32 : Endianness.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- u -

  • USB_CONFIG_ATTR_REMOTEWAKEUP : StdDescriptors.h
  • USB_CONFIG_ATTR_RESERVED : StdDescriptors.h
  • USB_CONFIG_ATTR_SELFPOWERED : StdDescriptors.h
  • USB_CONFIG_POWER_MA : StdDescriptors.h
  • USB_HOST_TIMEOUT_MS : HostStandardReq.h
  • USB_STRING_DESCRIPTOR : StdDescriptors.h
  • USB_STRING_DESCRIPTOR_ARRAY : StdDescriptors.h
  • USB_STRING_LEN : StdDescriptors.h


XMC USB Library: Globals

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • b
  • c
  • d
  • e
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • u
  • v

- v -

  • VERSION_BCD : StdDescriptors.h


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/ArchitectureSpecific.h Source File

  • USB
  • Common
ArchitectureSpecific.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
51 #ifndef __LUFA_ARCHSPEC_H__
52 #define __LUFA_ARCHSPEC_H__
53
54 /* Preprocessor Checks: */
55 #if !defined(__INCLUDE_FROM_COMMON_H)
56 #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
57 #endif
58
59 /* Enable C linkage for C++ Compilers: */
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif
63
64 /* Public Interface - May be used in end-application: */
65 /* Macros: */
66
67 /* Disable C linkage for C++ Compilers: */
68 #if defined(__cplusplus)
69 }
70 #endif
71
72 #endif
73


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Architectures.h Source File

  • USB
  • Common
Architectures.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
54 #ifndef __LUFA_ARCHITECTURES_H__
55 #define __LUFA_ARCHITECTURES_H__
56
57 /* Preprocessor Checks: */
58 #if !defined(__INCLUDE_FROM_COMMON_H)
59 #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
60 #endif
61
62 /* Public Interface - May be used in end-application: */
63 /* Macros: */
64
65 #endif
66


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Attributes.h Source File

  • USB
  • Common
Attributes.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
55 #ifndef __LUFA_ATTR_H__
56 #define __LUFA_ATTR_H__
57
58 /* Preprocessor Checks: */
59 #if !defined(__INCLUDE_FROM_COMMON_H)
60 #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
61 #endif
62
63 /* Public Interface - May be used in end-application: */
64 /* Macros: */
65 #if defined(__GNUC__) || defined(__DOXYGEN__)
66
69 #define ATTR_NO_RETURN __attribute__ ((noreturn))
70
74 #define ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
75
80 #define ATTR_NON_NULL_PTR_ARG(...) __attribute__ ((nonnull (__VA_ARGS__)))
81
86 #define ATTR_NAKED __attribute__ ((naked))
87
91 #define ATTR_NO_INLINE __attribute__ ((noinline))
92
96 #define ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
97
101 #define ATTR_PURE __attribute__ ((pure))
102
106 #define ATTR_CONST __attribute__ ((const))
107
109 #define ATTR_DEPRECATED __attribute__ ((deprecated))
110
114 #define ATTR_WEAK
115
121 #define ATTR_NO_INIT __attribute__ ((section (".noinit")))
122
128 #define ATTR_INIT_SECTION(SectionIndex) __attribute__ ((used, naked, section (".init" #SectionIndex )))
129
134 #define ATTR_ALIAS(Func)
135
139 #define ATTR_PACKED __attribute__ ((packed))
140 #define ATTR_IAR_PACKED
141
146 #define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
147
148 #elif defined(__ICCARM__)
149 #define ATTR_NO_RETURN
150 #define ATTR_WARN_UNUSED_RESULT
151 #define ATTR_NON_NULL_PTR_ARG(...)
152 #define ATTR_NAKED
153 #define ATTR_NO_INLINE
154 #define ATTR_ALWAYS_INLINE
155 #define ATTR_PURE
156 #define ATTR_CONST
157 #define ATTR_DEPRECATED
158 #define ATTR_WEAK
159 #define ATTR_NO_INIT
160 #define ATTR_INIT_SECTION(SectionIndex)
161 #define ATTR_ALIAS(Func)
162 #define ATTR_PACKED
163 #define ATTR_IAR_PACKED __packed
164 #define ATTR_ALIGNED(Bytes)
165 #elif defined ( __CC_ARM )
166 #define ATTR_NO_RETURN
167 #define ATTR_WARN_UNUSED_RESULT
168 #define ATTR_NON_NULL_PTR_ARG(...)
169 #define ATTR_NAKED
170 #define ATTR_NO_INLINE
171 #define ATTR_ALWAYS_INLINE
172 #define ATTR_PURE
173 #define ATTR_CONST
174 #define ATTR_DEPRECATED
175 #define ATTR_WEAK
176 #define ATTR_NO_INIT
177 #define ATTR_INIT_SECTION(SectionIndex)
178 #define ATTR_ALIAS(Func)
179 #define ATTR_PACKED __attribute__((packed))
180 #define ATTR_IAR_PACKED
181 #define ATTR_ALIGNED(Bytes)
182 #elif defined ( __TASKING__ )
183 #define ATTR_NO_RETURN
184 #define ATTR_WARN_UNUSED_RESULT
185 #define ATTR_NON_NULL_PTR_ARG(...)
186 #define ATTR_NAKED
187 #define ATTR_NO_INLINE
188 #define ATTR_ALWAYS_INLINE
189 #define ATTR_PURE
190 #define ATTR_CONST
191 #define ATTR_DEPRECATED
192 #define ATTR_WEAK
193 #define ATTR_NO_INIT
194 #define ATTR_INIT_SECTION(SectionIndex)
195 #define ATTR_ALIAS(Func)
196 #define ATTR_PACKED __packed__
197 #define ATTR_IAR_PACKED
198 #define ATTR_ALIGNED(Bytes)
199 #endif
200
201 #endif
202


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/BoardTypes.h Source File

  • USB
  • Common
BoardTypes.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
51 #ifndef __LUFA_BOARDTYPES_H__
52 #define __LUFA_BOARDTYPES_H__
53
54 /* Preprocessor Checks: */
55 #if !defined(__INCLUDE_FROM_COMMON_H)
56 #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
57 #endif
58
59 /* Public Interface - May be used in end-application: */
60 /* Macros: */
66 #define BOARD_USER 0
67
70 #define BOARD_NONE 1
71
73 #define BOARD_USBKEY 2
74
76 #define BOARD_STK525 3
77
79 #define BOARD_STK526 4
80
82 #define BOARD_RZUSBSTICK 5
83
85 #define BOARD_ATAVRUSBRF01 6
86
88 #define BOARD_BUMBLEB 7
89
91 #define BOARD_XPLAIN 8
92
94 #define BOARD_XPLAIN_REV1 9
95
97 #define BOARD_EVK527 10
98
100 #define BOARD_TEENSY 11
101
103 #define BOARD_USBTINYMKII 12
104
106 #define BOARD_BENITO 13
107
109 #define BOARD_JMDBU2 14
110
112 #define BOARD_OLIMEX162 15
113
115 #define BOARD_UDIP 16
116
118 #define BOARD_BUI 17
119
121 #define BOARD_UNO 18
122
124 #define BOARD_CULV3 19
125
127 #define BOARD_BLACKCAT 20
128
130 #define BOARD_MAXIMUS 21
131
133 #define BOARD_MINIMUS 22
134
136 #define BOARD_ADAFRUITU4 23
137
139 #define BOARD_MICROSIN162 24
140
142 #define BOARD_USBFOO 25
143
145 #define BOARD_SPARKFUN8U2 26
146
148 #define BOARD_EVK1101 27
149
151 #define BOARD_TUL 28
152
154 #define BOARD_EVK1100 29
155
157 #define BOARD_EVK1104 30
158
160 #define BOARD_A3BU_XPLAINED 31
161
163 #define BOARD_TEENSY2 32
164
166 #define BOARD_USB2AX 33
167
169 #define BOARD_USB2AX_V3 34
170
172 #define BOARD_MICROPENDOUS_32U2 35
173
175 #define BOARD_MICROPENDOUS_A 36
176
178 #define BOARD_MICROPENDOUS_1 37
179
181 #define BOARD_MICROPENDOUS_2 38
182
184 #define BOARD_MICROPENDOUS_3 39
185
187 #define BOARD_MICROPENDOUS_4 40
188
190 #define BOARD_MICROPENDOUS_DIP 41
191
193 #define BOARD_MICROPENDOUS_REV1 42
194
196 #define BOARD_MICROPENDOUS_REV2 43
197
199 #define BOARD_B1_XPLAINED 44
200
202 #define BOARD_MULTIO 45
203
205 #define BOARD_BIGMULTIO 46
206
208 #define BOARD_DUCE 47
209
211 #define BOARD_OLIMEX32U4 48
212
214 #define BOARD_OLIMEXT32U4 49
215
217 #define BOARD_OLIMEXISPMK2 50
218
220 #define BOARD_LEONARDO 51
221
223 #define BOARD_UC3A3_XPLAINED 52
224
226 #define BOARD_USB2AX_V31 53
227
229 #define BOARD_STANGE_ISP 54
230
232 #define BOARD_C3_XPLAINED 55
233
235 #define BOARD_U2S 56
236
238 #define BOARD_YUN 57
239
241 #define BOARD_MICRO 58
242
244 #define BOARD_XPLAINED_MINI 59
245
246 #if !defined(__DOXYGEN__)
247 #define BOARD_ BOARD_NONE
248
249 #if !defined(BOARD)
250 #define BOARD BOARD_NONE
251 #endif
252 #endif
253
254 #endif
255


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/CDCClass.h Source File

  • USB
  • Class
CDCClass.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
60 #ifndef _CDC_CLASS_H_
61 #define _CDC_CLASS_H_
62
63 /* Macros: */
64 #define __INCLUDE_FROM_USB_DRIVER
65 #define __INCLUDE_FROM_CDC_DRIVER
66
67 /* Includes: */
68 #include "../Core/USBMode.h"
69
70 #if defined(USB_CAN_BE_DEVICE)
71 #include "Device/CDCClassDevice.h"
72 #endif
73
74 #if defined(USB_CAN_BE_HOST)
75 #include "Host/CDCClassHost.h"
76 #endif
77
78 #endif
79
CDCClassDevice.h
Device mode driver for the library USB CDC Class driver.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/CDCClassCommon.h Source File

  • USB
  • Class
  • Common
CDCClassCommon.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
50 #ifndef _CDC_CLASS_COMMON_H_
51 #define _CDC_CLASS_COMMON_H_
52
53 /* Includes: */
54 #include "../../Core/StdDescriptors.h"
55
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif
60
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_CDC_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
64 #endif
65
66 /* Macros: */
72 #define CDC_CONTROL_LINE_OUT_DTR (1 << 0)
73
77 #define CDC_CONTROL_LINE_OUT_RTS (1 << 1)
78
82 #define CDC_CONTROL_LINE_IN_DCD (1 << 0)
83
87 #define CDC_CONTROL_LINE_IN_DSR (1 << 1)
88
92 #define CDC_CONTROL_LINE_IN_BREAK (1 << 2)
93
97 #define CDC_CONTROL_LINE_IN_RING (1 << 3)
98
102 #define CDC_CONTROL_LINE_IN_FRAMEERROR (1 << 4)
103
107 #define CDC_CONTROL_LINE_IN_PARITYERROR (1 << 5)
108
112 #define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
113
114
122 #define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
123 struct \
124 { \
125 USB_Descriptor_Header_t Header; \
126 uint8_t SubType; \
127 uint8_t Data[DataSize]; \
128 }
129
130 /* Enums: */
134 enum CDC_Descriptor_ClassSubclassProtocol_t
135 {
136 CDC_CSCP_CDCClass = 0x02,
139 CDC_CSCP_NoSpecificSubclass = 0x00,
142 CDC_CSCP_ACMSubclass = 0x02,
145 CDC_CSCP_ATCommandProtocol = 0x01,
148 CDC_CSCP_NoSpecificProtocol = 0x00,
151 CDC_CSCP_VendorSpecificProtocol = 0xFF,
154 CDC_CSCP_CDCDataClass = 0x0A,
157 CDC_CSCP_NoDataSubclass = 0x00,
160 CDC_CSCP_NoDataProtocol = 0x00,
163 };
164
166 enum CDC_ClassRequests_t
167 {
168 CDC_REQ_SendEncapsulatedCommand = 0x00,
169 CDC_REQ_GetEncapsulatedResponse = 0x01,
170 CDC_REQ_SetLineEncoding = 0x20,
171 CDC_REQ_GetLineEncoding = 0x21,
172 CDC_REQ_SetControlLineState = 0x22,
173 CDC_REQ_SendBreak = 0x23,
174 };
175
177 enum CDC_ClassNotifications_t
178 {
179 CDC_NOTIF_SerialState = 0x20,
184 };
185
187 enum CDC_DescriptorSubtypes_t
188 {
189 CDC_DSUBTYPE_CSInterface_Header = 0x00,
190 CDC_DSUBTYPE_CSInterface_CallManagement = 0x01,
191 CDC_DSUBTYPE_CSInterface_ACM = 0x02,
192 CDC_DSUBTYPE_CSInterface_DirectLine = 0x03,
193 CDC_DSUBTYPE_CSInterface_TelephoneRinger = 0x04,
194 CDC_DSUBTYPE_CSInterface_TelephoneCall = 0x05,
195 CDC_DSUBTYPE_CSInterface_Union = 0x06,
196 CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07,
197 CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08,
198 CDC_DSUBTYPE_CSInterface_USBTerminal = 0x09,
199 CDC_DSUBTYPE_CSInterface_NetworkChannel = 0x0A,
200 CDC_DSUBTYPE_CSInterface_ProtocolUnit = 0x0B,
201 CDC_DSUBTYPE_CSInterface_ExtensionUnit = 0x0C,
202 CDC_DSUBTYPE_CSInterface_MultiChannel = 0x0D,
203 CDC_DSUBTYPE_CSInterface_CAPI = 0x0E,
204 CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F,
205 CDC_DSUBTYPE_CSInterface_ATM = 0x10,
206 };
207
209 enum CDC_LineEncodingFormats_t
210 {
211 CDC_LINEENCODING_OneStopBit = 0,
212 CDC_LINEENCODING_OneAndAHalfStopBits = 1,
213 CDC_LINEENCODING_TwoStopBits = 2,
214 };
215
217 enum CDC_LineEncodingParity_t
218 {
219 CDC_PARITY_None = 0,
220 CDC_PARITY_Odd = 1,
221 CDC_PARITY_Even = 2,
222 CDC_PARITY_Mark = 3,
223 CDC_PARITY_Space = 4,
224 };
225
226 /* Type Defines: */
237 typedef ATTR_IAR_PACKED struct
238 {
239 USB_Descriptor_Header_t Header;
240 uint8_t Subtype;
243 uint16_t CDCSpecification;
248 } ATTR_PACKED USB_CDC_Descriptor_FunctionalHeader_t;
249
261 typedef ATTR_IAR_PACKED struct
262 {
263 uint8_t bFunctionLength;
264 uint8_t bDescriptorType;
267 uint8_t bDescriptorSubType;
270 uint16_t bcdCDC;
274 } ATTR_PACKED USB_CDC_StdDescriptor_FunctionalHeader_t;
275
285 typedef ATTR_IAR_PACKED struct
286 {
287 USB_Descriptor_Header_t Header;
288 uint8_t Subtype;
291 uint8_t Capabilities;
295 } ATTR_PACKED USB_CDC_Descriptor_FunctionalACM_t;
296
307 typedef ATTR_IAR_PACKED struct
308 {
309 uint8_t bFunctionLength;
310 uint8_t bDescriptorType;
313 uint8_t bDescriptorSubType;
316 uint8_t bmCapabilities;
320 } ATTR_PACKED USB_CDC_StdDescriptor_FunctionalACM_t;
321
331 typedef ATTR_IAR_PACKED struct
332 {
333 USB_Descriptor_Header_t Header;
334 uint8_t Subtype;
337 uint8_t MasterInterfaceNumber;
338 uint8_t SlaveInterfaceNumber;
339 } ATTR_PACKED USB_CDC_Descriptor_FunctionalUnion_t;
340
351 typedef ATTR_IAR_PACKED struct
352 {
353 uint8_t bFunctionLength;
354 uint8_t bDescriptorType;
357 uint8_t bDescriptorSubType;
360 uint8_t bMasterInterface;
361 uint8_t bSlaveInterface0;
362 } ATTR_PACKED USB_CDC_StdDescriptor_FunctionalUnion_t;
363
371 typedef ATTR_IAR_PACKED struct
372 {
373 uint32_t BaudRateBPS;
374 uint8_t CharFormat;
377 uint8_t ParityType;
380 uint8_t DataBits;
381 } ATTR_PACKED CDC_LineEncoding_t;
382
383 /* Disable C linkage for C++ Compilers: */
384 #if defined(__cplusplus)
385 }
386 #endif
387
388 #endif
389
USB_CDC_StdDescriptor_FunctionalHeader_t
ATTR_IAR_PACKED struct @1 USB_CDC_StdDescriptor_FunctionalHeader_t
CDC class-specific Functional Header Descriptor (USB-IF naming conventions).
CDC_CSCP_NoSpecificProtocol
Definition: CDCClassCommon.h:148
CDC_REQ_SetLineEncoding
Definition: CDCClassCommon.h:170
CDC_CSCP_ACMSubclass
Definition: CDCClassCommon.h:142
CDC_CSCP_ATCommandProtocol
Definition: CDCClassCommon.h:145
DataBits
uint8_t DataBits
Definition: CDCClassCommon.h:380
CDC_PARITY_Mark
Definition: CDCClassCommon.h:222
CDC_DSUBTYPE_CSInterface_ProtocolUnit
Definition: CDCClassCommon.h:200
CDC_DSUBTYPE_CSInterface_ATM
Definition: CDCClassCommon.h:205
CDC_LineEncodingParity_t
CDC_LineEncodingParity_t
Definition: CDCClassCommon.h:217
CDC_Descriptor_ClassSubclassProtocol_t
CDC_Descriptor_ClassSubclassProtocol_t
Definition: CDCClassCommon.h:134
CDC_DSUBTYPE_CSInterface_MultiChannel
Definition: CDCClassCommon.h:202
CDC_CSCP_NoDataProtocol
Definition: CDCClassCommon.h:160
SlaveInterfaceNumber
uint8_t SlaveInterfaceNumber
Definition: CDCClassCommon.h:338
CDC_LineEncodingFormats_t
CDC_LineEncodingFormats_t
Definition: CDCClassCommon.h:209
CDC_DSUBTYPE_CSInterface_DirectLine
Definition: CDCClassCommon.h:192
CDC_CSCP_VendorSpecificProtocol
Definition: CDCClassCommon.h:151
CDC_DSUBTYPE_CSInterface_CallManagement
Definition: CDCClassCommon.h:190
USB_CDC_Descriptor_FunctionalACM_t
ATTR_IAR_PACKED struct @2 USB_CDC_Descriptor_FunctionalACM_t
CDC class-specific Functional ACM Descriptor (LUFA naming conventions).
USB_CDC_StdDescriptor_FunctionalUnion_t
ATTR_IAR_PACKED struct @5 USB_CDC_StdDescriptor_FunctionalUnion_t
CDC class-specific Functional Union Descriptor (USB-IF naming conventions).
BaudRateBPS
uint32_t BaudRateBPS
Definition: CDCClassCommon.h:373
CDC_DSUBTYPE_CSInterface_Ethernet
Definition: CDCClassCommon.h:204
CDC_ClassRequests_t
CDC_ClassRequests_t
Definition: CDCClassCommon.h:166
CDC_DSUBTYPE_CSInterface_CountrySelection
Definition: CDCClassCommon.h:196
CDC_DSUBTYPE_CSInterface_Union
Definition: CDCClassCommon.h:195
CDC_DSUBTYPE_CSInterface_ACM
Definition: CDCClassCommon.h:191
Capabilities
uint8_t Capabilities
Definition: CDCClassCommon.h:291
CDC_LINEENCODING_TwoStopBits
Definition: CDCClassCommon.h:213
CDC_PARITY_Odd
Definition: CDCClassCommon.h:220
CDC_CSCP_CDCClass
Definition: CDCClassCommon.h:136
CDC_CSCP_CDCDataClass
Definition: CDCClassCommon.h:154
MasterInterfaceNumber
uint8_t MasterInterfaceNumber
Definition: CDCClassCommon.h:337
CDC_DSUBTYPE_CSInterface_Header
Definition: CDCClassCommon.h:189
USB_Descriptor_Header_t
ATTR_IAR_PACKED struct @22 USB_Descriptor_Header_t
Standard USB Descriptor Header (LUFA naming conventions).
CDC_CSCP_NoDataSubclass
Definition: CDCClassCommon.h:157
CDC_REQ_GetLineEncoding
Definition: CDCClassCommon.h:171
bDescriptorSubType
uint8_t bDescriptorSubType
Definition: CDCClassCommon.h:267
bMasterInterface
uint8_t bMasterInterface
Definition: CDCClassCommon.h:360
CDC_CSCP_NoSpecificSubclass
Definition: CDCClassCommon.h:139
CDC_DSUBTYPE_CSInterface_TelephoneCall
Definition: CDCClassCommon.h:194
CDC_LINEENCODING_OneAndAHalfStopBits
Definition: CDCClassCommon.h:212
Subtype
uint8_t Subtype
Definition: CDCClassCommon.h:240
CDC_PARITY_Space
Definition: CDCClassCommon.h:223
bcdCDC
uint16_t bcdCDC
Definition: CDCClassCommon.h:270
CDC_DSUBTYPE_CSInterface_ExtensionUnit
Definition: CDCClassCommon.h:201
CDC_DSUBTYPE_CSInterface_TelephoneRinger
Definition: CDCClassCommon.h:193
Header
USB_Descriptor_Header_t Header
Definition: CDCClassCommon.h:239
CDC_LINEENCODING_OneStopBit
Definition: CDCClassCommon.h:211
CDCSpecification
uint16_t CDCSpecification
Definition: CDCClassCommon.h:243
CDC_DescriptorSubtypes_t
CDC_DescriptorSubtypes_t
Definition: CDCClassCommon.h:187
USB_CDC_StdDescriptor_FunctionalACM_t
ATTR_IAR_PACKED struct @3 USB_CDC_StdDescriptor_FunctionalACM_t
CDC class-specific Functional ACM Descriptor (USB-IF naming conventions).
USB_CDC_Descriptor_FunctionalHeader_t
ATTR_IAR_PACKED struct @0 USB_CDC_Descriptor_FunctionalHeader_t
CDC class-specific Functional Header Descriptor (LUFA naming conventions).
CDC_LineEncoding_t
ATTR_IAR_PACKED struct @6 CDC_LineEncoding_t
CDC Virtual Serial Port Line Encoding Settings Structure.
CharFormat
uint8_t CharFormat
Definition: CDCClassCommon.h:374
CDC_REQ_GetEncapsulatedResponse
Definition: CDCClassCommon.h:169
CDC_PARITY_None
Definition: CDCClassCommon.h:219
CDC_REQ_SendEncapsulatedCommand
Definition: CDCClassCommon.h:168
CDC_REQ_SetControlLineState
Definition: CDCClassCommon.h:172
CDC_DSUBTYPE_CSInterface_TelephoneOpModes
Definition: CDCClassCommon.h:197
CDC_DSUBTYPE_CSInterface_NetworkChannel
Definition: CDCClassCommon.h:199
bmCapabilities
uint8_t bmCapabilities
Definition: CDCClassCommon.h:316
bFunctionLength
uint8_t bFunctionLength
Definition: CDCClassCommon.h:263
CDC_PARITY_Even
Definition: CDCClassCommon.h:221
CDC_NOTIF_SerialState
Definition: CDCClassCommon.h:179
bSlaveInterface0
uint8_t bSlaveInterface0
Definition: CDCClassCommon.h:361
CDC_REQ_SendBreak
Definition: CDCClassCommon.h:173
ParityType
uint8_t ParityType
Definition: CDCClassCommon.h:377
CDC_DSUBTYPE_CSInterface_USBTerminal
Definition: CDCClassCommon.h:198
bDescriptorType
uint8_t bDescriptorType
Definition: CDCClassCommon.h:264
USB_CDC_Descriptor_FunctionalUnion_t
ATTR_IAR_PACKED struct @4 USB_CDC_Descriptor_FunctionalUnion_t
CDC class-specific Functional Union Descriptor (LUFA naming conventions).
CDC_DSUBTYPE_CSInterface_CAPI
Definition: CDCClassCommon.h:203
CDC_ClassNotifications_t
CDC_ClassNotifications_t
Definition: CDCClassCommon.h:177


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device/CDCClassDevice.h Source File

  • USB
  • Class
  • Device
CDCClassDevice.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
71 #ifndef _CDC_CLASS_DEVICE_H_
72 #define _CDC_CLASS_DEVICE_H_
73
74 /* Includes: */
75 #include "../../USB.h"
76 #include "../Common/CDCClassCommon.h"
77
78 #include <stdio.h>
79
80 /* Enable C linkage for C++ Compilers: */
81 #if defined(__cplusplus)
82 extern "C" {
83 #endif
84
85 /* Preprocessor Checks: */
86 #if !defined(__INCLUDE_FROM_CDC_DRIVER)
87 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
88 #endif
89
90 /* Public Interface - May be used in end-application: */
91 /* Type Defines: */
98 typedef struct
99 {
100 struct
101 {
102 uint8_t ControlInterfaceNumber;
104 USB_Endpoint_Table_t DataINEndpoint;
105 USB_Endpoint_Table_t DataOUTEndpoint;
106 USB_Endpoint_Table_t NotificationEndpoint;
107 } Config;
110 struct
111 {
112 struct
113 {
114 uint16_t HostToDevice;
117 uint16_t DeviceToHost;
121 } ControlLineStates;
123 CDC_LineEncoding_t LineEncoding;
127 } State;
130 } USB_ClassInfo_CDC_Device_t;
131
132 /* Function Prototypes: */
141 bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
142
148 void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
149
155 void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
156
164 void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
165
174 void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
175
182 void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
183 const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1);
184
199 uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
200 const void* const Buffer,
201 const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
202
216 uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
217 const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
218
232 uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
233 const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
234
247 uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
248
261 int16_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
262
272 uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
273
284 void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
285
286 #if defined(FDEV_SETUP_STREAM) || defined(__DOXYGEN__)
287
305 void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
306 FILE* const Stream) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
307
316 void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
317 FILE* const Stream) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
318 #endif
319
320 /* Private Interface - For use in library only: */
321 #if !defined(__DOXYGEN__)
322 /* Function Prototypes: */
323 #if defined(__INCLUDE_FROM_CDC_DEVICE_C)
324 #if defined(FDEV_SETUP_STREAM)
325 static int CDC_Device_putchar(char c,
326 FILE* Stream) ATTR_NON_NULL_PTR_ARG(2);
327 static int CDC_Device_getchar(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
328 static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
329 #endif
330
331 void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);
332 void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);
333 void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
334 const uint8_t Duration);
335 #endif
336
337 #endif
338
339 /* Disable C linkage for C++ Compilers: */
340 #if defined(__cplusplus)
341 }
342 #endif
343
344 #endif
345
CDC_Device_SendData
uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const void *const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
Definition: CDCClassDevice.c:158
CDC_Device_SendString
uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const char *const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
Definition: CDCClassDevice.c:148
USB_ClassInfo_CDC_Device_t::DataINEndpoint
USB_Endpoint_Table_t DataINEndpoint
Definition: CDCClassDevice.h:104
CDC_Device_ConfigureEndpoints
bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:115
USB_ClassInfo_CDC_Device_t::DeviceToHost
uint16_t DeviceToHost
Definition: CDCClassDevice.h:117
USB_Endpoint_Table_t
Definition: EndPoint.h:94
CDC_Device_ProcessControlRequest
void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:40
USB_ClassInfo_CDC_Device_t::DataOUTEndpoint
USB_Endpoint_Table_t DataOUTEndpoint
Definition: CDCClassDevice.h:105
CDC_Device_Flush
uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:191
CDC_Device_USBTask
void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:135
USB_ClassInfo_CDC_Device_t::NotificationEndpoint
USB_Endpoint_Table_t NotificationEndpoint
Definition: CDCClassDevice.h:106
EVENT_CDC_Device_ControLineStateChanged
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:339
CDC_Device_SendByte
uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:169
CDC_Device_SendControlLineStateChange
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:264
CDC_LineEncoding_t
ATTR_IAR_PACKED struct @6 CDC_LineEncoding_t
CDC Virtual Serial Port Line Encoding Settings Structure.
CDC_Device_ReceiveByte
int16_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:243
EVENT_CDC_Device_BreakSent
void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:343
USB_ClassInfo_CDC_Device_t
CDC Class Device Mode Configuration and State Structure.
Definition: CDCClassDevice.h:98
CDC_Device_BytesReceived
uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:218
USB_ClassInfo_CDC_Device_t::LineEncoding
CDC_LineEncoding_t LineEncoding
Definition: CDCClassDevice.h:123
USB_ClassInfo_CDC_Device_t::ControlInterfaceNumber
uint8_t ControlInterfaceNumber
Definition: CDCClassDevice.h:102
USB_ClassInfo_CDC_Device_t::HostToDevice
uint16_t HostToDevice
Definition: CDCClassDevice.h:114
EVENT_CDC_Device_LineEncodingChanged
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: CDCClassDevice.c:335


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Common.h Source File

  • USB
  • Common
Common.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
59 #ifndef __LUFA_COMMON_H__
60 #define __LUFA_COMMON_H__
61
62 /* Macros: */
63 #define __INCLUDE_FROM_COMMON_H
64
65 /* Includes: */
66 #include <stdint.h>
67 #include <stdbool.h>
68 #include <string.h>
69 #include <stddef.h>
70
71 #include "Architectures.h"
72 #include "BoardTypes.h"
73 #include "ArchitectureSpecific.h"
74 #include "CompilerSpecific.h"
75 #include "Attributes.h"
76
77 #if defined(USE_LUFA_CONFIG_HEADER)
78 #include "LUFAConfig.h"
79 #endif
80
81 /* Enable C linkage for C++ Compilers: */
82 #if defined(__cplusplus)
83 extern "C" {
84 #endif
85
86 /* Architecture specific utility includes: */
87 #if defined(__DOXYGEN__)
88
92 typedef MACHINE_REG_t uint_reg_t;
93 #else
94 #include <xmc_common.h>
95
96 #define ARCH_LITTLE_ENDIAN
97 #include "Endianness.h"
98
99 #endif
100
101 /* Public Interface - May be used in end-application: */
102 /* Macros: */
103 #if !defined(__DOXYGEN__)
104 // Obsolete, retained for compatibility with user code
105 #define MACROS do
106 #define MACROE while (0)
107 #endif
108
119 #if !defined(MAX) || defined(__DOXYGEN__)
120 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
121 #endif
122
133 #if !defined(MIN) || defined(__DOXYGEN__)
134 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
135 #endif
136
137 #if !defined(STRINGIFY) || defined(__DOXYGEN__)
138
145 #define STRINGIFY(x) #x
146
154 #define STRINGIFY_EXPANDED(x) STRINGIFY(x)
155 #endif
156
157 #if !defined(CONCAT) || defined(__DOXYGEN__)
158
165 #define CONCAT(x, y) x ## y
166
174 #define CONCAT_EXPANDED(x, y) CONCAT(x, y)
175 #endif
176
177 #if !defined(ISR) || defined(__DOXYGEN__)
178
192 #define ISR(Name, ...) void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)
193 #endif
194
195 /* Inline Functions: */
203 static inline uint8_t BitReverse(uint8_t Byte) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
204 static inline uint8_t BitReverse(uint8_t Byte)
205 {
206 Byte = (((Byte & 0xF0) >> 4) | ((Byte & 0x0F) << 4));
207 Byte = (((Byte & 0xCC) >> 2) | ((Byte & 0x33) << 2));
208 Byte = (((Byte & 0xAA) >> 1) | ((Byte & 0x55) << 1));
209
210 return Byte;
211 }
212
213
214 /* Disable C linkage for C++ Compilers: */
215 #if defined(__cplusplus)
216 }
217 #endif
218
219 #endif
220
BoardTypes.h
Supported pre-made board hardware defines.
Architectures.h
Supported library architecture defines.
Endianness.h
Endianness and Byte Ordering macros and functions.
CompilerSpecific.h
Compiler specific definitions for code optimization and correctness.
Attributes.h
Special function/variable attribute macros.
ArchitectureSpecific.h
Architecture specific definitions relating to specific processor architectures.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/CompilerSpecific.h Source File

  • USB
  • Common
CompilerSpecific.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
54 #ifndef __LUFA_COMPILERSPEC_H__
55 #define __LUFA_COMPILERSPEC_H__
56
57 /* Preprocessor Checks: */
58 #if !defined(__INCLUDE_FROM_COMMON_H)
59 #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
60 #endif
61
62 /* Public Interface - May be used in end-application: */
63 /* Macros: */
64 #if defined(__GNUC__) || defined(__DOXYGEN__)
65
73 #define GCC_FORCE_POINTER_ACCESS(StructPtr) __asm__ __volatile__("" : "=b" (StructPtr) : "0" (StructPtr))
74
79 #define GCC_MEMORY_BARRIER() __asm__ __volatile__("" ::: "memory");
80
87 #define GCC_IS_COMPILE_CONST(x) __builtin_constant_p(x)
88 #else
89 #define GCC_FORCE_POINTER_ACCESS(StructPtr)
90 #define GCC_MEMORY_BARRIER()
91 #define GCC_IS_COMPILE_CONST(x) 0
92 #endif
93
94 #endif
95


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/ConfigDescriptors.h Source File

  • USB
  • Core
ConfigDescriptors.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
50 #ifndef __CONFIGDESCRIPTORS_H__
51 #define __CONFIGDESCRIPTORS_H__
52
53 /* Includes: */
54 #include "../Common/Common.h"
55 #include "USBMode.h"
56 #include "StdDescriptors.h"
57
58 /* Enable C linkage for C++ Compilers: */
59 #if defined(__cplusplus)
60 extern "C" {
61 #endif
62
63 /* Preprocessor Checks: */
64 #if !defined(__INCLUDE_FROM_USB_DRIVER)
65 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
66 #endif
67
68 /* Public Interface - May be used in end-application: */
69 /* Macros: */
82 #define DESCRIPTOR_PCAST(DescriptorPtr, Type) ((Type*)(DescriptorPtr))
83
96 #define DESCRIPTOR_CAST(DescriptorPtr, Type) (*DESCRIPTOR_PCAST(DescriptorPtr, Type))
97
102 #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Type
103
105 #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_PCAST(DescriptorPtr, USB_Descriptor_Header_t)->Size
106
107 /* Type Defines: */
113 typedef uint8_t (* ConfigComparatorPtr_t)(void*);
114
115 /* Enums: */
117 enum USB_Host_GetConfigDescriptor_ErrorCodes_t
118 {
119 HOST_GETCONFIG_Successful = 0,
120 HOST_GETCONFIG_DeviceDisconnect = 1,
123 HOST_GETCONFIG_PipeError = 2,
124 HOST_GETCONFIG_SetupStalled = 3,
127 HOST_GETCONFIG_SoftwareTimeOut = 4,
128 HOST_GETCONFIG_BuffOverflow = 5,
131 HOST_GETCONFIG_InvalidData = 6,
132 };
133
135 enum DSearch_Return_ErrorCodes_t
136 {
137 DESCRIPTOR_SEARCH_Found = 0,
138 DESCRIPTOR_SEARCH_Fail = 1,
139 DESCRIPTOR_SEARCH_NotFound = 2,
140 };
141
143 enum DSearch_Comp_Return_ErrorCodes_t
144 {
145 DESCRIPTOR_SEARCH_COMP_Found = 0,
147 DESCRIPTOR_SEARCH_COMP_Fail = 1,
148 DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2,
149 };
150
151 /* Function Prototypes: */
163 uint8_t USB_Host_GetDeviceConfigDescriptor(const uint8_t ConfigNumber,
164 uint16_t* const ConfigSizePtr,
165 void* const BufferPtr,
166 const uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3);
167
175 void USB_GetNextDescriptorOfType(uint16_t* const BytesRem,
176 void** const CurrConfigLoc,
177 const uint8_t Type)
178 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
179
190 void USB_GetNextDescriptorOfTypeBefore(uint16_t* const BytesRem,
191 void** const CurrConfigLoc,
192 const uint8_t Type,
193 const uint8_t BeforeType)
194 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
195
205 void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
206 void** const CurrConfigLoc,
207 const uint8_t Type,
208 const uint8_t AfterType)
209 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
210
252 uint8_t USB_GetNextDescriptorComp(uint16_t* const BytesRem,
253 void** const CurrConfigLoc,
254 ConfigComparatorPtr_t const ComparatorRoutine) ATTR_NON_NULL_PTR_ARG(1)
255 ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3);
256
257 /* Inline Functions: */
264 static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
265 void** CurrConfigLoc) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
266 static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
267 void** CurrConfigLoc)
268 {
269 uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
270
271 if (*BytesRem < CurrDescriptorSize)
272 CurrDescriptorSize = *BytesRem;
273
274 *CurrConfigLoc = (void*)((uintptr_t)*CurrConfigLoc + CurrDescriptorSize);
275 *BytesRem -= CurrDescriptorSize;
276 }
277
278 /* Disable C linkage for C++ Compilers: */
279 #if defined(__cplusplus)
280 }
281 #endif
282
283 #endif
284
HOST_GETCONFIG_SetupStalled
Definition: ConfigDescriptors.h:124
DSearch_Return_ErrorCodes_t
DSearch_Return_ErrorCodes_t
Definition: ConfigDescriptors.h:135
ConfigComparatorPtr_t
uint8_t(* ConfigComparatorPtr_t)(void *)
Definition: ConfigDescriptors.h:113
DESCRIPTOR_SEARCH_COMP_Fail
Definition: ConfigDescriptors.h:147
DESCRIPTOR_CAST
#define DESCRIPTOR_CAST(DescriptorPtr, Type)
Definition: ConfigDescriptors.h:96
Type
uint8_t Type
Definition: StdDescriptors.h:260
DESCRIPTOR_SEARCH_COMP_EndOfDescriptor
Definition: ConfigDescriptors.h:148
USB_GetNextDescriptorOfTypeAfter
void USB_GetNextDescriptorOfTypeAfter(uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type, const uint8_t AfterType) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
Definition: ConfigDescriptors.c:108
DESCRIPTOR_SEARCH_Found
Definition: ConfigDescriptors.h:137
DESCRIPTOR_SEARCH_NotFound
Definition: ConfigDescriptors.h:139
DSearch_Comp_Return_ErrorCodes_t
DSearch_Comp_Return_ErrorCodes_t
Definition: ConfigDescriptors.h:143
USB_Descriptor_Header_t
ATTR_IAR_PACKED struct @22 USB_Descriptor_Header_t
Standard USB Descriptor Header (LUFA naming conventions).
DESCRIPTOR_SEARCH_Fail
Definition: ConfigDescriptors.h:138
HOST_GETCONFIG_InvalidData
Definition: ConfigDescriptors.h:131
USB_GetNextDescriptorOfTypeBefore
void USB_GetNextDescriptorOfTypeBefore(uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type, const uint8_t BeforeType) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
Definition: ConfigDescriptors.c:87
HOST_GETCONFIG_PipeError
Definition: ConfigDescriptors.h:123
USBMode.h
USB mode and feature support definitions.
USB_GetNextDescriptorOfType
void USB_GetNextDescriptorOfType(uint16_t *const BytesRem, void **const CurrConfigLoc, const uint8_t Type) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
Definition: ConfigDescriptors.c:74
HOST_GETCONFIG_SoftwareTimeOut
Definition: ConfigDescriptors.h:127
StdDescriptors.h
Common standard USB Descriptor definitions for all architectures.
HOST_GETCONFIG_Successful
Definition: ConfigDescriptors.h:119
USB_GetNextDescriptorComp
uint8_t USB_GetNextDescriptorComp(uint16_t *const BytesRem, void **const CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3)
Definition: ConfigDescriptors.c:119
USB_Host_GetConfigDescriptor_ErrorCodes_t
USB_Host_GetConfigDescriptor_ErrorCodes_t
Definition: ConfigDescriptors.h:117
HOST_GETCONFIG_DeviceDisconnect
Definition: ConfigDescriptors.h:120
HOST_GETCONFIG_BuffOverflow
Definition: ConfigDescriptors.h:128
USB_Host_GetDeviceConfigDescriptor
uint8_t USB_Host_GetDeviceConfigDescriptor(const uint8_t ConfigNumber, uint16_t *const ConfigSizePtr, void *const BufferPtr, const uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3)
DESCRIPTOR_SEARCH_COMP_Found
Definition: ConfigDescriptors.h:145


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Device.h Source File

  • USB
  • Core
Device.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
49 #ifndef __USBDEVICE_H__
50 #define __USBDEVICE_H__
51
52 /* Includes: */
53 #include "../Common/Common.h"
54 #include "USBMode.h"
55 #include "StdDescriptors.h"
56 #include "USBInterrupt.h"
57 #include "Endpoint.h"
58
59 /* Enable C linkage for C++ Compilers: */
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif
63
64 /* Preprocessor Checks: */
65 #if !defined(__INCLUDE_FROM_USB_DRIVER)
66 #error Do not include this file directly. Include USB/USB.h instead.
67 #endif
68
69 /* Public Interface - May be used in end-application: */
70 /* Enums: */
78 enum USB_Device_States_t
79 {
80 DEVICE_STATE_Unattached = 0,
83 DEVICE_STATE_Powered = 1,
87 DEVICE_STATE_Default = 2,
91 DEVICE_STATE_Addressed = 3,
95 DEVICE_STATE_Configured = 4,
99 DEVICE_STATE_Suspended = 5,
104 };
105
106 /* Function Prototypes: */
133 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
134 const uint8_t wIndex,
135 const void** const DescriptorAddress
136 #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) || defined(__DOXYGEN__)) && \
137 !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
138 , uint8_t* const DescriptorMemorySpace
139 #endif
140 ) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
141
142 /* Architecture Includes: */
143 #include "XMC4000/Device_XMC4000.h"
144
145 /* Disable C linkage for C++ Compilers: */
146 #if defined(__cplusplus)
147 }
148 #endif
149
150 #endif
151
DEVICE_STATE_Addressed
Definition: Device.h:91
DEVICE_STATE_Configured
Definition: Device.h:95
USBInterrupt.h
USB controller interrupt service routine management.
DEVICE_STATE_Suspended
Definition: Device.h:99
DEVICE_STATE_Default
Definition: Device.h:87
CALLBACK_USB_GetDescriptor
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, const void **const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3)
DEVICE_STATE_Powered
Definition: Device.h:83
wIndex
uint16_t wIndex
Definition: StdRequestType.h:168
USBMode.h
USB mode and feature support definitions.
USB_Device_States_t
USB_Device_States_t
Definition: Device.h:78
StdDescriptors.h
Common standard USB Descriptor definitions for all architectures.
DEVICE_STATE_Unattached
Definition: Device.h:80
EndPoint.h
USB Endpoint definitions for all architectures.
wValue
uint16_t wValue
Definition: StdRequestType.h:167
Device_XMC4000.h
USB Device definitions for the Infineon XMC4000 microcontrollers.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/Device_XMC4000.h Source File

  • USB
  • Core
  • XMC4000
Device_XMC4000.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 /*
32 * Copyright (C) 2015 Infineon Technologies AG. All rights Reserved bits.
33 *
34 * Infineon Technologies AG (Infineon) is supplying this software for use with
35 * Infineon's microcontrollers.
36 * This file can be freely distributed within development tools that are
37 * supporting such microcontrollers.
38 *
39 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
40 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
41 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
42 * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
43 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
44 */
45
63 #ifndef __USBDEVICE_XMC4000_H__
64 #define __USBDEVICE_XMC4000_H__
65
66 /* Includes: */
67 #include "../../Common/Common.h"
68 #include "../USBController.h"
69 #include "../StdDescriptors.h"
70 #include "../USBInterrupt.h"
71 #include "../Endpoint.h"
72
73 /* Enable C linkage for C++ Compilers: */
74 #if defined(__cplusplus)
75 extern "C" {
76 #endif
77
78 /* Preprocessor Checks: */
79 #if !defined(__INCLUDE_FROM_USB_DRIVER)
80 #error Do not include this file directly. USB/USB.h instead.
81 #endif
82
83 /* Public Interface - May be used in end-application: */
84 /* Macros: */
85
86 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
87
88 #define INTERNAL_SERIAL_LENGTH_BITS 0
89 #define INTERNAL_SERIAL_START_ADDRESS 0
90
91 /* Inline Functions: */
92 static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
93 static inline void USB_Device_SetDeviceAddress(const uint8_t Address)
94 {
95 (void)Address;
96 }
97
98 static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
99 static inline void USB_Device_EnableDeviceAddress(const uint8_t Address)
100 {
101 device.Driver->DeviceSetAddress(Address, XMC_USBD_SET_ADDRESS_STAGE_SETUP);
102 }
103
104 static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
105 static inline bool USB_Device_IsAddressSet(void)
106 {
107 dcfg_data_t data;
108 data.d32 = xmc_device.device_register->dcfg;
109 return ((data.b.devaddr != 0) ? true : false);
110 }
111
118 static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE;
119 static inline uint16_t USB_Device_GetFrameNumber(void) {
120 return device.Driver->GetFrameNumber();
121 }
122
123 /* Disable C linkage for C++ Compilers: */
124 #if defined(__cplusplus)
125 }
126 #endif
127
128 #endif /* __USBDEVICE_XMC4000_H__ */
129
USBD_Device::Driver
XMC_USBD_DRIVER_t * Driver
Definition: USBController_XMC4000.h:173


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/DeviceStandardReq.h Source File

  • USB
  • Core
DeviceStandardReq.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
41 #ifndef __DEVICESTDREQ_H__
42 #define __DEVICESTDREQ_H__
43
44 /* Includes: */
45 #include "../Common/Common.h"
46 #include "USBMode.h"
47 #include "StdDescriptors.h"
48 #include "Events.h"
49 #include "StdRequestType.h"
50 #include "USBTask.h"
51 #include "USBController.h"
52
53 /* Enable C linkage for C++ Compilers: */
54 #if defined(__cplusplus)
55 extern "C" {
56 #endif
57
58 /* Preprocessor Checks: */
59 #if !defined(__INCLUDE_FROM_USB_DRIVER)
60 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
61 #endif
62
63 /* Public Interface - May be used in end-application: */
64 /* Enums: */
65 #if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) || defined(__DOXYGEN__)
66
72 enum USB_DescriptorMemorySpaces_t
73 {
74 #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) || defined(__DOXYGEN__)
75 MEMSPACE_FLASH = 0,
76 #endif
77 #if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE) || defined(__DOXYGEN__)
78 MEMSPACE_EEPROM = 1,
79 #endif
80 MEMSPACE_RAM = 2,
81 };
82 #endif
83
84 /* Global Variables: */
94 extern uint8_t USB_Device_ConfigurationNumber;
95
96 #if !defined(NO_DEVICE_REMOTE_WAKEUP)
97
110 extern bool USB_Device_RemoteWakeupEnabled;
111 #endif
112
113 #if !defined(NO_DEVICE_SELF_POWER)
114
120 extern bool USB_Device_CurrentlySelfPowered;
121 #endif
122
123 /* Private Interface - For use in library only: */
124 #if !defined(__DOXYGEN__)
125 #if defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)
126 #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
127 #elif defined(USE_RAM_DESCRIPTORS) && defined(USE_FLASH_DESCRIPTORS)
128 #error USE_RAM_DESCRIPTORS and USE_FLASH_DESCRIPTORS are mutually exclusive.
129 #elif defined(USE_FLASH_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)
130 #error USE_FLASH_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
131 #elif defined(USE_FLASH_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS) && defined(USE_RAM_DESCRIPTORS)
132 #error Only one of the USE_*_DESCRIPTORS modes should be selected.
133 #endif
134
135 /* Function Prototypes: */
136 void USB_Device_ProcessControlRequest(void);
137
138 #if defined(__INCLUDE_FROM_DEVICESTDREQ_C)
139 static void USB_Device_SetAddress(void);
140 static void USB_Device_SetConfiguration(void);
141 static void USB_Device_GetConfiguration(void);
142 static void USB_Device_GetDescriptor(void);
143 static void USB_Device_GetStatus(void);
144 static void USB_Device_ClearSetFeature(void);
145
146 #if !defined(NO_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
147 static void USB_Device_GetInternalSerialDescriptor(void);
148 #endif
149 #endif
150 #endif
151
152 /* Disable C linkage for C++ Compilers: */
153 #if defined(__cplusplus)
154 }
155 #endif
156
157 #endif
158
StdRequestType.h
USB control endpoint request definitions.
USB_Device_CurrentlySelfPowered
bool USB_Device_CurrentlySelfPowered
USBController.h
Common USB Controller definitions for all architectures.
USBMode.h
USB mode and feature support definitions.
USB_Device_ConfigurationNumber
uint8_t USB_Device_ConfigurationNumber
USB_Device_ProcessControlRequest
void USB_Device_ProcessControlRequest(void)
Handle device request on endpoint 0.
Definition: USBController_XMC4000.c:72
StdDescriptors.h
Common standard USB Descriptor definitions for all architectures.
Events.h
USB Event management definitions.
USB_Device_RemoteWakeupEnabled
bool USB_Device_RemoteWakeupEnabled
USBTask.h
Main USB service task management.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/EndPoint.h Source File

  • USB
  • Core
EndPoint.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
72 #ifndef __ENDPOINT_H__
73 #define __ENDPOINT_H__
74
75 /* Includes: */
76 #include "../Common/Common.h"
77 #include "USBMode.h"
78
79 /* Enable C linkage for C++ Compilers: */
80 #if defined(__cplusplus)
81 extern "C" {
82 #endif
83
84 /* Preprocessor Checks: */
85 #if !defined(__INCLUDE_FROM_USB_DRIVER)
86 #error Do not include this file directly. Include USB/USB.h instead.
87 #endif
88
89 /* Public Interface - May be used in end-application: */
90 /* Type Defines: */
94 typedef struct
95 {
96 uint8_t Address;
97 uint16_t Size;
98 uint8_t Type;
99 uint8_t Banks;
100 } USB_Endpoint_Table_t;
101
102 /* Macros: */
106 #define ENDPOINT_EPNUM_MASK 0x0F
107
111 #define ENDPOINT_CONTROLEP 0
112
113 /* Architecture Includes: */
114 #include "XMC4000/Endpoint_XMC4000.h"
115
116 /* Disable C linkage for C++ Compilers: */
117 #if defined(__cplusplus)
118 }
119 #endif
120
121 #endif
122
USB_Endpoint_Table_t::Banks
uint8_t Banks
Definition: EndPoint.h:99
USB_Endpoint_Table_t::Type
uint8_t Type
Definition: EndPoint.h:98
USB_Endpoint_Table_t
Definition: EndPoint.h:94
Endpoint_XMC4000.h
USBMode.h
USB mode and feature support definitions.
USB_Endpoint_Table_t::Size
uint16_t Size
Definition: EndPoint.h:97
USB_Endpoint_Table_t::Address
uint8_t Address
Definition: EndPoint.h:96


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Common/Endianness.h Source File

  • USB
  • Common
Endianness.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
56 #ifndef __LUFA_ENDIANNESS_H__
57 #define __LUFA_ENDIANNESS_H__
58
59 /* Enable C linkage for C++ Compilers: */
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif
63
64 /* Preprocessor Checks: */
65 #if !defined(__INCLUDE_FROM_COMMON_H)
66 #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
67 #endif
68
69 #if !(defined(ARCH_BIG_ENDIAN) || defined(ARCH_LITTLE_ENDIAN))
70 #error ARCH_BIG_ENDIAN or ARCH_LITTLE_ENDIAN not set for the specified architecture.
71 #endif
72
73 /* Public Interface - May be used in end-application: */
74 /* Macros: */
88 #define SWAPENDIAN_16(x) (uint16_t)((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
89
103 #define SWAPENDIAN_32(x) (uint32_t)((((x) & 0xFF000000UL) >> 24UL) | (((x) & 0x00FF0000UL) >> 8UL) | \
104 (((x) & 0x0000FF00UL) << 8UL) | (((x) & 0x000000FFUL) << 24UL))
105
106 #if defined(ARCH_BIG_ENDIAN) && !defined(le16_to_cpu)
107 #define le16_to_cpu(x) SwapEndian_16(x)
108 #define le32_to_cpu(x) SwapEndian_32(x)
109 #define be16_to_cpu(x) (x)
110 #define be32_to_cpu(x) (x)
111 #define cpu_to_le16(x) SwapEndian_16(x)
112 #define cpu_to_le32(x) SwapEndian_32(x)
113 #define cpu_to_be16(x) (x)
114 #define cpu_to_be32(x) (x)
115 #define LE16_TO_CPU(x) SWAPENDIAN_16(x)
116 #define LE32_TO_CPU(x) SWAPENDIAN_32(x)
117 #define BE16_TO_CPU(x) (x)
118 #define BE32_TO_CPU(x) (x)
119 #define CPU_TO_LE16(x) SWAPENDIAN_16(x)
120 #define CPU_TO_LE32(x) SWAPENDIAN_32(x)
121 #define CPU_TO_BE16(x) (x)
122 #define CPU_TO_BE32(x) (x)
123 #elif !defined(le16_to_cpu)
124
126
141 #define le16_to_cpu(x) (x)
142
157 #define le32_to_cpu(x) (x)
158
173 #define be16_to_cpu(x) SwapEndian_16(x)
174
189 #define be32_to_cpu(x) SwapEndian_32(x)
190
205 #define cpu_to_le16(x) (x)
206
221 #define cpu_to_le32(x) (x)
222
237 #define cpu_to_be16(x) SwapEndian_16(x)
238
253 #define cpu_to_be32(x) SwapEndian_32(x)
254
256
259
274 #define LE16_TO_CPU(x) (x)
275
290 #define LE32_TO_CPU(x) (x)
291
306 #define BE16_TO_CPU(x) SWAPENDIAN_16(x)
307
322 #define BE32_TO_CPU(x) SWAPENDIAN_32(x)
323
338 #define CPU_TO_LE16(x) (x)
339
354 #define CPU_TO_LE32(x) (x)
355
370 #define CPU_TO_BE16(x) SWAPENDIAN_16(x)
371
386 #define CPU_TO_BE32(x) SWAPENDIAN_32(x)
387
389 #endif
390
391 /* Inline Functions: */
400 static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
401 static inline uint16_t SwapEndian_16(const uint16_t Word)
402 {
403 if (GCC_IS_COMPILE_CONST(Word))
404 return SWAPENDIAN_16(Word);
405
406 uint8_t Temp;
407
408 union
409 {
410 uint16_t Word;
411 uint8_t Bytes[2];
412 } Data;
413
414 Data.Word = Word;
415
416 Temp = Data.Bytes[0];
417 Data.Bytes[0] = Data.Bytes[1];
418 Data.Bytes[1] = Temp;
419
420 return Data.Word;
421 }
422
431 static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
432 static inline uint32_t SwapEndian_32(const uint32_t DWord)
433 {
434 if (GCC_IS_COMPILE_CONST(DWord))
435 return SWAPENDIAN_32(DWord);
436
437 uint8_t Temp;
438
439 union
440 {
441 uint32_t DWord;
442 uint8_t Bytes[4];
443 } Data;
444
445 Data.DWord = DWord;
446
447 Temp = Data.Bytes[0];
448 Data.Bytes[0] = Data.Bytes[3];
449 Data.Bytes[3] = Temp;
450
451 Temp = Data.Bytes[1];
452 Data.Bytes[1] = Data.Bytes[2];
453 Data.Bytes[2] = Temp;
454
455 return Data.DWord;
456 }
457
467 static inline void SwapEndian_n(void* const Data,
468 uint8_t Length) ATTR_NON_NULL_PTR_ARG(1);
469 static inline void SwapEndian_n(void* const Data,
470 uint8_t Length)
471 {
472 uint8_t* CurrDataPos = (uint8_t*)Data;
473
474 while (Length > 1)
475 {
476 uint8_t Temp = *CurrDataPos;
477 *CurrDataPos = *(CurrDataPos + Length - 1);
478 *(CurrDataPos + Length - 1) = Temp;
479
480 CurrDataPos++;
481 Length -= 2;
482 }
483 }
484
485 /* Disable C linkage for C++ Compilers: */
486 #if defined(__cplusplus)
487 }
488 #endif
489
490 #endif
491
SWAPENDIAN_16
#define SWAPENDIAN_16(x)
Definition: Endianness.h:88
SWAPENDIAN_32
#define SWAPENDIAN_32(x)
Definition: Endianness.h:103


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/Endpoint_XMC4000.h Source File

  • USB
  • Core
  • XMC4000
Endpoint_XMC4000.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2013.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30 /*******************************************************************************
31 *
32 * Copyright (C) 2013 Infineon Technologies AG. All rights reserved.
33 *
34 * Infineon Technologies AG (Infineon) is supplying this software for use with
35 * Infineon's microcontrollers.
36 * This file can be freely distributed within development tools that are
37 * supporting such microcontrollers.
38 *
39 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
40 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
41 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
42 * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
43 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
44 *
45 */
46
66 #ifndef ENDPOINT_XMC4000_H_
67 #define ENDPOINT_XMC4000_H_
68
69 #include "../../Common/Common.h"
70 #include "../USBTask.h"
71 #include "../USBInterrupt.h"
72 #include "../USBController.h"
73
74 /* Enable C linkage for C++ Compilers: */
75 #if defined(__cplusplus)
76 extern "C" {
77 #endif
78
79 /* Preprocessor Checks: */
80 #if !defined(__INCLUDE_FROM_USB_DRIVER)
81 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
82 #endif
83
84 /* Public Interface - May be used in end-application: */
85
90 enum Endpoint_WaitUntilReady_ErrorCodes_t
91 {
92 ENDPOINT_READYWAIT_NoError = 0,
93 ENDPOINT_READYWAIT_EndpointStalled = 1,
96 ENDPOINT_READYWAIT_DeviceDisconnected = 2,
99 ENDPOINT_READYWAIT_BusSuspended = 3,
103 ENDPOINT_READYWAIT_Timeout = 4,
107 };
108
115 static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
116 static inline uint8_t Endpoint_GetCurrentEndpoint(void)
117 {
118 return device.CurrentDirection | device.CurrentEndpoint;
119 }
120
128 static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
129 static inline void Endpoint_SelectEndpoint(const uint8_t Address)
130 {
131 device.CurrentEndpoint = Address & ENDPOINT_EPNUM_MASK;
132 device.CurrentDirection = (Address & ENDPOINT_DIR_MASK);
133 }
134
141 static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
142 static inline bool Endpoint_IsSETUPReceived(void)
143 {
144 return device.IsSetupRecieved;
145 }
146
147
155 static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
156 static inline void Endpoint_ClearSETUP(void)
157 {
158 device.IsSetupRecieved = 0;
159 }
160
164 static inline void Endpoint_ClearStatusStage(void) ATTR_ALWAYS_INLINE;
165 static inline void Endpoint_ClearStatusStage(void)
166 {
167
168 }
169
176 static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
177 static inline bool Endpoint_IsINReady(void)
178 {
179 USBD_Endpoint_t *ep = &device.Endpoints[device.CurrentEndpoint];
180 return ep->InInUse == 0 && ep->IsEnabled;
181 }
182
189 static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
190 static inline bool Endpoint_IsOUTReceived(void)
191 {
192 USBD_Endpoint_t *ep = &device.Endpoints[device.CurrentEndpoint];
193 return ep->IsOutRecieved;
194 }
195
200 static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
201 static inline uint8_t Endpoint_GetEndpointDirection(void)
202 {
203 USBD_Endpoint_t *ep = &device.Endpoints[device.CurrentEndpoint];
204 return ep->Address & ENDPOINT_DIR_MASK;
205 }
206
213 static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
214 static inline uint16_t Endpoint_BytesInEndpoint(void)
215 {
216 USBD_Endpoint_t *ep = &device.Endpoints[device.CurrentEndpoint];
217 if (ep->Direction)
218 return ep->InBytesAvailable;
219 else
220 return ep->OutBytesAvailable;
221 }
222
228 void Endpoint_ClearOUT(void);
229
235 void Endpoint_ClearIN(void);
236
248 bool Endpoint_IsReadWriteAllowed(void);
249
261 static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
262 static inline void Endpoint_StallTransaction(void)
263 {
264 device.Endpoints[device.CurrentEndpoint].IsHalted = 1;
265 device.Driver->EndpointStall(device.CurrentDirection | device.CurrentEndpoint,1);
266 }
267
272 static inline void Endpoint_ClearStall(void) ATTR_ALWAYS_INLINE;
273 static inline void Endpoint_ClearStall(void)
274 {
275 device.Endpoints[device.CurrentEndpoint].IsHalted = 0;
276 device.Driver->EndpointStall(device.CurrentDirection | device.CurrentEndpoint,0);
277 }
278
285 static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
286 static inline bool Endpoint_IsStalled(void)
287 {
288 return device.Endpoints[device.CurrentEndpoint].IsHalted == 1 ? true : false;
289 }
290
296 static inline void Endpoint_ResetEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
297 static inline void Endpoint_ResetEndpoint(const uint8_t Address)
298 {
299 device.Driver->EndpointAbort(device.CurrentDirection | device.CurrentEndpoint);
300 USBD_Endpoint_t *ep = &device.Endpoints[device.CurrentEndpoint];
301 ep->IsHalted = 0;
302 ep->IsOutRecieved = 0;
303 ep->InBytesAvailable = 0;
304 ep->InDataLeft = 0;
305 ep->InInUse = 0;
306 ep->OutBytesAvailable = 0;
307 ep->OutOffset = 0;
308 ep->OutInUse = 0;
309 }
310
312 static inline void Endpoint_ResetDataToggle(void) ATTR_ALWAYS_INLINE;
313 static inline void Endpoint_ResetDataToggle(void)
314 {
315 xmc_device.endpoint_in_register[device.CurrentEndpoint]->diepctl |= (1<<28);
316 }
317
318
330 bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
331 const uint8_t Entries);
332
342 uint8_t Endpoint_WaitUntilReady(void);
343
350 uint8_t Endpoint_Read_8(void);
351
358 void Endpoint_Write_8(const uint8_t data);
359
367 void Endpoint_Write_32_LE(const uint32_t Data);
368
376 uint32_t Endpoint_Read_32_LE(void);
377
385 static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
386 static inline void Endpoint_Write_16_LE(const uint16_t Data)
387 {
388 Endpoint_Write_8(Data & 0xFF);
389 Endpoint_Write_8(Data >> 8);
390 }
391
396 static inline bool Endpoint_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
397 static inline bool Endpoint_IsEnabled(void)
398 {
399 return true;
400 }
401
402 /* Disable C linkage for C++ Compilers: */
403 #if defined(__cplusplus)
404 }
405 #endif
406
409 #endif /* ENDPOINT_XMC4000_H_ */
USBD_Endpoint::OutOffset
uint32_t OutOffset
Definition: USBController_XMC4000.h:149
USBD_Endpoint::Direction
uint32_t Direction
Definition: USBController_XMC4000.h:129
USBD_Device::CurrentEndpoint
uint8_t CurrentEndpoint
Definition: USBController_XMC4000.h:180
ENDPOINT_READYWAIT_DeviceDisconnected
Definition: Endpoint_XMC4000.h:96
ENDPOINT_READYWAIT_EndpointStalled
Definition: Endpoint_XMC4000.h:93
ENDPOINT_READYWAIT_Timeout
Definition: Endpoint_XMC4000.h:103
USBD_Endpoint::IsHalted
uint32_t IsHalted
Definition: USBController_XMC4000.h:137
USB_Endpoint_Table_t
Definition: EndPoint.h:94
Endpoint_Read_8
uint8_t Endpoint_Read_8(void)
Definition: Endpoint_XMC4000.c:179
USBD_Endpoint::InInUse
volatile uint32_t InInUse
Definition: USBController_XMC4000.h:139
ENDPOINT_DIR_MASK
#define ENDPOINT_DIR_MASK
Definition: USBController.h:71
USBD_Endpoint::IsOutRecieved
volatile uint32_t IsOutRecieved
Definition: USBController_XMC4000.h:140
Endpoint_Write_8
void Endpoint_Write_8(const uint8_t data)
Definition: Endpoint_XMC4000.c:163
USBD_Device::Endpoints
USBD_Endpoint_t Endpoints[ENDPOINT_TOTAL_ENDPOINTS]
Definition: USBController_XMC4000.h:174
USBD_Device::CurrentDirection
uint8_t CurrentDirection
Definition: USBController_XMC4000.h:181
USBD_Endpoint
USBD Endpoint.
Definition: USBController_XMC4000.h:118
ENDPOINT_EPNUM_MASK
#define ENDPOINT_EPNUM_MASK
Definition: EndPoint.h:106
Endpoint_Write_32_LE
void Endpoint_Write_32_LE(const uint32_t Data)
Definition: Endpoint_XMC4000.c:196
USBD_Endpoint::OutBytesAvailable
uint32_t OutBytesAvailable
Definition: USBController_XMC4000.h:148
ENDPOINT_READYWAIT_BusSuspended
Definition: Endpoint_XMC4000.h:99
Endpoint_ClearIN
void Endpoint_ClearIN(void)
Definition: Endpoint_XMC4000.c:115
USBD_Endpoint::InBytesAvailable
uint32_t InBytesAvailable
Definition: USBController_XMC4000.h:158
USBD_Device::IsSetupRecieved
volatile uint8_t IsSetupRecieved
Definition: USBController_XMC4000.h:183
USBD_Device::Driver
XMC_USBD_DRIVER_t * Driver
Definition: USBController_XMC4000.h:173
USBD_Endpoint::InDataLeft
uint32_t InDataLeft
Definition: USBController_XMC4000.h:161
ENDPOINT_READYWAIT_NoError
Definition: Endpoint_XMC4000.h:92
Endpoint_ClearOUT
void Endpoint_ClearOUT(void)
Definition: Endpoint_XMC4000.c:98
USBD_Endpoint::OutInUse
volatile uint32_t OutInUse
Definition: USBController_XMC4000.h:138
Endpoint_Read_32_LE
uint32_t Endpoint_Read_32_LE(void)
Definition: Endpoint_XMC4000.c:210
USBD_Endpoint::IsEnabled
uint32_t IsEnabled
Definition: USBController_XMC4000.h:136
Endpoint_WaitUntilReady_ErrorCodes_t
Endpoint_WaitUntilReady_ErrorCodes_t
Definition: Endpoint_XMC4000.h:90
Endpoint_WaitUntilReady
uint8_t Endpoint_WaitUntilReady(void)
Definition: Endpoint_XMC4000.c:54
USBD_Endpoint::Address
uint32_t Address
Definition: USBController_XMC4000.h:125
Endpoint_IsReadWriteAllowed
bool Endpoint_IsReadWriteAllowed(void)
Definition: Endpoint_XMC4000.c:148
Endpoint_ConfigureEndpointTable
bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t *const Table, const uint8_t Entries)
Definition: Endpoint_XMC4000.c:227


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/EndpointStream.h Source File

  • USB
  • Core
EndpointStream.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
49 #ifndef __ENDPOINT_STREAM_H__
50 #define __ENDPOINT_STREAM_H__
51
52 /* Includes: */
53 #include "../Common/Common.h"
54 #include "USBMode.h"
55
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif
60
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_USB_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
64 #endif
65
66 /* Public Interface - May be used in end-application: */
67 /* Enums: */
69 enum Endpoint_Stream_RW_ErrorCodes_t
70 {
71 ENDPOINT_RWSTREAM_NoError = 0,
72 ENDPOINT_RWSTREAM_EndpointStalled = 1,
75 ENDPOINT_RWSTREAM_DeviceDisconnected = 2,
78 ENDPOINT_RWSTREAM_BusSuspended = 3,
82 ENDPOINT_RWSTREAM_Timeout = 4,
86 ENDPOINT_RWSTREAM_IncompleteTransfer = 5,
91 };
92
94 enum Endpoint_ControlStream_RW_ErrorCodes_t
95 {
96 ENDPOINT_RWCSTREAM_NoError = 0,
97 ENDPOINT_RWCSTREAM_HostAborted = 1,
98 ENDPOINT_RWCSTREAM_DeviceDisconnected = 2,
101 ENDPOINT_RWCSTREAM_BusSuspended = 3,
105 };
106
107 /* Architecture Includes: */
108 #include "XMC4000/EndpointStream_XMC4000.h"
109
110 /* Disable C linkage for C++ Compilers: */
111 #if defined(__cplusplus)
112 }
113 #endif
114
115 #endif
116
ENDPOINT_RWSTREAM_NoError
Definition: EndpointStream.h:71
Endpoint_Stream_RW_ErrorCodes_t
Endpoint_Stream_RW_ErrorCodes_t
Definition: EndpointStream.h:69
ENDPOINT_RWSTREAM_IncompleteTransfer
Definition: EndpointStream.h:86
ENDPOINT_RWSTREAM_EndpointStalled
Definition: EndpointStream.h:72
Endpoint_ControlStream_RW_ErrorCodes_t
Endpoint_ControlStream_RW_ErrorCodes_t
Definition: EndpointStream.h:94
ENDPOINT_RWSTREAM_BusSuspended
Definition: EndpointStream.h:78
ENDPOINT_RWCSTREAM_DeviceDisconnected
Definition: EndpointStream.h:98
USBMode.h
USB mode and feature support definitions.
ENDPOINT_RWCSTREAM_BusSuspended
Definition: EndpointStream.h:101
ENDPOINT_RWCSTREAM_NoError
Definition: EndpointStream.h:96
ENDPOINT_RWCSTREAM_HostAborted
Definition: EndpointStream.h:97
EndpointStream_XMC4000.h
Endpoint data stream transmission and reception management for the XMC microcontrollers.
ENDPOINT_RWSTREAM_DeviceDisconnected
Definition: EndpointStream.h:75
ENDPOINT_RWSTREAM_Timeout
Definition: EndpointStream.h:82


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/EndpointStream_XMC4000.h Source File

  • USB
  • Core
  • XMC4000
EndpointStream_XMC4000.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2013.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30 /*******************************************************************************
31 *
32 * Copyright (C) 2013 Infineon Technologies AG. All rights reserved.
33 *
34 * Infineon Technologies AG (Infineon) is supplying this software for use with
35 * Infineon's microcontrollers.
36 * This file can be freely distributed within development tools that are
37 * supporting such microcontrollers.
38 *
39 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
40 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
41 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
42 * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
43 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
44 *
45 ********************************************************************************/
46
47
48
67 #ifndef ENDPOINTSTREAM_XMC4000_H_
68 #define ENDPOINTSTREAM_XMC4000_H_
69
70 #include "../../Common/Common.h"
71 #include "../USBMode.h"
72 #include "../USBTask.h"
73
74 #if defined(__cplusplus)
75 extern "C" {
76 #endif
77
78 /* Preprocessor Checks: */
79 #if !defined(__INCLUDE_FROM_USB_DRIVER)
80 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
81 #endif
82
85
136 uint8_t Endpoint_Discard_Stream(uint16_t Length,
137 uint16_t* const BytesProcessed);
138
189 uint8_t Endpoint_Null_Stream(uint16_t Length,
190 uint16_t* const BytesProcessed);
191
193
196
252 uint8_t Endpoint_Write_Stream_LE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
253
268 uint8_t Endpoint_Write_Stream_BE (const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
269
325 uint8_t Endpoint_Read_Stream_LE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
326
341 uint8_t Endpoint_Read_Stream_BE (void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
342
363 uint8_t Endpoint_Write_Control_Stream_LE (const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
364
385 uint8_t Endpoint_Write_Control_Stream_BE (const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
386
407 uint8_t Endpoint_Read_Control_Stream_LE (void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
408
429 uint8_t Endpoint_Read_Control_Stream_BE (void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
430
432
433 #if defined(__cplusplus)
434 }
435 #endif
436
437 #endif /* USBD_ENDPOINTSTREAM_XMC4000_H_ */
438
Endpoint_Null_Stream
uint8_t Endpoint_Null_Stream(uint16_t Length, uint16_t *const BytesProcessed)
Definition: EndpointStream_XMC4000.c:267
Endpoint_Write_Control_Stream_LE
uint8_t Endpoint_Write_Control_Stream_LE(const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:220
Endpoint_Write_Control_Stream_BE
uint8_t Endpoint_Write_Control_Stream_BE(const void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:241
Endpoint_Read_Control_Stream_BE
uint8_t Endpoint_Read_Control_Stream_BE(void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:263
Endpoint_Discard_Stream
uint8_t Endpoint_Discard_Stream(uint16_t Length, uint16_t *const BytesProcessed)
Endpoint_Read_Stream_LE
uint8_t Endpoint_Read_Stream_LE(void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:143
Endpoint_Write_Stream_LE
uint8_t Endpoint_Write_Stream_LE(const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:54
Endpoint_Write_Stream_BE
uint8_t Endpoint_Write_Stream_BE(const void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:105
Endpoint_Read_Control_Stream_LE
uint8_t Endpoint_Read_Control_Stream_LE(void *const Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:245
Endpoint_Read_Stream_BE
uint8_t Endpoint_Read_Stream_BE(void *const Buffer, uint16_t Length, uint16_t *const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1)
Definition: EndpointStream_XMC4000.c:181


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Events.h Source File

  • USB
  • Core
Events.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
58 #ifndef __USBEVENTS_H__
59 #define __USBEVENTS_H__
60
61 /* Includes: */
62 #include "../Common/Common.h"
63 #include "USBMode.h"
64
65 /* Enable C linkage for C++ Compilers: */
66 #if defined(__cplusplus)
67 extern "C" {
68 #endif
69
70 /* Preprocessor Checks: */
71 #if !defined(__INCLUDE_FROM_USB_DRIVER)
72 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
73 #endif
74
75 /* Public Interface - May be used in end-application: */
76 /* Pseudo-Functions for Doxygen: */
77 #if !defined(__INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)
78
89 void EVENT_USB_UIDChange(void);
90
102 void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
103
117 void EVENT_USB_Host_DeviceAttached(void);
118
131 void EVENT_USB_Host_DeviceUnattached(void);
132
149 void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode,
150 const uint8_t SubErrorCode);
151
166 void EVENT_USB_Host_DeviceEnumerationComplete(void);
167
183 void EVENT_USB_Host_StartOfFrame(void);
184
205 void EVENT_USB_Device_Connect(void);
206
223 void EVENT_USB_Device_Disconnect(void);
224
249 void EVENT_USB_Device_ControlRequest(void);
250
263 void EVENT_USB_Device_ConfigurationChanged(void);
264
281 void EVENT_USB_Device_Suspend(void);
282
299 void EVENT_USB_Device_WakeUp(void);
300
311 void EVENT_USB_Device_Reset(void);
312
327 void EVENT_USB_Device_StartOfFrame(void);
328 #endif
329
330 /* Private Interface - For use in library only: */
331 #if !defined(__DOXYGEN__)
332 /* Function Prototypes: */
333 #if defined(__INCLUDE_FROM_EVENTS_C)
334 void USB_Event_Stub(void) ATTR_CONST;
335
336 #if defined(USB_CAN_BE_BOTH)
337 void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
338 #endif
339
340 #if defined(USB_CAN_BE_HOST)
341 #pragma weak EVENT_USB_Host_HostError=USB_Event_Stub
342 void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
343 #pragma weak EVENT_USB_Host_DeviceAttached=USB_Event_Stub
344 void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
345 #pragma weak EVENT_USB_Host_DeviceUnattached=USB_Event_Stub
346 void EVENT_USB_Host_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
347 #pragma weak EVENT_USB_Host_DeviceEnumerationComplete=USB_Event_Stub
348 void EVENT_USB_Host_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
349 #pragma weak EVENT_USB_Host_DeviceEnumerationFailed=USB_Event_Stub
350 void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode,
351 const uint8_t SubErrorCode)
352 ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
353 #pragma weak EVENT_USB_Host_StartOfFrame=USB_Event_Stub
354 void EVENT_USB_Host_StartOfFrame(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
355 #endif
356
357 #if defined(USB_CAN_BE_DEVICE)
358 #pragma weak EVENT_USB_Device_Connect=USB_Event_Stub
359 void EVENT_USB_Device_Connect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
360 #pragma weak EVENT_USB_Device_Disconnect=USB_Event_Stub
361 void EVENT_USB_Device_Disconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
362 #pragma weak EVENT_USB_Device_ControlRequest=USB_Event_Stub
363 void EVENT_USB_Device_ControlRequest(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
364 #pragma weak EVENT_USB_Device_ConfigurationChanged=USB_Event_Stub
365 void EVENT_USB_Device_ConfigurationChanged(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
366 #pragma weak EVENT_USB_Device_Suspend=USB_Event_Stub
367 void EVENT_USB_Device_Suspend(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
368 #pragma weak EVENT_USB_Device_WakeUp=USB_Event_Stub
369 void EVENT_USB_Device_WakeUp(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
370 #pragma weak EVENT_USB_Device_Reset=USB_Event_Stub
371 void EVENT_USB_Device_Reset(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
372 #pragma weak EVENT_USB_Device_StartOfFrame=USB_Event_Stub
373 void EVENT_USB_Device_StartOfFrame(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
374 #endif
375 #endif
376 #endif
377
378 /* Disable C linkage for C++ Compilers: */
379 #if defined(__cplusplus)
380 }
381 #endif
382
383 #endif
384
EVENT_USB_Device_WakeUp
void EVENT_USB_Device_WakeUp(void)
EVENT_USB_Host_HostError
void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
EVENT_USB_Host_DeviceEnumerationComplete
void EVENT_USB_Host_DeviceEnumerationComplete(void)
EVENT_USB_UIDChange
void EVENT_USB_UIDChange(void)
EVENT_USB_Device_Connect
void EVENT_USB_Device_Connect(void)
USBMode.h
USB mode and feature support definitions.
EVENT_USB_Host_StartOfFrame
void EVENT_USB_Host_StartOfFrame(void)
EVENT_USB_Device_ConfigurationChanged
void EVENT_USB_Device_ConfigurationChanged(void)
EVENT_USB_Device_StartOfFrame
void EVENT_USB_Device_StartOfFrame(void)
EVENT_USB_Host_DeviceEnumerationFailed
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)
EVENT_USB_Device_Disconnect
void EVENT_USB_Device_Disconnect(void)
EVENT_USB_Device_Suspend
void EVENT_USB_Device_Suspend(void)
EVENT_USB_Device_Reset
void EVENT_USB_Device_Reset(void)
EVENT_USB_Device_ControlRequest
void EVENT_USB_Device_ControlRequest(void)
EVENT_USB_Host_DeviceUnattached
void EVENT_USB_Host_DeviceUnattached(void)
EVENT_USB_Host_DeviceAttached
void EVENT_USB_Host_DeviceAttached(void)


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/HIDClass.h Source File

  • USB
  • Class
HIDClass.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
61 #ifndef _HID_CLASS_H_
62 #define _HID_CLASS_H_
63
64 /* Macros: */
65 #define __INCLUDE_FROM_USB_DRIVER
66 #define __INCLUDE_FROM_HID_DRIVER
67
68 /* Includes: */
69 #include "../Core/USBMode.h"
70
71 #if defined(USB_CAN_BE_DEVICE)
72 #include "Device/HIDClassDevice.h"
73 #endif
74
75 #if defined(USB_CAN_BE_HOST)
76 #include "Host/HIDClassHost.h"
77 #endif
78
79 #endif
80
HIDClassDevice.h
Device mode driver for the library USB HID Class driver.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDClassCommon.h Source File

  • USB
  • Class
  • Common
HIDClassCommon.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
50 #ifndef _HID_CLASS_COMMON_H_
51 #define _HID_CLASS_COMMON_H_
52
53 /* Includes: */
54 #include "../../Core/StdDescriptors.h"
55 #include "HIDParser.h"
56
57 /* Enable C linkage for C++ Compilers: */
58 #if defined(__cplusplus)
59 extern "C" {
60 #endif
61
62 /* Preprocessor Checks: */
63 #if !defined(__INCLUDE_FROM_HID_DRIVER)
64 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
65 #endif
66
67 /* Macros: */
71 #define HID_KEYBOARD_MODIFIER_LEFTCTRL (1 << 0)
72
74 #define HID_KEYBOARD_MODIFIER_LEFTSHIFT (1 << 1)
75
77 #define HID_KEYBOARD_MODIFIER_LEFTALT (1 << 2)
78
80 #define HID_KEYBOARD_MODIFIER_LEFTGUI (1 << 3)
81
83 #define HID_KEYBOARD_MODIFIER_RIGHTCTRL (1 << 4)
84
86 #define HID_KEYBOARD_MODIFIER_RIGHTSHIFT (1 << 5)
87
89 #define HID_KEYBOARD_MODIFIER_RIGHTALT (1 << 6)
90
92 #define HID_KEYBOARD_MODIFIER_RIGHTGUI (1 << 7)
93
94
98 #define HID_KEYBOARD_LED_NUMLOCK (1 << 0)
99
101 #define HID_KEYBOARD_LED_CAPSLOCK (1 << 1)
102
104 #define HID_KEYBOARD_LED_SCROLLLOCK (1 << 2)
105
107 #define HID_KEYBOARD_LED_COMPOSE (1 << 3)
108
110 #define HID_KEYBOARD_LED_KANA (1 << 4)
111
112
115 #define HID_KEYBOARD_SC_ERROR_ROLLOVER 0x01
116 #define HID_KEYBOARD_SC_POST_FAIL 0x02
117 #define HID_KEYBOARD_SC_ERROR_UNDEFINED 0x03
118 #define HID_KEYBOARD_SC_A 0x04
119 #define HID_KEYBOARD_SC_B 0x05
120 #define HID_KEYBOARD_SC_C 0x06
121 #define HID_KEYBOARD_SC_D 0x07
122 #define HID_KEYBOARD_SC_E 0x08
123 #define HID_KEYBOARD_SC_F 0x09
124 #define HID_KEYBOARD_SC_G 0x0A
125 #define HID_KEYBOARD_SC_H 0x0B
126 #define HID_KEYBOARD_SC_I 0x0C
127 #define HID_KEYBOARD_SC_J 0x0D
128 #define HID_KEYBOARD_SC_K 0x0E
129 #define HID_KEYBOARD_SC_L 0x0F
130 #define HID_KEYBOARD_SC_M 0x10
131 #define HID_KEYBOARD_SC_N 0x11
132 #define HID_KEYBOARD_SC_O 0x12
133 #define HID_KEYBOARD_SC_P 0x13
134 #define HID_KEYBOARD_SC_Q 0x14
135 #define HID_KEYBOARD_SC_R 0x15
136 #define HID_KEYBOARD_SC_S 0x16
137 #define HID_KEYBOARD_SC_T 0x17
138 #define HID_KEYBOARD_SC_U 0x18
139 #define HID_KEYBOARD_SC_V 0x19
140 #define HID_KEYBOARD_SC_W 0x1A
141 #define HID_KEYBOARD_SC_X 0x1B
142 #define HID_KEYBOARD_SC_Y 0x1C
143 #define HID_KEYBOARD_SC_Z 0x1D
144 #define HID_KEYBOARD_SC_1_AND_EXCLAMATION 0x1E
145 #define HID_KEYBOARD_SC_2_AND_AT 0x1F
146 #define HID_KEYBOARD_SC_3_AND_HASHMARK 0x20
147 #define HID_KEYBOARD_SC_4_AND_DOLLAR 0x21
148 #define HID_KEYBOARD_SC_5_AND_PERCENTAGE 0x22
149 #define HID_KEYBOARD_SC_6_AND_CARET 0x23
150 #define HID_KEYBOARD_SC_7_AND_AMPERSAND 0x24
151 #define HID_KEYBOARD_SC_8_AND_ASTERISK 0x25
152 #define HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS 0x26
153 #define HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS 0x27
154 #define HID_KEYBOARD_SC_ENTER 0x28
155 #define HID_KEYBOARD_SC_ESCAPE 0x29
156 #define HID_KEYBOARD_SC_BACKSPACE 0x2A
157 #define HID_KEYBOARD_SC_TAB 0x2B
158 #define HID_KEYBOARD_SC_SPACE 0x2C
159 #define HID_KEYBOARD_SC_MINUS_AND_UNDERSCORE 0x2D
160 #define HID_KEYBOARD_SC_EQUAL_AND_PLUS 0x2E
161 #define HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE 0x2F
162 #define HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE 0x30
163 #define HID_KEYBOARD_SC_BACKSLASH_AND_PIPE 0x31
164 #define HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE 0x32
165 #define HID_KEYBOARD_SC_SEMICOLON_AND_COLON 0x33
166 #define HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE 0x34
167 #define HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE 0x35
168 #define HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN 0x36
169 #define HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN 0x37
170 #define HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK 0x38
171 #define HID_KEYBOARD_SC_CAPS_LOCK 0x39
172 #define HID_KEYBOARD_SC_F1 0x3A
173 #define HID_KEYBOARD_SC_F2 0x3B
174 #define HID_KEYBOARD_SC_F3 0x3C
175 #define HID_KEYBOARD_SC_F4 0x3D
176 #define HID_KEYBOARD_SC_F5 0x3E
177 #define HID_KEYBOARD_SC_F6 0x3F
178 #define HID_KEYBOARD_SC_F7 0x40
179 #define HID_KEYBOARD_SC_F8 0x41
180 #define HID_KEYBOARD_SC_F9 0x42
181 #define HID_KEYBOARD_SC_F10 0x43
182 #define HID_KEYBOARD_SC_F11 0x44
183 #define HID_KEYBOARD_SC_F12 0x45
184 #define HID_KEYBOARD_SC_PRINT_SCREEN 0x46
185 #define HID_KEYBOARD_SC_SCROLL_LOCK 0x47
186 #define HID_KEYBOARD_SC_PAUSE 0x48
187 #define HID_KEYBOARD_SC_INSERT 0x49
188 #define HID_KEYBOARD_SC_HOME 0x4A
189 #define HID_KEYBOARD_SC_PAGE_UP 0x4B
190 #define HID_KEYBOARD_SC_DELETE 0x4C
191 #define HID_KEYBOARD_SC_END 0x4D
192 #define HID_KEYBOARD_SC_PAGE_DOWN 0x4E
193 #define HID_KEYBOARD_SC_RIGHT_ARROW 0x4F
194 #define HID_KEYBOARD_SC_LEFT_ARROW 0x50
195 #define HID_KEYBOARD_SC_DOWN_ARROW 0x51
196 #define HID_KEYBOARD_SC_UP_ARROW 0x52
197 #define HID_KEYBOARD_SC_NUM_LOCK 0x53
198 #define HID_KEYBOARD_SC_KEYPAD_SLASH 0x54
199 #define HID_KEYBOARD_SC_KEYPAD_ASTERISK 0x55
200 #define HID_KEYBOARD_SC_KEYPAD_MINUS 0x56
201 #define HID_KEYBOARD_SC_KEYPAD_PLUS 0x57
202 #define HID_KEYBOARD_SC_KEYPAD_ENTER 0x58
203 #define HID_KEYBOARD_SC_KEYPAD_1_AND_END 0x59
204 #define HID_KEYBOARD_SC_KEYPAD_2_AND_DOWN_ARROW 0x5A
205 #define HID_KEYBOARD_SC_KEYPAD_3_AND_PAGE_DOWN 0x5B
206 #define HID_KEYBOARD_SC_KEYPAD_4_AND_LEFT_ARROW 0x5C
207 #define HID_KEYBOARD_SC_KEYPAD_5 0x5D
208 #define HID_KEYBOARD_SC_KEYPAD_6_AND_RIGHT_ARROW 0x5E
209 #define HID_KEYBOARD_SC_KEYPAD_7_AND_HOME 0x5F
210 #define HID_KEYBOARD_SC_KEYPAD_8_AND_UP_ARROW 0x60
211 #define HID_KEYBOARD_SC_KEYPAD_9_AND_PAGE_UP 0x61
212 #define HID_KEYBOARD_SC_KEYPAD_0_AND_INSERT 0x62
213 #define HID_KEYBOARD_SC_KEYPAD_DOT_AND_DELETE 0x63
214 #define HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE 0x64
215 #define HID_KEYBOARD_SC_APPLICATION 0x65
216 #define HID_KEYBOARD_SC_POWER 0x66
217 #define HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN 0x67
218 #define HID_KEYBOARD_SC_F13 0x68
219 #define HID_KEYBOARD_SC_F14 0x69
220 #define HID_KEYBOARD_SC_F15 0x6A
221 #define HID_KEYBOARD_SC_F16 0x6B
222 #define HID_KEYBOARD_SC_F17 0x6C
223 #define HID_KEYBOARD_SC_F18 0x6D
224 #define HID_KEYBOARD_SC_F19 0x6E
225 #define HID_KEYBOARD_SC_F20 0x6F
226 #define HID_KEYBOARD_SC_F21 0x70
227 #define HID_KEYBOARD_SC_F22 0x71
228 #define HID_KEYBOARD_SC_F23 0x72
229 #define HID_KEYBOARD_SC_F24 0x73
230 #define HID_KEYBOARD_SC_EXECUTE 0x74
231 #define HID_KEYBOARD_SC_HELP 0x75
232 #define HID_KEYBOARD_SC_MENU 0x76
233 #define HID_KEYBOARD_SC_SELECT 0x77
234 #define HID_KEYBOARD_SC_STOP 0x78
235 #define HID_KEYBOARD_SC_AGAIN 0x79
236 #define HID_KEYBOARD_SC_UNDO 0x7A
237 #define HID_KEYBOARD_SC_CUT 0x7B
238 #define HID_KEYBOARD_SC_COPY 0x7C
239 #define HID_KEYBOARD_SC_PASTE 0x7D
240 #define HID_KEYBOARD_SC_FIND 0x7E
241 #define HID_KEYBOARD_SC_MUTE 0x7F
242 #define HID_KEYBOARD_SC_VOLUME_UP 0x80
243 #define HID_KEYBOARD_SC_VOLUME_DOWN 0x81
244 #define HID_KEYBOARD_SC_LOCKING_CAPS_LOCK 0x82
245 #define HID_KEYBOARD_SC_LOCKING_NUM_LOCK 0x83
246 #define HID_KEYBOARD_SC_LOCKING_SCROLL_LOCK 0x84
247 #define HID_KEYBOARD_SC_KEYPAD_COMMA 0x85
248 #define HID_KEYBOARD_SC_KEYPAD_EQUAL_SIGN_AS400 0x86
249 #define HID_KEYBOARD_SC_INTERNATIONAL1 0x87
250 #define HID_KEYBOARD_SC_INTERNATIONAL2 0x88
251 #define HID_KEYBOARD_SC_INTERNATIONAL3 0x89
252 #define HID_KEYBOARD_SC_INTERNATIONAL4 0x8A
253 #define HID_KEYBOARD_SC_INTERNATIONAL5 0x8B
254 #define HID_KEYBOARD_SC_INTERNATIONAL6 0x8C
255 #define HID_KEYBOARD_SC_INTERNATIONAL7 0x8D
256 #define HID_KEYBOARD_SC_INTERNATIONAL8 0x8E
257 #define HID_KEYBOARD_SC_INTERNATIONAL9 0x8F
258 #define HID_KEYBOARD_SC_LANG1 0x90
259 #define HID_KEYBOARD_SC_LANG2 0x91
260 #define HID_KEYBOARD_SC_LANG3 0x92
261 #define HID_KEYBOARD_SC_LANG4 0x93
262 #define HID_KEYBOARD_SC_LANG5 0x94
263 #define HID_KEYBOARD_SC_LANG6 0x95
264 #define HID_KEYBOARD_SC_LANG7 0x96
265 #define HID_KEYBOARD_SC_LANG8 0x97
266 #define HID_KEYBOARD_SC_LANG9 0x98
267 #define HID_KEYBOARD_SC_ALTERNATE_ERASE 0x99
268 #define HID_KEYBOARD_SC_SYSREQ 0x9A
269 #define HID_KEYBOARD_SC_CANCEL 0x9B
270 #define HID_KEYBOARD_SC_CLEAR 0x9C
271 #define HID_KEYBOARD_SC_PRIOR 0x9D
272 #define HID_KEYBOARD_SC_RETURN 0x9E
273 #define HID_KEYBOARD_SC_SEPARATOR 0x9F
274 #define HID_KEYBOARD_SC_OUT 0xA0
275 #define HID_KEYBOARD_SC_OPER 0xA1
276 #define HID_KEYBOARD_SC_CLEAR_AND_AGAIN 0xA2
277 #define HID_KEYBOARD_SC_CRSEL_AND_PROPS 0xA3
278 #define HID_KEYBOARD_SC_EXSEL 0xA4
279 #define HID_KEYBOARD_SC_KEYPAD_00 0xB0
280 #define HID_KEYBOARD_SC_KEYPAD_000 0xB1
281 #define HID_KEYBOARD_SC_THOUSANDS_SEPARATOR 0xB2
282 #define HID_KEYBOARD_SC_DECIMAL_SEPARATOR 0xB3
283 #define HID_KEYBOARD_SC_CURRENCY_UNIT 0xB4
284 #define HID_KEYBOARD_SC_CURRENCY_SUB_UNIT 0xB5
285 #define HID_KEYBOARD_SC_KEYPAD_OPENING_PARENTHESIS 0xB6
286 #define HID_KEYBOARD_SC_KEYPAD_CLOSING_PARENTHESIS 0xB7
287 #define HID_KEYBOARD_SC_KEYPAD_OPENING_BRACE 0xB8
288 #define HID_KEYBOARD_SC_KEYPAD_CLOSING_BRACE 0xB9
289 #define HID_KEYBOARD_SC_KEYPAD_TAB 0xBA
290 #define HID_KEYBOARD_SC_KEYPAD_BACKSPACE 0xBB
291 #define HID_KEYBOARD_SC_KEYPAD_A 0xBC
292 #define HID_KEYBOARD_SC_KEYPAD_B 0xBD
293 #define HID_KEYBOARD_SC_KEYPAD_C 0xBE
294 #define HID_KEYBOARD_SC_KEYPAD_D 0xBF
295 #define HID_KEYBOARD_SC_KEYPAD_E 0xC0
296 #define HID_KEYBOARD_SC_KEYPAD_F 0xC1
297 #define HID_KEYBOARD_SC_KEYPAD_XOR 0xC2
298 #define HID_KEYBOARD_SC_KEYPAD_CARET 0xC3
299 #define HID_KEYBOARD_SC_KEYPAD_PERCENTAGE 0xC4
300 #define HID_KEYBOARD_SC_KEYPAD_LESS_THAN_SIGN 0xC5
301 #define HID_KEYBOARD_SC_KEYPAD_GREATER_THAN_SIGN 0xC6
302 #define HID_KEYBOARD_SC_KEYPAD_AMP 0xC7
303 #define HID_KEYBOARD_SC_KEYPAD_AMP_AMP 0xC8
304 #define HID_KEYBOARD_SC_KEYPAD_PIPE 0xC9
305 #define HID_KEYBOARD_SC_KEYPAD_PIPE_PIPE 0xCA
306 #define HID_KEYBOARD_SC_KEYPAD_COLON 0xCB
307 #define HID_KEYBOARD_SC_KEYPAD_HASHMARK 0xCC
308 #define HID_KEYBOARD_SC_KEYPAD_SPACE 0xCD
309 #define HID_KEYBOARD_SC_KEYPAD_AT 0xCE
310 #define HID_KEYBOARD_SC_KEYPAD_EXCLAMATION_SIGN 0xCF
311 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_STORE 0xD0
312 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_RECALL 0xD1
313 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_CLEAR 0xD2
314 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_ADD 0xD3
315 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_SUBTRACT 0xD4
316 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_MULTIPLY 0xD5
317 #define HID_KEYBOARD_SC_KEYPAD_MEMORY_DIVIDE 0xD6
318 #define HID_KEYBOARD_SC_KEYPAD_PLUS_AND_MINUS 0xD7
319 #define HID_KEYBOARD_SC_KEYPAD_CLEAR 0xD8
320 #define HID_KEYBOARD_SC_KEYPAD_CLEAR_ENTRY 0xD9
321 #define HID_KEYBOARD_SC_KEYPAD_BINARY 0xDA
322 #define HID_KEYBOARD_SC_KEYPAD_OCTAL 0xDB
323 #define HID_KEYBOARD_SC_KEYPAD_DECIMAL 0xDC
324 #define HID_KEYBOARD_SC_KEYPAD_HEXADECIMAL 0xDD
325 #define HID_KEYBOARD_SC_LEFT_CONTROL 0xE0
326 #define HID_KEYBOARD_SC_LEFT_SHIFT 0xE1
327 #define HID_KEYBOARD_SC_LEFT_ALT 0xE2
328 #define HID_KEYBOARD_SC_LEFT_GUI 0xE3
329 #define HID_KEYBOARD_SC_RIGHT_CONTROL 0xE4
330 #define HID_KEYBOARD_SC_RIGHT_SHIFT 0xE5
331 #define HID_KEYBOARD_SC_RIGHT_ALT 0xE6
332 #define HID_KEYBOARD_SC_RIGHT_GUI 0xE7
333 #define HID_KEYBOARD_SC_MEDIA_PLAY 0xE8
334 #define HID_KEYBOARD_SC_MEDIA_STOP 0xE9
335 #define HID_KEYBOARD_SC_MEDIA_PREVIOUS_TRACK 0xEA
336 #define HID_KEYBOARD_SC_MEDIA_NEXT_TRACK 0xEB
337 #define HID_KEYBOARD_SC_MEDIA_EJECT 0xEC
338 #define HID_KEYBOARD_SC_MEDIA_VOLUME_UP 0xED
339 #define HID_KEYBOARD_SC_MEDIA_VOLUME_DOWN 0xEE
340 #define HID_KEYBOARD_SC_MEDIA_MUTE 0xEF
341 #define HID_KEYBOARD_SC_MEDIA_WWW 0xF0
342 #define HID_KEYBOARD_SC_MEDIA_BACKWARD 0xF1
343 #define HID_KEYBOARD_SC_MEDIA_FORWARD 0xF2
344 #define HID_KEYBOARD_SC_MEDIA_CANCEL 0xF3
345 #define HID_KEYBOARD_SC_MEDIA_SEARCH 0xF4
346 #define HID_KEYBOARD_SC_MEDIA_SLEEP 0xF8
347 #define HID_KEYBOARD_SC_MEDIA_LOCK 0xF9
348 #define HID_KEYBOARD_SC_MEDIA_RELOAD 0xFA
349 #define HID_KEYBOARD_SC_MEDIA_CALCULATOR 0xFB
350
351
377 #define HID_DESCRIPTOR_JOYSTICK(MinAxisVal, MaxAxisVal, MinPhysicalVal, MaxPhysicalVal, Buttons) \
378 HID_RI_USAGE_PAGE(8, 0x01), \
379 HID_RI_USAGE(8, 0x04), \
380 HID_RI_COLLECTION(8, 0x01), \
381 HID_RI_USAGE(8, 0x01), \
382 HID_RI_COLLECTION(8, 0x00), \
383 HID_RI_USAGE(8, 0x30), \
384 HID_RI_USAGE(8, 0x31), \
385 HID_RI_USAGE(8, 0x32), \
386 HID_RI_LOGICAL_MINIMUM(16, MinAxisVal), \
387 HID_RI_LOGICAL_MAXIMUM(16, MaxAxisVal), \
388 HID_RI_PHYSICAL_MINIMUM(16, MinPhysicalVal), \
389 HID_RI_PHYSICAL_MAXIMUM(16, MaxPhysicalVal), \
390 HID_RI_REPORT_COUNT(8, 3), \
391 HID_RI_REPORT_SIZE(8, (((MinAxisVal >= -128) && (MaxAxisVal <= 127)) ? 8 : 16)), \
392 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
393 HID_RI_END_COLLECTION(0), \
394 HID_RI_USAGE_PAGE(8, 0x09), \
395 HID_RI_USAGE_MINIMUM(8, 0x01), \
396 HID_RI_USAGE_MAXIMUM(8, Buttons), \
397 HID_RI_LOGICAL_MINIMUM(8, 0x00), \
398 HID_RI_LOGICAL_MAXIMUM(8, 0x01), \
399 HID_RI_REPORT_SIZE(8, 0x01), \
400 HID_RI_REPORT_COUNT(8, Buttons), \
401 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
402 HID_RI_REPORT_SIZE(8, (Buttons % 8) ? (8 - (Buttons % 8)) : 0), \
403 HID_RI_REPORT_COUNT(8, 0x01), \
404 HID_RI_INPUT(8, HID_IOF_CONSTANT), \
405 HID_RI_END_COLLECTION(0)
406
423 #define HID_DESCRIPTOR_KEYBOARD(MaxKeys) \
424 HID_RI_USAGE_PAGE(8, 0x01), \
425 HID_RI_USAGE(8, 0x06), \
426 HID_RI_COLLECTION(8, 0x01), \
427 HID_RI_USAGE_PAGE(8, 0x07), \
428 HID_RI_USAGE_MINIMUM(8, 0xE0), \
429 HID_RI_USAGE_MAXIMUM(8, 0xE7), \
430 HID_RI_LOGICAL_MINIMUM(8, 0x00), \
431 HID_RI_LOGICAL_MAXIMUM(8, 0x01), \
432 HID_RI_REPORT_SIZE(8, 0x01), \
433 HID_RI_REPORT_COUNT(8, 0x08), \
434 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
435 HID_RI_REPORT_COUNT(8, 0x01), \
436 HID_RI_REPORT_SIZE(8, 0x08), \
437 HID_RI_INPUT(8, HID_IOF_CONSTANT), \
438 HID_RI_USAGE_PAGE(8, 0x08), \
439 HID_RI_USAGE_MINIMUM(8, 0x01), \
440 HID_RI_USAGE_MAXIMUM(8, 0x05), \
441 HID_RI_REPORT_COUNT(8, 0x05), \
442 HID_RI_REPORT_SIZE(8, 0x01), \
443 HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), \
444 HID_RI_REPORT_COUNT(8, 0x01), \
445 HID_RI_REPORT_SIZE(8, 0x03), \
446 HID_RI_OUTPUT(8, HID_IOF_CONSTANT), \
447 HID_RI_LOGICAL_MINIMUM(8, 0x00), \
448 HID_RI_LOGICAL_MAXIMUM(8, 0xFF), \
449 HID_RI_USAGE_PAGE(8, 0x07), \
450 HID_RI_USAGE_MINIMUM(8, 0x00), \
451 HID_RI_USAGE_MAXIMUM(8, 0xFF), \
452 HID_RI_REPORT_COUNT(8, MaxKeys), \
453 HID_RI_REPORT_SIZE(8, 0x08), \
454 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE), \
455 HID_RI_END_COLLECTION(0)
456
481 #define HID_DESCRIPTOR_MOUSE(MinAxisVal, MaxAxisVal, MinPhysicalVal, MaxPhysicalVal, Buttons, AbsoluteCoords) \
482 HID_RI_USAGE_PAGE(8, 0x01), \
483 HID_RI_USAGE(8, 0x02), \
484 HID_RI_COLLECTION(8, 0x01), \
485 HID_RI_USAGE(8, 0x01), \
486 HID_RI_COLLECTION(8, 0x00), \
487 HID_RI_USAGE_PAGE(8, 0x09), \
488 HID_RI_USAGE_MINIMUM(8, 0x01), \
489 HID_RI_USAGE_MAXIMUM(8, Buttons), \
490 HID_RI_LOGICAL_MINIMUM(8, 0x00), \
491 HID_RI_LOGICAL_MAXIMUM(8, 0x01), \
492 HID_RI_REPORT_COUNT(8, Buttons), \
493 HID_RI_REPORT_SIZE(8, 0x01), \
494 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
495 HID_RI_REPORT_COUNT(8, 0x01), \
496 HID_RI_REPORT_SIZE(8, (Buttons % 8) ? (8 - (Buttons % 8)) : 0), \
497 HID_RI_INPUT(8, HID_IOF_CONSTANT), \
498 HID_RI_USAGE_PAGE(8, 0x01), \
499 HID_RI_USAGE(8, 0x30), \
500 HID_RI_USAGE(8, 0x31), \
501 HID_RI_LOGICAL_MINIMUM(16, MinAxisVal), \
502 HID_RI_LOGICAL_MAXIMUM(16, MaxAxisVal), \
503 HID_RI_PHYSICAL_MINIMUM(16, MinPhysicalVal), \
504 HID_RI_PHYSICAL_MAXIMUM(16, MaxPhysicalVal), \
505 HID_RI_REPORT_COUNT(8, 0x02), \
506 HID_RI_REPORT_SIZE(8, (((MinAxisVal >= -128) && (MaxAxisVal <= 127)) ? 8 : 16)), \
507 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | (AbsoluteCoords ? HID_IOF_ABSOLUTE : HID_IOF_RELATIVE)), \
508 HID_RI_END_COLLECTION(0), \
509 HID_RI_END_COLLECTION(0)
510
522 #define HID_DESCRIPTOR_VENDOR(VendorPageNum, CollectionUsage, DataINUsage, DataOUTUsage, NumBytes) \
523 HID_RI_USAGE_PAGE(16, (0xFF00 | VendorPageNum)), \
524 HID_RI_USAGE(8, CollectionUsage), \
525 HID_RI_COLLECTION(8, 0x01), \
526 HID_RI_USAGE(8, DataINUsage), \
527 HID_RI_LOGICAL_MINIMUM(8, 0x00), \
528 HID_RI_LOGICAL_MAXIMUM(8, 0xFF), \
529 HID_RI_REPORT_SIZE(8, 0x08), \
530 HID_RI_REPORT_COUNT(8, NumBytes), \
531 HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
532 HID_RI_USAGE(8, DataOUTUsage), \
533 HID_RI_LOGICAL_MINIMUM(8, 0x00), \
534 HID_RI_LOGICAL_MAXIMUM(8, 0xFF), \
535 HID_RI_REPORT_SIZE(8, 0x08), \
536 HID_RI_REPORT_COUNT(8, NumBytes), \
537 HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), \
538 HID_RI_END_COLLECTION(0)
539
540
541 /* Type Defines: */
545 enum HID_Descriptor_ClassSubclassProtocol_t
546 {
547 HID_CSCP_HIDClass = 0x03,
550 HID_CSCP_NonBootSubclass = 0x00,
553 HID_CSCP_BootSubclass = 0x01,
556 HID_CSCP_NonBootProtocol = 0x00,
559 HID_CSCP_KeyboardBootProtocol = 0x01,
562 HID_CSCP_MouseBootProtocol = 0x02,
565 };
566
568 enum HID_ClassRequests_t
569 {
570 HID_REQ_GetReport = 0x01,
571 HID_REQ_GetIdle = 0x02,
572 HID_REQ_GetProtocol = 0x03,
573 HID_REQ_SetReport = 0x09,
574 HID_REQ_SetIdle = 0x0A,
575 HID_REQ_SetProtocol = 0x0B,
576 };
577
579 enum HID_DescriptorTypes_t
580 {
581 HID_DTYPE_HID = 0x21,
582 HID_DTYPE_Report = 0x22,
583 };
584
586 enum HID_ReportItemTypes_t
587 {
588 HID_REPORT_ITEM_In = 0,
589 HID_REPORT_ITEM_Out = 1,
590 HID_REPORT_ITEM_Feature = 2,
591 };
592
602 typedef ATTR_IAR_PACKED struct
603 {
604 USB_Descriptor_Header_t Header;
606 uint16_t HIDSpec;
610 uint8_t CountryCode;
612 uint8_t TotalReportDescriptors;
614 uint8_t HIDReportType;
615 uint16_t HIDReportLength;
616 } ATTR_PACKED USB_HID_Descriptor_HID_t;
617
628 typedef ATTR_IAR_PACKED struct
629 {
630 uint8_t bLength;
631 uint8_t bDescriptorType;
635 uint16_t bcdHID;
639 uint8_t bCountryCode;
641 uint8_t bNumDescriptors;
643 uint8_t bDescriptorType2;
644 uint16_t wDescriptorLength;
645 } ATTR_PACKED USB_HID_StdDescriptor_HID_t;
646
651 typedef ATTR_IAR_PACKED struct
652 {
653 uint8_t Button;
654 int8_t X;
655 int8_t Y;
656 } ATTR_PACKED USB_MouseReport_Data_t;
657
662 typedef ATTR_IAR_PACKED struct
663 {
664 uint8_t Modifier;
667 uint8_t Reserved;
668 uint8_t KeyCode[6];
669 } ATTR_PACKED USB_KeyboardReport_Data_t;
670
672 typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
673
674 /* Disable C linkage for C++ Compilers: */
675 #if defined(__cplusplus)
676 }
677 #endif
678
679 #endif
680
HID_CSCP_NonBootSubclass
Definition: HIDClassCommon.h:550
HID_ReportItemTypes_t
HID_ReportItemTypes_t
Definition: HIDClassCommon.h:586
X
int8_t X
Definition: HIDClassCommon.h:654
HID_DTYPE_HID
Definition: HIDClassCommon.h:581
Button
uint8_t Button
Definition: HIDClassCommon.h:653
bNumDescriptors
uint8_t bNumDescriptors
Definition: HIDClassCommon.h:641
Reserved
uint8_t Reserved
Definition: HIDClassCommon.h:667
HIDParser.h
USB Human Interface Device (HID) Class report descriptor parser.
bDescriptorType2
uint8_t bDescriptorType2
Definition: HIDClassCommon.h:643
HID_DTYPE_Report
Definition: HIDClassCommon.h:582
USB_HID_StdDescriptor_HID_t
ATTR_IAR_PACKED struct @8 USB_HID_StdDescriptor_HID_t
HID class-specific HID Descriptor (USB-IF naming conventions).
HID_REQ_SetIdle
Definition: HIDClassCommon.h:574
HIDSpec
uint16_t HIDSpec
Definition: HIDClassCommon.h:606
HID_REQ_GetProtocol
Definition: HIDClassCommon.h:572
USB_HID_Descriptor_HID_t
ATTR_IAR_PACKED struct @7 USB_HID_Descriptor_HID_t
HID class-specific HID Descriptor (LUFA naming conventions).
HID_REPORT_ITEM_Feature
Definition: HIDClassCommon.h:590
HID_CSCP_BootSubclass
Definition: HIDClassCommon.h:553
USB_Descriptor_Header_t
ATTR_IAR_PACKED struct @22 USB_Descriptor_Header_t
Standard USB Descriptor Header (LUFA naming conventions).
bLength
uint8_t bLength
Definition: HIDClassCommon.h:630
HID_REPORT_ITEM_Out
Definition: HIDClassCommon.h:589
HID_Descriptor_ClassSubclassProtocol_t
HID_Descriptor_ClassSubclassProtocol_t
Definition: HIDClassCommon.h:545
TotalReportDescriptors
uint8_t TotalReportDescriptors
Definition: HIDClassCommon.h:612
HID_CSCP_MouseBootProtocol
Definition: HIDClassCommon.h:562
HID_ClassRequests_t
HID_ClassRequests_t
Definition: HIDClassCommon.h:568
CountryCode
uint8_t CountryCode
Definition: HIDClassCommon.h:610
USB_MouseReport_Data_t
ATTR_IAR_PACKED struct @9 USB_MouseReport_Data_t
Standard HID Boot Protocol Mouse Report.
HID_DescriptorTypes_t
HID_DescriptorTypes_t
Definition: HIDClassCommon.h:579
Header
USB_Descriptor_Header_t Header
Definition: HIDClassCommon.h:604
USB_KeyboardReport_Data_t
ATTR_IAR_PACKED struct @10 USB_KeyboardReport_Data_t
Standard HID Boot Protocol Keyboard Report.
HID_CSCP_HIDClass
Definition: HIDClassCommon.h:547
KeyCode
uint8_t KeyCode[6]
Definition: HIDClassCommon.h:668
Y
int8_t Y
Definition: HIDClassCommon.h:655
bCountryCode
uint8_t bCountryCode
Definition: HIDClassCommon.h:639
HIDReportLength
uint16_t HIDReportLength
Definition: HIDClassCommon.h:615
wDescriptorLength
uint16_t wDescriptorLength
Definition: HIDClassCommon.h:644
HID_CSCP_NonBootProtocol
Definition: HIDClassCommon.h:556
bcdHID
uint16_t bcdHID
Definition: HIDClassCommon.h:635
HID_REQ_SetReport
Definition: HIDClassCommon.h:573
USB_Descriptor_HIDReport_Datatype_t
uint8_t USB_Descriptor_HIDReport_Datatype_t
Definition: HIDClassCommon.h:672
HIDReportType
uint8_t HIDReportType
Definition: HIDClassCommon.h:614
HID_REQ_GetIdle
Definition: HIDClassCommon.h:571
HID_REPORT_ITEM_In
Definition: HIDClassCommon.h:588
HID_CSCP_KeyboardBootProtocol
Definition: HIDClassCommon.h:559
Modifier
uint8_t Modifier
Definition: HIDClassCommon.h:664
bDescriptorType
uint8_t bDescriptorType
Definition: HIDClassCommon.h:631
HID_REQ_SetProtocol
Definition: HIDClassCommon.h:575
HID_REQ_GetReport
Definition: HIDClassCommon.h:570


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device/HIDClassDevice.h Source File

  • USB
  • Class
  • Device
HIDClassDevice.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
53 #ifndef _HID_CLASS_DEVICE_H_
54 #define _HID_CLASS_DEVICE_H_
55
56 /* Includes: */
57 #include "../../USB.h"
58 #include "../Common/HIDClassCommon.h"
59
60 /* Enable C linkage for C++ Compilers: */
61 #if defined(__cplusplus)
62 extern "C" {
63 #endif
64
65 /* Preprocessor Checks: */
66 #if !defined(__INCLUDE_FROM_HID_DRIVER)
67 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
68 #endif
69
70 /* Public Interface - May be used in end-application: */
71 /* Type Defines: */
82 typedef struct
83 {
84 struct
85 {
86 uint8_t InterfaceNumber;
88 USB_Endpoint_Table_t ReportINEndpoint;
90 void* PrevReportINBuffer;
102 uint8_t PrevReportINBufferSize;
108 } Config;
111 struct
112 {
113 bool UsingReportProtocol;
114 uint16_t PrevFrameNum;
115 uint16_t IdleCount;
116 uint16_t IdleMSRemaining;
118 } State;
121 } USB_ClassInfo_HID_Device_t;
122
123 /* Function Prototypes: */
132 bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
133
139 void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
140
146 void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
147
163 bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
164 uint8_t* const ReportID,
165 const uint8_t ReportType,
166 void* ReportData,
167 uint16_t* const ReportSize) ATTR_NON_NULL_PTR_ARG(1)
168 ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(4) ATTR_NON_NULL_PTR_ARG(5);
169
181 void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
182 const uint8_t ReportID,
183 const uint8_t ReportType,
184 const void* ReportData,
185 const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4);
186
187 /* Inline Functions: */
195 static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_ALWAYS_INLINE ATTR_NON_NULL_PTR_ARG(1);
196 static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
197 {
198 if (HIDInterfaceInfo->State.IdleMSRemaining)
199 HIDInterfaceInfo->State.IdleMSRemaining--;
200 }
201
202 /* Disable C linkage for C++ Compilers: */
203 #if defined(__cplusplus)
204 }
205 #endif
206
207 #endif
208
HID_Device_USBTask
void HID_Device_USBTask(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: HIDClassDevice.c:156
USB_ClassInfo_HID_Device_t::PrevReportINBufferSize
uint8_t PrevReportINBufferSize
Definition: HIDClassDevice.h:102
USB_ClassInfo_HID_Device_t::IdleMSRemaining
uint16_t IdleMSRemaining
Definition: HIDClassDevice.h:116
HID_Device_ProcessControlRequest
void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: HIDClassDevice.c:40
USB_ClassInfo_HID_Device_t::InterfaceNumber
uint8_t InterfaceNumber
Definition: HIDClassDevice.h:86
USB_ClassInfo_HID_Device_t::PrevReportINBuffer
void * PrevReportINBuffer
Definition: HIDClassDevice.h:90
USB_ClassInfo_HID_Device_t::UsingReportProtocol
bool UsingReportProtocol
Definition: HIDClassDevice.h:113
USB_Endpoint_Table_t
Definition: EndPoint.h:94
USB_ClassInfo_HID_Device_t
HID Class Device Mode Configuration and State Structure.
Definition: HIDClassDevice.h:82
USB_ClassInfo_HID_Device_t::ReportINEndpoint
USB_Endpoint_Table_t ReportINEndpoint
Definition: HIDClassDevice.h:88
USB_ClassInfo_HID_Device_t::IdleCount
uint16_t IdleCount
Definition: HIDClassDevice.h:115
USB_ClassInfo_HID_Device_t::PrevFrameNum
uint16_t PrevFrameNum
Definition: HIDClassDevice.h:114
CALLBACK_HID_Device_CreateHIDReport
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, uint8_t *const ReportID, const uint8_t ReportType, void *ReportData, uint16_t *const ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(4) ATTR_NON_NULL_PTR_ARG(5)
HID_Device_ConfigureEndpoints
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: HIDClassDevice.c:142
CALLBACK_HID_Device_ProcessHIDReport
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, const uint8_t ReportID, const uint8_t ReportType, const void *ReportData, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4)


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDParser.h Source File

  • USB
  • Class
  • Common
HIDParser.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
66 #ifndef __HIDPARSER_H__
67 #define __HIDPARSER_H__
68
69 /* Includes: */
70 #include "../../Common/Common.h"
71
72 #include "HIDReportData.h"
73 #include "HIDClassCommon.h"
74
75 /* Enable C linkage for C++ Compilers: */
76 #if defined(__cplusplus)
77 extern "C" {
78 #endif
79
80 /* Macros: */
81 #if !defined(HID_STATETABLE_STACK_DEPTH) || defined(__DOXYGEN__)
82
88 #define HID_STATETABLE_STACK_DEPTH 2
89 #endif
90
91 #if !defined(HID_USAGE_STACK_DEPTH) || defined(__DOXYGEN__)
92
99 #define HID_USAGE_STACK_DEPTH 8
100 #endif
101
102 #if !defined(HID_MAX_COLLECTIONS) || defined(__DOXYGEN__)
103
109 #define HID_MAX_COLLECTIONS 10
110 #endif
111
112 #if !defined(HID_MAX_REPORTITEMS) || defined(__DOXYGEN__)
113
119 #define HID_MAX_REPORTITEMS 20
120 #endif
121
122 #if !defined(HID_MAX_REPORT_IDS) || defined(__DOXYGEN__)
123
130 #define HID_MAX_REPORT_IDS 10
131 #endif
132
142 #define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))
143
144 /* Public Interface - May be used in end-application: */
145 /* Enums: */
147 enum HID_Parse_ErrorCodes_t
148 {
149 HID_PARSE_Successful = 0,
150 HID_PARSE_HIDStackOverflow = 1,
151 HID_PARSE_HIDStackUnderflow = 2,
152 HID_PARSE_InsufficientReportItems = 3,
153 HID_PARSE_UnexpectedEndCollection = 4,
154 HID_PARSE_InsufficientCollectionPaths = 5,
155 HID_PARSE_UsageListOverflow = 6,
156 HID_PARSE_InsufficientReportIDItems = 7,
157 HID_PARSE_NoUnfilteredReportItems = 8,
158 };
159
160 /* Type Defines: */
165 typedef struct
166 {
167 uint32_t Minimum;
168 uint32_t Maximum;
169 } HID_MinMax_t;
170
175 typedef struct
176 {
177 uint32_t Type;
178 uint8_t Exponent;
179 } HID_Unit_t;
180
185 typedef struct
186 {
187 uint16_t Page;
188 uint16_t Usage;
189 } HID_Usage_t;
190
196 typedef struct HID_CollectionPath
197 {
198 uint8_t Type;
199 HID_Usage_t Usage;
200 struct HID_CollectionPath* Parent;
201 } HID_CollectionPath_t;
202
207 typedef struct
208 {
209 uint8_t BitSize;
211 HID_Usage_t Usage;
212 HID_Unit_t Unit;
213 HID_MinMax_t Logical;
214 HID_MinMax_t Physical;
215 } HID_ReportItem_Attributes_t;
216
221 typedef struct
222 {
223 uint16_t BitOffset;
224 uint8_t ItemType;
225 uint16_t ItemFlags;
226 uint8_t ReportID;
227 HID_CollectionPath_t* CollectionPath;
229 HID_ReportItem_Attributes_t Attributes;
231 uint32_t Value;
234 uint32_t PreviousValue;
235 } HID_ReportItem_t;
236
241 typedef struct
242 {
243 uint8_t ReportID;
244 uint16_t ReportSizeBits[3];
247 } HID_ReportSizeInfo_t;
248
253 typedef struct
254 {
255 uint8_t TotalReportItems;
256 HID_ReportItem_t ReportItems[HID_MAX_REPORTITEMS];
259 HID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS];
262 uint8_t TotalDeviceReports;
263 HID_ReportSizeInfo_t ReportIDSizes[HID_MAX_REPORT_IDS];
264 uint16_t LargestReportSizeBits;
265 bool UsingReportIDs;
268 } HID_ReportInfo_t;
269
270 /* Function Prototypes: */
280 uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
281 uint16_t ReportSize,
282 HID_ReportInfo_t* const ParserData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
283
297 bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
298 HID_ReportItem_t* const ReportItem) ATTR_NON_NULL_PTR_ARG(1);
299
313 void USB_SetHIDReportItemInfo(uint8_t* ReportData,
314 HID_ReportItem_t* const ReportItem) ATTR_NON_NULL_PTR_ARG(1);
315
325 uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData,
326 const uint8_t ReportID,
327 const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1);
328
343 bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem);
344
345 /* Private Interface - For use in library only: */
346 #if !defined(__DOXYGEN__)
347 /* Type Defines: */
348 typedef struct
349 {
350 HID_ReportItem_Attributes_t Attributes;
351 uint8_t ReportCount;
352 uint8_t ReportID;
353 } HID_StateTable_t;
354 #endif
355
356 /* Disable C linkage for C++ Compilers: */
357 #if defined(__cplusplus)
358 }
359 #endif
360
361 #endif
362
HID_ReportItem_Attributes_t::Logical
HID_MinMax_t Logical
Definition: HIDParser.h:213
HID_ReportItem_t::BitOffset
uint16_t BitOffset
Definition: HIDParser.h:223
HID_PARSE_UsageListOverflow
Definition: HIDParser.h:155
HID_PARSE_InsufficientReportItems
Definition: HIDParser.h:152
HID_ReportItem_t::ItemFlags
uint16_t ItemFlags
Definition: HIDParser.h:225
HID_ReportItem_t::Value
uint32_t Value
Definition: HIDParser.h:231
HID_Unit_t::Exponent
uint8_t Exponent
Definition: HIDParser.h:178
HID_MinMax_t::Maximum
uint32_t Maximum
Definition: HIDParser.h:168
HID_MinMax_t::Minimum
uint32_t Minimum
Definition: HIDParser.h:167
HID_ReportItem_t::ItemType
uint8_t ItemType
Definition: HIDParser.h:224
USB_SetHIDReportItemInfo
void USB_SetHIDReportItemInfo(uint8_t *ReportData, HID_ReportItem_t *const ReportItem) ATTR_NON_NULL_PTR_ARG(1)
Definition: HIDParser.c:347
HID_PARSE_Successful
Definition: HIDParser.h:149
HID_PARSE_InsufficientCollectionPaths
Definition: HIDParser.h:154
HID_PARSE_UnexpectedEndCollection
Definition: HIDParser.h:153
HID_CollectionPath::Usage
HID_Usage_t Usage
Definition: HIDParser.h:199
HID_Usage_t::Page
uint16_t Page
Definition: HIDParser.h:187
HID_MinMax_t
HID Parser Report Item Min/Max Structure.
Definition: HIDParser.h:165
HID_Parse_ErrorCodes_t
HID_Parse_ErrorCodes_t
Definition: HIDParser.h:147
HID_CollectionPath::Parent
struct HID_CollectionPath * Parent
Definition: HIDParser.h:200
HID_CollectionPath_t
struct HID_CollectionPath HID_CollectionPath_t
HID Parser Report Item Collection Path Structure.
HID_ReportItem_Attributes_t::Physical
HID_MinMax_t Physical
Definition: HIDParser.h:214
HID_ReportItem_t::PreviousValue
uint32_t PreviousValue
Definition: HIDParser.h:234
HID_PARSE_HIDStackOverflow
Definition: HIDParser.h:150
HID_ReportSizeInfo_t::ReportID
uint8_t ReportID
Definition: HIDParser.h:243
HID_StateTable_t
Definition: HIDParser.h:348
HID_Unit_t
HID Parser Report Item Unit Structure.
Definition: HIDParser.h:175
HID_ReportItem_t
HID Parser Report Item Details Structure.
Definition: HIDParser.h:221
HIDClassCommon.h
Common definitions and declarations for the library USB HID Class driver.
HID_ReportItem_t::Attributes
HID_ReportItem_Attributes_t Attributes
Definition: HIDParser.h:229
HID_ReportItem_Attributes_t::BitSize
uint8_t BitSize
Definition: HIDParser.h:209
USB_ProcessHIDReport
uint8_t USB_ProcessHIDReport(const uint8_t *ReportData, uint16_t ReportSize, HID_ReportInfo_t *const ParserData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3)
Definition: HIDParser.c:35
HID_ReportItem_Attributes_t::Unit
HID_Unit_t Unit
Definition: HIDParser.h:212
HID_ReportItem_Attributes_t::Usage
HID_Usage_t Usage
Definition: HIDParser.h:211
HID_PARSE_HIDStackUnderflow
Definition: HIDParser.h:151
HID_PARSE_NoUnfilteredReportItems
Definition: HIDParser.h:157
HIDReportData.h
Constants for HID report item attributes.
HID_CollectionPath::Type
uint8_t Type
Definition: HIDParser.h:198
HID_ReportItem_t::CollectionPath
HID_CollectionPath_t * CollectionPath
Definition: HIDParser.h:227
HID_ReportSizeInfo_t
HID Parser Report Size Structure.
Definition: HIDParser.h:241
CALLBACK_HIDParser_FilterHIDReportItem
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t *const CurrentItem)
HID_Usage_t
HID Parser Report Item Usage Structure.
Definition: HIDParser.h:185
USB_GetHIDReportSize
uint16_t USB_GetHIDReportSize(HID_ReportInfo_t *const ParserData, const uint8_t ReportID, const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1)
Definition: HIDParser.c:375
HID_PARSE_InsufficientReportIDItems
Definition: HIDParser.h:156
USB_GetHIDReportItemInfo
bool USB_GetHIDReportItemInfo(const uint8_t *ReportData, HID_ReportItem_t *const ReportItem) ATTR_NON_NULL_PTR_ARG(1)
Definition: HIDParser.c:314
HID_Unit_t::Type
uint32_t Type
Definition: HIDParser.h:177
HID_ReportInfo_t::TotalDeviceReports
uint8_t TotalDeviceReports
Definition: HIDParser.h:262
HID_CollectionPath
HID Parser Report Item Collection Path Structure.
Definition: HIDParser.h:196
Attributes
uint8_t Attributes
Definition: StdDescriptors.h:645
HID_ReportInfo_t::LargestReportSizeBits
uint16_t LargestReportSizeBits
Definition: HIDParser.h:264
HID_ReportItem_t::ReportID
uint8_t ReportID
Definition: HIDParser.h:226
HID_ReportInfo_t::TotalReportItems
uint8_t TotalReportItems
Definition: HIDParser.h:255
HID_ReportInfo_t::UsingReportIDs
bool UsingReportIDs
Definition: HIDParser.h:265
HID_Usage_t::Usage
uint16_t Usage
Definition: HIDParser.h:188
HID_ReportItem_Attributes_t
HID Parser Report Item Attributes Structure.
Definition: HIDParser.h:207
HID_ReportInfo_t
HID Parser State Structure.
Definition: HIDParser.h:253


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/HIDReportData.h Source File

  • USB
  • Class
  • Common
HIDReportData.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
46 #ifndef __HIDREPORTDATA_H__
47 #define __HIDREPORTDATA_H__
48
49 /* Private Interface - For use in library only: */
50 #if !defined(__DOXYGEN__)
51 /* Macros: */
52 #define HID_RI_DATA_SIZE_MASK 0x03
53 #define HID_RI_TYPE_MASK 0x0C
54 #define HID_RI_TAG_MASK 0xF0
55
56 #define HID_RI_TYPE_MAIN 0x00
57 #define HID_RI_TYPE_GLOBAL 0x04
58 #define HID_RI_TYPE_LOCAL 0x08
59
60 #define HID_RI_DATA_BITS_0 0x00
61 #define HID_RI_DATA_BITS_8 0x01
62 #define HID_RI_DATA_BITS_16 0x02
63 #define HID_RI_DATA_BITS_32 0x03
64 #define HID_RI_DATA_BITS(DataBits) CONCAT_EXPANDED(HID_RI_DATA_BITS_, DataBits)
65
66 #define _HID_RI_ENCODE_0(Data)
67 #define _HID_RI_ENCODE_8(Data) , (Data & 0xFF)
68 #define _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_8(Data) _HID_RI_ENCODE_8(Data >> 8)
69 #define _HID_RI_ENCODE_32(Data) _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_16(Data >> 16)
70 #define _HID_RI_ENCODE(DataBits, ...) CONCAT_EXPANDED(_HID_RI_ENCODE_, DataBits(__VA_ARGS__))
71
72 #define _HID_RI_ENTRY(Type, Tag, DataBits, ...) (Type | Tag | HID_RI_DATA_BITS(DataBits)) _HID_RI_ENCODE(DataBits, (__VA_ARGS__))
73 #endif
74
75 /* Public Interface - May be used in end-application: */
76 /* Macros: */
79 #define HID_IOF_CONSTANT (1 << 0)
80 #define HID_IOF_DATA (0 << 0)
81 #define HID_IOF_VARIABLE (1 << 1)
82 #define HID_IOF_ARRAY (0 << 1)
83 #define HID_IOF_RELATIVE (1 << 2)
84 #define HID_IOF_ABSOLUTE (0 << 2)
85 #define HID_IOF_WRAP (1 << 3)
86 #define HID_IOF_NO_WRAP (0 << 3)
87 #define HID_IOF_NON_LINEAR (1 << 4)
88 #define HID_IOF_LINEAR (0 << 4)
89 #define HID_IOF_NO_PREFERRED_STATE (1 << 5)
90 #define HID_IOF_PREFERRED_STATE (0 << 5)
91 #define HID_IOF_NULLSTATE (1 << 6)
92 #define HID_IOF_NO_NULL_POSITION (0 << 6)
93 #define HID_IOF_VOLATILE (1 << 7)
94 #define HID_IOF_NON_VOLATILE (0 << 7)
95 #define HID_IOF_BUFFERED_BYTES (1 << 8)
96 #define HID_IOF_BITFIELD (0 << 8)
97
98
101 #define HID_RI_INPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x80, DataBits, __VA_ARGS__)
102 #define HID_RI_OUTPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x90, DataBits, __VA_ARGS__)
103 #define HID_RI_COLLECTION(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xA0, DataBits, __VA_ARGS__)
104 #define HID_RI_FEATURE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xB0, DataBits, __VA_ARGS__)
105 #define HID_RI_END_COLLECTION(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0xC0, DataBits, __VA_ARGS__)
106 #define HID_RI_USAGE_PAGE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x00, DataBits, __VA_ARGS__)
107 #define HID_RI_LOGICAL_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x10, DataBits, __VA_ARGS__)
108 #define HID_RI_LOGICAL_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x20, DataBits, __VA_ARGS__)
109 #define HID_RI_PHYSICAL_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x30, DataBits, __VA_ARGS__)
110 #define HID_RI_PHYSICAL_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x40, DataBits, __VA_ARGS__)
111 #define HID_RI_UNIT_EXPONENT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x50, DataBits, __VA_ARGS__)
112 #define HID_RI_UNIT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x60, DataBits, __VA_ARGS__)
113 #define HID_RI_REPORT_SIZE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x70, DataBits, __VA_ARGS__)
114 #define HID_RI_REPORT_ID(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x80, DataBits, __VA_ARGS__)
115 #define HID_RI_REPORT_COUNT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0x90, DataBits, __VA_ARGS__)
116 #define HID_RI_PUSH(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0xA0, DataBits, __VA_ARGS__)
117 #define HID_RI_POP(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_GLOBAL, 0xB0, DataBits, __VA_ARGS__)
118 #define HID_RI_USAGE(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x00, DataBits, __VA_ARGS__)
119 #define HID_RI_USAGE_MINIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x10, DataBits, __VA_ARGS__)
120 #define HID_RI_USAGE_MAXIMUM(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_LOCAL , 0x20, DataBits, __VA_ARGS__)
121
122
125 #endif
126


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Host.h Source File

  • USB
  • Core
Host.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
49 #ifndef __USBHOST_H__
50 #define __USBHOST_H__
51
52 /* Includes: */
53 #include "../../../Common/Common.h"
54 #include "USBMode.h"
55
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif
60
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_USB_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
64 #endif
65
66 /* Public Interface - May be used in end-application: */
67 /* Enums: */
76 enum USB_Host_States_t
77 {
78 HOST_STATE_WaitForDevice = 0,
82 HOST_STATE_Unattached = 1,
85 HOST_STATE_Powered = 2,
89 HOST_STATE_Powered_WaitForDeviceSettle = 3,
92 HOST_STATE_Powered_WaitForConnect = 4,
96 HOST_STATE_Powered_DoReset = 5,
99 HOST_STATE_Powered_ConfigPipe = 6,
102 HOST_STATE_Default = 7,
106 HOST_STATE_Default_PostReset = 8,
110 HOST_STATE_Default_PostAddressSet = 9,
116 HOST_STATE_Addressed = 10,
119 HOST_STATE_Configured = 11,
122 };
123
124 /* Architecture Includes: */
125 #if (ARCH == ARCH_AVR8)
126 #include "AVR8/Host_AVR8.h"
127 #elif (ARCH == ARCH_UC3)
128 #include "UC3/Host_UC3.h"
129 #endif
130
131 /* Disable C linkage for C++ Compilers: */
132 #if defined(__cplusplus)
133 }
134 #endif
135
136 #endif
137
HOST_STATE_Default_PostReset
Definition: Host.h:106
HOST_STATE_Powered
Definition: Host.h:85
USB_Host_States_t
USB_Host_States_t
Definition: Host.h:76
HOST_STATE_Powered_WaitForDeviceSettle
Definition: Host.h:89
HOST_STATE_Powered_ConfigPipe
Definition: Host.h:99
HOST_STATE_Default
Definition: Host.h:102
HOST_STATE_Addressed
Definition: Host.h:116
HOST_STATE_WaitForDevice
Definition: Host.h:78
USBMode.h
USB mode and feature support definitions.
HOST_STATE_Configured
Definition: Host.h:119
HOST_STATE_Powered_DoReset
Definition: Host.h:96
HOST_STATE_Powered_WaitForConnect
Definition: Host.h:92
HOST_STATE_Unattached
Definition: Host.h:82
HOST_STATE_Default_PostAddressSet
Definition: Host.h:110


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/HostStandardReq.h Source File

  • USB
  • Core
HostStandardReq.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
41 #ifndef __HOSTSTDREQ_H__
42 #define __HOSTSTDREQ_H__
43
44 /* Includes: */
45 #include "../Common/Common.h"
46 #include "USBMode.h"
47 #include "StdRequestType.h"
48 #include "USBController.h"
49
50 /* Enable C linkage for C++ Compilers: */
51 #if defined(__cplusplus)
52 extern "C" {
53 #endif
54
55 /* Preprocessor Checks: */
56 #if !defined(__INCLUDE_FROM_USB_DRIVER)
57 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
58 #endif
59
60 /* Public Interface - May be used in end-application: */
61 /* Macros: */
62 #if !defined(USB_HOST_TIMEOUT_MS) || defined(__DOXYGEN__)
63
70 #define USB_HOST_TIMEOUT_MS 1000
71 #endif
72
73 /* Enums: */
79 enum USB_Host_SendControlErrorCodes_t
80 {
81 HOST_SENDCONTROL_Successful = 0,
82 HOST_SENDCONTROL_DeviceDisconnected = 1,
85 HOST_SENDCONTROL_PipeError = 2,
86 HOST_SENDCONTROL_SetupStalled = 3,
89 HOST_SENDCONTROL_SoftwareTimeOut = 4,
90 };
91
92 /* Global Variables: */
103 extern uint8_t USB_Host_ConfigurationNumber;
104
105 /* Function Prototypes: */
117 uint8_t USB_Host_SendControlRequest(void* const BufferPtr);
118
132 uint8_t USB_Host_SetDeviceConfiguration(const uint8_t ConfigNumber);
133
145 uint8_t USB_Host_GetDeviceConfiguration(uint8_t* const ConfigNumber) ATTR_NON_NULL_PTR_ARG(1);
146
161 uint8_t USB_Host_GetDescriptor(const uint8_t Type,
162 const uint8_t Index,
163 void* const Buffer,
164 const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(3);
165
178 uint8_t USB_Host_GetDeviceStatus(uint8_t* const FeatureStatus) ATTR_NON_NULL_PTR_ARG(1);
179
190 uint8_t USB_Host_ClearEndpointStall(const uint8_t EndpointAddress);
191
204 uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceIndex,
205 const uint8_t AltSetting);
206
207
220 uint8_t USB_Host_GetInterfaceAltSetting(const uint8_t InterfaceIndex,
221 uint8_t* const AltSetting) ATTR_NON_NULL_PTR_ARG(2);
222
223 /* Inline Functions: */
237 static inline uint8_t USB_Host_GetDeviceDescriptor(USB_Descriptor_Device_t* const DeviceDescriptorPtr) ATTR_NON_NULL_PTR_ARG(1);
238 static inline uint8_t USB_Host_GetDeviceDescriptor(USB_Descriptor_Device_t* const DeviceDescriptorPtr)
239 {
240 return USB_Host_GetDescriptor(DTYPE_Device, 0, DeviceDescriptorPtr, sizeof(USB_Descriptor_Device_t));
241 }
242
259 static inline uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index,
260 void* const Buffer,
261 const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(2);
262 static inline uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index,
263 void* const Buffer,
264 const uint8_t BufferLength)
265 {
266 return USB_Host_GetDescriptor(DTYPE_String, Index, Buffer, BufferLength);
267 }
268
269 /* Private Interface - For use in library only: */
270 #if !defined(__DOXYGEN__)
271 /* Enums: */
272 enum USB_WaitForTypes_t
273 {
274 USB_HOST_WAITFOR_SetupSent,
275 USB_HOST_WAITFOR_InReceived,
276 USB_HOST_WAITFOR_OutReady,
277 };
278
279 /* Function Prototypes: */
280 #if defined(__INCLUDE_FROM_HOSTSTDREQ_C)
281 static uint8_t USB_Host_SendControlRequest_PRV(void* const BufferPtr);
282 static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType);
283 #endif
284 #endif
285
286 /* Disable C linkage for C++ Compilers: */
287 #if defined(__cplusplus)
288 }
289 #endif
290
291 #endif
292
StdRequestType.h
USB control endpoint request definitions.
HOST_SENDCONTROL_Successful
Definition: HostStandardReq.h:81
USB_Host_GetDeviceStatus
uint8_t USB_Host_GetDeviceStatus(uint8_t *const FeatureStatus) ATTR_NON_NULL_PTR_ARG(1)
USB_Host_GetDescriptor
uint8_t USB_Host_GetDescriptor(const uint8_t Type, const uint8_t Index, void *const Buffer, const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(3)
DTYPE_String
Definition: StdDescriptors.h:204
Type
uint8_t Type
Definition: StdDescriptors.h:260
HOST_SENDCONTROL_SetupStalled
Definition: HostStandardReq.h:86
USBController.h
Common USB Controller definitions for all architectures.
HOST_SENDCONTROL_DeviceDisconnected
Definition: HostStandardReq.h:82
USBMode.h
USB mode and feature support definitions.
USB_Host_GetDeviceConfiguration
uint8_t USB_Host_GetDeviceConfiguration(uint8_t *const ConfigNumber) ATTR_NON_NULL_PTR_ARG(1)
USB_Host_SendControlErrorCodes_t
USB_Host_SendControlErrorCodes_t
Definition: HostStandardReq.h:79
USB_Host_SetDeviceConfiguration
uint8_t USB_Host_SetDeviceConfiguration(const uint8_t ConfigNumber)
USB_Host_SendControlRequest
uint8_t USB_Host_SendControlRequest(void *const BufferPtr)
USB_Host_ClearEndpointStall
uint8_t USB_Host_ClearEndpointStall(const uint8_t EndpointAddress)
HOST_SENDCONTROL_PipeError
Definition: HostStandardReq.h:85
EndpointAddress
uint8_t EndpointAddress
Definition: StdDescriptors.h:642
DTYPE_Device
Definition: StdDescriptors.h:202
HOST_SENDCONTROL_SoftwareTimeOut
Definition: HostStandardReq.h:89
USB_Host_SetInterfaceAltSetting
uint8_t USB_Host_SetInterfaceAltSetting(const uint8_t InterfaceIndex, const uint8_t AltSetting)
USB_Descriptor_Device_t
ATTR_IAR_PACKED struct @24 USB_Descriptor_Device_t
Standard USB Device Descriptor (LUFA naming conventions).
USB_Host_ConfigurationNumber
uint8_t USB_Host_ConfigurationNumber
USB_Host_GetInterfaceAltSetting
uint8_t USB_Host_GetInterfaceAltSetting(const uint8_t InterfaceIndex, uint8_t *const AltSetting) ATTR_NON_NULL_PTR_ARG(2)


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/MassStorageClass.h Source File

  • USB
  • Class
MassStorageClass.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
60 #ifndef _MS_CLASS_H_
61 #define _MS_CLASS_H_
62
63 /* Macros: */
64 #define __INCLUDE_FROM_USB_DRIVER
65 #define __INCLUDE_FROM_MS_DRIVER
66
67 /* Includes: */
68 #include "../Core/USBMode.h"
69
70 #if defined(USB_CAN_BE_DEVICE)
71 #include "Device/MassStorageClassDevice.h"
72 #endif
73
74 #if defined(USB_CAN_BE_HOST)
75 #include "Host/MassStorageClassHost.h"
76 #endif
77
78 #endif
79
MassStorageClassDevice.h
Device mode driver for the library USB Mass Storage Class driver.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Common/MassStorageClassCommon.h Source File

  • USB
  • Class
  • Common
MassStorageClassCommon.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
50 #ifndef _MS_CLASS_COMMON_H_
51 #define _MS_CLASS_COMMON_H_
52
53 /* Includes: */
54 #include "../../Core/StdDescriptors.h"
55
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif
60
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_MS_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
64 #endif
65
66 /* Macros: */
68 #define MS_CBW_SIGNATURE 0x43425355UL
69
71 #define MS_CSW_SIGNATURE 0x53425355UL
72
74 #define MS_COMMAND_DIR_DATA_OUT (0 << 7)
75
77 #define MS_COMMAND_DIR_DATA_IN (1 << 7)
78
82 #define SCSI_CMD_INQUIRY 0x12
83
85 #define SCSI_CMD_REQUEST_SENSE 0x03
86
88 #define SCSI_CMD_TEST_UNIT_READY 0x00
89
91 #define SCSI_CMD_READ_CAPACITY_10 0x25
92
94 #define SCSI_CMD_START_STOP_UNIT 0x1B
95
97 #define SCSI_CMD_SEND_DIAGNOSTIC 0x1D
98
100 #define SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1E
101
103 #define SCSI_CMD_WRITE_10 0x2A
104
106 #define SCSI_CMD_READ_10 0x28
107
109 #define SCSI_CMD_WRITE_6 0x0A
110
112 #define SCSI_CMD_READ_6 0x08
113
115 #define SCSI_CMD_VERIFY_10 0x2F
116
118 #define SCSI_CMD_MODE_SENSE_6 0x1A
119
121 #define SCSI_CMD_MODE_SENSE_10 0x5A
122
123
127 #define SCSI_SENSE_KEY_GOOD 0x00
128
130 #define SCSI_SENSE_KEY_RECOVERED_ERROR 0x01
131
133 #define SCSI_SENSE_KEY_NOT_READY 0x02
134
136 #define SCSI_SENSE_KEY_MEDIUM_ERROR 0x03
137
139 #define SCSI_SENSE_KEY_HARDWARE_ERROR 0x04
140
142 #define SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
143
147 #define SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
148
150 #define SCSI_SENSE_KEY_DATA_PROTECT 0x07
151
153 #define SCSI_SENSE_KEY_BLANK_CHECK 0x08
154
156 #define SCSI_SENSE_KEY_VENDOR_SPECIFIC 0x09
157
159 #define SCSI_SENSE_KEY_COPY_ABORTED 0x0A
160
162 #define SCSI_SENSE_KEY_ABORTED_COMMAND 0x0B
163
165 #define SCSI_SENSE_KEY_VOLUME_OVERFLOW 0x0D
166
168 #define SCSI_SENSE_KEY_MISCOMPARE 0x0E
169
170
174 #define SCSI_ASENSE_NO_ADDITIONAL_INFORMATION 0x00
175
177 #define SCSI_ASENSE_LOGICAL_UNIT_NOT_READY 0x04
178
180 #define SCSI_ASENSE_INVALID_FIELD_IN_CDB 0x24
181
185 #define SCSI_ASENSE_NOT_READY_TO_READY_CHANGE 0x28
186
188 #define SCSI_ASENSE_WRITE_PROTECTED 0x27
189
191 #define SCSI_ASENSE_FORMAT_ERROR 0x31
192
194 #define SCSI_ASENSE_INVALID_COMMAND 0x20
195
197 #define SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x21
198
200 #define SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A
201
202
206 #define SCSI_ASENSEQ_NO_QUALIFIER 0x00
207
209 #define SCSI_ASENSEQ_FORMAT_COMMAND_FAILED 0x01
210
214 #define SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED 0x02
215
217 #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
218
219
220 /* Enums: */
224 enum MS_Descriptor_ClassSubclassProtocol_t
225 {
226 MS_CSCP_MassStorageClass = 0x08,
229 MS_CSCP_SCSITransparentSubclass = 0x06,
233 MS_CSCP_BulkOnlyTransportProtocol = 0x50,
236 };
237
239 enum MS_ClassRequests_t
240 {
241 MS_REQ_GetMaxLUN = 0xFE,
244 MS_REQ_MassStorageReset = 0xFF,
247 };
248
250 enum MS_CommandStatusCodes_t
251 {
252 MS_SCSI_COMMAND_Pass = 0,
253 MS_SCSI_COMMAND_Fail = 1,
256 MS_SCSI_COMMAND_PhaseError = 2,
257 };
258
259 /* Type Defines: */
266 typedef ATTR_IAR_PACKED struct
267 {
268 uint32_t Signature;
269 uint32_t Tag;
270 uint32_t DataTransferLength;
271 uint8_t Flags;
272 uint8_t LUN;
273 uint8_t SCSICommandLength;
274 uint8_t SCSICommandData[16];
275 } ATTR_PACKED MS_CommandBlockWrapper_t;
276
283 typedef ATTR_IAR_PACKED struct
284 {
285 uint32_t Signature;
286 uint32_t Tag;
287 uint32_t DataTransferResidue;
288 uint8_t Status;
289 } ATTR_PACKED MS_CommandStatusWrapper_t;
290
298 typedef ATTR_IAR_PACKED struct
299 {
300 uint8_t ResponseCode;
301
302 uint8_t SegmentNumber;
303
304 unsigned SenseKey : 4;
305 unsigned Reserved : 1;
306 unsigned ILI : 1;
307 unsigned EOM : 1;
308 unsigned FileMark : 1;
309
310 uint8_t Information[4];
311 uint8_t AdditionalLength;
312 uint8_t CmdSpecificInformation[4];
313 uint8_t AdditionalSenseCode;
314 uint8_t AdditionalSenseQualifier;
315 uint8_t FieldReplaceableUnitCode;
316 uint8_t SenseKeySpecific[3];
317 } ATTR_PACKED SCSI_Request_Sense_Response_t;
318
327 typedef ATTR_IAR_PACKED struct
328 {
329 unsigned DeviceType : 5;
330 unsigned PeripheralQualifier : 3;
331
332 unsigned Reserved : 7;
333 unsigned Removable : 1;
334
335 uint8_t Version;
336
337 unsigned ResponseDataFormat : 4;
338 unsigned Reserved2 : 1;
339 unsigned NormACA : 1;
340 unsigned TrmTsk : 1;
341 unsigned AERC : 1;
342
343 uint8_t AdditionalLength;
344 uint8_t Reserved3[2];
345
346 unsigned SoftReset : 1;
347 unsigned CmdQue : 1;
348 unsigned Reserved4 : 1;
349 unsigned Linked : 1;
350 unsigned Sync : 1;
351 unsigned WideBus16Bit : 1;
352 unsigned WideBus32Bit : 1;
353 unsigned RelAddr : 1;
354
355 uint8_t VendorID[8];
356 uint8_t ProductID[16];
357 uint8_t RevisionID[4];
358 } ATTR_PACKED SCSI_Inquiry_Response_t;
359
360 /* Disable C linkage for C++ Compilers: */
361 #if defined(__cplusplus)
362 }
363 #endif
364
365 #endif
366
MS_SCSI_COMMAND_Fail
Definition: MassStorageClassCommon.h:253
MS_ClassRequests_t
MS_ClassRequests_t
Definition: MassStorageClassCommon.h:239
SCSI_Request_Sense_Response_t
ATTR_IAR_PACKED struct @13 SCSI_Request_Sense_Response_t
Mass Storage Class SCSI Sense Structure.
Tag
uint32_t Tag
Definition: MassStorageClassCommon.h:269
DataTransferResidue
uint32_t DataTransferResidue
Definition: MassStorageClassCommon.h:287
SCSICommandData
uint8_t SCSICommandData[16]
Definition: MassStorageClassCommon.h:274
Reserved
uint8_t Reserved
Definition: HIDClassCommon.h:667
VendorID
uint16_t VendorID
Definition: StdDescriptors.h:305
Status
uint8_t Status
Definition: MassStorageClassCommon.h:288
DataTransferLength
uint32_t DataTransferLength
Definition: MassStorageClassCommon.h:270
Flags
uint8_t Flags
Definition: MassStorageClassCommon.h:271
LUN
uint8_t LUN
Definition: MassStorageClassCommon.h:272
SCSI_Inquiry_Response_t
ATTR_IAR_PACKED struct @14 SCSI_Inquiry_Response_t
Mass Storage Class SCSI Inquiry Structure.
MS_CSCP_BulkOnlyTransportProtocol
Definition: MassStorageClassCommon.h:233
MS_CommandStatusCodes_t
MS_CommandStatusCodes_t
Definition: MassStorageClassCommon.h:250
MS_CSCP_MassStorageClass
Definition: MassStorageClassCommon.h:226
SCSICommandLength
uint8_t SCSICommandLength
Definition: MassStorageClassCommon.h:273
Signature
uint32_t Signature
Definition: MassStorageClassCommon.h:268
MS_REQ_GetMaxLUN
Definition: MassStorageClassCommon.h:241
MS_CommandStatusWrapper_t
ATTR_IAR_PACKED struct @12 MS_CommandStatusWrapper_t
Mass Storage Class Command Status Wrapper.
MS_CommandBlockWrapper_t
ATTR_IAR_PACKED struct @11 MS_CommandBlockWrapper_t
Mass Storage Class Command Block Wrapper.
MS_SCSI_COMMAND_PhaseError
Definition: MassStorageClassCommon.h:256
MS_REQ_MassStorageReset
Definition: MassStorageClassCommon.h:244
MS_SCSI_COMMAND_Pass
Definition: MassStorageClassCommon.h:252
ProductID
uint16_t ProductID
Definition: StdDescriptors.h:306
MS_Descriptor_ClassSubclassProtocol_t
MS_Descriptor_ClassSubclassProtocol_t
Definition: MassStorageClassCommon.h:224
MS_CSCP_SCSITransparentSubclass
Definition: MassStorageClassCommon.h:229


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Class/Device/MassStorageClassDevice.h Source File

  • USB
  • Class
  • Device
MassStorageClassDevice.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
53 #ifndef _MS_CLASS_DEVICE_H_
54 #define _MS_CLASS_DEVICE_H_
55
56 /* Includes: */
57 #include "../../USB.h"
58 #include "../Common/MassStorageClassCommon.h"
59
60 /* Enable C linkage for C++ Compilers: */
61 #if defined(__cplusplus)
62 extern "C" {
63 #endif
64
65 /* Preprocessor Checks: */
66 #if !defined(__INCLUDE_FROM_MS_DRIVER)
67 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
68 #endif
69
70 /* Public Interface - May be used in end-application: */
71 /* Type Defines: */
78 typedef struct
79 {
80 struct
81 {
82 uint8_t InterfaceNumber;
84 USB_Endpoint_Table_t DataINEndpoint;
85 USB_Endpoint_Table_t DataOUTEndpoint;
87 uint8_t TotalLUNs;
88 } Config;
91 struct
92 {
93 MS_CommandBlockWrapper_t CommandBlock;
96 MS_CommandStatusWrapper_t CommandStatus;
99 volatile bool IsMassStoreReset;
102 } State;
105 } USB_ClassInfo_MS_Device_t;
106
107 /* Function Prototypes: */
116 bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
117
123 void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
124
130 void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
131
141 bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
142
143 /* Private Interface - For use in library only: */
144 #if !defined(__DOXYGEN__)
145 /* Function Prototypes: */
146 #if defined(__INCLUDE_FROM_MASSSTORAGE_DEVICE_C)
147 static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
148 static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
149 #endif
150
151 #endif
152
153 /* Disable C linkage for C++ Compilers: */
154 #if defined(__cplusplus)
155 }
156 #endif
157
158 #endif
159
USB_ClassInfo_MS_Device_t::IsMassStoreReset
volatile bool IsMassStoreReset
Definition: MassStorageClassDevice.h:99
USB_ClassInfo_MS_Device_t::InterfaceNumber
uint8_t InterfaceNumber
Definition: MassStorageClassDevice.h:82
USB_Endpoint_Table_t
Definition: EndPoint.h:94
USB_ClassInfo_MS_Device_t
Mass Storage Class Device Mode Configuration and State Structure.
Definition: MassStorageClassDevice.h:78
USB_ClassInfo_MS_Device_t::DataINEndpoint
USB_Endpoint_Table_t DataINEndpoint
Definition: MassStorageClassDevice.h:84
MS_Device_ConfigureEndpoints
bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: MassStorageClassDevice.c:74
MS_Device_ProcessControlRequest
void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: MassStorageClassDevice.c:40
USB_ClassInfo_MS_Device_t::TotalLUNs
uint8_t TotalLUNs
Definition: MassStorageClassDevice.h:87
MS_CommandStatusWrapper_t
ATTR_IAR_PACKED struct @12 MS_CommandStatusWrapper_t
Mass Storage Class Command Status Wrapper.
MS_CommandBlockWrapper_t
ATTR_IAR_PACKED struct @11 MS_CommandBlockWrapper_t
Mass Storage Class Command Block Wrapper.
CALLBACK_MS_Device_SCSICommandReceived
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
USB_ClassInfo_MS_Device_t::DataOUTEndpoint
USB_Endpoint_Table_t DataOUTEndpoint
Definition: MassStorageClassDevice.h:85
MS_Device_USBTask
void MS_Device_USBTask(USB_ClassInfo_MS_Device_t *const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
Definition: MassStorageClassDevice.c:90
USB_ClassInfo_MS_Device_t::CommandBlock
MS_CommandBlockWrapper_t CommandBlock
Definition: MassStorageClassDevice.h:93
USB_ClassInfo_MS_Device_t::CommandStatus
MS_CommandStatusWrapper_t CommandStatus
Definition: MassStorageClassDevice.h:96


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/OTG.h Source File

  • USB
  • Core
OTG.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
50 #ifndef __USBOTG_H__
51 #define __USBOTG_H__
52
53 /* Includes: */
54 #include "../Common/Common.h"
55 #include "USBMode.h"
56
57 /* Enable C linkage for C++ Compilers: */
58 #if defined(__cplusplus)
59 extern "C" {
60 #endif
61
62 /* Preprocessor Checks: */
63 #if !defined(__INCLUDE_FROM_USB_DRIVER)
64 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
65 #endif
66
67 /* Disable C linkage for C++ Compilers: */
68 #if defined(__cplusplus)
69 }
70 #endif
71
72 #endif
73
USBMode.h
USB mode and feature support definitions.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/Pipe.h Source File

  • USB
  • Core
Pipe.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
82 #ifndef __PIPE_H__
83 #define __PIPE_H__
84
85 /* Includes: */
86 #include "../Common/Common.h"
87 #include "USBMode.h"
88
89 /* Enable C linkage for C++ Compilers: */
90 #if defined(__cplusplus)
91 extern "C" {
92 #endif
93
94 /* Preprocessor Checks: */
95 #if !defined(__INCLUDE_FROM_USB_DRIVER)
96 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
97 #endif
98
99 /* Public Interface - May be used in end-application: */
100 /* Type Defines: */
104 typedef struct
105 {
106 uint8_t Address;
107 uint16_t Size;
108 uint8_t EndpointAddress;
109 uint8_t Type;
110 uint8_t Banks;
111 } USB_Pipe_Table_t;
112
113 /* Macros: */
117 #define PIPE_CONTROLPIPE 0
118
122 #define PIPE_PIPENUM_MASK 0x0F
123
127 #define PIPE_EPNUM_MASK 0x0F
128
129 /* Architecture Includes: */
130
131 /* Disable C linkage for C++ Compilers: */
132 #if defined(__cplusplus)
133 }
134 #endif
135
136 #endif
137
USB_Pipe_Table_t::EndpointAddress
uint8_t EndpointAddress
Definition: Pipe.h:108
USB_Pipe_Table_t::Size
uint16_t Size
Definition: Pipe.h:107
USB_Pipe_Table_t::Banks
uint8_t Banks
Definition: Pipe.h:110
USBMode.h
USB mode and feature support definitions.
USB_Pipe_Table_t::Type
uint8_t Type
Definition: Pipe.h:109
USB_Pipe_Table_t::Address
uint8_t Address
Definition: Pipe.h:106
USB_Pipe_Table_t
Definition: Pipe.h:104


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/PipeStream.h Source File

  • USB
  • Core
PipeStream.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
49 #ifndef __PIPE_STREAM_H__
50 #define __PIPE_STREAM_H__
51
52 /* Includes: */
53 #include "../Common/Common.h"
54 #include "USBMode.h"
55
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif
60
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_USB_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
64 #endif
65
66 /* Public Interface - May be used in end-application: */
67 /* Enums: */
69 enum Pipe_Stream_RW_ErrorCodes_t
70 {
71 PIPE_RWSTREAM_NoError = 0,
72 PIPE_RWSTREAM_PipeStalled = 1,
73 PIPE_RWSTREAM_DeviceDisconnected = 2,
76 PIPE_RWSTREAM_Timeout = 3,
80 PIPE_RWSTREAM_IncompleteTransfer = 4,
83 };
84
85 /* Architecture Includes: */
86
87 /* Disable C linkage for C++ Compilers: */
88 #if defined(__cplusplus)
89 }
90 #endif
91
92 #endif
93
PIPE_RWSTREAM_NoError
Definition: PipeStream.h:71
PIPE_RWSTREAM_Timeout
Definition: PipeStream.h:76
PIPE_RWSTREAM_DeviceDisconnected
Definition: PipeStream.h:73
Pipe_Stream_RW_ErrorCodes_t
Pipe_Stream_RW_ErrorCodes_t
Definition: PipeStream.h:69
USBMode.h
USB mode and feature support definitions.
PIPE_RWSTREAM_PipeStalled
Definition: PipeStream.h:72
PIPE_RWSTREAM_IncompleteTransfer
Definition: PipeStream.h:80


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/StdDescriptors.h Source File

  • USB
  • Core
StdDescriptors.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
49 #ifndef __USBDESCRIPTORS_H__
50 #define __USBDESCRIPTORS_H__
51
52 /* Includes: */
53 #include "../Common/Common.h"
54 #include "USBMode.h"
55 #include "Events.h"
56
57 /* Enable C linkage for C++ Compilers: */
58 #if defined(__cplusplus)
59 extern "C" {
60 #endif
61
62 /* Preprocessor Checks: */
63 #if !defined(__INCLUDE_FROM_USB_DRIVER)
64 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
65 #endif
66
67 /* Public Interface - May be used in end-application: */
68 /* Macros: */
73 #define NO_DESCRIPTOR 0
74
79 #define USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
80
86 #define USB_STRING_LEN(UnicodeChars) (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1))
87
94 #define USB_STRING_DESCRIPTOR(String) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String }
95
100 #define USB_STRING_DESCRIPTOR_ARRAY(...) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} }
101
112 #define VERSION_BCD(Major, Minor, Revision) \
113 CPU_TO_LE16( ((Major & 0xFF) << 8) | \
114 ((Minor & 0x0F) << 4) | \
115 (Revision & 0x0F) )
116
120 #define LANGUAGE_ID_ENG 0x0409
121
127 #define USB_CONFIG_ATTR_RESERVED 0x80
128
133 #define USB_CONFIG_ATTR_SELFPOWERED 0x40
134
140 #define USB_CONFIG_ATTR_REMOTEWAKEUP 0x20
141
142
150 #define ENDPOINT_ATTR_NO_SYNC (0 << 2)
151
157 #define ENDPOINT_ATTR_ASYNC (1 << 2)
158
164 #define ENDPOINT_ATTR_ADAPTIVE (2 << 2)
165
171 #define ENDPOINT_ATTR_SYNC (3 << 2)
172
173
181 #define ENDPOINT_USAGE_DATA (0 << 4)
182
188 #define ENDPOINT_USAGE_FEEDBACK (1 << 4)
189
195 #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)
196
197
198 /* Enums: */
200 enum USB_DescriptorTypes_t
201 {
202 DTYPE_Device = 0x01,
203 DTYPE_Configuration = 0x02,
204 DTYPE_String = 0x03,
205 DTYPE_Interface = 0x04,
206 DTYPE_Endpoint = 0x05,
207 DTYPE_DeviceQualifier = 0x06,
208 DTYPE_Other = 0x07,
209 DTYPE_InterfacePower = 0x08,
210 DTYPE_InterfaceAssociation = 0x0B,
211 DTYPE_CSInterface = 0x24,
212 DTYPE_CSEndpoint = 0x25,
213 };
214
216 enum USB_Descriptor_ClassSubclassProtocol_t
217 {
218 USB_CSCP_NoDeviceClass = 0x00,
221 USB_CSCP_NoDeviceSubclass = 0x00,
224 USB_CSCP_NoDeviceProtocol = 0x00,
227 USB_CSCP_VendorSpecificClass = 0xFF,
230 USB_CSCP_VendorSpecificSubclass = 0xFF,
233 USB_CSCP_VendorSpecificProtocol = 0xFF,
236 USB_CSCP_IADDeviceClass = 0xEF,
239 USB_CSCP_IADDeviceSubclass = 0x02,
242 USB_CSCP_IADDeviceProtocol = 0x01,
245 };
246
247 /* Type Defines: */
257 typedef ATTR_IAR_PACKED struct
258 {
259 uint8_t Size;
260 uint8_t Type;
263 } ATTR_PACKED USB_Descriptor_Header_t;
264
274 typedef ATTR_IAR_PACKED struct
275 {
276 uint8_t bLength;
277 uint8_t bDescriptorType;
280 } ATTR_PACKED USB_StdDescriptor_Header_t;
281
291 typedef ATTR_IAR_PACKED struct
292 {
293 USB_Descriptor_Header_t Header;
295 uint16_t USBSpecification;
299 uint8_t Class;
300 uint8_t SubClass;
301 uint8_t Protocol;
303 uint8_t Endpoint0Size;
305 uint16_t VendorID;
306 uint16_t ProductID;
307 uint16_t ReleaseNumber;
311 uint8_t ManufacturerStrIndex;
317 uint8_t ProductStrIndex;
321 uint8_t SerialNumStrIndex;
333 uint8_t NumberOfConfigurations;
336 } ATTR_PACKED USB_Descriptor_Device_t;
337
347 typedef ATTR_IAR_PACKED struct
348 {
349 uint8_t bLength;
350 uint8_t bDescriptorType;
353 uint16_t bcdUSB;
357 uint8_t bDeviceClass;
358 uint8_t bDeviceSubClass;
359 uint8_t bDeviceProtocol;
360 uint8_t bMaxPacketSize0;
361 uint16_t idVendor;
362 uint16_t idProduct;
363 uint16_t bcdDevice;
367 uint8_t iManufacturer;
373 uint8_t iProduct;
377 uint8_t iSerialNumber;
389 uint8_t bNumConfigurations;
392 } ATTR_PACKED USB_StdDescriptor_Device_t;
393
401 typedef ATTR_IAR_PACKED struct
402 {
403 USB_Descriptor_Header_t Header;
405 uint16_t USBSpecification;
409 uint8_t Class;
410 uint8_t SubClass;
411 uint8_t Protocol;
413 uint8_t Endpoint0Size;
414 uint8_t NumberOfConfigurations;
417 uint8_t Reserved;
418 } ATTR_PACKED USB_Descriptor_DeviceQualifier_t;
419
427 typedef ATTR_IAR_PACKED struct
428 {
429 uint8_t bLength;
430 uint8_t bDescriptorType;
433 uint16_t bcdUSB;
437 uint8_t bDeviceClass;
438 uint8_t bDeviceSubClass;
439 uint8_t bDeviceProtocol;
440 uint8_t bMaxPacketSize0;
441 uint8_t bNumConfigurations;
444 uint8_t bReserved;
445 } ATTR_PACKED USB_StdDescriptor_DeviceQualifier_t;
446
456 typedef ATTR_IAR_PACKED struct
457 {
458 USB_Descriptor_Header_t Header;
460 uint16_t TotalConfigurationSize;
463 uint8_t TotalInterfaces;
465 uint8_t ConfigurationNumber;
466 uint8_t ConfigurationStrIndex;
468 uint8_t ConfigAttributes;
472 uint8_t MaxPowerConsumption;
476 } ATTR_PACKED USB_Descriptor_Configuration_Header_t;
477
487 typedef ATTR_IAR_PACKED struct
488 {
489 uint8_t bLength;
490 uint8_t bDescriptorType;
493 uint16_t wTotalLength;
496 uint8_t bNumInterfaces;
497 uint8_t bConfigurationValue;
498 uint8_t iConfiguration;
499 uint8_t bmAttributes;
502 uint8_t bMaxPower;
506 } ATTR_PACKED USB_StdDescriptor_Configuration_Header_t;
507
517 typedef ATTR_IAR_PACKED struct
518 {
519 USB_Descriptor_Header_t Header;
521 uint8_t InterfaceNumber;
522 uint8_t AlternateSetting;
527 uint8_t TotalEndpoints;
529 uint8_t Class;
530 uint8_t SubClass;
531 uint8_t Protocol;
533 uint8_t InterfaceStrIndex;
534 } ATTR_PACKED USB_Descriptor_Interface_t;
535
545 typedef ATTR_IAR_PACKED struct
546 {
547 uint8_t bLength;
548 uint8_t bDescriptorType;
551 uint8_t bInterfaceNumber;
552 uint8_t bAlternateSetting;
557 uint8_t bNumEndpoints;
558 uint8_t bInterfaceClass;
559 uint8_t bInterfaceSubClass;
560 uint8_t bInterfaceProtocol;
561 uint8_t iInterface;
564 } ATTR_PACKED USB_StdDescriptor_Interface_t;
565
581 typedef ATTR_IAR_PACKED struct
582 {
583 USB_Descriptor_Header_t Header;
585 uint8_t FirstInterfaceIndex;
586 uint8_t TotalInterfaces;
588 uint8_t Class;
589 uint8_t SubClass;
590 uint8_t Protocol;
592 uint8_t IADStrIndex;
595 } ATTR_PACKED USB_Descriptor_Interface_Association_t;
596
613 typedef ATTR_IAR_PACKED struct
614 {
615 uint8_t bLength;
616 uint8_t bDescriptorType;
619 uint8_t bFirstInterface;
620 uint8_t bInterfaceCount;
621 uint8_t bFunctionClass;
622 uint8_t bFunctionSubClass;
623 uint8_t bFunctionProtocol;
624 uint8_t iFunction;
627 } ATTR_PACKED USB_StdDescriptor_Interface_Association_t;
628
638 typedef ATTR_IAR_PACKED struct
639 {
640 USB_Descriptor_Header_t Header;
642 uint8_t EndpointAddress;
645 uint8_t Attributes;
648 uint16_t EndpointSize;
651 uint8_t PollingIntervalMS;
654 } ATTR_PACKED USB_Descriptor_Endpoint_t;
655
666 typedef ATTR_IAR_PACKED struct
667 {
668 uint8_t bLength;
669 uint8_t bDescriptorType;
672 uint8_t bEndpointAddress;
675 uint8_t bmAttributes;
678 uint16_t wMaxPacketSize;
681 uint8_t bInterval;
684 } ATTR_PACKED USB_StdDescriptor_Endpoint_t;
685
701 typedef ATTR_IAR_PACKED struct
702 {
703 USB_Descriptor_Header_t Header;
705 #if defined(__CC_ARM)
706 #define MAX_ALLOC 256
707 #else
708 #define MAX_ALLOC
709 #endif
710
711 #if (!defined(__DOXYGEN__))
712 wchar_t UnicodeString[MAX_ALLOC];
713 #else
714 uint16_t UnicodeString[MAX_ALLOC];
726 #endif
727 } ATTR_PACKED USB_Descriptor_String_t;
728
745 typedef ATTR_IAR_PACKED struct
746 {
747 uint8_t bLength;
748 uint8_t bDescriptorType;
751 uint16_t bString[];
760 } ATTR_PACKED USB_StdDescriptor_String_t;
761
762
763 /* Disable C linkage for C++ Compilers: */
764 #if defined(__cplusplus)
765 }
766 #endif
767
768 #endif
769
NumberOfConfigurations
uint8_t NumberOfConfigurations
Definition: StdDescriptors.h:333
bMaxPacketSize0
uint8_t bMaxPacketSize0
Definition: StdDescriptors.h:360
bNumInterfaces
uint8_t bNumInterfaces
Definition: StdDescriptors.h:496
PollingIntervalMS
uint8_t PollingIntervalMS
Definition: StdDescriptors.h:651
FirstInterfaceIndex
uint8_t FirstInterfaceIndex
Definition: StdDescriptors.h:585
USB_StdDescriptor_Device_t
ATTR_IAR_PACKED struct @25 USB_StdDescriptor_Device_t
Standard USB Device Descriptor (USB-IF naming conventions).
USB_CSCP_NoDeviceProtocol
Definition: StdDescriptors.h:224
bDeviceClass
uint8_t bDeviceClass
Definition: StdDescriptors.h:357
bAlternateSetting
uint8_t bAlternateSetting
Definition: StdDescriptors.h:552
iSerialNumber
uint8_t iSerialNumber
Definition: StdDescriptors.h:377
bmAttributes
uint8_t bmAttributes
Definition: StdDescriptors.h:499
USB_StdDescriptor_Interface_Association_t
ATTR_IAR_PACKED struct @33 USB_StdDescriptor_Interface_Association_t
Standard USB Interface Association Descriptor (USB-IF naming conventions).
bFirstInterface
uint8_t bFirstInterface
Definition: StdDescriptors.h:619
USB_Descriptor_Endpoint_t
ATTR_IAR_PACKED struct @34 USB_Descriptor_Endpoint_t
Standard USB Endpoint Descriptor (LUFA naming conventions).
InterfaceStrIndex
uint8_t InterfaceStrIndex
Definition: StdDescriptors.h:533
Protocol
uint8_t Protocol
Definition: StdDescriptors.h:301
bInterfaceClass
uint8_t bInterfaceClass
Definition: StdDescriptors.h:558
bConfigurationValue
uint8_t bConfigurationValue
Definition: StdDescriptors.h:497
DTYPE_Other
Definition: StdDescriptors.h:208
bInterfaceCount
uint8_t bInterfaceCount
Definition: StdDescriptors.h:620
bFunctionClass
uint8_t bFunctionClass
Definition: StdDescriptors.h:621
DTYPE_DeviceQualifier
Definition: StdDescriptors.h:207
iFunction
uint8_t iFunction
Definition: StdDescriptors.h:624
DTYPE_InterfaceAssociation
Definition: StdDescriptors.h:210
VendorID
uint16_t VendorID
Definition: StdDescriptors.h:305
DTYPE_String
Definition: StdDescriptors.h:204
Type
uint8_t Type
Definition: StdDescriptors.h:260
idProduct
uint16_t idProduct
Definition: StdDescriptors.h:362
ConfigAttributes
uint8_t ConfigAttributes
Definition: StdDescriptors.h:468
USB_CSCP_NoDeviceClass
Definition: StdDescriptors.h:218
ConfigurationStrIndex
uint8_t ConfigurationStrIndex
Definition: StdDescriptors.h:466
USB_CSCP_NoDeviceSubclass
Definition: StdDescriptors.h:221
USB_Descriptor_String_t
ATTR_IAR_PACKED struct @36 USB_Descriptor_String_t
Standard USB String Descriptor (LUFA naming conventions).
USBSpecification
uint16_t USBSpecification
Definition: StdDescriptors.h:295
IADStrIndex
uint8_t IADStrIndex
Definition: StdDescriptors.h:592
USB_StdDescriptor_Header_t
ATTR_IAR_PACKED struct @23 USB_StdDescriptor_Header_t
Standard USB Descriptor Header (USB-IF naming conventions).
bInterval
uint8_t bInterval
Definition: StdDescriptors.h:681
USB_Descriptor_Interface_Association_t
ATTR_IAR_PACKED struct @32 USB_Descriptor_Interface_Association_t
Standard USB Interface Association Descriptor (LUFA naming conventions).
wTotalLength
uint16_t wTotalLength
Definition: StdDescriptors.h:493
USB_StdDescriptor_Configuration_Header_t
ATTR_IAR_PACKED struct @29 USB_StdDescriptor_Configuration_Header_t
Standard USB Configuration Descriptor (USB-IF naming conventions).
USB_Descriptor_Header_t
ATTR_IAR_PACKED struct @22 USB_Descriptor_Header_t
Standard USB Descriptor Header (LUFA naming conventions).
Reserved
uint8_t Reserved
Definition: StdDescriptors.h:417
iConfiguration
uint8_t iConfiguration
Definition: StdDescriptors.h:498
USB_StdDescriptor_DeviceQualifier_t
ATTR_IAR_PACKED struct @27 USB_StdDescriptor_DeviceQualifier_t
Standard USB Device Qualifier Descriptor (USB-IF naming conventions).
USB_CSCP_VendorSpecificSubclass
Definition: StdDescriptors.h:230
ConfigurationNumber
uint8_t ConfigurationNumber
Definition: StdDescriptors.h:465
USB_CSCP_IADDeviceClass
Definition: StdDescriptors.h:236
USBMode.h
USB mode and feature support definitions.
bFunctionProtocol
uint8_t bFunctionProtocol
Definition: StdDescriptors.h:623
bMaxPower
uint8_t bMaxPower
Definition: StdDescriptors.h:502
ManufacturerStrIndex
uint8_t ManufacturerStrIndex
Definition: StdDescriptors.h:311
TotalEndpoints
uint8_t TotalEndpoints
Definition: StdDescriptors.h:527
bString
uint16_t bString[]
Definition: StdDescriptors.h:751
bcdUSB
uint16_t bcdUSB
Definition: StdDescriptors.h:353
USB_CSCP_IADDeviceSubclass
Definition: StdDescriptors.h:239
ProductStrIndex
uint8_t ProductStrIndex
Definition: StdDescriptors.h:317
MaxPowerConsumption
uint8_t MaxPowerConsumption
Definition: StdDescriptors.h:472
Size
uint8_t Size
Definition: StdDescriptors.h:259
InterfaceNumber
uint8_t InterfaceNumber
Definition: StdDescriptors.h:521
bInterfaceProtocol
uint8_t bInterfaceProtocol
Definition: StdDescriptors.h:560
USB_DescriptorTypes_t
USB_DescriptorTypes_t
Definition: StdDescriptors.h:200
bEndpointAddress
uint8_t bEndpointAddress
Definition: StdDescriptors.h:672
TotalInterfaces
uint8_t TotalInterfaces
Definition: StdDescriptors.h:463
AlternateSetting
uint8_t AlternateSetting
Definition: StdDescriptors.h:522
EndpointSize
uint16_t EndpointSize
Definition: StdDescriptors.h:648
Events.h
USB Event management definitions.
ReleaseNumber
uint16_t ReleaseNumber
Definition: StdDescriptors.h:307
Endpoint0Size
uint8_t Endpoint0Size
Definition: StdDescriptors.h:303
DTYPE_Interface
Definition: StdDescriptors.h:205
bInterfaceNumber
uint8_t bInterfaceNumber
Definition: StdDescriptors.h:551
USB_StdDescriptor_String_t
ATTR_IAR_PACKED struct @37 USB_StdDescriptor_String_t
Standard USB String Descriptor (USB-IF naming conventions).
USB_Descriptor_DeviceQualifier_t
ATTR_IAR_PACKED struct @26 USB_Descriptor_DeviceQualifier_t
Standard USB Device Qualifier Descriptor (LUFA naming conventions).
Class
uint8_t Class
Definition: StdDescriptors.h:299
iManufacturer
uint8_t iManufacturer
Definition: StdDescriptors.h:367
bInterfaceSubClass
uint8_t bInterfaceSubClass
Definition: StdDescriptors.h:559
TotalConfigurationSize
uint16_t TotalConfigurationSize
Definition: StdDescriptors.h:460
DTYPE_CSEndpoint
Definition: StdDescriptors.h:212
USB_CSCP_VendorSpecificClass
Definition: StdDescriptors.h:227
DTYPE_Configuration
Definition: StdDescriptors.h:203
bLength
uint8_t bLength
Definition: StdDescriptors.h:276
DTYPE_InterfacePower
Definition: StdDescriptors.h:209
USB_Descriptor_Configuration_Header_t
ATTR_IAR_PACKED struct @28 USB_Descriptor_Configuration_Header_t
Standard USB Configuration Descriptor (LUFA naming conventions).
Header
USB_Descriptor_Header_t Header
Definition: StdDescriptors.h:293
bDeviceProtocol
uint8_t bDeviceProtocol
Definition: StdDescriptors.h:359
bDeviceSubClass
uint8_t bDeviceSubClass
Definition: StdDescriptors.h:358
EndpointAddress
uint8_t EndpointAddress
Definition: StdDescriptors.h:642
DTYPE_Device
Definition: StdDescriptors.h:202
DTYPE_CSInterface
Definition: StdDescriptors.h:211
SerialNumStrIndex
uint8_t SerialNumStrIndex
Definition: StdDescriptors.h:321
USB_CSCP_IADDeviceProtocol
Definition: StdDescriptors.h:242
bFunctionSubClass
uint8_t bFunctionSubClass
Definition: StdDescriptors.h:622
bReserved
uint8_t bReserved
Definition: StdDescriptors.h:444
DTYPE_Endpoint
Definition: StdDescriptors.h:206
iInterface
uint8_t iInterface
Definition: StdDescriptors.h:561
USB_StdDescriptor_Endpoint_t
ATTR_IAR_PACKED struct @35 USB_StdDescriptor_Endpoint_t
Standard USB Endpoint Descriptor (USB-IF naming conventions).
bDescriptorType
uint8_t bDescriptorType
Definition: StdDescriptors.h:277
bNumConfigurations
uint8_t bNumConfigurations
Definition: StdDescriptors.h:389
ProductID
uint16_t ProductID
Definition: StdDescriptors.h:306
SubClass
uint8_t SubClass
Definition: StdDescriptors.h:300
bNumEndpoints
uint8_t bNumEndpoints
Definition: StdDescriptors.h:557
iProduct
uint8_t iProduct
Definition: StdDescriptors.h:373
USB_Descriptor_ClassSubclassProtocol_t
USB_Descriptor_ClassSubclassProtocol_t
Definition: StdDescriptors.h:216
Attributes
uint8_t Attributes
Definition: StdDescriptors.h:645
bcdDevice
uint16_t bcdDevice
Definition: StdDescriptors.h:363
wMaxPacketSize
uint16_t wMaxPacketSize
Definition: StdDescriptors.h:678
USB_Descriptor_Interface_t
ATTR_IAR_PACKED struct @30 USB_Descriptor_Interface_t
Standard USB Interface Descriptor (LUFA naming conventions).
USB_Descriptor_Device_t
ATTR_IAR_PACKED struct @24 USB_Descriptor_Device_t
Standard USB Device Descriptor (LUFA naming conventions).
USB_StdDescriptor_Interface_t
ATTR_IAR_PACKED struct @31 USB_StdDescriptor_Interface_t
Standard USB Interface Descriptor (USB-IF naming conventions).
idVendor
uint16_t idVendor
Definition: StdDescriptors.h:361
USB_CSCP_VendorSpecificProtocol
Definition: StdDescriptors.h:233


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/StdRequestType.h Source File

  • USB
  • Core
StdRequestType.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
49 #ifndef __STDREQTYPE_H__
50 #define __STDREQTYPE_H__
51
52 /* Includes: */
53 #include "../Common/Common.h"
54 #include "USBMode.h"
55
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif
60
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_USB_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
64 #endif
65
66 /* Public Interface - May be used in end-application: */
67 /* Macros: */
73 #define CONTROL_REQTYPE_DIRECTION 0x80
74
80 #define CONTROL_REQTYPE_TYPE 0x60
81
88 #define CONTROL_REQTYPE_RECIPIENT 0x1F
89
96 #define REQDIR_HOSTTODEVICE (0 << 7)
97
102 #define REQDIR_DEVICETOHOST (1 << 7)
103
104
111 #define REQTYPE_STANDARD (0 << 5)
112
117 #define REQTYPE_CLASS (1 << 5)
118
123 #define REQTYPE_VENDOR (2 << 5)
124
125
132 #define REQREC_DEVICE (0 << 0)
133
139 #define REQREC_INTERFACE (1 << 0)
140
146 #define REQREC_ENDPOINT (2 << 0)
147
153 #define REQREC_OTHER (3 << 0)
154
155
156 /* Type Defines: */
163 typedef ATTR_IAR_PACKED struct
164 {
165 uint8_t bmRequestType;
166 uint8_t bRequest;
167 uint16_t wValue;
168 uint16_t wIndex;
169 uint16_t wLength;
170 } ATTR_PACKED USB_Request_Header_t;
171
172 /* Enums: */
179 enum USB_Control_Request_t
180 {
181 REQ_GetStatus = 0,
185 REQ_ClearFeature = 1,
189 REQ_SetFeature = 3,
193 REQ_SetAddress = 5,
197 REQ_GetDescriptor = 6,
201 REQ_SetDescriptor = 7,
204 REQ_GetConfiguration = 8,
208 REQ_SetConfiguration = 9,
212 REQ_GetInterface = 10,
215 REQ_SetInterface = 11,
218 REQ_SynchFrame = 12,
221 };
222
226 enum USB_Feature_Selectors_t
227 {
228 FEATURE_SEL_EndpointHalt = 0x00,
233 FEATURE_SEL_DeviceRemoteWakeup = 0x01,
238 FEATURE_SEL_TestMode = 0x02,
241 };
242
243 /* Private Interface - For use in library only: */
244 #if !defined(__DOXYGEN__)
245 /* Macros: */
246 #define FEATURE_SELFPOWERED_ENABLED (1 << 0)
247 #define FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1)
248 #endif
249
250 /* Disable C linkage for C++ Compilers: */
251 #if defined(__cplusplus)
252 }
253 #endif
254
255 #endif
256
REQ_GetStatus
Definition: StdRequestType.h:181
USB_Request_Header_t
ATTR_IAR_PACKED struct @38 USB_Request_Header_t
Standard USB Control Request.
FEATURE_SEL_EndpointHalt
Definition: StdRequestType.h:228
bmRequestType
uint8_t bmRequestType
Definition: StdRequestType.h:165
FEATURE_SEL_DeviceRemoteWakeup
Definition: StdRequestType.h:233
REQ_GetDescriptor
Definition: StdRequestType.h:197
REQ_SetFeature
Definition: StdRequestType.h:189
USB_Feature_Selectors_t
USB_Feature_Selectors_t
Definition: StdRequestType.h:226
REQ_GetConfiguration
Definition: StdRequestType.h:204
REQ_SetConfiguration
Definition: StdRequestType.h:208
wIndex
uint16_t wIndex
Definition: StdRequestType.h:168
REQ_SetDescriptor
Definition: StdRequestType.h:201
USBMode.h
USB mode and feature support definitions.
REQ_SetAddress
Definition: StdRequestType.h:193
REQ_SetInterface
Definition: StdRequestType.h:215
FEATURE_SEL_TestMode
Definition: StdRequestType.h:238
wLength
uint16_t wLength
Definition: StdRequestType.h:169
bRequest
uint8_t bRequest
Definition: StdRequestType.h:166
USB_Control_Request_t
USB_Control_Request_t
Definition: StdRequestType.h:179
REQ_GetInterface
Definition: StdRequestType.h:212
REQ_ClearFeature
Definition: StdRequestType.h:185
wValue
uint16_t wValue
Definition: StdRequestType.h:167
REQ_SynchFrame
Definition: StdRequestType.h:218


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/USB.h Source File

  • USB
USB.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
375 #ifndef __USB_H__
376 #define __USB_H__
377
378 /* Macros: */
379 #define __INCLUDE_FROM_USB_DRIVER
380
381 /* Includes: */
382 #include "Common/Common.h"
383 #include "Core/USBMode.h"
384
385 /* Includes: */
386 #include "Core/USBTask.h"
387 #include "Core/Events.h"
388 #include "Core/StdDescriptors.h"
389 #include "Core/ConfigDescriptors.h"
390 #include "Core/USBController.h"
391
392 #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
393 #include "Core/Host.h"
394 #include "Core/Pipe.h"
395 #include "Core/HostStandardReq.h"
396 #include "Core/PipeStream.h"
397 #endif
398
399 #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
400 #include "Core/Device.h"
401 #include "Core/Endpoint.h"
402 #include "Core/DeviceStandardReq.h"
403 #include "Core/EndpointStream.h"
404 #endif
405
406 #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
407 #include "Core/OTG.h"
408 #endif
409
410 #include "Class/CDCClass.h"
411 #include "Class/HIDClass.h"
412 #include "Class/MassStorageClass.h"
413
414 #endif
415
ConfigDescriptors.h
USB Configuration Descriptor definitions.
Device.h
Common USB Device definitions for all architectures.
MassStorageClass.h
Master include file for the library USB Mass Storage Class driver.
Host.h
Common USB Host definitions for all architectures.
PipeStream.h
Pipe data stream transmission and reception management.
USBController.h
Common USB Controller definitions for all architectures.
HIDClass.h
Master include file for the library USB HID Class driver.
USBMode.h
USB mode and feature support definitions.
Pipe.h
Common USB Pipe definitions for all architectures.
HostStandardReq.h
USB host standard request management.
StdDescriptors.h
Common standard USB Descriptor definitions for all architectures.
DeviceStandardReq.h
USB device standard request management.
Events.h
USB Event management definitions.
Common.h
Common library convenience headers, macros and functions.
CDCClass.h
Master include file for the library USB CDC-ACM Class driver.
OTG.h
Common USB OTG definitions for all architectures.
EndpointStream.h
Endpoint data stream transmission and reception management.
EndPoint.h
USB Endpoint definitions for all architectures.
USBTask.h
Main USB service task management.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBController.h Source File

  • USB
  • Core
USBController.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
48 #ifndef __USBCONTROLLER_H__
49 #define __USBCONTROLLER_H__
50
51 /* Includes: */
52 #include "../Common/Common.h"
53 #include "USBMode.h"
54
55 /* Enable C linkage for C++ Compilers: */
56 #if defined(__cplusplus)
57 extern "C" {
58 #endif
59
60 /* Preprocessor Checks and Defines: */
61 #if !defined(__INCLUDE_FROM_USB_DRIVER)
62 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
63 #endif
64
65 /* Defines: */
71 #define ENDPOINT_DIR_MASK 0x80
72
76 #define ENDPOINT_DIR_OUT 0x00
77
81 #define ENDPOINT_DIR_IN 0x80
82
83
89 #define PIPE_DIR_MASK 0x80
90
94 #define PIPE_DIR_OUT 0x00
95
99 #define PIPE_DIR_IN 0x80
100
101
107 #define EP_TYPE_MASK 0x03
108
113 #define EP_TYPE_CONTROL 0x00
114
119 #define EP_TYPE_ISOCHRONOUS 0x01
120
125 #define EP_TYPE_BULK 0x02
126
131 #define EP_TYPE_INTERRUPT 0x03
132
133
134 /* Enums: */
138 enum USB_Modes_t
139 {
140 USB_MODE_None = 0,
141 USB_MODE_Device = 1,
142 USB_MODE_Host = 2,
143 USB_MODE_UID = 3,
146 };
147
148 /* Architecture Includes: */
149 #include "XMC4000/USBController_XMC4000.h"
150
151 /* Disable C linkage for C++ Compilers: */
152 #if defined(__cplusplus)
153 }
154 #endif
155
156 #endif
157
USBMode.h
USB mode and feature support definitions.
USB_MODE_UID
Definition: USBController.h:143
USB_MODE_Host
Definition: USBController.h:142
USBController_XMC4000.h
USB Controller definitions for the Infineon XMC4000 microcontrollers.
USB_Modes_t
USB_Modes_t
Definition: USBController.h:138
USB_MODE_Device
Definition: USBController.h:141
USB_MODE_None
Definition: USBController.h:140


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/XMC4000/USBController_XMC4000.h Source File

  • USB
  • Core
  • XMC4000
USBController_XMC4000.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
48 #ifndef __USBCONTROLLER_XMC4000_H__
49 #define __USBCONTROLLER_XMC4000_H__
50
51 /* Includes: */
52 #include <xmc_usbd.h>
53 #include "../../Common/Common.h"
54 #include "../USBMode.h"
55 #include "../Events.h"
56 #include "../USBTask.h"
57 #include "../USBInterrupt.h"
58
59 /* Enable C linkage for C++ Compilers: */
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif
63
64 /* Preprocessor Checks and Defines: */
65 #if !defined(__INCLUDE_FROM_USB_DRIVER)
66 #error Do not include this file directly. Include USB/USB.h instead.
67 #endif
68
69 /* Public Interface - May be used in end-application: */
70 /* Macros: */
71 #define NO_COPY_DRIVER 0
72
73 #define NUM_INTERFACES 1
74
75 /* Macros: */
76 #if (!defined(MAX_ENDPOINT_INDEX) && !defined(CONTROL_ONLY_DEVICE)) || defined(__DOXYGEN__)
77
80 #define ENDPOINT_TOTAL_ENDPOINTS 7
81 #else
82 #if defined(CONTROL_ONLY_DEVICE)
83 #define ENDPOINT_TOTAL_ENDPOINTS 1
84 #else
85 #define ENDPOINT_TOTAL_ENDPOINTS (MAX_ENDPOINT_INDEX + 1)
86 #endif
87 #endif
88
92 typedef enum EP0_State
93 {
94 DISCONNECT,
95 IDLE,
96 IN_DATA,
97 IN_STATUS,
98 OUT_DATA,
99 OUT_STATUS
100 } EP0_State_t;
101
102 /* Anonymous structure/union guard start */
103 #if defined (__CC_ARM)
104 #pragma push
105 #pragma anon_unions
106 #elif defined (__TASKING__)
107 #pragma warning 586
108 #endif
109
118 typedef struct USBD_Endpoint
119 {
124 union {
125 uint32_t Address:8;
126 struct {
127 uint32_t Number:4;
128 uint32_t :3;
129 uint32_t Direction:1;
130 };
131
132 };
133
134 /* Endpoint flags */
135 uint32_t IsConfigured:1;
136 uint32_t IsEnabled:1;
137 uint32_t IsHalted:1;
138 volatile uint32_t OutInUse:1;
139 volatile uint32_t InInUse:1;
140 volatile uint32_t IsOutRecieved:1;
141 uint32_t MaxPacketSize:7;
143
148 uint32_t OutBytesAvailable;
149 uint32_t OutOffset;
150 uint8_t *OutBuffer;
151 uint32_t OutBufferLength;
153
158 uint32_t InBytesAvailable;
159 uint8_t *InBuffer;
160 uint32_t InBufferLength;
161 uint32_t InDataLeft;
162 uint8_t* InDataBuffer;
164 } USBD_Endpoint_t;
165
171 typedef struct USBD_Device
172 {
173 XMC_USBD_DRIVER_t *Driver;
174 USBD_Endpoint_t Endpoints[ENDPOINT_TOTAL_ENDPOINTS];
176 uint8_t InterfaceSettings[NUM_INTERFACES];
177 uint8_t Configuration;
178 uint8_t PreSuspendDeviceState;
179 EP0_State_t EP0_State;
180 uint8_t CurrentEndpoint;
181 uint8_t CurrentDirection;
182 uint8_t IsConfigured:1;
183 volatile uint8_t IsSetupRecieved:1;
184 uint8_t RemoteWakeUp:1;
185 uint8_t SelfPowered:1;
186 } USB_Device_t;
187
188 /* Anonymous structure/union guard end */
189 #if defined (__CC_ARM)
190 #pragma pop
191 #elif defined (__TASKING__)
192 #pragma warning restore
193 #endif
194
195 /* Global Variables: */
196 extern USB_Device_t device;
197
198 /* Inline Functions: */
203 static inline void USB_Detach(void) ATTR_ALWAYS_INLINE;
204 static inline void USB_Detach(void)
205 {
206 device.Driver->DeviceDisconnect();
207 }
208
217 static inline void USB_Attach(void) ATTR_ALWAYS_INLINE;
218 static inline void USB_Attach(void)
219 {
220 device.Driver->DeviceConnect();
221 }
222
223 /* Function Prototypes: */
232 int USBD_Initialize(XMC_USBD_t *usb_init);
233
234
235 /* Private Interface - For use in library only: */
236 #if !defined(__DOXYGEN__)
237
242 void USBD_SignalDeviceEventHandler(XMC_USBD_EVENT_t event);
243
249 void USBD_SignalEndpointEvent_Handler (uint8_t ep_addr, XMC_USBD_EP_EVENT_t ep_event);
250
256 int USB_IsEnumDone(void);
257
266 void USBD_SetEndpointBuffer(uint8_t Address,uint8_t *Buffer,uint16_t Length);
267
268 #endif
269
270 /* Includes: */
271 #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
272 #include "../Device.h"
273 #include "../Endpoint.h"
274 #include "../DeviceStandardReq.h"
275 #include "../EndpointStream.h"
276 #endif
277
278 /* Disable C linkage for C++ Compilers: */
279 #if defined(__cplusplus)
280 }
281 #endif
282
283 #endif
284
USBD_Endpoint::OutOffset
uint32_t OutOffset
Definition: USBController_XMC4000.h:149
USBD_Device::EP0_State
EP0_State_t EP0_State
Definition: USBController_XMC4000.h:179
USBD_Endpoint::Direction
uint32_t Direction
Definition: USBController_XMC4000.h:129
USBD_Device::CurrentEndpoint
uint8_t CurrentEndpoint
Definition: USBController_XMC4000.h:180
USBD_SignalEndpointEvent_Handler
void USBD_SignalEndpointEvent_Handler(uint8_t ep_addr, XMC_USBD_EP_EVENT_t ep_event)
Endpoint Event Handler for the device controller driver.
Definition: USBController_XMC4000.c:427
USBD_Endpoint::OutBuffer
uint8_t * OutBuffer
Definition: USBController_XMC4000.h:150
OUT_DATA
Definition: USBController_XMC4000.h:98
EP0_State
EP0_State
State machine of Endpoint 0.
Definition: USBController_XMC4000.h:92
USBD_Endpoint::IsHalted
uint32_t IsHalted
Definition: USBController_XMC4000.h:137
USBD_Endpoint::OutBufferLength
uint32_t OutBufferLength
Definition: USBController_XMC4000.h:151
USBD_Endpoint::Number
uint32_t Number
Definition: USBController_XMC4000.h:127
USBD_SetEndpointBuffer
void USBD_SetEndpointBuffer(uint8_t Address, uint8_t *Buffer, uint16_t Length)
Configure an USBD Endpoint.
Definition: USBController_XMC4000.c:550
USBD_Endpoint::InInUse
volatile uint32_t InInUse
Definition: USBController_XMC4000.h:139
USBD_Endpoint::IsOutRecieved
volatile uint32_t IsOutRecieved
Definition: USBController_XMC4000.h:140
USBD_Device::Endpoints
USBD_Endpoint_t Endpoints[ENDPOINT_TOTAL_ENDPOINTS]
Definition: USBController_XMC4000.h:174
USBD_Endpoint::IsConfigured
uint32_t IsConfigured
Definition: USBController_XMC4000.h:135
USBD_Initialize
int USBD_Initialize(XMC_USBD_t *usb_init)
Initialize the USB device core driver.
Definition: USBController_XMC4000.c:496
IN_STATUS
Definition: USBController_XMC4000.h:97
USBD_Device::CurrentDirection
uint8_t CurrentDirection
Definition: USBController_XMC4000.h:181
USBD_Endpoint
USBD Endpoint.
Definition: USBController_XMC4000.h:118
IDLE
Definition: USBController_XMC4000.h:95
USB_IsEnumDone
int USB_IsEnumDone(void)
Is the enumeration done?
Definition: USBController_XMC4000.c:532
USBD_Endpoint::OutBytesAvailable
uint32_t OutBytesAvailable
Definition: USBController_XMC4000.h:148
IN_DATA
Definition: USBController_XMC4000.h:96
USBD_Device::PreSuspendDeviceState
uint8_t PreSuspendDeviceState
Definition: USBController_XMC4000.h:178
USBD_Endpoint::InBuffer
uint8_t * InBuffer
Definition: USBController_XMC4000.h:159
USBD_Endpoint_t
struct USBD_Endpoint USBD_Endpoint_t
USBD Endpoint.
USBD_Endpoint::InBytesAvailable
uint32_t InBytesAvailable
Definition: USBController_XMC4000.h:158
USBD_Device::IsSetupRecieved
volatile uint8_t IsSetupRecieved
Definition: USBController_XMC4000.h:183
USBD_Endpoint::MaxPacketSize
uint32_t MaxPacketSize
Definition: USBController_XMC4000.h:141
USBD_Endpoint::InBufferLength
uint32_t InBufferLength
Definition: USBController_XMC4000.h:160
USBD_Device::Driver
XMC_USBD_DRIVER_t * Driver
Definition: USBController_XMC4000.h:173
USBD_Endpoint::InDataLeft
uint32_t InDataLeft
Definition: USBController_XMC4000.h:161
EP0_State_t
enum EP0_State EP0_State_t
State machine of Endpoint 0.
USBD_Device::InterfaceSettings
uint8_t InterfaceSettings[NUM_INTERFACES]
Definition: USBController_XMC4000.h:176
USB_Device_t
struct USBD_Device USB_Device_t
USBD Device.
USBD_Endpoint::OutInUse
volatile uint32_t OutInUse
Definition: USBController_XMC4000.h:138
USBD_SignalDeviceEventHandler
void USBD_SignalDeviceEventHandler(XMC_USBD_EVENT_t event)
Device Event Handler for the device controller driver.
Definition: USBController_XMC4000.c:343
DISCONNECT
Definition: USBController_XMC4000.h:94
USBD_Device::SelfPowered
uint8_t SelfPowered
Definition: USBController_XMC4000.h:185
USBD_Device::RemoteWakeUp
uint8_t RemoteWakeUp
Definition: USBController_XMC4000.h:184
USBD_Endpoint::IsEnabled
uint32_t IsEnabled
Definition: USBController_XMC4000.h:136
OUT_STATUS
Definition: USBController_XMC4000.h:99
USBD_Device
USBD Device.
Definition: USBController_XMC4000.h:171
ENDPOINT_TOTAL_ENDPOINTS
#define ENDPOINT_TOTAL_ENDPOINTS
Definition: USBController_XMC4000.h:80
USBD_Device::Configuration
uint8_t Configuration
Definition: USBController_XMC4000.h:177
USBD_Endpoint::Address
uint32_t Address
Definition: USBController_XMC4000.h:125
USBD_Endpoint::InDataBuffer
uint8_t * InDataBuffer
Definition: USBController_XMC4000.h:162
USBD_Device::IsConfigured
uint8_t IsConfigured
Definition: USBController_XMC4000.h:182


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBInterrupt.h Source File

  • USB
  • Core
USBInterrupt.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
41 #ifndef __USBINTERRUPT_H__
42 #define __USBINTERRUPT_H__
43
44 /* Includes: */
45 #include "../Common/Common.h"
46 #include "USBMode.h"
47
48 /* Enable C linkage for C++ Compilers: */
49 #if defined(__cplusplus)
50 extern "C" {
51 #endif
52
53 /* Preprocessor Checks: */
54 #if !defined(__INCLUDE_FROM_USB_DRIVER)
55 #error Do not include this file directly. Include USB/USB.h instead.
56 #endif
57
58 /* Architecture Includes: */
59
60 /* Disable C linkage for C++ Compilers: */
61 #if defined(__cplusplus)
62 }
63 #endif
64
65 #endif
66
USBMode.h
USB mode and feature support definitions.


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBMode.h Source File

  • USB
  • Core
USBMode.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
55 #ifndef __USBMODE_H__
56 #define __USBMODE_H__
57
58 /* Enable C linkage for C++ Compilers: */
59 #if defined(__cplusplus)
60 extern "C" {
61 #endif
62
63 /* Preprocessor Checks: */
64 #if !defined(__INCLUDE_FROM_USB_DRIVER)
65 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
66 #endif
67
68 /* Includes: */
69 #include "../Common/Common.h"
70
71 /* Public Interface - May be used in end-application: */
72 #if defined(__DOXYGEN__)
73
76 #define USB_CAN_BE_DEVICE
77
81 #define USB_CAN_BE_HOST
82
83 #else
84 /* Macros: */
85 #define USB_CAN_BE_DEVICE
86 //#define USB_CAN_BE_HOST
87
88 #if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
89 #error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
90 #elif defined(USB_HOST_ONLY)
91 #if !defined(USB_CAN_BE_HOST)
92 #error USB_HOST_ONLY is not available for the currently selected microcontroller model.
93 #else
94 #undef USB_CAN_BE_DEVICE
95 #endif
96 #elif defined(USB_DEVICE_ONLY)
97 #if !defined(USB_CAN_BE_DEVICE)
98 #error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.
99 #else
100 #undef USB_CAN_BE_HOST
101 #endif
102 #endif
103
104 #if (defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST))
105 #define USB_CAN_BE_BOTH
106 #endif
107
108 #if (!defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST))
109 #error The currently selected device, USB mode or architecture is not supported.
110 #endif
111 #endif
112
113 /* Disable C linkage for C++ Compilers: */
114 #if defined(__cplusplus)
115 }
116 #endif
117
118 #endif
119


XMC USB Library: C:/LLDWork/LLD/USBlib/USB/Core/USBTask.h Source File

  • USB
  • Core
USBTask.h
Go to the documentation of this file.
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2014.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
41 #ifndef __USBTASK_H__
42 #define __USBTASK_H__
43
44 /* Includes: */
45 #include "../Common/Common.h"
46 #include "USBMode.h"
47 #include "USBController.h"
48 #include "Events.h"
49 #include "StdRequestType.h"
50 #include "StdDescriptors.h"
51
52 #if defined(USB_CAN_BE_DEVICE)
53 #include "DeviceStandardReq.h"
54 #endif
55
56 #if defined(USB_CAN_BE_HOST)
57 #include "HostStandardReq.h"
58 #endif
59
60 /* Enable C linkage for C++ Compilers: */
61 #if defined(__cplusplus)
62 extern "C" {
63 #endif
64
65 /* Preprocessor Checks: */
66 #if !defined(__INCLUDE_FROM_USB_DRIVER)
67 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
68 #endif
69
70 /* Public Interface - May be used in end-application: */
71 /* Global Variables: */
81 extern volatile bool USB_IsInitialized;
82
91 extern USB_Request_Header_t USB_ControlRequest;
92
93 #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
94 #if !defined(HOST_STATE_AS_GPIOR) || defined(__DOXYGEN__)
95
108 extern volatile uint8_t USB_HostState;
109 #else
110 #define USB_HostState CONCAT_EXPANDED(GPIOR, HOST_STATE_AS_GPIOR)
111 #endif
112 #endif
113
114 #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
115 #if !defined(DEVICE_STATE_AS_GPIOR) || defined(__DOXYGEN__)
116
134 extern volatile uint8_t USB_DeviceState;
135 #else
136 #define USB_DeviceState CONCAT_EXPANDED(GPIOR, DEVICE_STATE_AS_GPIOR)
137 #endif
138 #endif
139
140 /* Function Prototypes: */
163 void USB_USBTask(void);
164
165 /* Private Interface - For use in library only: */
166 #if !defined(__DOXYGEN__)
167 /* Function Prototypes: */
168 #if defined(__INCLUDE_FROM_USBTASK_C)
169 #if defined(USB_CAN_BE_HOST)
170 static void USB_HostTask(void);
171 #endif
172
173 #if defined(USB_CAN_BE_DEVICE)
174 static void USB_DeviceTask(void);
175 #endif
176 #endif
177
178 /* Macros: */
179 #define HOST_TASK_NONBLOCK_WAIT(Duration, NextState) do { USB_HostState = HOST_STATE_WaitForDevice; \
180 WaitMSRemaining = (Duration); \
181 PostWaitState = (NextState); } while (0)
182 #endif
183
184 /* Disable C linkage for C++ Compilers: */
185 #if defined(__cplusplus)
186 }
187 #endif
188
189 #endif
190
USB_Request_Header_t
ATTR_IAR_PACKED struct @38 USB_Request_Header_t
Standard USB Control Request.
StdRequestType.h
USB control endpoint request definitions.
USBController.h
Common USB Controller definitions for all architectures.
USB_ControlRequest
USB_Request_Header_t USB_ControlRequest
Definition: USBTask.c:36
USBMode.h
USB mode and feature support definitions.
USB_USBTask
void USB_USBTask(void)
Definition: USBTask.c:46
USB_DeviceState
volatile uint8_t USB_DeviceState
Definition: USBTask.c:43
HostStandardReq.h
USB host standard request management.
StdDescriptors.h
Common standard USB Descriptor definitions for all architectures.
DeviceStandardReq.h
USB device standard request management.
Events.h
USB Event management definitions.
USB_IsInitialized
volatile bool USB_IsInitialized
Definition: USBTask.c:35