Hanna
Sourcecode Kontrollplatine |
Bibliothek zur USB-Kommunikation von Jürgen W. Mehr ...
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stddef.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
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 | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | ATTR_PACKED |
struct | USB_Request_Header |
Makrodefinitionen | |
#define | ARCH_HAS_EEPROM_ADDRESS_SPACE |
#define | ARCH_HAS_FLASH_ADDRESS_SPACE |
#define | ARCH_HAS_MULTI_ADDRESS_SPACE |
#define | ARCH_LITTLE_ENDIAN |
#define | ATTR_ALIAS(Func) __attribute__ ((alias( #Func ))) |
#define | ATTR_ALWAYS_INLINE __attribute__ ((always_inline)) |
#define | ATTR_CONST __attribute__ ((const)) |
#define | ATTR_DEPRECATED __attribute__ ((deprecated)) |
#define | ATTR_INIT_SECTION(SectionIndex) __attribute__ ((naked, section (".init" #SectionIndex ))) |
#define | ATTR_NAKED __attribute__ ((naked)) |
#define | ATTR_NO_INIT __attribute__ ((section (".noinit"))) |
#define | ATTR_NO_INLINE __attribute__ ((noinline)) |
#define | ATTR_NO_RETURN __attribute__ ((noreturn)) |
#define | ATTR_NON_NULL_PTR_ARG(...) __attribute__ ((nonnull (__VA_ARGS__))) |
#define | ATTR_PACKED __attribute__ ((packed)) |
#define | ATTR_PURE __attribute__ ((pure)) |
#define | ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) |
#define | ATTR_WEAK __attribute__ ((weak)) |
#define | CONTROL_REQTYPE_DIRECTION 0x80 |
#define | CONTROL_REQTYPE_RECIPIENT 0x1F |
#define | CONTROL_REQTYPE_TYPE 0x60 |
#define | CPU_TO_LE16(x) x |
#define | ENDPOINT_ATTR_ADAPTIVE (2 << 2) |
#define | ENDPOINT_ATTR_ASYNC (1 << 2) |
#define | ENDPOINT_ATTR_NO_SYNC (0 << 2) |
#define | ENDPOINT_ATTR_SYNC (3 << 2) |
#define | ENDPOINT_DESCRIPTOR_DIR_IN ENDPOINT_DIR_IN |
#define | ENDPOINT_DESCRIPTOR_DIR_OUT ENDPOINT_DIR_OUT |
#define | ENDPOINT_DIR_IN 0x80 |
#define | ENDPOINT_DIR_MASK 0x80 |
#define | ENDPOINT_DIR_OUT 0x00 |
#define | ENDPOINT_USAGE_DATA (0 << 4) |
#define | ENDPOINT_USAGE_FEEDBACK (1 << 4) |
#define | ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4) |
#define | EP_TYPE_BULK 0x02 |
#define | EP_TYPE_CONTROL 0x00 |
#define | EP_TYPE_INTERRUPT 0x03 |
#define | EP_TYPE_ISOCHRONOUS 0x01 |
#define | FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1) |
#define | FEATURE_SELFPOWERED_ENABLED (1 << 0) |
#define | GCC_FORCE_ALIGN_2 |
#define | GCC_FORCE_POINTER_ACCESS(StructPtr) |
#define | GCC_IS_COMPILE_CONST(x) 0 |
#define | GCC_MEMORY_BARRIER() |
#define | INTERNAL_SERIAL_LENGTH_BITS (8 * (1 + (offsetof(NVM_PROD_SIGNATURES_t, COORDY1) - offsetof(NVM_PROD_SIGNATURES_t, LOTNUM0)))) |
#define | INTERNAL_SERIAL_START_ADDRESS offsetof(NVM_PROD_SIGNATURES_t, LOTNUM0) |
#define | LACR16(addr, msk) __lac((unsigned char)msk,(unsigned char*)addr) |
From Atmel: Macros for XMEGA instructions not yet supported by the toolchain. | |
#define | LANGUAGE_ID_ENG 0x0409 |
#define | LASR16(addr, msk) __las((unsigned char)msk,(unsigned char*)addr) |
#define | LATR16(addr, msk) __lat(msk,addr) |
#define | likely(x) x |
#define | MACROE while (0) |
#define | MACROS do |
#define | MAX(x, y) (((x) > (y)) ? (x) : (y)) |
#define | MIN(x, y) (((x) < (y)) ? (x) : (y)) |
#define | NO_DESCRIPTOR 0 |
#define | REQDIR_DEVICETOHOST (1 << 7) |
#define | REQDIR_HOSTTODEVICE (0 << 7) |
#define | REQREC_DEVICE (0 << 0) |
#define | REQREC_ENDPOINT (2 << 0) |
#define | REQREC_INTERFACE (1 << 0) |
#define | REQREC_OTHER (3 << 0) |
#define | REQTYPE_CLASS (1 << 5) |
#define | REQTYPE_STANDARD (0 << 5) |
#define | REQTYPE_VENDOR (2 << 5) |
#define | STRINGIFY(x) #x |
#define | STRINGIFY_EXPANDED(x) STRINGIFY(x) |
#define | unlikely(x) x |
#define | USB_CONFIG_ATTR_BUSPOWERED 0x80 |
#define | USB_CONFIG_ATTR_REMOTEWAKEUP 0x20 |
#define | USB_CONFIG_ATTR_SELFPOWERED 0x40 |
#define | USB_CONFIG_POWER_MA(mA) ((mA) >> 1) |
#define | USB_DEF_EP0_SIZE 64 |
#define | USB_DEF_EP_MAX 16 |
#define | USB_DEF_EP_NUM 3 |
#define | USB_DEF_PID 0x2404 |
#define | USB_DEF_VID 0x03EB |
#define | USB_STRING_LEN(UnicodeChars) (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1)) |
#define | USE_INTERNAL_SERIAL 0xDC |
#define | VERSION_BCD(x) CPU_TO_LE16((((VERSION_TENS(x) << 4) | VERSION_ONES(x)) << 8) | ((VERSION_TENTHS(x) << 4) | VERSION_HUNDREDTHS(x))) |
#define | VERSION_HUNDREDTHS(x) (int)((((x) - (int)(x)) * 100) - (10 * VERSION_TENTHS(x))) |
#define | VERSION_ONES(x) (int)((x) - (10 * VERSION_TENS(x))) |
#define | VERSION_TENS(x) (int)((x) / 10) |
#define | VERSION_TENTHS(x) (int)(((x) - (int)(x)) * 10) |
#define | XCHR16(addr, msk) __xch(msk,addr) |
Typdefinitionen | |
typedef uint8_t | uint_reg_t |
typedef struct USB_Request_Header | USB_Request_Header_t |
typedef struct USB_Request_Header | USB_Requst_Header_t |
Funktionen | |
void | EVENT_USB_Device_ConfigurationChanged (uint8_t config) |
void | EVENT_USB_Device_ControlOUT (uint8_t *data, uint8_t len) |
bool | EVENT_USB_Device_ControlRequest (struct USB_Request_Header *req) |
void | EVENT_USB_Device_Reset (void) |
bool | EVENT_USB_Device_SetInterface (uint8_t interface, uint8_t altsetting) |
void | EVENT_USB_Device_StartOfFrame (void) |
void | EVENT_USB_Device_Suspend (void) |
void | EVENT_USB_Device_WakeUp (void) |
Bibliothek zur USB-Kommunikation von Jürgen W.
$Revision: 464 $ $Date: 2016-04-02 12:30:30 +0200 (Sa, 02 Apr 2016) $
Definiert in Datei usb_defaults.h.
Aufzählungswerte | |
---|---|
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. |
Definiert in Zeile 604 der Datei usb_defaults.h.
Enum for possible Class, Subclass and Protocol values of device and interface descriptors.
Definiert in Zeile 253 der Datei usb_defaults.h.
Enum for the possible standard descriptor types, as given in each descriptor's header.
Definiert in Zeile 237 der Datei usb_defaults.h.
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.
Definiert in Zeile 659 der Datei usb_defaults.h.
void EVENT_USB_Device_ConfigurationChanged | ( | uint8_t | config | ) |
void EVENT_USB_Device_ControlOUT | ( | uint8_t * | data, |
uint8_t | len | ||
) |
bool EVENT_USB_Device_ControlRequest | ( | USB_Request_Header_t * | req | ) |
Event handlers. These functions are called from ISRs or are otherwise time-critical, so handle them quickly.Callback to handle a control request that was not handled by the library. Return true if the request has been handled. Returning false will send a STALL to the host.
Event handler for the library USB Control Request reception event.
void EVENT_USB_Device_Reset | ( | void | ) |
bool EVENT_USB_Device_SetInterface | ( | uint8_t | interface, |
uint8_t | altsetting | ||
) |
void EVENT_USB_Device_StartOfFrame | ( | void | ) |
Event called on start of frame, if enabled
void EVENT_USB_Device_Suspend | ( | void | ) |