Hanna
Sourcecode Kontrollplatine
Datenstrukturen | Makrodefinitionen | Aufzählungen | Funktionen
Descriptors.h-Dateireferenz

Bibliothek zur USB-Kommunikation von Jürgen W. Mehr ...

#include <avr/pgmspace.h>
#include "usb_defaults.h"
Include-Abhängigkeitsdiagramm für Descriptors.h:
Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  ATTR_PACKED
 
struct  ATTR_PACKED
 
struct  ATTR_PACKED
 
struct  ATTR_PACKED
 
struct  ATTR_PACKED
 
struct  ATTR_PACKED
 
struct  ATTR_PACKED
 
struct  USB_Descriptor_Configuration_t
 

Makrodefinitionen

#define CDC_CONTROL_LINE_IN_BREAK   (1 << 2)
 
#define CDC_CONTROL_LINE_IN_DCD   (1 << 0)
 
#define CDC_CONTROL_LINE_IN_DSR   (1 << 1)
 
#define CDC_CONTROL_LINE_IN_FRAMEERROR   (1 << 4)
 
#define CDC_CONTROL_LINE_IN_OVERRUNERROR   (1 << 6)
 
#define CDC_CONTROL_LINE_IN_PARITYERROR   (1 << 5)
 
#define CDC_CONTROL_LINE_IN_RING   (1 << 3)
 
#define CDC_CONTROL_LINE_OUT_DTR   (1 << 0)
 
#define CDC_CONTROL_LINE_OUT_RTS   (1 << 1)
 
#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize)
 
#define CDC_NOTIFICATION_EPADDR   (ENDPOINT_DIR_IN | 2)
 
#define CDC_NOTIFICATION_EPSIZE   8
 
#define CDC_RX_EPADDR   (ENDPOINT_DIR_OUT | 4)
 
#define CDC_TX_EPADDR   (ENDPOINT_DIR_IN | 3)
 
#define CDC_TXRX_EPSIZE   64
 

Aufzählungen

enum  CDC_ClassNotifications_t { CDC_NOTIF_SerialState = 0x20 }
 
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_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_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
}
 

Funktionen

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)
 

Ausführliche Beschreibung

Bibliothek zur USB-Kommunikation von Jürgen W.

Autoren
: Jürgen H. (woodym) aus http://www.mikrocontroller.net/topic/295339; Copyright (C) Dean Camera, 2011. dean@.nosp@m.four.nosp@m.walle.nosp@m.dcub.nosp@m.icle..nosp@m.com
Datum
03.05.2013 / 30.08.2015
                $Revision: 464 $
                $Date: 2016-04-02 12:30:30 +0200 (Sa, 02 Apr 2016) $

LUFA Library Copyright (C) Dean Camera, 2011.

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

Definiert in Datei Descriptors.h.

Makro-Dokumentation

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

Definiert in Zeile 95 der Datei Descriptors.h.

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

Definiert in Zeile 85 der Datei Descriptors.h.

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

Definiert in Zeile 90 der Datei Descriptors.h.

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

Definiert in Zeile 105 der Datei Descriptors.h.

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

Definiert in Zeile 115 der Datei Descriptors.h.

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

Definiert in Zeile 110 der Datei Descriptors.h.

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

Definiert in Zeile 100 der Datei Descriptors.h.

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

Definiert in Zeile 75 der Datei Descriptors.h.

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

Definiert in Zeile 80 der Datei Descriptors.h.

#define CDC_FUNCTIONAL_DESCRIPTOR (   DataSize)
Wert:
struct \
{ \
USB_Descriptor_Header_t Header; \
uint8_t SubType; \
uint8_t Data[DataSize]; \
}

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.

Parameter
[in]DataSizeSize in bytes of the CDC functional descriptor's data payload.

Definiert in Zeile 127 der Datei Descriptors.h.

#define CDC_NOTIFICATION_EPADDR   (ENDPOINT_DIR_IN | 2)

Endpoint address of the CDC device-to-host notification IN endpoint.

Definiert in Zeile 55 der Datei Descriptors.h.

#define CDC_NOTIFICATION_EPSIZE   8

Size in bytes of the CDC device-to-host notification IN endpoint.

Definiert in Zeile 64 der Datei Descriptors.h.

#define CDC_RX_EPADDR   (ENDPOINT_DIR_OUT | 4)

Endpoint address of the CDC host-to-device data OUT endpoint.

Definiert in Zeile 61 der Datei Descriptors.h.

#define CDC_TX_EPADDR   (ENDPOINT_DIR_IN | 3)

Endpoint address of the CDC device-to-host data IN endpoint.

Definiert in Zeile 58 der Datei Descriptors.h.

#define CDC_TXRX_EPSIZE   64

Size in bytes of the CDC data IN and OUT endpoints.

Definiert in Zeile 67 der Datei Descriptors.h.

Dokumentation der Aufzählungstypen

Enum for the CDC class specific notification requests that can be issued by a CDC device to a host.

Aufzählungswerte
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.

Definiert in Zeile 184 der Datei Descriptors.h.

Enum for the CDC class specific control requests that can be issued by the USB bus host.

Aufzählungswerte
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.

Definiert in Zeile 173 der Datei Descriptors.h.

Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the CDC device class.

Aufzählungswerte
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.

Definiert in Zeile 141 der Datei Descriptors.h.

Enum for the CDC class specific interface descriptor subtypes.

Aufzählungswerte
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.

Definiert in Zeile 194 der Datei Descriptors.h.

Enum for the possible line encoding formats of a virtual serial port.

Aufzählungswerte
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.

Definiert in Zeile 216 der Datei Descriptors.h.

Enum for the possible line encoding parity settings of a virtual serial port.

Aufzählungswerte
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.

Definiert in Zeile 224 der Datei Descriptors.h.

Dokumentation der Funktionen

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

This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" documentation) by the application code so that the address and size of a requested descriptor can be given to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the USB host.

Definiert in Zeile 182 der Datei Descriptors.c.