forked from mirror/qmk_firmware
Run wspurify script on /trunk/ and /branches/ C source files, to remove any trailing whitespace at the end of each line.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
header, copy this into your project's root directory and supply
|
||||
the \c USE_LUFA_CONFIG_HEADER token to the compiler so that it is
|
||||
defined in all compiled source files.
|
||||
|
||||
|
||||
For information on what each token does, refer to the LUFA
|
||||
manual section "Summary of Compile Tokens".
|
||||
*/
|
||||
@@ -85,7 +85,7 @@
|
||||
// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here}
|
||||
|
||||
#elif (ARCH == ARCH_XMEGA)
|
||||
|
||||
|
||||
/* Non-USB Related Configuration Tokens: */
|
||||
// #define DISABLE_TERMINAL_CODES
|
||||
|
||||
@@ -151,6 +151,6 @@
|
||||
// #define USB_HOST_TIMEOUT_MS {Insert Value Here}
|
||||
// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#if !defined(__INCLUDE_FROM_COMMON_H)
|
||||
#error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
|
||||
#endif
|
||||
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
@@ -82,7 +82,7 @@
|
||||
"M" (_SFR_IO_ADDR(MCUCR)) \
|
||||
: "r0"); \
|
||||
}MACROE
|
||||
|
||||
|
||||
/** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always
|
||||
* be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimizer
|
||||
* removes/reorders code to the point where break points cannot reliably be set.
|
||||
@@ -136,7 +136,7 @@
|
||||
#define pgm_read_ptr(Address) (void*)pgm_read_word(Address)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
|
||||
/** Selects the Atmel 32-bit UC3 AVR (AT32UC3* chips) architecture. */
|
||||
#define ARCH_UC3 1
|
||||
|
||||
|
||||
/** Selects the Atmel XMEGA AVR (ATXMEGA*U chips) architecture. */
|
||||
#define ARCH_XMEGA 2
|
||||
|
||||
|
||||
#if !defined(__DOXYGEN__)
|
||||
#define ARCH_ ARCH_AVR8
|
||||
|
||||
|
||||
@@ -133,14 +133,14 @@
|
||||
* \param[in] Func Name of the function which the given function name should alias.
|
||||
*/
|
||||
#define ATTR_ALIAS(Func) __attribute__ ((alias( #Func )))
|
||||
|
||||
|
||||
/** Marks a variable or struct element for packing into the smallest space available, omitting any
|
||||
* alignment bytes usually added between fields to optimize field accesses.
|
||||
*/
|
||||
#define ATTR_PACKED __attribute__ ((packed))
|
||||
|
||||
/** Indicates the minimum alignment in bytes for a variable or struct element.
|
||||
*
|
||||
*
|
||||
* \param[in] Bytes Minimum number of bytes the item should be aligned to.
|
||||
*/
|
||||
#define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
|
||||
|
||||
@@ -140,13 +140,13 @@
|
||||
|
||||
/** Selects the Kernel Concepts USBFOO specific board drivers, including the Button and LEDs drivers. */
|
||||
#define BOARD_USBFOO 25
|
||||
|
||||
|
||||
/** Selects the Sparkfun ATMEGA8U2 specific board drivers, including the driver for the board LEDs. */
|
||||
#define BOARD_SPARKFUN8U2 26
|
||||
|
||||
/** Selects the Atmel EVK1101 specific board drivers, including the Button, Joystick and LED drivers. */
|
||||
#define BOARD_EVK1101 27
|
||||
|
||||
|
||||
/** Selects the Busware TUL specific board drivers, including the Button and LED drivers. */
|
||||
#define BOARD_TUL 28
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
/** Selects the Atmel EVK1104 specific board drivers, including the Button and LED drivers. */
|
||||
#define BOARD_EVK1104 30
|
||||
|
||||
|
||||
/** Selects the Atmel XMEGA A3BU Xplained specific board drivers, including Dataflash, Button and LED drivers. */
|
||||
#define BOARD_A3BU_XPLAINED 31
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** \defgroup Group_GlobalInt Global Interrupt Macros
|
||||
* \brief Convenience macros for the management of interrupts globally within the device.
|
||||
*
|
||||
@@ -54,13 +54,13 @@
|
||||
|
||||
/* Macros: */
|
||||
#define __INCLUDE_FROM_COMMON_H
|
||||
|
||||
|
||||
/* Includes: */
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#if defined(USE_LUFA_CONFIG_HEADER)
|
||||
#include "LUFAConfig.h"
|
||||
#endif
|
||||
@@ -70,7 +70,7 @@
|
||||
#include "ArchitectureSpecific.h"
|
||||
#include "CompilerSpecific.h"
|
||||
#include "Attributes.h"
|
||||
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
@@ -90,9 +90,9 @@
|
||||
#include <avr/eeprom.h>
|
||||
#include <avr/boot.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
|
||||
typedef uint8_t uint_reg_t;
|
||||
|
||||
|
||||
#define ARCH_HAS_EEPROM_ADDRESS_SPACE
|
||||
#define ARCH_HAS_FLASH_ADDRESS_SPACE
|
||||
#define ARCH_HAS_MULTI_ADDRESS_SPACE
|
||||
@@ -110,7 +110,7 @@
|
||||
// =================================================
|
||||
|
||||
typedef uint32_t uint_reg_t;
|
||||
|
||||
|
||||
#define ARCH_BIG_ENDIAN
|
||||
|
||||
#include "Endianness.h"
|
||||
@@ -120,15 +120,15 @@
|
||||
#include <avr/pgmspace.h>
|
||||
#include <avr/eeprom.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
|
||||
typedef uint8_t uint_reg_t;
|
||||
|
||||
|
||||
#define ARCH_HAS_EEPROM_ADDRESS_SPACE
|
||||
#define ARCH_HAS_FLASH_ADDRESS_SPACE
|
||||
#define ARCH_HAS_MULTI_ADDRESS_SPACE
|
||||
#define ARCH_LITTLE_ENDIAN
|
||||
|
||||
#include "Endianness.h"
|
||||
#include "Endianness.h"
|
||||
#else
|
||||
#error Unknown device architecture specified.
|
||||
#endif
|
||||
@@ -176,7 +176,7 @@
|
||||
#if !defined(MIN) || defined(__DOXYGEN__)
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(STRINGIFY) || defined(__DOXYGEN__)
|
||||
/** 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.
|
||||
@@ -256,7 +256,7 @@
|
||||
while (Milliseconds--)
|
||||
{
|
||||
__builtin_mtsr(AVR32_COUNT, 0);
|
||||
while (__builtin_mfsr(AVR32_COUNT) < (F_CPU / 1000));
|
||||
while (__builtin_mfsr(AVR32_COUNT) < (F_CPU / 1000));
|
||||
}
|
||||
#elif (ARCH == ARCH_XMEGA)
|
||||
if (GCC_IS_COMPILE_CONST(Milliseconds))
|
||||
@@ -267,7 +267,7 @@
|
||||
{
|
||||
while (Milliseconds--)
|
||||
_delay_ms(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -316,12 +316,12 @@
|
||||
else
|
||||
__builtin_csrf(AVR32_SR_GM_OFFSET);
|
||||
#elif (ARCH == ARCH_XMEGA)
|
||||
SREG = GlobalIntState;
|
||||
SREG = GlobalIntState;
|
||||
#endif
|
||||
|
||||
|
||||
GCC_MEMORY_BARRIER();
|
||||
}
|
||||
|
||||
|
||||
/** Enables global interrupt handling for the device, allowing interrupts to be handled.
|
||||
*
|
||||
* \ingroup Group_GlobalInt
|
||||
@@ -340,7 +340,7 @@
|
||||
#endif
|
||||
|
||||
GCC_MEMORY_BARRIER();
|
||||
}
|
||||
}
|
||||
|
||||
/** Disabled global interrupt handling for the device, preventing interrupts from being handled.
|
||||
*
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
@@ -77,7 +77,7 @@
|
||||
* assembly output in an unexpected manner on sections of code that are ordering-specific.
|
||||
*/
|
||||
#define GCC_MEMORY_BARRIER() __asm__ __volatile__("" ::: "memory");
|
||||
|
||||
|
||||
/** Evaluates to boolean true if the specified value can be determined at compile time to be a constant value
|
||||
* when compiling under GCC.
|
||||
*
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#if !defined(__INCLUDE_FROM_COMMON_H)
|
||||
#error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality.
|
||||
#endif
|
||||
|
||||
|
||||
#if !(defined(ARCH_BIG_ENDIAN) || defined(ARCH_LITTLE_ENDIAN))
|
||||
#error ARCH_BIG_ENDIAN or ARCH_LITTLE_ENDIAN not set for the specified architecture.
|
||||
#endif
|
||||
@@ -115,11 +115,11 @@
|
||||
#define CPU_TO_LE16(x) SWAPENDIAN_16(x)
|
||||
#define CPU_TO_LE32(x) SWAPENDIAN_32(x)
|
||||
#define CPU_TO_BE16(x) (x)
|
||||
#define CPU_TO_BE32(x) (x)
|
||||
#define CPU_TO_BE32(x) (x)
|
||||
#elif !defined(le16_to_cpu)
|
||||
/** \name Run-time endianness conversion */
|
||||
//@{
|
||||
|
||||
|
||||
/** Performs a conversion between a Little Endian encoded 16-bit piece of data and the
|
||||
* Endianness of the currently selected CPU architecture.
|
||||
*
|
||||
@@ -398,7 +398,7 @@
|
||||
{
|
||||
if (GCC_IS_COMPILE_CONST(Word))
|
||||
return SWAPENDIAN_16(Word);
|
||||
|
||||
|
||||
uint8_t Temp;
|
||||
|
||||
union
|
||||
@@ -486,3 +486,4 @@
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -124,3 +124,4 @@
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
/* Macros: */
|
||||
#define JOY_FMASK ((1 << 4) | (1 << 5) | (1 << 6) | (1 << 7))
|
||||
#define JOY_CMASK (1 << 6)
|
||||
|
||||
|
||||
#define JOY_PORTC_MASK_SHIFT 3
|
||||
#endif
|
||||
|
||||
|
||||
@@ -127,3 +127,4 @@
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
@@ -9,13 +9,13 @@
|
||||
/*
|
||||
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
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
|
||||
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 disclaim all warranties with regard to this
|
||||
@@ -82,7 +82,7 @@
|
||||
DDRB |= LEDS_ALL_LEDS;
|
||||
PORTB &= ~LEDS_ALL_LEDS;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
PORTB |= LEDMask;
|
||||
@@ -97,18 +97,18 @@
|
||||
{
|
||||
PORTB = ((PORTB & ~LEDS_ALL_LEDS) | LEDMask);
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
|
||||
const uint8_t ActiveMask)
|
||||
{
|
||||
PORTB = ((PORTB & ~LEDMask) | ActiveMask);
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
PORTB ^= LEDMask;
|
||||
}
|
||||
|
||||
|
||||
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint8_t LEDs_GetLEDs(void)
|
||||
{
|
||||
@@ -120,7 +120,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
@@ -9,13 +9,13 @@
|
||||
/*
|
||||
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
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
|
||||
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 disclaim all warranties with regard to this
|
||||
@@ -35,7 +35,7 @@
|
||||
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
|
||||
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
|
||||
*/
|
||||
|
||||
|
||||
/** \ingroup Group_Buttons
|
||||
* \defgroup Group_Buttons_MINIMUS MINIMUS
|
||||
* \brief Board specific Buttons driver header for the MINIMUS.
|
||||
@@ -60,12 +60,12 @@
|
||||
#if !defined(__INCLUDE_FROM_BUTTONS_H)
|
||||
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/** Button mask for the first button on the board. */
|
||||
#define BUTTONS_BUTTON1 (1 << 7)
|
||||
|
||||
|
||||
/* Inline Functions: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
static inline void Buttons_Init(void)
|
||||
@@ -85,7 +85,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
@@ -9,13 +9,13 @@
|
||||
/*
|
||||
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
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
|
||||
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 disclaim all warranties with regard to this
|
||||
@@ -82,7 +82,7 @@
|
||||
DDRD |= LEDS_ALL_LEDS;
|
||||
PORTD |= LEDS_ALL_LEDS;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
PORTD &= ~LEDMask;
|
||||
@@ -97,18 +97,18 @@
|
||||
{
|
||||
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
|
||||
const uint8_t ActiveMask)
|
||||
{
|
||||
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
PORTD ^= LEDMask;
|
||||
}
|
||||
|
||||
|
||||
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint8_t LEDs_GetLEDs(void)
|
||||
{
|
||||
@@ -120,7 +120,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
/* Macros: */
|
||||
#define JOY_BMASK ((1 << 5) | (1 << 6) | (1 << 7))
|
||||
#define JOY_EMASK ((1 << 4) | (1 << 5))
|
||||
|
||||
|
||||
#define JOY_PORTE_MASK_SHIFT 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* \note This file should not be included directly. It is automatically included as needed by the LEDs driver
|
||||
* dispatch header located in LUFA/Drivers/Board/LEDs.h.
|
||||
*/
|
||||
|
||||
|
||||
/** \ingroup Group_LEDs
|
||||
* \defgroup Group_LEDs_TEENSY2 TEENSY2
|
||||
* \brief Board specific LED driver header for the PJRC Teensy 2 boards.
|
||||
@@ -88,7 +88,7 @@
|
||||
DDRD |= LEDS_ALL_LEDS;
|
||||
|
||||
#if (BOARD == BOARD_TEENSY2)
|
||||
PORTD &= ~LEDS_ALL_LEDS;
|
||||
PORTD &= ~LEDS_ALL_LEDS;
|
||||
#else
|
||||
PORTD |= LEDS_ALL_LEDS;
|
||||
#endif
|
||||
@@ -97,7 +97,7 @@
|
||||
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
#if (BOARD == BOARD_TEENSY2)
|
||||
PORTD |= LEDMask;
|
||||
PORTD |= LEDMask;
|
||||
#else
|
||||
PORTD &= ~LEDMask;
|
||||
#endif
|
||||
@@ -106,7 +106,7 @@
|
||||
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
#if (BOARD == BOARD_TEENSY2)
|
||||
PORTD &= ~LEDMask;
|
||||
PORTD &= ~LEDMask;
|
||||
#else
|
||||
PORTD |= LEDMask;
|
||||
#endif
|
||||
@@ -125,7 +125,7 @@
|
||||
const uint8_t ActiveMask)
|
||||
{
|
||||
#if (BOARD == BOARD_TEENSY2)
|
||||
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
|
||||
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
|
||||
#else
|
||||
PORTD = ((PORTD | LEDMask) & ~ActiveMask);
|
||||
#endif
|
||||
@@ -140,7 +140,7 @@
|
||||
static inline uint8_t LEDs_GetLEDs(void)
|
||||
{
|
||||
#if (BOARD == BOARD_TEENSY2)
|
||||
return (PORTD & LEDS_ALL_LEDS);
|
||||
return (PORTD & LEDS_ALL_LEDS);
|
||||
#else
|
||||
return (~PORTD & LEDS_ALL_LEDS);
|
||||
#endif
|
||||
|
||||
@@ -99,3 +99,4 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -170,3 +170,4 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
/* Macros: */
|
||||
#define JOY_BMASK ((1 << 5) | (1 << 6) | (1 << 7))
|
||||
#define JOY_EMASK ((1 << 4) | (1 << 5))
|
||||
|
||||
|
||||
#define JOY_PORTE_MASK_SHIFT 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -130,3 +130,4 @@
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* \note This file should not be included directly. It is automatically included as needed by the dataflash driver
|
||||
* dispatch header located in LUFA/Drivers/Board/Dataflash.h.
|
||||
*/
|
||||
|
||||
|
||||
/** \ingroup Group_Dataflash
|
||||
* \defgroup Group_Dataflash_XPLAIN_REV1 XPLAIN_REV1
|
||||
* \brief Board specific Dataflash driver header for the original Atmel XPLAIN, revision 1.
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* \note This file should not be included directly. It is automatically included as needed by the LEDs driver
|
||||
* dispatch header located in LUFA/Drivers/Board/LEDs.h.
|
||||
*/
|
||||
|
||||
|
||||
/** \ingroup Group_LEDs
|
||||
* \defgroup Group_LEDs_XPLAIN_REV1 XPLAIN_REV1
|
||||
* \brief Board specific LED driver header for the original Atmel XPLAIN, revision 1.
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
* // Display which button was pressed (assuming two board buttons)
|
||||
* printf("Button pressed: %s\r\n", (ButtonPress == BUTTONS_BUTTON1) ? "Button 1" : "Button 2");
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
#elif (BOARD == BOARD_EVK527)
|
||||
#include "AVR8/EVK527/Dataflash.h"
|
||||
#elif (BOARD == BOARD_A3BU_XPLAINED)
|
||||
#include "XMEGA/A3BU_XPLAINED/Dataflash.h"
|
||||
#include "XMEGA/A3BU_XPLAINED/Dataflash.h"
|
||||
#else
|
||||
#include "Board/Dataflash.h"
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
*
|
||||
* // Display which direction the joystick was moved in
|
||||
* printf("Joystick moved:\r\n");
|
||||
*
|
||||
*
|
||||
* if (JoystickMovement & (JOY_UP | JOY_DOWN))
|
||||
* printf("%s ", (JoystickMovement & JOY_UP) ? "Up" : "Down");
|
||||
*
|
||||
|
||||
@@ -78,13 +78,13 @@
|
||||
* LEDs_Init();
|
||||
*
|
||||
* // Turn on each of the four LEDs in turn
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* Delay_MS(500);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* Delay_MS(500);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* Delay_MS(500);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* LEDs_SetAllLEDs(LEDS_LED1);
|
||||
* Delay_MS(500);
|
||||
*
|
||||
* // Turn on all LEDs
|
||||
@@ -166,7 +166,7 @@
|
||||
#elif (BOARD == BOARD_EVK1101)
|
||||
#include "UC3/EVK1101/LEDs.h"
|
||||
#elif (BOARD == BOARD_TUL)
|
||||
#include "AVR8/TUL/LEDs.h"
|
||||
#include "AVR8/TUL/LEDs.h"
|
||||
#elif (BOARD == BOARD_EVK1100)
|
||||
#include "UC3/EVK1100/LEDs.h"
|
||||
#elif (BOARD == BOARD_EVK1104)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
* // Display converted temperature in degrees Celsius
|
||||
* printf("Current Temperature: %d Degrees\r\n", Temperature_GetTemperature());
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
/** ADC channel MUX mask for the temperature sensor. */
|
||||
#define TEMP_ADC_CHANNEL_MASK ADC_CHANNEL0
|
||||
|
||||
|
||||
/** Size of the temperature sensor lookup table, in lookup values */
|
||||
#define TEMP_TABLE_SIZE 120
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BUTTONS_EVK1100_H__
|
||||
#define __BUTTONS_EVK1100_H__
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#if !defined(__INCLUDE_FROM_BUTTONS_H)
|
||||
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
@@ -97,7 +97,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __JOYSTICK_EVK1100_H__
|
||||
#define __JOYSTICK_EVK1100_H__
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
#define JOY_PORT 0
|
||||
#define JOY_MASK ((1UL << 28) | (1UL << 27) | (1UL << 26) | (1UL << 25) | (1UL << 20))
|
||||
#endif
|
||||
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/** Mask for the joystick being pushed in the left direction. */
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
/** Mask for the joystick being pushed inward. */
|
||||
#define JOY_PRESS (1UL << 20)
|
||||
|
||||
|
||||
/* Inline Functions: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
static inline void Joystick_Init(void)
|
||||
@@ -92,7 +92,7 @@
|
||||
AVR32_GPIO.port[JOY_PORT].gpers = JOY_MASK;
|
||||
AVR32_GPIO.port[JOY_PORT].gpers = JOY_MASK;
|
||||
};
|
||||
|
||||
|
||||
static inline uint32_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint32_t Joystick_GetStatus(void)
|
||||
{
|
||||
@@ -108,3 +108,4 @@
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
/** LED mask for the eighth LED on the board. */
|
||||
#define LEDS_LED8 (1UL << 30)
|
||||
|
||||
|
||||
/** LED mask for all the LEDs on the board. */
|
||||
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4 \
|
||||
LEDS_LED5 | LEDS_LED6 | LEDS_LED7 | LEDS_LED8)
|
||||
@@ -108,7 +108,7 @@
|
||||
AVR32_GPIO.port[LEDS_PORT].oders = LEDS_ALL_LEDS;
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask)
|
||||
{
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask;
|
||||
@@ -124,7 +124,7 @@
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS;
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ChangeLEDs(const uint32_t LEDMask, const uint32_t ActiveMask)
|
||||
{
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDMask;
|
||||
@@ -135,7 +135,7 @@
|
||||
{
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrt = LEDMask;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint32_t LEDs_GetLEDs(void)
|
||||
{
|
||||
@@ -147,7 +147,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BUTTONS_EVK1101_H__
|
||||
#define __BUTTONS_EVK1101_H__
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#if !defined(__INCLUDE_FROM_BUTTONS_H)
|
||||
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
@@ -94,7 +94,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __JOYSTICK_EVK1101_H__
|
||||
#define __JOYSTICK_EVK1101_H__
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#define JOY_PRESS_PORT 0
|
||||
#define JOY_PRESS_MASK (1UL << 13)
|
||||
#endif
|
||||
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/** Mask for the joystick being pushed in the left direction. */
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
/** Mask for the joystick being pushed inward. */
|
||||
#define JOY_PRESS (1UL << 13)
|
||||
|
||||
|
||||
/* Inline Functions: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
static inline void Joystick_Init(void)
|
||||
@@ -97,7 +97,7 @@
|
||||
AVR32_GPIO.port[JOY_MOVE_PORT].puers = JOY_MOVE_MASK;
|
||||
AVR32_GPIO.port[JOY_PRESS_PORT].puers = JOY_PRESS_MASK;
|
||||
};
|
||||
|
||||
|
||||
static inline uint32_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint32_t Joystick_GetStatus(void)
|
||||
{
|
||||
@@ -114,3 +114,4 @@
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -95,7 +95,7 @@
|
||||
AVR32_GPIO.port[LEDS_PORT].oders = LEDS_ALL_LEDS;
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask)
|
||||
{
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask;
|
||||
@@ -111,7 +111,7 @@
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS;
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ChangeLEDs(const uint32_t LEDMask, const uint32_t ActiveMask)
|
||||
{
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrs = LEDMask;
|
||||
@@ -122,7 +122,7 @@
|
||||
{
|
||||
AVR32_GPIO.port[LEDS_PORT].ovrt = LEDMask;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint32_t LEDs_GetLEDs(void)
|
||||
{
|
||||
@@ -134,7 +134,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BUTTONS_EVK1104_H__
|
||||
#define __BUTTONS_EVK1104_H__
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#if !defined(__INCLUDE_FROM_BUTTONS_H)
|
||||
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
@@ -91,7 +91,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -100,7 +100,7 @@
|
||||
AVR32_GPIO.port[3].oders = LEDS_LEDMASK3;
|
||||
AVR32_GPIO.port[3].ovrs = LEDS_LEDMASK3;
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask)
|
||||
{
|
||||
AVR32_GPIO.port[2].ovrc = (LEDMask & LEDS_LEDMASK2);
|
||||
@@ -121,7 +121,7 @@
|
||||
AVR32_GPIO.port[3].ovrs = LEDS_LEDMASK3;
|
||||
AVR32_GPIO.port[3].ovrc = (LEDMask & LEDS_LEDMASK3);
|
||||
}
|
||||
|
||||
|
||||
static inline void LEDs_ChangeLEDs(const uint32_t LEDMask, const uint32_t ActiveMask)
|
||||
{
|
||||
AVR32_GPIO.port[2].ovrs = (LEDMask & LEDS_LEDMASK2);
|
||||
@@ -136,7 +136,7 @@
|
||||
AVR32_GPIO.port[2].ovrt = (LEDMask & LEDS_LEDMASK2);
|
||||
AVR32_GPIO.port[3].ovrt = (LEDMask & LEDS_LEDMASK3);
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint32_t LEDs_GetLEDs(void)
|
||||
{
|
||||
@@ -148,7 +148,8 @@
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BUTTONS_A3BU_XPLAINED_H__
|
||||
#define __BUTTONS_A3BU_XPLAINED_H__
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
{
|
||||
PORTE_OUTCLR = BUTTONS_BUTTON1;
|
||||
PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
|
||||
|
||||
|
||||
PORTE_PIN5CTRL = PORT_OPC_PULLUP_gc;
|
||||
PORTF_PIN1CTRL = PORT_OPC_PULLUP_gc;
|
||||
PORTF_PIN2CTRL = PORT_OPC_PULLUP_gc;
|
||||
@@ -100,4 +100,3 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.fourwalledcubicle.com
|
||||
*/
|
||||
@@ -124,4 +124,3 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
* or deletions) must not overlap. If there is possibility of two or more of the same kind of
|
||||
* operating occurring at the same point in time, atomic (mutex) locking should be used.
|
||||
*/
|
||||
|
||||
|
||||
/** \ingroup Group_MiscDrivers
|
||||
* \defgroup Group_RingBuff Generic Byte Ring Buffer - LUFA/Drivers/Misc/RingBuffer.h
|
||||
* \brief Lightweight ring buffer, for fast insertion/deletion of bytes.
|
||||
@@ -134,7 +134,7 @@
|
||||
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
Buffer->In = DataPtr;
|
||||
Buffer->Out = DataPtr;
|
||||
Buffer->Start = &DataPtr[0];
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
Count = Buffer->Count;
|
||||
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
Buffer->Count++;
|
||||
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
@@ -264,7 +264,7 @@
|
||||
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)
|
||||
{
|
||||
GCC_FORCE_POINTER_ACCESS(Buffer);
|
||||
|
||||
|
||||
uint8_t Data = *Buffer->Out;
|
||||
|
||||
if (++Buffer->Out == Buffer->End)
|
||||
@@ -272,7 +272,7 @@
|
||||
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
Buffer->Count--;
|
||||
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
*/
|
||||
#define ESC_STRIKETHROUGH_OFF ANSI_ESCAPE_SEQUENCE("29m")
|
||||
//@}
|
||||
|
||||
|
||||
/** \name Text Colour Control Sequences */
|
||||
//@{
|
||||
/** Sets the foreground (text) colour to black. */
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
#define _ADC_GET_MUX_MASK2(y) ADC_CHANNEL ## y
|
||||
#define _ADC_GET_MUX_MASK(y) _ADC_GET_MUX_MASK2(y)
|
||||
#endif
|
||||
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/** \name ADC Reference Configuration Masks */
|
||||
@@ -118,7 +118,7 @@
|
||||
/** Reference mask, for using the internally generated 2.56V reference voltage as the ADC reference. */
|
||||
#define ADC_REFERENCE_INT2560MV ((1 << REFS1) | (1 << REFS0))
|
||||
//@}
|
||||
|
||||
|
||||
/** \name ADC Result Adjustment Configuration Masks */
|
||||
//@{
|
||||
/** Left-adjusts the 10-bit ADC result, so that the upper 8 bits of the value returned by the
|
||||
@@ -144,7 +144,7 @@
|
||||
*/
|
||||
#define ADC_SINGLE_CONVERSION (0 << ADATE)
|
||||
//@}
|
||||
|
||||
|
||||
/** \name ADC Prescaler Configuration Masks */
|
||||
//@{
|
||||
/** Sets the ADC input clock to prescale by a factor of 2 the AVR's system clock. */
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
* // Send a byte, and store the received byte from the same transaction
|
||||
* uint8_t ResponseByte = SPI_TransferByte(0xDC);
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
/** SPI data sample mode mask for \c SPI_Init(). Indicates that the data should be sampled on the trailing edge. */
|
||||
#define SPI_SAMPLE_TRAILING (1 << CPHA)
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SPI Data Ordering Configuration Masks */
|
||||
//@{
|
||||
/** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out MSB first. */
|
||||
@@ -148,7 +148,7 @@
|
||||
/** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out LSB first. */
|
||||
#define SPI_ORDER_LSB_FIRST (1 << DORD)
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SPI Mode Configuration Masks */
|
||||
//@{
|
||||
/** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into slave mode. */
|
||||
@@ -157,7 +157,7 @@
|
||||
/** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into master mode. */
|
||||
#define SPI_MODE_MASTER (1 << MSTR)
|
||||
//@}
|
||||
|
||||
|
||||
/* Inline Functions: */
|
||||
/** Initializes the SPI subsystem, ready for transfers. Must be called before calling any other
|
||||
* SPI routines.
|
||||
@@ -195,7 +195,7 @@
|
||||
SPCR = 0;
|
||||
SPSR = 0;
|
||||
}
|
||||
|
||||
|
||||
/** Retrieves the currently selected SPI mode, once the SPI interface has been configured.
|
||||
*
|
||||
* \return \ref SPI_MODE_MASTER if the interface is currently in SPI Master mode, \ref SPI_MODE_SLAVE otherwise
|
||||
|
||||
@@ -87,3 +87,4 @@ void Serial_SendData(const uint8_t* Buffer, uint16_t Length)
|
||||
while (Length--)
|
||||
Serial_SendByte(*(Buffer++));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/* Includes: */
|
||||
#include "../../../Common/Common.h"
|
||||
#include "../../Misc/TerminalCodes.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
@@ -87,7 +87,7 @@
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* External Variables: */
|
||||
extern FILE USARTSerialStream;
|
||||
|
||||
|
||||
/* Function Prototypes: */
|
||||
int Serial_putchar(char DataByte,
|
||||
FILE *Stream);
|
||||
@@ -127,7 +127,7 @@
|
||||
* \param[in] StringPtr Pointer to a string located in SRAM space.
|
||||
*/
|
||||
void Serial_SendString(const char* StringPtr) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
||||
/** Transmits a given buffer located in SRAM memory through the USART.
|
||||
*
|
||||
* \param[in] Buffer Pointer to a buffer containing the data to send.
|
||||
@@ -190,7 +190,7 @@
|
||||
stdin = Stream;
|
||||
stdout = Stream;
|
||||
}
|
||||
|
||||
|
||||
*Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW);
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
{
|
||||
if (!(Serial_IsCharReceived()))
|
||||
return -1;
|
||||
|
||||
|
||||
return UDR1;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,9 +119,9 @@ bool TWI_ReceiveByte(uint8_t* const Byte,
|
||||
TWCR = TWCRMask;
|
||||
while (!(TWCR & (1 << TWINT)));
|
||||
*Byte = TWDR;
|
||||
|
||||
|
||||
uint8_t Status = (TWSR & TW_STATUS_MASK);
|
||||
|
||||
|
||||
return ((LastByte) ? (Status == TW_MR_DATA_NACK) : (Status == TW_MR_DATA_ACK));
|
||||
}
|
||||
|
||||
@@ -133,19 +133,19 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress,
|
||||
uint8_t Length)
|
||||
{
|
||||
uint8_t ErrorCode;
|
||||
|
||||
|
||||
if ((ErrorCode = TWI_StartTransmission((SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_WRITE,
|
||||
TimeoutMS)) == TWI_ERROR_NoError)
|
||||
{
|
||||
while (InternalAddressLen--)
|
||||
{
|
||||
if (!(TWI_SendByte(*(InternalAddress++))))
|
||||
{
|
||||
{
|
||||
ErrorCode = TWI_ERROR_SlaveNAK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((ErrorCode = TWI_StartTransmission((SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_READ,
|
||||
TimeoutMS)) == TWI_ERROR_NoError)
|
||||
{
|
||||
@@ -157,11 +157,11 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TWI_StopTransmission();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ErrorCode;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress,
|
||||
while (InternalAddressLen--)
|
||||
{
|
||||
if (!(TWI_SendByte(*(InternalAddress++))))
|
||||
{
|
||||
{
|
||||
ErrorCode = TWI_ERROR_SlaveNAK;
|
||||
break;
|
||||
}
|
||||
@@ -194,9 +194,10 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TWI_StopTransmission();
|
||||
}
|
||||
|
||||
|
||||
return ErrorCode;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
* }
|
||||
* }
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
* <b>High Level API Example:</b>
|
||||
* \code
|
||||
* // Initialize the TWI driver before first use at 200KHz
|
||||
@@ -154,10 +154,10 @@
|
||||
* or \ref TWI_ADDRESS_WRITE to obtain the device's read and write address respectively.
|
||||
*/
|
||||
#define TWI_DEVICE_ADDRESS_MASK 0xFE
|
||||
|
||||
|
||||
/** Bit length prescaler for \ref TWI_Init(). This mask multiplies the TWI bit length prescaler by 1. */
|
||||
#define TWI_BIT_PRESCALE_1 ((0 << TWPS1) | (0 << TWPS0))
|
||||
|
||||
|
||||
/** Bit length prescaler for \ref TWI_Init(). This mask multiplies the TWI bit length prescaler by 4. */
|
||||
#define TWI_BIT_PRESCALE_4 ((0 << TWPS1) | (1 << TWPS0))
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
/** Bit length prescaler for \ref TWI_Init(). This mask multiplies the TWI bit length prescaler by 64. */
|
||||
#define TWI_BIT_PRESCALE_64 ((1 << TWPS1) | (1 << TWPS0))
|
||||
|
||||
|
||||
/** Calculates the length of each bit on the TWI bus for a given target frequency. This may be used with
|
||||
* the \ref TWI_Init() function to convert a bus frequency to a number of clocks for the \c BitLength
|
||||
* parameter.
|
||||
@@ -189,7 +189,7 @@
|
||||
TWI_ERROR_SlaveNotReady = 4, /**< Slave NAKed the TWI bus START condition. */
|
||||
TWI_ERROR_SlaveNAK = 5, /**< Slave NAKed whilst attempting to send data to the device. */
|
||||
};
|
||||
|
||||
|
||||
/* Inline Functions: */
|
||||
/** Initializes the TWI hardware into master mode, ready for data transmission and reception. This must be
|
||||
* before any other TWI operations.
|
||||
@@ -256,7 +256,7 @@
|
||||
const bool LastByte) ATTR_NON_NULL_PTR_ARG(1);
|
||||
bool TWI_ReceiveByte(uint8_t* const Byte,
|
||||
const bool LastByte);
|
||||
|
||||
|
||||
/** High level function to perform a complete packet transfer over the TWI bus to the specified
|
||||
* device.
|
||||
*
|
||||
|
||||
@@ -67,9 +67,10 @@
|
||||
#if (ARCH == ARCH_AVR8)
|
||||
#include "AVR8/SPI_AVR8.h"
|
||||
#elif (ARCH == ARCH_XMEGA)
|
||||
#include "XMEGA/SPI_XMEGA.h"
|
||||
#include "XMEGA/SPI_XMEGA.h"
|
||||
#else
|
||||
#error The SPI peripheral driver is not currently available for your selected architecture.
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -71,3 +71,4 @@
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
* // Send a byte, and store the received byte from the same transaction
|
||||
* uint8_t ResponseByte = SPI_TransferByte(&SPIC, 0xDC);
|
||||
* \endcode
|
||||
*
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
/** SPI data sample mode mask for \c SPI_Init(). Indicates that the data should be sampled on the trailing edge. */
|
||||
#define SPI_SAMPLE_TRAILING SPI_MODE0_bm
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SPI Data Ordering Configuration Masks */
|
||||
//@{
|
||||
/** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out MSB first. */
|
||||
@@ -145,7 +145,7 @@
|
||||
/** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out LSB first. */
|
||||
#define SPI_ORDER_LSB_FIRST SPI_DORD_bm
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SPI Mode Configuration Masks */
|
||||
//@{
|
||||
/** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into slave mode. */
|
||||
@@ -154,7 +154,7 @@
|
||||
/** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into master mode. */
|
||||
#define SPI_MODE_MASTER SPI_MASTER_bm
|
||||
//@}
|
||||
|
||||
|
||||
/* Inline Functions: */
|
||||
/** Initializes the SPI subsystem, ready for transfers. Must be called before calling any other
|
||||
* SPI routines.
|
||||
@@ -177,7 +177,7 @@
|
||||
{
|
||||
SPI->CTRL &= ~SPI_ENABLE_bm;
|
||||
}
|
||||
|
||||
|
||||
/** Retrieves the currently selected SPI mode, once the SPI interface has been configured.
|
||||
*
|
||||
* \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
|
||||
|
||||
@@ -73,3 +73,4 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -125,3 +125,4 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
* allows for pitch adjustments to be made via control requests directed at the endpoint.
|
||||
*/
|
||||
#define AUDIO_EP_PITCH_CONTROL (1 << 1)
|
||||
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio
|
||||
* device class.
|
||||
@@ -244,7 +244,7 @@
|
||||
* interface belongs to the Streaming Audio protocol.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/** Audio class specific interface description subtypes, for the Audio Control interface. */
|
||||
enum Audio_CSInterface_AC_SubTypes_t
|
||||
{
|
||||
@@ -287,7 +287,7 @@
|
||||
AUDIO_REQ_GetMemory = 0x85, /**< Audio class-specific request to get the memory value of a parameter within the device. */
|
||||
AUDIO_REQ_GetStatus = 0xFF, /**< Audio class-specific request to get the device status. */
|
||||
};
|
||||
|
||||
|
||||
/** Enum for Audio class specific Endpoint control modifiers which can be set and retrieved by a USB host, if the corresponding
|
||||
* endpoint control is indicated to be supported in the Endpoint's Audio-class specific endpoint descriptor.
|
||||
*/
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
|
||||
//@}
|
||||
|
||||
|
||||
/** 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
|
||||
@@ -161,7 +161,7 @@
|
||||
* belongs to no specific protocol of the CDC data class.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/** Enum for the CDC class specific control requests that can be issued by the USB bus host. */
|
||||
enum CDC_ClassRequests_t
|
||||
{
|
||||
@@ -355,7 +355,7 @@
|
||||
uint8_t bMasterInterface; /**< Interface number of the CDC Control interface. */
|
||||
uint8_t bSlaveInterface0; /**< Interface number of the CDC Data interface. */
|
||||
} ATTR_PACKED USB_CDC_StdDescriptor_FunctionalUnion_t;
|
||||
|
||||
|
||||
/** \brief 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
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
/** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */
|
||||
#define HID_KEYBOARD_MODIFIER_RIGHTGUI (1 << 7)
|
||||
//@}
|
||||
|
||||
|
||||
/** \name Keyboard Standard Report LED Masks */
|
||||
//@{
|
||||
/** Constant for a keyboard output report LED byte, indicating that the host's NUM LOCK mode is currently set. */
|
||||
@@ -108,7 +108,7 @@
|
||||
//@}
|
||||
|
||||
/** \name 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
|
||||
@@ -208,7 +208,7 @@
|
||||
#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_NON_US_BACKSLASH_AND_PIPE 0x64
|
||||
#define HID_KEYBOARD_SC_POWER 0x66
|
||||
#define HID_KEYBOARD_SC_EQUAL_SIGN 0x67
|
||||
#define HID_KEYBOARD_SC_F13 0x68
|
||||
@@ -496,7 +496,7 @@
|
||||
* \param[in] VendorPageNum Vendor Defined HID Usage Page index, ranging from 0x00 to 0xFF.
|
||||
* \param[in] CollectionUsage Vendor Usage for the encompassing report IN and OUT collection, ranging from 0x00 to 0xFF.
|
||||
* \param[in] DataINUsage Vendor Usage for the IN report data, ranging from 0x00 to 0xFF.
|
||||
* \param[in] DataOUTUsage Vendor Usage for the OUT report data, ranging from 0x00 to 0xFF.
|
||||
* \param[in] DataOUTUsage Vendor Usage for the OUT report data, ranging from 0x00 to 0xFF.
|
||||
* \param[in] NumBytes Length of the data IN and OUT reports.
|
||||
*/
|
||||
#define HID_DESCRIPTOR_VENDOR(VendorPageNum, CollectionUsage, DataINUsage, DataOUTUsage, NumBytes) \
|
||||
@@ -517,7 +517,7 @@
|
||||
HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), \
|
||||
HID_RI_END_COLLECTION(0)
|
||||
//@}
|
||||
|
||||
|
||||
/* Type Defines: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the HID
|
||||
* device class.
|
||||
@@ -543,7 +543,7 @@
|
||||
* belongs to the Mouse HID boot protocol.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/** Enum for the HID class specific control requests that can be issued by the USB bus host. */
|
||||
enum HID_ClassRequests_t
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
|
||||
case HID_RI_USAGE_PAGE(0):
|
||||
if ((HIDReportItem & HID_RI_DATA_SIZE_MASK) == HID_RI_DATA_BITS_32)
|
||||
CurrStateTable->Attributes.Usage.Page = (ReportItemData >> 16);
|
||||
|
||||
|
||||
CurrStateTable->Attributes.Usage.Page = ReportItemData;
|
||||
break;
|
||||
case HID_RI_LOGICAL_MINIMUM(0):
|
||||
@@ -359,3 +359,4 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
#include "HIDReportData.h"
|
||||
#include "HIDClassCommon.h"
|
||||
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
|
||||
@@ -63,15 +63,15 @@
|
||||
#define HID_RI_DATA_BITS_32 0x03
|
||||
#define HID_RI_DATA_BITS(DataBits) HID_RI_DATA_BITS_ ## DataBits
|
||||
|
||||
#define _HID_RI_ENCODE_0(Data)
|
||||
#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, ...) _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__))
|
||||
#endif
|
||||
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/** \name HID Input, Output and Feature Report Descriptor Item Flags */
|
||||
@@ -95,7 +95,7 @@
|
||||
#define HID_IOF_BUFFERED_BYTES (1 << 8)
|
||||
#define HID_IOF_BITFIELD (0 << 8)
|
||||
//@}
|
||||
|
||||
|
||||
/** \name HID Report Descriptor Item Macros */
|
||||
//@{
|
||||
#define HID_RI_INPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x80, DataBits, __VA_ARGS__)
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
/** SCSI Command Code for a MODE SENSE (10) command. */
|
||||
#define SCSI_CMD_MODE_SENSE_10 0x5A
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SCSI Sense Key Values */
|
||||
//@{
|
||||
/** SCSI Sense Code to indicate no error has occurred. */
|
||||
@@ -164,7 +164,7 @@
|
||||
/** SCSI Sense Code to indicate that the source data did not match the data read from the medium. */
|
||||
#define SCSI_SENSE_KEY_MISCOMPARE 0x0E
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SCSI Additional Sense Codes */
|
||||
//@{
|
||||
/** SCSI Additional Sense Code to indicate no additional sense information is available. */
|
||||
@@ -196,7 +196,7 @@
|
||||
/** SCSI Additional Sense Code to indicate that no removable medium is inserted into the device. */
|
||||
#define SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A
|
||||
//@}
|
||||
|
||||
|
||||
/** \name SCSI Additional Sense Key Code Qualifiers */
|
||||
//@{
|
||||
/** SCSI Additional Sense Qualifier Code to indicate no additional sense qualifier information is available. */
|
||||
@@ -213,7 +213,7 @@
|
||||
/** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */
|
||||
#define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
|
||||
//@}
|
||||
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Mass
|
||||
* Storage device class.
|
||||
@@ -231,7 +231,7 @@
|
||||
* belongs to the Bulk Only Transport protocol of the Mass Storage class.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/** Enum for the Mass Storage class specific control requests that can be issued by the USB bus host. */
|
||||
enum MS_ClassRequests_t
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
* belongs to the Bidirectional protocol of the Printer class.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/** Enum for the Printer class specific control requests that can be issued by the USB bus host. */
|
||||
enum PRNT_ClassRequests_t
|
||||
{
|
||||
@@ -106,7 +106,7 @@
|
||||
PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new
|
||||
* printer commands.
|
||||
*/
|
||||
};
|
||||
};
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
#define REMOTE_NDIS_MEDIA_STATE_CONNECTED 0x00000000UL
|
||||
#define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED 0x00000001UL
|
||||
//@}
|
||||
|
||||
|
||||
/** \name RNDIS Media Types */
|
||||
//@{
|
||||
#define REMOTE_NDIS_MEDIUM_802_3 0x00000000UL
|
||||
@@ -124,7 +124,7 @@
|
||||
#define REMOTE_NDIS_DF_CONNECTIONLESS 0x00000001UL
|
||||
#define REMOTE_NDIS_DF_CONNECTION_ORIENTED 0x00000002UL
|
||||
//@}
|
||||
|
||||
|
||||
/** \name RNDIS Packet Types */
|
||||
//@{
|
||||
#define REMOTE_NDIS_PACKET_DIRECTED 0x00000001UL
|
||||
@@ -140,7 +140,7 @@
|
||||
#define REMOTE_NDIS_PACKET_FUNCTIONAL 0x00004000UL
|
||||
#define REMOTE_NDIS_PACKET_MAC_FRAME 0x00008000UL
|
||||
//@}
|
||||
|
||||
|
||||
/** \name RNDIS OID Values */
|
||||
//@{
|
||||
#define OID_GEN_SUPPORTED_LIST 0x00010101UL
|
||||
|
||||
@@ -50,16 +50,16 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
|
||||
else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
|
||||
{
|
||||
bool EndpointFilterMatch = false;
|
||||
|
||||
|
||||
EndpointFilterMatch |= (AudioInterfaceInfo->Config.DataINEndpointNumber &&
|
||||
((uint8_t)USB_ControlRequest.wIndex == (ENDPOINT_DIR_IN | AudioInterfaceInfo->Config.DataINEndpointNumber)));
|
||||
|
||||
|
||||
EndpointFilterMatch |= (AudioInterfaceInfo->Config.DataOUTEndpointNumber &&
|
||||
((uint8_t)USB_ControlRequest.wIndex == (ENDPOINT_DIR_OUT | AudioInterfaceInfo->Config.DataOUTEndpointNumber)));
|
||||
|
||||
if (!(EndpointFilterMatch))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (USB_ControlRequest.bRequest)
|
||||
{
|
||||
@@ -92,20 +92,20 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
|
||||
uint8_t EndpointProperty = USB_ControlRequest.bRequest;
|
||||
uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex;
|
||||
uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
|
||||
|
||||
|
||||
if (CALLBACK_Audio_Device_GetSetEndpointProperty(AudioInterfaceInfo, EndpointProperty, EndpointAddress,
|
||||
EndpointControl, NULL, NULL))
|
||||
{
|
||||
uint16_t ValueLength = USB_ControlRequest.wLength;
|
||||
uint8_t Value[ValueLength];
|
||||
|
||||
|
||||
Endpoint_ClearSETUP();
|
||||
Endpoint_Read_Control_Stream_LE(Value, ValueLength);
|
||||
Endpoint_ClearIN();
|
||||
Endpoint_ClearIN();
|
||||
|
||||
CALLBACK_Audio_Device_GetSetEndpointProperty(AudioInterfaceInfo, EndpointProperty, EndpointAddress,
|
||||
EndpointControl, &ValueLength, Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -126,7 +126,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
|
||||
{
|
||||
Endpoint_ClearSETUP();
|
||||
Endpoint_Write_Control_Stream_LE(Value, ValueLength);
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_ClearOUT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,3 +180,4 @@ void Audio_Device_Event_Stub(void)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*/
|
||||
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
||||
/** Audio class driver callback for the setting and retrieval of streaming endpoint properties. This callback must be implemented
|
||||
* in the user application to handle property manipulations on streaming audio endpoints.
|
||||
*
|
||||
@@ -357,12 +357,12 @@
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_AUDIO_DEVICE_C)
|
||||
void Audio_Device_Event_Stub(void) ATTR_CONST;
|
||||
|
||||
|
||||
void EVENT_Audio_Device_StreamStartStop(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(Audio_Device_Event_Stub);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -78,7 +78,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
|
||||
|
||||
Endpoint_ClearOUT();
|
||||
Endpoint_ClearStatusStage();
|
||||
|
||||
|
||||
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
#endif
|
||||
|
||||
void CDC_Device_Event_Stub(void) ATTR_CONST;
|
||||
|
||||
|
||||
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
|
||||
ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub);
|
||||
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
|
||||
|
||||
@@ -64,7 +64,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
|
||||
memcpy(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportData,
|
||||
HIDInterfaceInfo->Config.PrevReportINBufferSize);
|
||||
}
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
|
||||
|
||||
Endpoint_ClearSETUP();
|
||||
@@ -84,7 +84,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
|
||||
Endpoint_ClearSETUP();
|
||||
Endpoint_Read_Control_Stream_LE(ReportData, ReportSize);
|
||||
Endpoint_ClearIN();
|
||||
|
||||
|
||||
CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportType,
|
||||
&ReportData[ReportID ? 1 : 0], ReportSize - (ReportID ? 1 : 0));
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
||||
|
||||
struct
|
||||
{
|
||||
// No state information for this class
|
||||
|
||||
@@ -160,7 +160,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
|
||||
uint16_t BytesProcessed;
|
||||
|
||||
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
|
||||
|
||||
|
||||
BytesProcessed = 0;
|
||||
while (Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock,
|
||||
(sizeof(MS_CommandBlockWrapper_t) - 16), &BytesProcessed) ==
|
||||
@@ -231,8 +231,9 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt
|
||||
if (MSInterfaceInfo->State.IsMassStoreReset)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_ClearIN();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
|
||||
uint16_t ResponseSize;
|
||||
|
||||
QUERY_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_QUERY_CMPLT);
|
||||
|
||||
|
||||
if (RNDIS_Device_ProcessNDISQuery(RNDISInterfaceInfo, Query_Oid, QueryData, le32_to_cpu(QUERY_Message->InformationBufferLength),
|
||||
ResponseData, &ResponseSize))
|
||||
{
|
||||
@@ -453,7 +453,7 @@ bool RNDIS_Device_IsPacketReceived(USB_ClassInfo_RNDIS_Device_t* const RNDISInte
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber);
|
||||
return Endpoint_IsOUTReceived();
|
||||
}
|
||||
@@ -467,15 +467,15 @@ uint8_t RNDIS_Device_ReadPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa
|
||||
{
|
||||
return ENDPOINT_RWSTREAM_DeviceDisconnected;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber);
|
||||
|
||||
|
||||
*PacketLength = 0;
|
||||
|
||||
if (!(Endpoint_IsOUTReceived()))
|
||||
return ENDPOINT_RWSTREAM_NoError;
|
||||
|
||||
RNDIS_Packet_Message_t RNDISPacketHeader;
|
||||
RNDIS_Packet_Message_t RNDISPacketHeader;
|
||||
Endpoint_Read_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_Packet_Message_t), NULL);
|
||||
|
||||
if (le32_to_cpu(RNDISPacketHeader.DataLength) > ETHERNET_FRAME_SIZE_MAX)
|
||||
@@ -484,12 +484,12 @@ uint8_t RNDIS_Device_ReadPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa
|
||||
|
||||
return RNDIS_ERROR_LOGICAL_CMD_FAILED;
|
||||
}
|
||||
|
||||
|
||||
*PacketLength = (uint16_t)le32_to_cpu(RNDISPacketHeader.DataLength);
|
||||
|
||||
Endpoint_Read_Stream_LE(Buffer, *PacketLength, NULL);
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
||||
return ENDPOINT_RWSTREAM_NoError;
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ uint8_t RNDIS_Device_SendPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa
|
||||
{
|
||||
return ENDPOINT_RWSTREAM_DeviceDisconnected;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpointNumber);
|
||||
|
||||
if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)
|
||||
|
||||
@@ -443,3 +443,4 @@ static int AOA_Host_getchar_Blocking(FILE* Stream)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -325,3 +325,4 @@
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
|
||||
return AUDIO_ENUMERROR_NoCompatibleInterfaceFound;
|
||||
}
|
||||
|
||||
AudioControlInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
|
||||
AudioControlInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
|
||||
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
DCOMP_Audio_Host_NextAudioStreamInterface) != DESCRIPTOR_SEARCH_COMP_Found)
|
||||
@@ -78,7 +78,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
|
||||
}
|
||||
|
||||
AudioStreamingInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
|
||||
|
||||
|
||||
DataINEndpoint = NULL;
|
||||
DataOUTEndpoint = NULL;
|
||||
|
||||
@@ -125,7 +125,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
|
||||
DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
|
||||
{
|
||||
@@ -137,7 +137,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
|
||||
AudioInterfaceInfo->State.StreamingInterfaceNumber = AudioStreamingInterface->InterfaceNumber;
|
||||
AudioInterfaceInfo->State.EnabledStreamingAltIndex = AudioStreamingInterface->AlternateSetting;
|
||||
AudioInterfaceInfo->State.IsActive = true;
|
||||
|
||||
|
||||
return AUDIO_ENUMERROR_NoError;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ uint8_t Audio_Host_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const Audi
|
||||
RequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT);
|
||||
else
|
||||
RequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT);
|
||||
|
||||
|
||||
Pipe_SelectPipe(DataPipeIndex);
|
||||
EndpointAddress = Pipe_GetBoundEndpointAddress();
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
*/
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the Audio Control interface within the attached device. */
|
||||
uint8_t StreamingInterfaceNumber; /**< Interface index of the Audio Streaming interface within the attached device. */
|
||||
|
||||
|
||||
uint8_t EnabledStreamingAltIndex; /**< Alternative setting index of the Audio Streaming interface when the stream is enabled. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Audio interface's IN data pipe. */
|
||||
@@ -331,7 +331,7 @@
|
||||
const int8_t Sample)
|
||||
{
|
||||
(void)AudioInterfaceInfo;
|
||||
|
||||
|
||||
Pipe_Write_8(Sample);
|
||||
|
||||
if (!(Pipe_IsReadWriteAllowed()))
|
||||
@@ -357,7 +357,7 @@
|
||||
const int16_t Sample)
|
||||
{
|
||||
(void)AudioInterfaceInfo;
|
||||
|
||||
|
||||
Pipe_Write_16_LE(Sample);
|
||||
|
||||
if (!(Pipe_IsReadWriteAllowed()))
|
||||
@@ -395,7 +395,7 @@
|
||||
Pipe_Freeze();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Function Prototypes: */
|
||||
|
||||
@@ -145,13 +145,13 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
|
||||
DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
|
||||
{
|
||||
return CDC_ENUMERROR_PipeConfigurationFailed;
|
||||
}
|
||||
|
||||
|
||||
if (InterruptPeriod)
|
||||
Pipe_SetInterruptPeriod(InterruptPeriod);
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
#endif
|
||||
|
||||
void CDC_Host_Event_Stub(void) ATTR_CONST;
|
||||
|
||||
|
||||
void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
|
||||
ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
||||
{
|
||||
if (DataOUTEndpoint == NULL)
|
||||
continue;
|
||||
|
||||
|
||||
Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
|
||||
EndpointAddress = DataOUTEndpoint->EndpointAddress;
|
||||
Token = PIPE_TOKEN_OUT;
|
||||
@@ -139,7 +139,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
||||
{
|
||||
return HID_ENUMERROR_PipeConfigurationFailed;
|
||||
}
|
||||
|
||||
|
||||
if (InterruptPeriod)
|
||||
Pipe_SetInterruptPeriod(InterruptPeriod);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
|
||||
|
||||
#if !defined(NO_CLASS_DRIVER_AUTOFLUSH)
|
||||
MIDI_Host_Flush(MIDIInterfaceInfo);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
|
||||
|
||||
@@ -103,7 +103,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
|
||||
Token = PIPE_TOKEN_OUT;
|
||||
Type = EP_TYPE_BULK;
|
||||
DoubleBanked = MSInterfaceInfo->Config.DataOUTPipeDoubleBank;
|
||||
|
||||
|
||||
MSInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
|
||||
}
|
||||
else
|
||||
@@ -186,7 +186,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
|
||||
{
|
||||
return ErrorCode;
|
||||
}
|
||||
|
||||
|
||||
Pipe_ClearOUT();
|
||||
Pipe_WaitUntilReady();
|
||||
|
||||
@@ -195,14 +195,14 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
|
||||
if (BufferPtr != NULL)
|
||||
{
|
||||
ErrorCode = MS_Host_SendReceiveData(MSInterfaceInfo, SCSICommandBlock, (void*)BufferPtr);
|
||||
|
||||
|
||||
if ((ErrorCode != PIPE_RWSTREAM_NoError) && (ErrorCode != PIPE_RWSTREAM_PipeStalled))
|
||||
{
|
||||
Pipe_Freeze();
|
||||
return ErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MS_CommandStatusWrapper_t SCSIStatusBlock;
|
||||
return MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSIStatusBlock);
|
||||
}
|
||||
@@ -348,9 +348,9 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
|
||||
|
||||
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||
return ErrorCode;
|
||||
|
||||
|
||||
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
|
||||
|
||||
|
||||
if ((ErrorCode = USB_Host_ClearEndpointStall(Pipe_GetBoundEndpointAddress())) != HOST_SENDCONTROL_Successful)
|
||||
return ErrorCode;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
/** Sends a MASS STORAGE RESET control request to the attached device, resetting the Mass Storage Interface
|
||||
* and readying it for the next Mass Storage command. This should be called after a failed SCSI request to
|
||||
* and readying it for the next Mass Storage command. This should be called after a failed SCSI request to
|
||||
* ensure the attached Mass Storage device is ready to receive the next command.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
|
||||
@@ -147,13 +147,13 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
|
||||
DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
|
||||
{
|
||||
return CDC_ENUMERROR_PipeConfigurationFailed;
|
||||
}
|
||||
|
||||
|
||||
if (InterruptPeriod)
|
||||
Pipe_SetInterruptPeriod(InterruptPeriod);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const R
|
||||
};
|
||||
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
|
||||
return USB_Host_SendControlRequest(Buffer);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const R
|
||||
};
|
||||
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
|
||||
|
||||
return USB_Host_SendControlRequest(Buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,13 +133,13 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
|
||||
DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
|
||||
{
|
||||
return SI_ENUMERROR_PipeConfigurationFailed;
|
||||
}
|
||||
|
||||
|
||||
if (InterruptPeriod)
|
||||
Pipe_SetInterruptPeriod(InterruptPeriod);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "../StdDescriptors.h"
|
||||
#include "../USBInterrupt.h"
|
||||
#include "../Endpoint.h"
|
||||
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
@@ -99,7 +99,7 @@
|
||||
*/
|
||||
#define USB_DEVICE_OPT_FULLSPEED (0 << 0)
|
||||
//@}
|
||||
|
||||
|
||||
#if (!defined(NO_INTERNAL_SERIAL) && \
|
||||
(defined(USB_SERIES_7_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_4_AVR) || \
|
||||
(defined(USB_SERIES_2_AVR) && (!defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))) || \
|
||||
@@ -119,7 +119,7 @@
|
||||
* model.
|
||||
*/
|
||||
#define INTERNAL_SERIAL_LENGTH_BITS 80
|
||||
|
||||
|
||||
/** Start address of the internal serial number, in the appropriate address space, if present on the selected microcontroller
|
||||
* model.
|
||||
*/
|
||||
@@ -129,8 +129,8 @@
|
||||
|
||||
#define INTERNAL_SERIAL_LENGTH_BITS 0
|
||||
#define INTERNAL_SERIAL_START_ADDRESS 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Function Prototypes: */
|
||||
/** Sends a Remote Wakeup request to the host. This signals to the host that the device should
|
||||
* be taken out of suspended mode, and communications should resume.
|
||||
@@ -221,14 +221,14 @@
|
||||
{
|
||||
return (UDADDR & (1 << ADDEN));
|
||||
}
|
||||
|
||||
|
||||
#if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
|
||||
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString)
|
||||
{
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS;
|
||||
|
||||
for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++)
|
||||
@@ -246,7 +246,7 @@
|
||||
UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ?
|
||||
(('A' - 10) + SerialByte) : ('0' + SerialByte));
|
||||
}
|
||||
|
||||
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -268,3 +268,4 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
|
||||
UECFG1X = UECFG1XData;
|
||||
|
||||
return Endpoint_IsConfigured();
|
||||
#else
|
||||
#else
|
||||
for (uint8_t EPNum = Number; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)
|
||||
{
|
||||
uint8_t UECFG0XTemp;
|
||||
@@ -60,7 +60,7 @@ bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
|
||||
uint8_t UEIENXTemp;
|
||||
|
||||
Endpoint_SelectEndpoint(EPNum);
|
||||
|
||||
|
||||
if (EPNum == Number)
|
||||
{
|
||||
UECFG0XTemp = UECFG0XData;
|
||||
@@ -84,11 +84,11 @@ bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
|
||||
UECFG0X = UECFG0XTemp;
|
||||
UECFG1X = UECFG1XTemp;
|
||||
UEIENX = UEIENXTemp;
|
||||
|
||||
|
||||
if (!(Endpoint_IsConfigured()))
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Endpoint_SelectEndpoint(Number);
|
||||
return true;
|
||||
#endif
|
||||
@@ -155,7 +155,7 @@ uint8_t Endpoint_WaitUntilReady(void)
|
||||
if (Endpoint_IsOUTReceived())
|
||||
return ENDPOINT_READYWAIT_NoError;
|
||||
}
|
||||
|
||||
|
||||
uint8_t USB_DeviceState_LCL = USB_DeviceState;
|
||||
|
||||
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
#endif
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/* Macros: */
|
||||
/** \name Endpoint Bank Mode Masks */
|
||||
//@{
|
||||
/** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
|
||||
|
||||
@@ -254,7 +254,7 @@ static void USB_Host_ResetDevice(void)
|
||||
USB_Host_ResetBus();
|
||||
while (!(USB_Host_IsBusResetComplete()));
|
||||
USB_Host_ResumeBus();
|
||||
|
||||
|
||||
USB_Host_ConfigurationNumber = 0;
|
||||
|
||||
bool HSOFIEnabled = USB_INT_IsEnabled(USB_INT_HSOFI);
|
||||
|
||||
@@ -56,7 +56,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
|
||||
Pipe_SetInfiniteINRequests();
|
||||
|
||||
return Pipe_IsConfigured();
|
||||
#else
|
||||
#else
|
||||
for (uint8_t PNum = Number; PNum < PIPE_TOTAL_PIPES; PNum++)
|
||||
{
|
||||
uint8_t UPCFG0XTemp;
|
||||
@@ -65,7 +65,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
|
||||
uint8_t UPIENXTemp;
|
||||
|
||||
Pipe_SelectPipe(PNum);
|
||||
|
||||
|
||||
if (PNum == Number)
|
||||
{
|
||||
UPCFG0XTemp = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0));
|
||||
@@ -83,7 +83,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
|
||||
|
||||
if (!(UPCFG1XTemp & (1 << ALLOC)))
|
||||
continue;
|
||||
|
||||
|
||||
Pipe_DisablePipe();
|
||||
UPCFG1X &= ~(1 << ALLOC);
|
||||
|
||||
@@ -94,12 +94,12 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
|
||||
UPIENX = UPIENXTemp;
|
||||
|
||||
Pipe_SetInfiniteINRequests();
|
||||
|
||||
|
||||
if (!(Pipe_IsConfigured()))
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Pipe_SelectPipe(Number);
|
||||
|
||||
Pipe_SelectPipe(Number);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
*/
|
||||
#define PIPE_TOKEN_OUT (2 << PTOKEN0)
|
||||
//@}
|
||||
|
||||
|
||||
/** \name Pipe Bank Mode Masks */
|
||||
//@{
|
||||
/** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the pipe
|
||||
@@ -425,7 +425,7 @@
|
||||
PIPE_ERRORFLAG_DATATGL)) |
|
||||
(UPSTAX & (PIPE_ERRORFLAG_OVERFLOW | PIPE_ERRORFLAG_UNDERFLOW)));
|
||||
}
|
||||
|
||||
|
||||
/** Retrieves the number of busy banks in the currently selected pipe, which have been queued for
|
||||
* transmission via the \ref Pipe_ClearOUT() command, or are awaiting acknowledgement via the
|
||||
* \ref Pipe_ClearIN() command.
|
||||
|
||||
@@ -81,3 +81,4 @@ uint8_t TEMPLATE_FUNC_NAME (void* const Buffer,
|
||||
#undef TEMPLATE_TRANSFER_BYTE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -90,3 +90,4 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
|
||||
#undef TEMPLATE_TRANSFER_BYTE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -86,3 +86,4 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
|
||||
#undef TEMPLATE_BUFFER_MOVE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
|
||||
Length -= *BytesProcessed;
|
||||
TEMPLATE_BUFFER_MOVE(DataStream, *BytesProcessed);
|
||||
}
|
||||
|
||||
|
||||
while (Length)
|
||||
{
|
||||
if (!(Pipe_IsReadWriteAllowed()))
|
||||
@@ -85,3 +85,4 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
|
||||
#undef TEMPLATE_BUFFER_MOVE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ void USB_ResetInterface(void)
|
||||
{
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
USB_PLL_On();
|
||||
while (!(USB_PLL_IsReady()));
|
||||
while (!(USB_PLL_IsReady()));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ static void USB_Init_Device(void)
|
||||
|
||||
#if !defined(FIXED_CONTROL_ENDPOINT_SIZE)
|
||||
USB_Descriptor_Device_t* DeviceDescriptorPtr;
|
||||
|
||||
|
||||
#if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \
|
||||
!(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
|
||||
uint8_t DescriptorAddressSpace;
|
||||
@@ -215,7 +215,7 @@ static void USB_Init_Device(void)
|
||||
#else
|
||||
USB_Device_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -255,7 +255,7 @@ static void USB_Init_Host(void)
|
||||
|
||||
USB_INT_Enable(USB_INT_SRPI);
|
||||
USB_INT_Enable(USB_INT_BCERRI);
|
||||
|
||||
|
||||
USB_Attach();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
OTGIEN |= (1 << VBERRE);
|
||||
break;
|
||||
case USB_INT_SRPI:
|
||||
OTGIEN |= (1 << SRPE);
|
||||
OTGIEN |= (1 << SRPE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -194,12 +194,12 @@
|
||||
OTGIEN &= ~(1 << VBERRE);
|
||||
break;
|
||||
case USB_INT_SRPI:
|
||||
OTGIEN &= ~(1 << SRPE);
|
||||
OTGIEN &= ~(1 << SRPE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void USB_INT_Clear(const uint8_t Interrupt) ATTR_ALWAYS_INLINE;
|
||||
static inline void USB_INT_Clear(const uint8_t Interrupt)
|
||||
{
|
||||
@@ -257,7 +257,7 @@
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline bool USB_INT_IsEnabled(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline bool USB_INT_IsEnabled(const uint8_t Interrupt)
|
||||
{
|
||||
@@ -300,10 +300,10 @@
|
||||
return (OTGIEN & (1 << SRPE));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
/* Includes: */
|
||||
#include "../../../Common/Common.h"
|
||||
#include "USBMode.h"
|
||||
#include "USBMode.h"
|
||||
#include "HostStandardReq.h"
|
||||
#include "StdDescriptors.h"
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
void** CurrConfigLoc)
|
||||
{
|
||||
uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
|
||||
|
||||
|
||||
if (*BytesRem < CurrDescriptorSize)
|
||||
CurrDescriptorSize = *BytesRem;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
/* Includes: */
|
||||
#include "../../../Common/Common.h"
|
||||
#include "USBMode.h"
|
||||
#include "USBMode.h"
|
||||
#include "StdDescriptors.h"
|
||||
#include "USBInterrupt.h"
|
||||
#include "Endpoint.h"
|
||||
@@ -145,7 +145,7 @@
|
||||
#elif (ARCH == ARCH_UC3)
|
||||
#include "UC3/Device_UC3.h"
|
||||
#elif (ARCH == ARCH_XMEGA)
|
||||
#include "XMEGA/Device_XMEGA.h"
|
||||
#include "XMEGA/Device_XMEGA.h"
|
||||
#endif
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
||||
@@ -124,7 +124,7 @@ static void USB_Device_SetAddress(void)
|
||||
uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F);
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
Endpoint_ClearSETUP();
|
||||
|
||||
Endpoint_ClearStatusStage();
|
||||
@@ -133,7 +133,7 @@ static void USB_Device_SetAddress(void)
|
||||
|
||||
USB_Device_SetDeviceAddress(DeviceAddress);
|
||||
USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
|
||||
|
||||
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ static void USB_Device_SetConfiguration(void)
|
||||
uint8_t MemoryAddressSpace;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr
|
||||
#if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \
|
||||
!(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
|
||||
@@ -185,7 +185,7 @@ static void USB_Device_SetConfiguration(void)
|
||||
}
|
||||
#else
|
||||
if ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations)
|
||||
return;
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -224,7 +224,7 @@ static void USB_Device_GetInternalSerialDescriptor(void)
|
||||
|
||||
SignatureDescriptor.Header.Type = DTYPE_String;
|
||||
SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4);
|
||||
|
||||
|
||||
USB_Device_GetSerialString(SignatureDescriptor.UnicodeString);
|
||||
|
||||
Endpoint_ClearSETUP();
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/* Includes: */
|
||||
#include "../../../Common/Common.h"
|
||||
#include "USBMode.h"
|
||||
#include "USBMode.h"
|
||||
#include "StdDescriptors.h"
|
||||
#include "Events.h"
|
||||
#include "StdRequestType.h"
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
/* Includes: */
|
||||
#include "../../../Common/Common.h"
|
||||
#include "USBMode.h"
|
||||
#include "USBMode.h"
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
@@ -9,13 +9,13 @@
|
||||
/*
|
||||
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
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
|
||||
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 disclaim all warranties with regard to this
|
||||
@@ -36,7 +36,7 @@
|
||||
* dispatch header located in LUFA/Drivers/USB/USB.h.
|
||||
*/
|
||||
|
||||
/** \ingroup Group_EndpointRW
|
||||
/** \ingroup Group_EndpointRW
|
||||
* \defgroup Group_EndpointStreamRW Read/Write of Multi-Byte Streams
|
||||
* \brief Endpoint data stream transmission and reception management.
|
||||
*
|
||||
@@ -44,7 +44,7 @@
|
||||
* and to endpoints.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef __ENDPOINT_STREAM_H__
|
||||
#define __ENDPOINT_STREAM_H__
|
||||
@@ -89,7 +89,7 @@
|
||||
* again to process the next chunk of data in the transfer.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/** Enum for the possible error return codes of the \c Endpoint_*_Control_Stream_* functions. */
|
||||
enum Endpoint_ControlStream_RW_ErrorCodes_t
|
||||
{
|
||||
@@ -110,7 +110,7 @@
|
||||
#elif (ARCH == ARCH_UC3)
|
||||
#include "UC3/EndpointStream_UC3.h"
|
||||
#elif (ARCH == ARCH_XMEGA)
|
||||
#include "XMEGA/EndpointStream_XMEGA.h"
|
||||
#include "XMEGA/EndpointStream_XMEGA.h"
|
||||
#endif
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
void EVENT_USB_Device_Disconnect(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
|
||||
* 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
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
/* Includes: */
|
||||
#include "../../../Common/Common.h"
|
||||
#include "USBMode.h"
|
||||
#include "USBMode.h"
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
@@ -108,16 +108,16 @@
|
||||
* bus address is being set.
|
||||
*/
|
||||
HOST_STATE_Default_PostAddressSet = 9, /**< 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
|
||||
* 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 \ref HOST_STATE_Addressed state
|
||||
* ready for use in the user application.
|
||||
*/
|
||||
HOST_STATE_Addressed = 10, /**< Indicates that the device has been enumerated and addressed, and is now waiting
|
||||
* for the user application to configure the device ready for use.
|
||||
* for the user application to configure the device ready for use.
|
||||
*/
|
||||
HOST_STATE_Configured = 11, /**< Indicates that the device has been configured into a valid device configuration,
|
||||
* ready for general use by the user application.
|
||||
* ready for general use by the user application.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user