forked from mfulz_github/qmk_firmware
More updates to remove architecture-specific comments from the documentation, alter USBMode.h preprocessor logic to support future architectures more easily.
This commit is contained in:
parent
28a1ee29a1
commit
f3ec62b5c6
|
@ -80,7 +80,7 @@
|
|||
|
||||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
* The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void)
|
||||
{
|
||||
|
|
|
@ -36,8 +36,7 @@
|
|||
inside the application's folder.
|
||||
|
||||
This stub is for the board-specific component of the LUFA Joystick
|
||||
driver, a small surface mount four-way (plus button) digital joystick
|
||||
on most USB AVR boards.
|
||||
driver, for a digital four-way (plus button) joystick.
|
||||
*/
|
||||
|
||||
#ifndef __JOYSTICK_USER_H__
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
inside the application's folder.
|
||||
|
||||
This stub is for the board-specific component of the LUFA LEDs driver,
|
||||
for the LEDs (up to four) mounted on most USB AVR boards.
|
||||
for the LEDs (up to four) mounted on most development boards.
|
||||
*/
|
||||
|
||||
#ifndef __LEDS_USER_H__
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
/** \file
|
||||
* \brief AVR-GCC special function/variable attribute macros.
|
||||
* \brief GCC special function/variable attribute macros.
|
||||
*
|
||||
* \copydetails Group_GCCAttributes
|
||||
*
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
/** \ingroup Group_Common
|
||||
* \defgroup Group_GCCAttributes Function/Variable Attributes
|
||||
* \brief AVR-GCC special function/variable attribute macros.
|
||||
* \brief GCC special function/variable attribute macros.
|
||||
*
|
||||
* This module contains macros for applying GCC specific attributes to functions and variables to control various
|
||||
* optimiser and code generation features of the compiler. Attributes may be placed in the function prototype
|
||||
|
|
|
@ -144,10 +144,11 @@
|
|||
#define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("BREAK" ::)
|
||||
|
||||
#if !defined(pgm_read_ptr) || defined(__DOXYGEN__)
|
||||
/** Reads a pointer out of PROGMEM space. This is currently a wrapper for the avr-libc \c pgm_read_ptr()
|
||||
* macro with a \c void* cast, so that its value can be assigned directly to a pointer variable or used
|
||||
* in pointer arithmetic without further casting in C. In a future avr-libc distribution this will be
|
||||
* part of the standard API and will be implemented in a more formal manner.
|
||||
/** Reads a pointer out of PROGMEM space on the AVR8 architecture. This is currently a wrapper for the
|
||||
* avr-libc \c pgm_read_ptr() macro with a \c void* cast, so that its value can be assigned directly
|
||||
* to a pointer variable or used in pointer arithmetic without further casting in C. In a future
|
||||
* avr-libc distribution this will be part of the standard API and will be implemented in a more formal
|
||||
* manner.
|
||||
*
|
||||
* \param[in] Addr Address of the pointer to read.
|
||||
*
|
||||
|
@ -165,8 +166,8 @@
|
|||
#define JTAG_DEBUG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE
|
||||
|
||||
/** Macro for testing condition "x" and writing debug data to the stdout stream if \c false. The stdout stream
|
||||
* must be pre-initialized before this macro is run and linked to an output device, such as the AVR's USART
|
||||
* peripheral.
|
||||
* must be pre-initialized before this macro is run and linked to an output device, such as the microcontroller's
|
||||
* USART peripheral.
|
||||
*
|
||||
* The output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion {Condition} failed."
|
||||
*
|
||||
|
@ -179,7 +180,7 @@
|
|||
__FILE__, __func__, __LINE__, #Condition); } }MACROE
|
||||
#endif
|
||||
|
||||
/** Forces GCC to use pointer indirection (via the AVR's pointer register pairs) when accessing the given
|
||||
/** Forces GCC to use pointer indirection (via the device's pointer register pairs) when accessing the given
|
||||
* struct pointer. In some cases GCC will emit non-optimal assembly code when accessing a structure through
|
||||
* a pointer, resulting in a larger binary. When this macro is used on a (non \c const) structure pointer before
|
||||
* use, it will force GCC to use pointer indirection on the elements rather than direct store and load
|
||||
|
|
|
@ -151,7 +151,7 @@
|
|||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
*
|
||||
* \note The AVR's SPI driver must be initialized before any of the dataflash commands are used.
|
||||
* \note The microcontroller's SPI driver must be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
* The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void)
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
* The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void)
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
* The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void)
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
* The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void)
|
||||
{
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
/* Inline Functions: */
|
||||
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
|
||||
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
* The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
|
||||
*/
|
||||
static inline void Dataflash_Init(void)
|
||||
{
|
||||
|
|
|
@ -295,7 +295,7 @@
|
|||
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Creates a standard character stream for the given CDC Device instance so that it can be used with all the regular
|
||||
* functions in the avr-libc <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created
|
||||
* functions in the standard <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created
|
||||
* stream is bidirectional and can be used for both input and output functions.
|
||||
*
|
||||
* Reading data from this stream is non-blocking, i.e. in most instances, complete strings cannot be read in by a single
|
||||
|
|
|
@ -285,7 +285,7 @@
|
|||
uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Creates a standard character stream for the given CDC Device instance so that it can be used with all the regular
|
||||
* functions in the avr-libc \c <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created
|
||||
* functions in the standard \c <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created
|
||||
* stream is bidirectional and can be used for both input and output functions.
|
||||
*
|
||||
* Reading data from this stream is non-blocking, i.e. in most instances, complete strings cannot be read in by a single
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
* This event is time-critical; exceeding OS-specific delays within this event handler (typically of around
|
||||
* two seconds) will prevent the device from enumerating correctly.
|
||||
*
|
||||
* \note For the smaller series 2 USB AVRs with limited USB controllers, VBUS is not available to the USB controller.
|
||||
* \note For the microcontrollers with limited USB controller functionality, VBUS sensing is not available.
|
||||
* this means that the current connection state is derived from the bus suspension and wake up events by default,
|
||||
* which is not always accurate (host may suspend the bus while still connected). If the actual connection state
|
||||
* needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by
|
||||
|
|
|
@ -303,7 +303,7 @@
|
|||
uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal
|
||||
* serial number, in uppercase Unicode ASCII.
|
||||
*
|
||||
* \note On some AVR models, there is an embedded serial number
|
||||
* \note On some microcontroller models, there is an embedded serial number
|
||||
* in the chip which can be used for the device serial number.
|
||||
* To use this serial number, set this to USE_INTERNAL_SERIAL.
|
||||
* On unsupported devices, this will evaluate to 0 and will cause
|
||||
|
@ -351,7 +351,7 @@
|
|||
uint8_t iSerialNumber; /**< String index for the product's globally unique hexadecimal
|
||||
* serial number, in uppercase Unicode ASCII.
|
||||
*
|
||||
* \note On some AVR models, there is an embedded serial number
|
||||
* \note On some microcontroller models, there is an embedded serial number
|
||||
* in the chip which can be used for the device serial number.
|
||||
* To use this serial number, set this to USE_INTERNAL_SERIAL.
|
||||
* On unsupported devices, this will evaluate to 0 and will cause
|
||||
|
|
|
@ -82,17 +82,17 @@
|
|||
*/
|
||||
#define USB_SERIES_7_AVR
|
||||
|
||||
/** Indicates that the target AVR microcontroller and compilation settings allow for the
|
||||
/** Indicates that the target microcontroller and compilation settings allow for the
|
||||
* target to be configured in USB Device mode when defined.
|
||||
*/
|
||||
#define USB_CAN_BE_DEVICE
|
||||
|
||||
/** Indicates that the target AVR microcontroller and compilation settings allow for the
|
||||
/** Indicates that the target microcontroller and compilation settings allow for the
|
||||
* target to be configured in USB Host mode when defined.
|
||||
*/
|
||||
#define USB_CAN_BE_HOST
|
||||
|
||||
/** Indicates that the target AVR microcontroller and compilation settings allow for the
|
||||
/** Indicates that the target microcontroller and compilation settings allow for the
|
||||
* target to be configured in either USB Device or Host mode when defined.
|
||||
*/
|
||||
#define USB_CAN_BE_BOTH
|
||||
|
@ -101,37 +101,48 @@
|
|||
#if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
|
||||
defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega8U2__))
|
||||
#define USB_SERIES_2_AVR
|
||||
#define USB_CAN_BE_DEVICE
|
||||
#elif (defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__))
|
||||
#define USB_SERIES_4_AVR
|
||||
#define USB_CAN_BE_DEVICE
|
||||
#elif (defined(__AVR_ATmega32U6__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
|
||||
#define USB_SERIES_6_AVR
|
||||
#define USB_CAN_BE_DEVICE
|
||||
#elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__))
|
||||
#define USB_SERIES_7_AVR
|
||||
#define USB_CAN_BE_DEVICE
|
||||
#define USB_CAN_BE_HOST
|
||||
#endif
|
||||
|
||||
#if !defined(USB_SERIES_7_AVR)
|
||||
#if defined(USB_HOST_ONLY)
|
||||
#error USB_HOST_ONLY is not available for the currently selected USB AVR model.
|
||||
#endif
|
||||
|
||||
#if !defined(USB_DEVICE_ONLY)
|
||||
#define USB_DEVICE_ONLY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (!defined(USB_DEVICE_ONLY) && !defined(USB_HOST_ONLY))
|
||||
|
||||
#if (defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST))
|
||||
#define USB_CAN_BE_BOTH
|
||||
#define USB_CAN_BE_HOST
|
||||
#define USB_CAN_BE_DEVICE
|
||||
#elif defined(USB_HOST_ONLY)
|
||||
#define USB_CAN_BE_HOST
|
||||
#elif defined(USB_DEVICE_ONLY)
|
||||
#define USB_CAN_BE_DEVICE
|
||||
#endif
|
||||
|
||||
#if defined(USB_HOST_ONLY)
|
||||
#if !defined(USB_CAN_BE_HOST)
|
||||
#error USB_HOST_ONLY is not available for the currently selected microcontroller model.
|
||||
#else
|
||||
#undef USB_CAN_BE_DEVICE
|
||||
#undef USB_CAN_BE_BOTH
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(USB_DEVICE_ONLY)
|
||||
#if !defined(USB_CAN_BE_DEVICE)
|
||||
#error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.
|
||||
#else
|
||||
#undef USB_CAN_BE_HOST
|
||||
#undef USB_CAN_BE_BOTH
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
|
||||
#error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
|
||||
#endif
|
||||
|
||||
#if (!defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST))
|
||||
#error The currently selected architecture is not supported under the USB component of the library.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -98,8 +98,8 @@
|
|||
* the library internally.
|
||||
*
|
||||
* To reduce program size and speed up checks of this global on the AVR8 architecture, it can be
|
||||
* placed into one of the AVR's GPIOR hardware registers instead of RAM by defining the
|
||||
* HOST_STATE_AS_GPIOR token to a value between 0 and 2 in the project makefile and passing it to
|
||||
* placed into one of the AVR's \c GPIOR hardware registers instead of RAM by defining the
|
||||
* \c HOST_STATE_AS_GPIOR token to a value between 0 and 2 in the project makefile and passing it to
|
||||
* the compiler via the -D switch. When defined, the corresponding GPIOR register should not be used
|
||||
* in the user application except implicitly via the library APIs.
|
||||
*
|
||||
|
@ -127,8 +127,8 @@
|
|||
* (see \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events).
|
||||
*
|
||||
* To reduce program size and speed up checks of this global on the AVR8 architecture, it can be
|
||||
* placed into one of the AVR's GPIOR hardware registers instead of RAM by defining the
|
||||
* DEVICE_STATE_AS_GPIOR token to a value between 0 and 2 in the project makefile and passing it to
|
||||
* placed into one of the AVR's \c GPIOR hardware registers instead of RAM by defining the
|
||||
* \c DEVICE_STATE_AS_GPIOR token to a value between 0 and 2 in the project makefile and passing it to
|
||||
* the compiler via the -D switch. When defined, the corresponding GPIOR register should not be used
|
||||
* in the user application except implicitly via the library APIs.
|
||||
*
|
||||
|
|
|
@ -364,11 +364,6 @@
|
|||
#include "../../Common/Common.h"
|
||||
#include "Core/USBMode.h"
|
||||
|
||||
/* Preprocessor Checks: */
|
||||
#if (!defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST))
|
||||
#error The currently selected architecture is not supported under the USB component of the library.
|
||||
#endif
|
||||
|
||||
/* Includes: */
|
||||
#include "Core/USBTask.h"
|
||||
#include "Core/Events.h"
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
/**
|
||||
* \page Page_DeviceSupport Device and Hardware Support
|
||||
*
|
||||
* Currently supported AVR models:
|
||||
* \section Sec_AVR8_Support Atmel 8-Bit AVR (AVR8)
|
||||
*
|
||||
* Currently supported AVR8 models:
|
||||
* - AT90USB82 (USB Device Only)
|
||||
* - ATMEGA8U2 (USB Device Only)
|
||||
* - AT90USB162 (USB Device Only)
|
||||
|
@ -44,6 +46,7 @@
|
|||
* - Minimus USB
|
||||
* - Olimex AVR-USB-162
|
||||
* - PJRC Teensy (all revisions and versions)
|
||||
* - Sparkfun U2 Breakout Board
|
||||
* - TCNISO Blackcat USB JTAG
|
||||
* - Tempusdictum Benito
|
||||
* - Tom's USBTINY-MKII (all revisions and versions)
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
* -# Change makefiles to allow for absolute LUFA location to be used
|
||||
* -# Re-add interrupt Pipe/Endpoint support
|
||||
* -# Investigate dynamically created device descriptors
|
||||
* -# Re-add in software PDI/TPI support into the AVRISP-MKII project
|
||||
* -# Add makefile includes to reduce boilerplate in user makefiles
|
||||
* - Documentation/Support
|
||||
* -# Add detailed overviews of how each demo works
|
||||
|
|
Loading…
Reference in New Issue