Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.

This commit is contained in:
Dean Camera 2012-05-10 19:24:58 +00:00
parent e8570c4a37
commit 359fbfe14d
395 changed files with 9912 additions and 2756 deletions

View file

@ -157,6 +157,10 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
#else
#error Unsupported architecture for this LUFA configuration file.
#endif
#endif

View file

@ -63,25 +63,27 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
#if (ARCH == ARCH_AVR8) || defined(__DOXYGEN__)
/** Disables the AVR's JTAG bus in software, until a system reset. This will override the current JTAG
* status as set by the JTAGEN fuse, disabling JTAG debugging and reverting the JTAG pins back to GPIO
* mode.
*
* \note This macro is not available for all architectures.
*/
#define JTAG_DISABLE() MACROS{ \
__asm__ __volatile__ ( \
"in __tmp_reg__,__SREG__" "\n\t" \
"cli" "\n\t" \
"out %1, %0" "\n\t" \
"out __SREG__, __tmp_reg__" "\n\t" \
"out %1, %0" "\n\t" \
: \
: "r" (1 << JTD), \
"M" (_SFR_IO_ADDR(MCUCR)) \
: "r0"); \
}MACROE
#if (ARCH == ARCH_AVR8) || (ARCH == ARCH_XMEGA) || defined(__DOXYGEN__)
#if (ARCH == ARCH_AVR8) || defined(__DOXYGEN__)
/** Disables the AVR's JTAG bus in software, until a system reset. This will override the current JTAG
* status as set by the JTAGEN fuse, disabling JTAG debugging and reverting the JTAG pins back to GPIO
* mode.
*
* \note This macro is not available for all architectures.
*/
#define JTAG_DISABLE() MACROS{ \
__asm__ __volatile__ ( \
"in __tmp_reg__,__SREG__" "\n\t" \
"cli" "\n\t" \
"out %1, %0" "\n\t" \
"out __SREG__, __tmp_reg__" "\n\t" \
"out %1, %0" "\n\t" \
: \
: "r" (1 << JTD), \
"M" (_SFR_IO_ADDR(MCUCR)) \
: "r0"); \
}MACROE
#endif
/** 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
@ -116,9 +118,10 @@
*
* \param[in] Condition Condition that will be evaluated,
*/
#define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \
"Assertion \"%s\" failed.\r\n"), \
__FILE__, __func__, __LINE__, #Condition); } }MACROE
#define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { \
printf_P(PSTR("%s: Function \"%s\", Line %d: " \
"Assertion \"%s\" failed.\r\n"), \
__FILE__, __func__, __LINE__, #Condition); } }MACROE
#if !defined(pgm_read_ptr) || defined(__DOXYGEN__)
/** Reads a pointer out of PROGMEM space on the AVR8 architecture. This is currently a wrapper for the
@ -135,6 +138,14 @@
*/
#define pgm_read_ptr(Address) (void*)pgm_read_word(Address)
#endif
#elif (ARCH == ARCH_UC3)
#define JTAG_DEBUG_POINT() __asm__ __volatile__ ("nop" ::)
#define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("breakpoint" ::)
#define JTAG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE
#define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { \
printf("%s: Function \"%s\", Line %d: " \
"Assertion \"%s\" failed.\r\n"), \
__FILE__, __func__, __LINE__, #Condition); } }MACROE
#endif
/* Disable C linkage for C++ Compilers: */

View file

@ -204,6 +204,16 @@
/** Selects the Bitwizard Big-Multio specific board drivers, including the driver for the board LEDs. */
#define BOARD_BIGMULTIO 46
/** Selects the DorkbotPDX Duce specific board drivers, including the driver for the board LEDs. */
#define BOARD_DUCE 47
/** Selects the Olimex AVR-USB-32U4 specific board drivers, including the Button and LED drivers. */
#define BOARD_OLIMEX32U4 48
/** Selects the Olimex AVR-USB-T32U4 specific board drivers, including the Button and LED drivers. */
#define BOARD_OLIMEXT32U4 49
#if !defined(__DOXYGEN__)
#define BOARD_ BOARD_NONE

View file

@ -10,9 +10,15 @@
* <b>New:</b>
* - Core:
* - Added support for the BitWizard Multio and Big-Multio boards
* - Added support for the DorkbotPDX Duce board
* - Added support for the Olimex AVR-USB-32U4 board
* - Added support for the Olimex AVR-USB-T32U4 board
* - Added new Endpoint_ConfigureEndpointTable() function
* - Added new Pipe_ConfigurePipeTable() function
* - Library Applications:
* - Modified the CDC Host demos to set a default CDC Line Encoding on enumerated devices
* - Added Dataflash operational checks and aborts to all projects using the Dataflash to ensure it is working correctly before use
* - Added new SerialToLCD user project contributed by Simon Foster
*
* <b>Changed:</b>
* - Core:
@ -20,10 +26,26 @@
* - Audio Device Class driver changed to also require the index of the Audio Control interface within the device, for SET/GET/CUR/MIN/MAX/RES property adjustments
* - Removed variable axis support from the HID_DESCRIPTOR_JOYSTICK() macro due to OS incompatibilities, replaced with fixed 3-axis joystick report structure
* - Removed the old pseudo-scheduler from the library as it was unused and deprecated since the 090810 release
* - Endpoint indexes are now specified as full endpoint addresses within the device in device mode, rather than a logical index
* - The Endpoint_ConfigureEndpoint() function no longer takes an endpoint direction as a parameter, as this is now deduced from the specified full endpoint
* address and type
* - The Endpoint_ConfigureEndpoint() function no longer takes a number of banks as a special mask; the number of banks is now specified as an integer parameter
* - Endpoints are now configured via instances of a new struct USB_Endpoint_Table_t in all device mode class drivers, rather than a list of endpoint parameters
* - Pipe indexes are now specified as full pipe addresses within the host in host mode, rather than a logical index
* - The Pipe_ConfigurePipe() function no longer takes an pipe token as a parameter, as this is now deduced from the specified full pipe address and type
* - The Pipe_ConfigurePipe() function no longer takes a number of banks as a special mask; the number of banks is now specified as an integer parameter
* - Pipes are now configured via instances of a new struct USB_Pipe_Table_t in all host mode class drivers, rather than a list of pipe parameters
* - Added support for various assert and debugging macros for the UC3 devices
* - Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues
* on some architectures (thanks to Darren Gibbs)
* - Changed board LED driver implementations of LEDs_ToggleLEDs() for the AVR8 architecture to use the fast PIN register toggle alternative function for speed
* - Library Applications:
* - Raised the guard bits in the AVRISP-MKII clone project when in PDI and TPI to 32, to prevent communication errors on low quality connections to a target
* - Added additional bootloader API data to expose the bootloader start address and class to the DFU and CDC class bootloaders
* - Reverted AVRISP-MKII clone project watchdog based command timeout patch in favour of a hardware timer, to allow for use in devices with WDTRST fuse programmed
* - The library bootloaders will now correctly start the user application after a watchdog-based application start, even if the /HWB line is held low externally
* during the reset phase
* - Increased endpoint polling interval for all demos and projects to 5ms, as 1ms was causing some enumeration issues on some machines (thanks to Riku Salminen)
*
* <b>Fixed:</b>
* - Core:
@ -33,11 +55,19 @@
* - Fixed compile error for the UC3 architecture when INTERRUPT_CONTROL_ENDPOINT is specified (thanks to Andrus Aaslaid)
* - Fixed compile error if LEDs_Disable() is called and BOARD=NONE is set (thanks to Sam Lin)
* - Fixed inverted LED logic in the OLIMEX162 board LED driver
* - Fixed incorrect reponse to GET STATUS requests in device mode if NO_DEVICE_SELF_POWER or NO_DEVICE_REMOTE_WAKEUP tokens are defined (thanks to Georg Glock)
* - Fixed inverted LED logic in the USB2AX board LED driver
* - Fixed possible deadlock in the CDC device driver if the USB connection is dropped while the CDC_REQ_SetLineEncoding control request is being processed by
* the stack (thanks to Jonathan Hudgins)
* - Fixed broken MIDI host driver MIDI_Host_ReceiveEventPacket() function due to not unfreezing the MIDI data IN pipe before use (thanks to Michael Brown)
* - Library Applications:
* - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter)
* - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is
* defined (thanks to Steven Morehouse)
* - Fixed AVRISP-MKII programmer project reset line polarity inverted when the generated EEP file is loaded into the USB AVR's EEPROM and avr-dude is used
* - Fixed CDC and DFU bootloaders failing to compile when the bootloader section size is 8KB or more (thanks to Georg Glock)
* - Fixed incorrect DFU version number reported to the host in the DFU bootloader descriptors (thanks to Georg Glock)
* - Fixed incorrect version hundredths value encoding in VERSION_BCD() macro (thanks to Georg Glock)
*
* \section Sec_ChangeLog120219 Version 120219
* <b>New:</b>

View file

@ -106,6 +106,7 @@
* - Busware BUI
* - Busware CUL V3
* - Busware TUL
* - DorkbotPDX Duce
* - Fletchtronics Bumble-B (using manufacturer recommended peripheral layout)
* - Kernel Concepts USBFOO
* - Linnix UDIP
@ -115,6 +116,8 @@
* - Microsin AVR-USB162
* - Minimus USB
* - Olimex AVR-USB-162
* - Olimex AVR-USB-32U4
* - Olimex AVR-USB-T32U4
* - Paranoid Studio's US2AX (V1, V2 and V3 hardware revisions)
* - PJRC Teensy (1.x and 2.x versions)
* - Sparkfun U2 Breakout Board
@ -377,6 +380,41 @@
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA64C3</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA128C3</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA192C3</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA256C3</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA384C3</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA16C4</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* <tr>
* <td>ATXMEGA32C4</td>
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
* </table>
*
* \section Sec_XMEGASupport_Boards Supported Atmel Boards

View file

@ -22,12 +22,10 @@
* -# Pull out third party libraries into a separate folder and reference them as required
* -# Add a LUFA_YIELD macro for integration into a third-party RTOS
* -# Abstract out Mass Storage byte send/receive to prevent low level API use in projects
* -# Consider switch from endpoint numbers to full endpoint addresses to ease future architecture expansion
* -# Fix HID report parser usage support for array types
* -# Make HOST_DEVICE_SETTLE_DELAY_MS a global variable that can be changed
* -# Add MANDATORY_EVENT_FUNCTIONS compile time option
* -# Add watchdog support to the library and apps/bootloaders
* -# Fix Still Image Host class driver - missing reqs, parameters
* - Testing/Verification
* -# Re-run USBIF test suite on all classes to formally verify operation
* -# Implement automated functional testing of all demos

View file

@ -0,0 +1,40 @@
/** \file
*
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
/** \page Page_KnownIssues Known Issues
* The following are known issues present in each official LUFA release. This list should contain all known
* issues in the library. Most of these issues should be corrected in the future release - see
* \ref Page_FutureChanges for a list of planned changes in future releases.
*
* \section Sec_KnownIssuesXXXXXX Version XXXXXX
* - AVR8 Architecture
* - No known issues.
* - XMEGA Architecture
* - No demos, bootloaders or projects have been ported for the XMEGA devices in the current release,
* although the architecture is supported in the LUFA core library.
* - Endpoints of more than 64 bytes are not currently supported in this release.
* - Isochronous endpoints are not currently supported in this release. As a result, the audio class
* cannot be used on XMEGA devices.
* - Multiple-bank endpoints are not currently supported in this release.
* - Early revisions of the ATXMEGA128A1U are incompatible with LUFA, due to their various errata
* relating to the USB controller.
* - UC3 Architecture
* - No demos, bootloaders or projects have been ported for the UC3 devices in the current release,
* although the architecture is supported in the LUFA core library.
* - DMA transfers to and from the USB controller are not yet implemented for this release.
* - The UC3C, UC3D and UC3L sub-families of UC3 are not currently supported by the library due to their
* altered USB controller design.
* - The various \c CreateStream() functions for creating standard \c <stdio.h> compatible virtual file
* streams are not available on the UC3 architecture, due to a lack of suitable library support.
* - Architecture Independant
* - The HID parser fails for array type elements that have a MIN and MAX usage applied; each element
* in the array will receive a unique incrementing usage from the MIN value, up to MAX.
* - The current application makefiles do not work if the output directory is not the same directory
* as the makefile itself.
* - The LUFA library is not watchdog aware, and thus timeouts are possible if short periods are used
* and a lengthy USB operation is initiated.
*/

View file

@ -20,6 +20,7 @@
*
* \li AVR-USB-162, a USBKEY-like development board for the AT90USB162: http://olimex.com/dev/avr-usb-162.html
* \li Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/wiki/benito
* \li Duce, the sucessor to the Benito #7: http://dorkbotpdx.org/wiki/duce
* \li JM-DB-U2, an ATMEGA32U2 development board: http://u2.mattair.net/index.html
* \li Micropendous, an open design/source set of AVR USB development boards: http://micropendous.org/
* \li Microsin AVR-USB162 breakout board, a DIY AT90USB162 development board: http://microsin.ru/content/view/685/44/
@ -36,6 +37,7 @@
* The following are known hobbyist projects using LUFA. Most are open source, and show off interesting ways that the LUFA library
* can be incorporated into many different applications.
*
* \li Accelerometer Game Joystick: http://www.crictor.co.il/he/episodes/joystick/
* \li Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia
* \li Arcade Joystick: http://jamie.lentin.co.uk/embedded/arcade-joystick/
* \li AttoBasic AVR BASIC interpreter: http://www.cappels.org/dproj/AttoBasic2_1/AttoBasic_2.1_with_USB_and_Arduino_support.html

View file

@ -9,6 +9,7 @@
*
* \section Sec_UnofficialResources Unofficial Resources
* Unofficial Russian LUFA documentation translation: http://microsin.ru/Download.cnt/doc/LUFA/ \n
* Tutorial for LUFA USB Control Transfers: http://www.avrbeginners.net/new/tutorials/usb-control-transfers-with-lufa/
*
* \section Sec_ProjectPages LUFA Related Webpages
* Project Homepage: http://www.lufa-lib.org \n
@ -22,8 +23,8 @@
*
* \section Sec_InDevelopment Latest In-Development Source Code
* Issue Tracker: http://www.lufa-lib.org/tracker \n
* SVN Access: http://www.lufa-lib.org/svn \n
* GIT Access: http://www.lufa-lib.org/git \n
* Public SVN Repository: http://www.lufa-lib.org/svn \n
* Public GIT Repository: http://www.lufa-lib.org/git \n
* Latest Repository Source Archive: http://www.lufa-lib.org/latest-archive \n
* Commit RSS Feed: http://www.lufa-lib.org/rss \n
*

View file

@ -42,6 +42,7 @@
* \li \subpage Page_Donating - Donating to support this project
* \li \subpage Page_DeviceSupport - Current Device and Hardware Support
* \li \subpage Page_ChangeLog - Project Changelog
* \li \subpage Page_KnownIssues - Known Issues
* \li \subpage Page_FutureChanges - Planned Changes to the Library
* \li \subpage Page_GettingStarted - Getting started with LUFA
* \li \subpage Page_DevelopingWithLUFA - Developing with LUFA

View file

@ -17,10 +17,33 @@
* - The HID_DESCRIPTOR_JOYSTICK() macro no longer takes a variable number of axis as a parameter, due to OS incompatibilities; this macro now uses a fixed
* 3 axis of data. User applications should update their calls to this macro and their report structures to suit a fixed 3-axis joystick report. If a user
* application requires more than 3 axis' of data, a custom report descriptor will need to be constructed by hand.
* - The \ref Endpoint_ConfigureEndpoint() function no longer takes in masks for the banks and direction; the number of banks is now an integer argument, and
* the direction is obtained from the full endpoint address within the device. Applications calling Endpoint_ConfigureEndpoint() should update their API
* call to use a full endpoint address (including ENDPOINT_DIR_IN or ENDPOINT_DIR_OUT direction in the MSB of the endpoint address) and an integer number
* of banks.
* - All endpoint functions now operate on full endpoint addresses within the device, rather than a directionless endpoint index. Applications should update
* their API calls to use full endpoint addresses when required within the device.
* - All device mode class drivers have been updated to use a new unified endpoint description structure for all endpoints; existing applications will need
* to update their class driver struct instantiation to match the new scheme (see \ref USB_Endpoint_Table_t).
* - The \c ENDPOINT_BANKS_SUPPORTED() and \c ENDPOINT_MAX_ENDPOINT_SIZE() macros have been removed, as these do not function correctly with the new addressing
* scheme for the endpoint APIs. Please refer to the target device's datasheet for the maximum bank size of each endpoint.
* - The MIDI class driver \ref MIDI_EventPacket_t event packet no longer contains seperate \c CableIndex and \c Command entries; these have been combined
* into a single \c Event element which can be contructed using the new macro \ref MIDI_EVENT(). Existing applications should use the new macro and structure
* element name.
*
* <b>Host Mode</b>
* - The Android Accessory Host class driver property strings are now a array of \c char* rather than a struct of named pointers. Existing applications
* should use C99 Designated Initializers with the property string indexes located in \ref AOA_Strings_t instead.
* - The \ref Pipe_ConfigurePipe() function no longer takes in masks for the banks and token; the number of banks is now an integer argument, and the token
* is now inferred from the full pipe address within the device, and the pipe type. Applications calling Pipe_ConfigurePipe() should update their API
* call to use a full pipe address (including PIPE_DIR_IN or PIPE_DIR_OUT direction in the MSB of the pipe address) and an integer number of banks.
* - All pipe functions now operate on full pipe addresses within the device, rather than a directionless pipe index. Applications should update their API
* calls to use full pipe addresses when required within the device.
* - All host mode class drivers have been updated to use a new unified pipe description structure for all pipes; existing applications will need to update
* their class driver struct instantiation to match the new scheme (see \ref USB_Pipe_Table_t).
* - The MIDI class driver \ref MIDI_EventPacket_t event packet no longer contains seperate \c CableIndex and \c Command entries; these have been combined
* into a single \c Event element which can be contructed using the new macro \ref MIDI_EVENT(). Existing applications should use the new macro and structure
* element name.
*
* \section Sec_Migration120219 Migrating from 111009 to 120219
* <b>USB Core</b>
@ -130,7 +153,7 @@
* eliminate any casting of descriptor pointers to a non \c const pointer.
* - The names of the class specific descriptor type defines in the USB Class drivers have changed - refer to the driver documentation
* for each class driver for the new class specific descriptor type names.
* - The \c ENDPOINT_DOUBLEBANK_SUPPORTED() macro is has been renamed \ref ENDPOINT_BANKS_SUPPORTED() and now returns the total number of
* - The \c ENDPOINT_DOUBLEBANK_SUPPORTED() macro is has been renamed \c ENDPOINT_BANKS_SUPPORTED() and now returns the total number of
* banks supported by the given endpoint. Existing code should switch to the new naming scheme, and test that the return value of the
* macro is equal to or greater than 2 to regain the previous functionality.
* - The \c EVENT_USB_Device_UnhandledControlRequest() event is now named \ref EVENT_USB_Device_ControlRequest() and fires before (not after)

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Adafruit U4 Breakout board (http://ladyada.net/products/atmega32u4breakout).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTE.6</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTE ^= LEDMask;
PINE = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Atmel ATAVRUSBRF01.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,12 @@
*
* Board specific LED driver header for the Atmel ATAVRUSBRF01.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>RX LED</td><td>High</td><td>PORTD.0</td></tr>
* <tr><td>LEDS_LED2</td><td>Red</td><td>TX LED</td><td>High</td><td>PORTD.1</td></tr>
* </table>
*
* @{
*/
@ -61,15 +67,6 @@
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
#define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED2)
#define LEDS_PORTE_LEDS (LEDS_LED3 | LEDS_LED4)
#define LEDS_PORTE_MASK_SHIFT 4
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** LED mask for the first LED on the board. */
@ -121,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,12 @@
*
* Board specific LED driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>TX LED</td><td>Low</td><td>PORTC.7</td></tr>
* <tr><td>LEDS_LED2</td><td>Red</td><td>RX LED</td><td>Low</td><td>PORTC.6</td></tr>
* </table>
*
* @{
*/
@ -112,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTC ^= LEDMask;
PINC = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,13 @@
*
* Board specific LED driver header for the Bitwizard Big-Multio (http://www.bitwizard.nl/wiki/index.php/Usbbigmultio).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Unknown</td><td>LED0</td><td>High</td><td>PORTF.6</td></tr>
* <tr><td>LEDS_LED2</td><td>Unknown</td><td>LED1</td><td>High</td><td>PORTF.7</td></tr>
* <tr><td>LEDS_LED3</td><td>Unknown</td><td>LED2</td><td>High</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/
@ -132,8 +139,8 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTF ^= (LEDMask & LEDS_PORTF_LEDS);
PORTE ^= (LEDMask & LEDS_PORTE_LEDS);
PINF = (LEDMask & LEDS_PORTF_LEDS);
PINE = (LEDMask & LEDS_PORTE_LEDS);
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -40,7 +40,13 @@
* \defgroup Group_LEDs_BLACKCAT BLACKCAT
* \brief Board specific LED driver header for the BLACKCAT USB JTAG.
*
* Board specific LED driver header for the TCNISO Blackcat USB JTAG (http://www.embeddedcomputers.net/products/BlackcatUSB/.
* Board specific LED driver header for the TCNISO Blackcat USB JTAG (http://www.embeddedcomputers.net/products/BlackcatUSB).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Unknown</td><td>LED0</td><td>High</td><td>PORTD.6</td></tr>
* <tr><td>LEDS_LED2</td><td>Unknown</td><td>LED1</td><td>High</td><td>PORTD.3</td></tr>
* </table>
*
* @{
*/
@ -112,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,13 @@
*
* Board specific LED driver header for the Busware BUI (http://www.busware.de/tiki-index.php?page=BUI).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Red</td><td>RGB LED</td><td>High</td><td>PORTC.2</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>RGB LED</td><td>High</td><td>PORTC.3</td></tr>
* <tr><td>LEDS_LED3</td><td>Blue</td><td>RGB LED</td><td>High</td><td>PORTC.4</td></tr>
* </table>
*
* @{
*/
@ -115,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTC ^= LEDMask;
PINC = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -44,6 +44,11 @@
* third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral
* layout for buttons, LEDs and a Joystick.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -44,6 +44,11 @@
* third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral
* layout for buttons, LEDs and a Joystick.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>PORTD.2</td><td>PORTD.3</td><td>PORTD.0</td><td>PORTD.1</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/

View file

@ -44,6 +44,14 @@
* third-party board does not include any on-board peripherals, but does have an officially recommended external
* peripheral layout for buttons, LEDs and a Joystick.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>N/A</td><td>User Supplied</td><td>High</td><td>PORTB.4</td></tr>
* <tr><td>LEDS_LED2</td><td>N/A</td><td>User Supplied</td><td>High</td><td>PORTB.5</td></tr>
* <tr><td>LEDS_LED3</td><td>N/A</td><td>User Supplied</td><td>High</td><td>PORTB.6</td></tr>
* <tr><td>LEDS_LED4</td><td>N/A</td><td>User Supplied</td><td>High</td><td>PORTB.7</td></tr>
* </table>
*
* @{
*/
@ -120,7 +128,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
PINB = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>General Indicator</td><td>High</td><td>PORTE.6</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTE ^= LEDMask;
PINE = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -0,0 +1,147 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Board specific LED driver header for the DorkbotPDX Duce.
* \copydetails Group_LEDs_DUCE
*
* \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_DUCE DUCE
* \brief Board specific LED driver header for the DorkbotPDX Duce.
*
* Board specific LED driver header for the DorkbotPDX Duce (http://dorkbotpdx.org/wiki/duce).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Red</td><td>Bicolor Indicator 1</td><td>High</td><td>PORTC.4</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>Bicolor Indicator 1</td><td>High</td><td>PORTC.5</td></tr>
* <tr><td>LEDS_LED3</td><td>Red</td><td>Bicolor Indicator 2</td><td>High</td><td>PORTC.6</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>Bicolor Indicator 2</td><td>High</td><td>PORTC.7</td></tr>
* </table>
*
* @{
*/
#ifndef __LEDS_DUCE_H__
#define __LEDS_DUCE_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** LED mask for the first LED on the board. */
#define LEDS_LED1 (1 << 4)
/** LED mask for the second LED on the board. */
#define LEDS_LED2 (1 << 5)
/** LED mask for the third LED on the board. */
#define LEDS_LED3 (1 << 6)
/** LED mask for the fourth LED on the board. */
#define LEDS_LED4 (1 << 7)
/** LED mask for all the LEDs on the board. */
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
DDRC |= LEDS_ALL_LEDS;
PORTC &= ~LEDS_ALL_LEDS;
}
static inline void LEDs_Disable(void)
{
DDRC &= ~LEDS_ALL_LEDS;
PORTC &= ~LEDS_ALL_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTC |= LEDMask;
}
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
PORTC &= ~LEDMask;
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
{
PORTC = ((PORTC & ~LEDS_ALL_LEDS) | LEDMask);
}
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTC = ((PORTC & ~LEDMask) | ActiveMask);
}
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PINC = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return (PORTC & LEDS_ALL_LEDS);
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Atmel EVK527.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel EVK527.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB321C (4MB)</td><td>PORTE.6</td><td>SPI0</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific joystick driver header for the Atmel EVK527.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>PORTF.4</td><td>PORTF.5</td><td>PORTF.7</td><td>PORTC.6</td><td>PORTF.6</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,13 @@
*
* Board specific LED driver header for the Atmel EVK527.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.6</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/
@ -115,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,12 @@
*
* Board specific LED driver header for the Maximus (http://www.avrusb.com/).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>LG</td><td>High</td><td>PORTB.6</td></tr>
* <tr><td>LEDS_LED2</td><td>Red</td><td>LR</td><td>High</td><td>PORTB.7</td></tr>
* </table>
*
* @{
*/
@ -112,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
PINB = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -100,6 +100,18 @@
*
* Board specific Buttons driver header for the Micropendous 32U2 (https://code.google.com/p/micropendous/wiki/Micropendous_32U2).
*
* <b>BOARD_MICROPENDOUS_1 and BOARD_MICROPENDOUS_32U2</b>:
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* <b>Other Revisions</b>:
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/

View file

@ -56,6 +56,18 @@
*
* Board specific LED driver header for the Micropendous 32U2 (https://code.google.com/p/micropendous/wiki/Micropendous_32U2).
*
* <b>BOARD_MICROPENDOUS_32U2</b>:
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.6</td></tr>
* </table>
*
* <b>Other Revisions</b>:
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTB.1</td></tr>
* </table>
*
* @{
*/
@ -92,6 +104,7 @@
#define _BOARD_LED_CONCAT(Reg, Letter) _BOARD_LED_CONCAT2(Reg, Letter)
#define _BOARD_LED_PORT _BOARD_LED_CONCAT(PORT, _BOARD_LED_PORTLETTER)
#define _BOARD_LED_PIN _BOARD_LED_CONCAT(PIN, _BOARD_LED_PORTLETTER)
#define _BOARD_LED_DDR _BOARD_LED_CONCAT(DDR, _BOARD_LED_PORTLETTER)
#endif
@ -143,7 +156,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
_BOARD_LED_PORT ^= LEDMask;
_BOARD_LED_PIN = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the MINIMUS.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,13 @@
*
* Board specific LED driver header for the Minimus USB (http://www.minimususb.com/).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Red</td><td>General Indicator</td><td>Low</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTD.6</td></tr>
* <tr><td>LEDS_LED3</td><td>Blue</td><td>General Indicator</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/
@ -69,11 +76,14 @@
/** LED mask for the second LED on the board. */
#define LEDS_LED2 (1 << 6)
/** LED mask for the third LED on the board. */
#define LEDS_LED3 (1 << 7)
/** LED mask for all the LEDs on the board. */
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2)
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3)
/** LED mask for the none of the board LEDs. */
#define LEDS_NO_LEDS 1
#define LEDS_NO_LEDS 0
/* Inline Functions: */
#if !defined(__DOXYGEN__)
@ -112,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,13 @@
*
* Board specific LED driver header for the Bitwizard Multio (http://www.bitwizard.nl/wiki/index.php/USB-multio).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.0</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTC.2</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/
@ -132,8 +139,8 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= (LEDMask & LEDS_PORTD_LEDS);
PORTC ^= (LEDMask & LEDS_PORTC_LEDS);
PIND = (LEDMask & LEDS_PORTD_LEDS);
PINC = (LEDMask & LEDS_PORTC_LEDS);
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Olimex AVR-USB-162 Development Board (http://www.olimex.com/dev/avr-usb-162.html).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Olimex AVR-USB-162 (http://www.olimex.com/dev/avr-usb-162.html).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>General Indicator</td><td>High</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -0,0 +1,103 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board.
* \copydetails Group_Buttons_OLIMEX32U4
*
* \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_OLIMEX32U4 OLIMEX32U4
* \brief Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board.
*
* Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board (http://www.olimex.com/dev/olimexino-32u4.html).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/
#ifndef __BUTTONS_OLIMEX32U4_H__
#define __BUTTONS_OLIMEX32U4_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#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 << 2)
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
{
DDRE &= ~BUTTONS_BUTTON1;
PORTE |= BUTTONS_BUTTON1;
}
static inline void Buttons_Disable(void)
{
DDRE &= ~BUTTONS_BUTTON1;
PORTE &= ~BUTTONS_BUTTON1;
}
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1);
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */

View file

@ -0,0 +1,179 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Board specific LED driver header for the Olimex AVR-USB-32U4.
* \copydetails Group_LEDs_OLIMEX32U4
*
* \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_OLIMEX32U4 OLIMEX32U4
* \brief Board specific LED driver header for the Olimex AVR-USB-32U4.
*
* Board specific LED driver header for the Olimex AVR-USB-32U4 (http://www.olimex.com/dev/olimexino-32u4.html).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>TX</td><td>High</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>RX</td><td>High</td><td>PORTB.0</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>General Indicator (Default Unconnected)</td><td>High</td><td>PORTE.6</td></tr>
* <tr><td>LEDS_LED4</td><td>Yellow</td><td>General Indicator (Default Unconnected)</td><td>High</td><td>PORTB.5</td></tr>
* </table>
*
* @{
*/
#ifndef __LEDS_OLIMEX32U4_H__
#define __LEDS_OLIMEX32U4_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
#define LEDS_PORTB_LEDS (LEDS_LED2 | LEDS_LED4)
#define LEDS_PORTD_LEDS (LEDS_LED1)
#define LEDS_PORTE_LEDS (LEDS_LED3)
#define LEDS_PORTD_MASK_SHIFT 1
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** LED mask for the first LED on the board. */
#define LEDS_LED1 ((1 << 5) >> LEDS_PORTD_MASK_SHIFT)
/** LED mask for the second LED on the board. */
#define LEDS_LED2 (1 << 0)
/** LED mask for the third LED on the board. */
#define LEDS_LED3 (1 << 5)
/** LED mask for the fourth LED on the board. */
#define LEDS_LED4 (1 << 6)
/** LED mask for all the LEDs on the board. */
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
DDRB |= LEDS_PORTB_LEDS;
PORTB &= ~LEDS_PORTB_LEDS;
DDRD |= (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT);
PORTD &= ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT);
DDRE |= LEDS_PORTE_LEDS;
PORTE &= ~LEDS_PORTE_LEDS;
}
static inline void LEDs_Disable(void)
{
DDRB &= LEDS_PORTB_LEDS;
PORTB &= ~LEDS_PORTB_LEDS;
DDRD &= (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT);
PORTD &= ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT);
DDRE &= LEDS_PORTE_LEDS;
PORTE &= ~LEDS_PORTE_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTB |= (LEDMask & LEDS_PORTB_LEDS);
PORTD |= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
PORTE |= (LEDMask & LEDS_PORTE_LEDS);
}
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
PORTB &= ~(LEDMask & LEDS_PORTB_LEDS);
PORTD &= ~((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
PORTE &= ~(LEDMask & LEDS_PORTE_LEDS);
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
{
PORTB = ((PORTB & ~LEDS_PORTB_LEDS) | (LEDMask & LEDS_PORTB_LEDS));
PORTD = ((PORTD & ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT)) |
((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT));
PORTE = ((PORTE & ~LEDS_PORTE_LEDS) | (LEDMask & LEDS_PORTE_LEDS));
}
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTB = ((PORTB & ~(LEDMask & LEDS_PORTB_LEDS)) | (ActiveMask & LEDS_PORTB_LEDS));
PORTD = ((PORTD & ~((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT)) |
((ActiveMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT));
PORTE = ((PORTE & ~(LEDMask & LEDS_PORTE_LEDS)) | (ActiveMask & LEDS_PORTE_LEDS));
}
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PINB = (LEDMask & LEDS_PORTB_LEDS);
PIND = ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
PINE = (LEDMask & LEDS_PORTE_LEDS);
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return ((PORTB & LEDS_PORTB_LEDS) |
((PORTD & (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT)) >> LEDS_PORTD_MASK_SHIFT) |
(PORTE & LEDS_PORTE_LEDS));
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */

View file

@ -0,0 +1,103 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Board specific Buttons driver header for the Olimex AVR-USB-T32U4 Development Board.
* \copydetails Group_Buttons_OLIMEXT32U4
*
* \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_OLIMEXT32U4 OLIMEXT32U4
* \brief Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board.
*
* Board specific Buttons driver header for the Olimex AVR-USB-T32U4 Development Board (http://www.olimex.com/dev/avr-t32u4.html).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/
#ifndef __BUTTONS_OLIMEXT32U4_H__
#define __BUTTONS_OLIMEXT32U4_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#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 << 2)
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
{
DDRE &= ~BUTTONS_BUTTON1;
PORTE |= BUTTONS_BUTTON1;
}
static inline void Buttons_Disable(void)
{
DDRE &= ~BUTTONS_BUTTON1;
PORTE &= ~BUTTONS_BUTTON1;
}
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1);
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */

View file

@ -0,0 +1,169 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Board specific LED driver header for the Olimex AVR-USB-T32U4.
* \copydetails Group_LEDs_OLIMEXT32U4
*
* \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_OLIMEXT32U4 OLIMEXT32U4
* \brief Board specific LED driver header for the Olimex AVR-USB-T32U4.
*
* Board specific LED driver header for the Olimex AVR-USB-T32U4 (http://www.olimex.com/dev/avr-t32u4.html).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>TX</td><td>High</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>RX</td><td>High</td><td>PORTB.0</td></tr>
* <tr><td>LEDS_LED3</td><td>N/A</td><td>General Indicator (Not Mounted)</td><td>High</td><td>PORTE.6</td></tr>
* </table>
*
* @{
*/
#ifndef __LEDS_OLIMEXT32U4_H__
#define __LEDS_OLIMEXT32U4_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
#define LEDS_PORTB_LEDS (LEDS_LED2)
#define LEDS_PORTD_LEDS (LEDS_LED1)
#define LEDS_PORTE_LEDS (LEDS_LED3)
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** LED mask for the first LED on the board. */
#define LEDS_LED1 (1 << 5)
/** LED mask for the second LED on the board. */
#define LEDS_LED2 (1 << 0)
/** LED mask for the third LED on the board. */
#define LEDS_LED3 (1 << 6)
/** LED mask for all the LEDs on the board. */
#define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3)
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
DDRB |= LEDS_PORTB_LEDS;
PORTB &= ~LEDS_PORTB_LEDS;
DDRD |= LEDS_PORTD_LEDS;
PORTD &= ~LEDS_PORTD_LEDS;
DDRE |= LEDS_PORTE_LEDS;
PORTE &= ~LEDS_PORTE_LEDS;
}
static inline void LEDs_Disable(void)
{
DDRB &= LEDS_PORTB_LEDS;
PORTB &= ~LEDS_PORTB_LEDS;
DDRD &= LEDS_PORTD_LEDS;
PORTD &= ~LEDS_PORTD_LEDS;
DDRE &= LEDS_PORTE_LEDS;
PORTE &= ~LEDS_PORTE_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTB |= (LEDMask & LEDS_PORTB_LEDS);
PORTD |= (LEDMask & LEDS_PORTD_LEDS);
PORTE |= (LEDMask & LEDS_PORTE_LEDS);
}
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
PORTB &= ~(LEDMask & LEDS_PORTB_LEDS);
PORTD &= ~(LEDMask & LEDS_PORTD_LEDS);
PORTE &= ~(LEDMask & LEDS_PORTE_LEDS);
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
{
PORTB = ((PORTB & ~LEDS_PORTB_LEDS) | (LEDMask & LEDS_PORTB_LEDS));
PORTD = ((PORTD & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS));
PORTE = ((PORTE & ~LEDS_PORTE_LEDS) | (LEDMask & LEDS_PORTE_LEDS));
}
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTB = ((PORTB & ~(LEDMask & LEDS_PORTB_LEDS)) | (ActiveMask & LEDS_PORTB_LEDS));
PORTD = ((PORTD & ~(LEDMask & LEDS_PORTD_LEDS)) | (ActiveMask & LEDS_PORTD_LEDS));
PORTE = ((PORTE & ~(LEDMask & LEDS_PORTE_LEDS)) | (ActiveMask & LEDS_PORTE_LEDS));
}
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PINB = (LEDMask & LEDS_PORTB_LEDS);
PIND = (LEDMask & LEDS_PORTD_LEDS);
PINE = (LEDMask & LEDS_PORTE_LEDS);
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return ((PORTB & LEDS_PORTB_LEDS) | (PORTD & LEDS_PORTD_LEDS) | (PORTE & LEDS_PORTE_LEDS));
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Atmel RZUSBSTICK.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Blue</td><td>General Indicator</td><td>High</td><td>PORTD.7</td></tr>
* <tr><td>LEDS_LED1</td><td>Red</td><td>General Indicator</td><td>Low</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTE.6</td></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>General Indicator</td><td>Low</td><td>PORTE.7</td></tr>
* </table>
*
* @{
*/
@ -144,8 +152,8 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= (LEDMask & LEDS_PORTD_LEDS);
PORTE ^= ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
PIND = (LEDMask & LEDS_PORTD_LEDS);
PINE = ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Sparkfun ATMEGA8U2 breakout board (http://www.sparkfun.com/products/10277).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTB.4</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
PINB = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Atmel STK525.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel STK525.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB321C (4MB)</td><td>PORTB.4</td><td>SPI0</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific joystick driver header for the Atmel STK525.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>PORTB.6</td><td>PORTB.7</td><td>PORTE.4</td><td>PORTE.5</td><td>PORTB.5</td></tr>
* </table>
*
* @{
*/
@ -76,7 +81,7 @@
#define JOY_LEFT (1 << 6)
/** Mask for the joystick being pushed in the right direction. */
#define JOY_RIGHT ((1 << 4) >> 1)
#define JOY_RIGHT ((1 << 4) >> JOY_PORTE_MASK_SHIFT)
/** Mask for the joystick being pushed in the upward direction. */
#define JOY_UP (1 << 7)

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Atmel STK525.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.4</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.6</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/
@ -118,7 +126,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Atmel STK526.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel STK525.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTC.2</td><td>SPI0</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific joystick driver header for the Atmel STK526.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>PORTB.4</td><td>PORTB.5</td><td>PORTB.6</td><td>PORTB.7</td><td>PORTB.0</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Atmel STK526.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.1</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.0</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/
@ -118,7 +126,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -51,6 +51,18 @@
*
* Board specific LED driver header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html).
*
* <b>TEENSY</b>:
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.6</td></tr>
* </table>
*
* <b>TEENSY2</b>:
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTD.6</td></tr>
* </table>
*
* @{
*/
@ -139,7 +151,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Busware TUL (http://www.busware.de/tiki-index.php?page=TUL).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Busware TUL (http://www.busware.de/tiki-index.php?page=TUL).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTF.0</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTF ^= LEDMask;
PINF = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Linnix UDIP (http://linnix.com/udip/).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Linnix UDIP (http://linnix.com/udip/).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>Bicolor Indicator 1</td><td>High</td><td>PORTB.6</td></tr>
* <tr><td>LEDS_LED2</td><td>Red</td><td>Bicolor Indicator 1</td><td>High</td><td>PORTB.5</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>Bicolor Indicator 2</td><td>High</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED4</td><td>Red</td><td>Bicolor Indicator 2</td><td>High</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/
@ -133,8 +141,8 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= (LEDMask & LEDS_PORTB_LEDS);
PORTD ^= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
PINB = (LEDMask & LEDS_PORTB_LEDS);
PIND = ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,12 @@
*
* Board specific LED driver header for the Arduino Uno (http://arduino.cc/en/Main/ArduinoBoardUno).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>RX</td><td>Low</td><td>PORTD.4</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>TX</td><td>Low</td><td>PORTD.5</td></tr>
* </table>
*
* @{
*/
@ -112,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -51,6 +51,11 @@
*
* Board specific Buttons driver header for the Paranoid Studio USB2AX (http://paranoidstudio.assembla.com/wiki/show/paranoidstudio/USB2AX).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -51,6 +51,18 @@
*
* Board specific LED driver header for the Paranoid Studio USB2AX (http://paranoidstudio.assembla.com/wiki/show/paranoidstudio/USB2AX).
*
* <b>USB2AX</b>:
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTC.6</td></tr>
* </table>
*
* <b>USB2AX_V3</b>:
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.1</td></tr>
* </table>
*
* @{
*/
@ -96,11 +108,11 @@
static inline void LEDs_Init(void)
{
#if (BOARD == BOARD_USB2AX)
DDRC |= LEDS_ALL_LEDS;
PORTC |= LEDS_ALL_LEDS;
DDRC |= LEDS_ALL_LEDS;
PORTC &= ~LEDS_ALL_LEDS;
#else
DDRD |= LEDS_ALL_LEDS;
PORTD |= LEDS_ALL_LEDS;
DDRD |= LEDS_ALL_LEDS;
PORTD &= ~LEDS_ALL_LEDS;
#endif
}
@ -118,27 +130,27 @@
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_USB2AX)
PORTC &= ~LEDMask;
PORTC |= LEDMask;
#else
PORTD &= ~LEDMask;
PORTD |= LEDMask;
#endif
}
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_USB2AX)
PORTC |= LEDMask;
PORTC &= ~LEDMask;
#else
PORTD |= LEDMask;
PORTD &= ~LEDMask;
#endif
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_USB2AX)
PORTC = ((PORTC | LEDS_ALL_LEDS) & ~LEDMask);
PORTC = ((PORTC & ~LEDS_ALL_LEDS) | LEDMask);
#else
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
#endif
}
@ -146,18 +158,18 @@
const uint8_t ActiveMask)
{
#if (BOARD == BOARD_USB2AX)
PORTC = ((PORTC | LEDMask) & ~ActiveMask);
PORTC = ((PORTC & ~LEDMask) | ActiveMask);
#else
PORTD = ((PORTD | LEDMask) & ~ActiveMask);
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
#endif
}
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_USB2AX)
PORTC ^= LEDMask;
PINC = LEDMask;
#else
PORTD ^= LEDMask;
PIND = LEDMask;
#endif
}
@ -165,9 +177,9 @@
static inline uint8_t LEDs_GetLEDs(void)
{
#if (BOARD == BOARD_USB2AX)
return (~PORTC & LEDS_ALL_LEDS);
return (PORTC & LEDS_ALL_LEDS);
#else
return (~PORTD & LEDS_ALL_LEDS);
return (PORTD & LEDS_ALL_LEDS);
#endif
}
#endif

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific LED driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTD.4</td></tr>
* </table>
*
* @{
*/
@ -109,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Atmel USBKEY.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTE.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,12 @@
*
* Board specific Dataflash driver header for the Atmel USBKEY board.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTE.0</td><td>SPI0</td></tr>
* <tr><td>DATAFLASH_CHIP2</td><td>AT45DB642D (8MB)</td><td>PORTE.1</td><td>SPI0</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific joystick driver header for the Atmel USBKEY.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>PORTB.6</td><td>PORTB.7</td><td>PORTE.4</td><td>PORTE.5</td><td>PORTB.5</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Atmel USBKEY.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Red</td><td>Bicolor Indicator 1</td><td>Low</td><td>PORTD.4</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>Bicolor Indicator 1</td><td>Low</td><td>PORTD.5</td></tr>
* <tr><td>LEDS_LED3</td><td>Red</td><td>Bicolor Indicator 2</td><td>Low</td><td>PORTD.6</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>Bicolor Indicator 2</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/
@ -118,7 +126,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/).
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>HWB Button</td><td>Low</td><td>PORTD.7</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,13 @@
*
* Board specific LED driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/).
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Red</td><td>Bicolor Indicator 1</td><td>High</td><td>PORTB.6</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>Bicolor Indicator 1</td><td>High</td><td>PORTB.7</td></tr>
* <tr><td>LEDS_LED3</td><td>Red</td><td>Target Power</td><td>High</td><td>PORTB.5</td></tr>
* </table>
*
* @{
*/
@ -115,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
PINB = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -51,6 +51,18 @@
*
* Board specific Dataflash driver header for the Atmel XPLAIN.
*
* <b>Revision 1 Boards</b>:
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB041D (512KB)</td><td>PORTB.5</td><td>SPI0</td></tr>
* </table>
*
* <b>Other Board Revisions</b>:
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTB.5</td><td>SPI0</td></tr>
* </table>
*
* @{
*/
@ -59,6 +71,7 @@
/* Includes: */
#include "../../../../Common/Common.h"
#include "../../../Misc/AT45DB642D.h"
#include "../../../Peripheral/SPI.h"

View file

@ -49,6 +49,11 @@
*
* Board specific LED driver header for the Atmel XPLAIN.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTB.6</td></tr>
* </table>
*
* @{
*/
@ -116,7 +121,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
PINB = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;

View file

@ -143,6 +143,10 @@
#include "AVR8/MICROPENDOUS/Buttons.h"
#elif (BOARD == BOARD_B1_XPLAINED)
#include "XMEGA/B1_XPLAINED/Buttons.h"
#elif (BOARD == BOARD_OLIMEX32U4)
#include "AVR8/OLIMEX32U4/Buttons.h"
#elif (BOARD == BOARD_OLIMEXT32U4)
#include "AVR8/OLIMEXT32U4/Buttons.h"
#else
#include "Board/Buttons.h"
#endif

View file

@ -80,11 +80,11 @@
* // Turn on each of the four LEDs in turn
* LEDs_SetAllLEDs(LEDS_LED1);
* Delay_MS(500);
* LEDs_SetAllLEDs(LEDS_LED1);
* LEDs_SetAllLEDs(LEDS_LED2);
* Delay_MS(500);
* LEDs_SetAllLEDs(LEDS_LED1);
* LEDs_SetAllLEDs(LEDS_LED3);
* Delay_MS(500);
* LEDs_SetAllLEDs(LEDS_LED1);
* LEDs_SetAllLEDs(LEDS_LED4);
* Delay_MS(500);
*
* // Turn on all LEDs
@ -185,6 +185,12 @@
#include "AVR8/MULTIO/LEDs.h"
#elif (BOARD == BOARD_BIGMULTIO)
#include "AVR8/BIGMULTIO/LEDs.h"
#elif (BOARD == BOARD_DUCE)
#include "AVR8/DUCE/LEDs.h"
#elif (BOARD == BOARD_OLIMEX32U4)
#include "AVR8/OLIMEX32U4/LEDs.h"
#elif (BOARD == BOARD_OLIMEXT32U4)
#include "AVR8/OLIMEXT32U4/LEDs.h"
#else
#include "Board/LEDs.h"
#endif

View file

@ -42,6 +42,13 @@
*
* Board specific Buttons driver header for the Atmel EVK1100.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>SW0 Button</td><td>Low</td><td>GPIO88</td></tr>
* <tr><td>BUTTONS_BUTTON2</td><td>SW1 Button</td><td>Low</td><td>GPIO85</td></tr>
* <tr><td>BUTTONS_BUTTON3</td><td>SW2 Button</td><td>Low</td><td>GPIO82</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific joystick driver header for the Atmel EVK1100.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>GPIO25</td><td>GPIO26</td><td>GPIO28</td><td>GPIO27</td><td>GPIO20</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,18 @@
*
* Board specific LED driver header for the Atmel EVK1100.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>LED0 LED</td><td>Low</td><td>GPIO51</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>LED1 LED</td><td>Low</td><td>GPIO52</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>LED2 LED</td><td>Low</td><td>GPIO53</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>LED3 LED</td><td>Low</td><td>GPIO54</td></tr>
* <tr><td>LEDS_LED5</td><td>Green</td><td>LED4 LED</td><td>Low</td><td>GPIO59</td></tr>
* <tr><td>LEDS_LED6</td><td>Green</td><td>LED5 LED</td><td>Low</td><td>GPIO60</td></tr>
* <tr><td>LEDS_LED7</td><td>Green</td><td>LED6 LED</td><td>Low</td><td>GPIO61</td></tr>
* <tr><td>LEDS_LED8</td><td>Green</td><td>LED7 LED</td><td>Low</td><td>GPIO62</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,12 @@
*
* Board specific Buttons driver header for the Atmel EVK1101.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>SW0 Button</td><td>Low</td><td>GPIO34</td></tr>
* <tr><td>BUTTONS_BUTTON2</td><td>SW1 Button</td><td>Low</td><td>GPIO35</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific joystick driver header for the Atmel EVK1101.
*
* <table>
* <tr><th>Left Port Pin</th><th>Up Port Pin</th><th>Right Port Pin</th><th>Down Port Pin</th><th>Press Port Pin</th></tr>
* <tr><td>GPIO38</td><td>GPIO39</td><td>GPIO41</td><td>GPIO40</td><td>GPIO13</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Atmel EVK1101.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>LED0 LED</td><td>Low</td><td>GPIO7</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>LED1 LED</td><td>Low</td><td>GPIO8</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>LED2 LED</td><td>Low</td><td>GPIO21</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>LED3 LED</td><td>Low</td><td>GPIO22</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Buttons driver header for the Atmel EVK1104.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>SW0 Button</td><td>Low</td><td>GPIO42</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific LED driver header for the Atmel EVK1104.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Green</td><td>LED0 LED</td><td>Low</td><td>GPIO67</td></tr>
* <tr><td>LEDS_LED2</td><td>Green</td><td>LED1 LED</td><td>Low</td><td>GPIO101</td></tr>
* <tr><td>LEDS_LED3</td><td>Green</td><td>LED2 LED</td><td>Low</td><td>GPIO102</td></tr>
* <tr><td>LEDS_LED4</td><td>Green</td><td>LED3 LED</td><td>Low</td><td>GPIO105</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,13 @@
*
* Board specific Buttons driver header for the Atmel XMEGA A3BU Xplained.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>SW0 Button</td><td>Low</td><td>PORTE.5</td></tr>
* <tr><td>BUTTONS_BUTTON2</td><td>SW1 Button</td><td>Low</td><td>PORTF.1</td></tr>
* <tr><td>BUTTONS_BUTTON3</td><td>SW2 Button</td><td>Low</td><td>PORTF.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel XMEGA B1 Xplained board.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTF.4</td><td>USARTD0 (In SPI Mode)</td></tr>
* </table>
*
* @{
*/
@ -71,10 +76,10 @@
#define DATAFLASH_TOTALCHIPS 1
/** Mask for no dataflash chip selected. */
#define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
#define DATAFLASH_NO_CHIP 0
/** Mask for the first dataflash chip selected. */
#define DATAFLASH_CHIP1 0
#define DATAFLASH_CHIP1 (1 << 4)
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
@ -88,8 +93,10 @@
*/
static inline void Dataflash_Init(void)
{
DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.OUTSET = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
@ -143,7 +150,8 @@
static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SelectChip(const uint8_t ChipMask)
{
DATAFLASH_CHIPCS_PORT.OUT = ((DATAFLASH_CHIPCS_PORT.OUT & ~DATAFLASH_CHIPCS_MASK) | ChipMask);
DATAFLASH_CHIPCS_PORT.OUTCLR = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.OUTSET = ChipMask;
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */

View file

@ -42,6 +42,12 @@
*
* Board specific LED driver header for the Atmel XMEGA A3BU Xplained.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>LED0 LED</td><td>Low</td><td>PORTR.0</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>LED1 LED</td><td>Low</td><td>PORTR.1</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific Buttons driver header for the Atmel XMEGA B1 Xplained.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>Touch CS0 Button</td><td>Low</td><td>PORTE.0</td></tr>
* <tr><td>BUTTONS_BUTTON2</td><td>Touch CS1 Button</td><td>Low</td><td>PORTE.1</td></tr>
* <tr><td>BUTTONS_BUTTON3</td><td>Touch CS2 Button</td><td>Low</td><td>PORTE.2</td></tr>
* <tr><td>BUTTONS_BUTTON4</td><td>Touch CS3 Button</td><td>Low</td><td>PORTE.3</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel XMEGA A3BU Xplained board.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTD.2</td><td>USARTC0 (In SPI Mode, Remapped)</td></tr>
* </table>
*
* @{
*/
@ -71,10 +76,10 @@
#define DATAFLASH_TOTALCHIPS 1
/** Mask for no dataflash chip selected. */
#define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
#define DATAFLASH_NO_CHIP 0
/** Mask for the first dataflash chip selected. */
#define DATAFLASH_CHIP1 0
#define DATAFLASH_CHIP1 (1 << 2)
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
@ -88,10 +93,12 @@
*/
static inline void Dataflash_Init(void)
{
DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.OUTSET = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
PORTE.REMAP |= PORT_USART0_bm;
PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
PORTC.REMAP |= PORT_USART0_bm;
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
@ -103,7 +110,7 @@
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte)
{
return SerialSPI_TransferByte(&USARTE0, Byte);
return SerialSPI_TransferByte(&USARTC0, Byte);
}
/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
@ -113,7 +120,7 @@
static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SendByte(const uint8_t Byte)
{
SerialSPI_SendByte(&USARTE0, Byte);
SerialSPI_SendByte(&USARTC0, Byte);
}
/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
@ -123,7 +130,7 @@
static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Dataflash_ReceiveByte(void)
{
return SerialSPI_ReceiveByte(&USARTE0);
return SerialSPI_ReceiveByte(&USARTC0);
}
/** Determines the currently selected dataflash chip.
@ -145,7 +152,8 @@
static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SelectChip(const uint8_t ChipMask)
{
DATAFLASH_CHIPCS_PORT.OUT = ((DATAFLASH_CHIPCS_PORT.OUT & ~DATAFLASH_CHIPCS_MASK) | ChipMask);
DATAFLASH_CHIPCS_PORT.OUTCLR = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.OUTSET = (ChipMask & DATAFLASH_CHIPCS_MASK);
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */

View file

@ -42,6 +42,15 @@
*
* Board specific LED driver header for the Atmel XMEGA B1 Xplained.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>LED0 LED</td><td>High</td><td>PORTB.4</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>LED1 LED</td><td>High</td><td>PORTB.5</td></tr>
* <tr><td>LEDS_LED3</td><td>Yellow</td><td>LED2 LED</td><td>High</td><td>PORTB.6</td></tr>
* <tr><td>LEDS_LED4</td><td>Yellow</td><td>LED3 LED</td><td>High</td><td>PORTB.7</td></tr>
* <tr><td>LEDS_LED5</td><td>Green</td><td>USB LED</td><td>Low</td><td>PORTE.4</td></tr>
* </table>
*
* @{
*/

View file

@ -176,9 +176,7 @@
*/
static inline void SerialSPI_SendByte(const uint8_t DataByte)
{
UDR1 = DataByte;
while (!(UCSR1A & (1 << TXC1)));
UCSR1A = (1 << TXC1);
SerialSPI_TransferByte(DataByte);
}
/** Sends a dummy byte through the USART SPI interface, blocking until the transfer is complete. The response
@ -188,10 +186,7 @@
*/
static inline uint8_t SerialSPI_ReceiveByte(void)
{
UDR1 = 0;
while (!(UCSR1A & (1 << TXC1)));
UCSR1A = (1 << TXC1);
return UDR1;
return SerialSPI_TransferByte(0);
}
/* Disable C linkage for C++ Compilers: */

View file

@ -52,7 +52,7 @@
*
* \code
* // Initialize the Master SPI mode USART driver before first use, with 1Mbit baud
* SerialSPI_Init(&USARTD0, (USART_SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING | SPI_ORDER_MSB_FIRST), 1000000);
* SerialSPI_Init(&USARTD0, (USART_SPI_SCK_LEAD_RISING | USART_SPI_SAMPLE_LEADING | USART_SPI_ORDER_MSB_FIRST), 1000000);
*
* // Send several bytes, ignoring the returned data
* SerialSPI_SendByte(&USARTD0, 0x01);
@ -177,9 +177,7 @@
static inline void SerialSPI_SendByte(USART_t* const USART,
const uint8_t DataByte)
{
USART->DATA = DataByte;
while (!(USART->STATUS & USART_TXCIF_bm));
USART->STATUS = USART_TXCIF_bm;
SerialSPI_TransferByte(USART, DataByte);
}
/** Sends a dummy byte through the USART SPI interface, blocking until the transfer is complete. The response
@ -191,10 +189,7 @@
*/
static inline uint8_t SerialSPI_ReceiveByte(USART_t* const USART)
{
USART->DATA = 0;
while (!(USART->STATUS & USART_TXCIF_bm));
USART->STATUS = USART_TXCIF_bm;
return USART->DATA;
return SerialSPI_TransferByte(USART, 0);
}
/* Disable C linkage for C++ Compilers: */

View file

@ -84,8 +84,20 @@
* addresses are zero-indexed. This converts a natural MIDI channel number into the logical channel address.
*
* \param[in] channel MIDI channel number to address.
*
* \return Constructed MIDI channel ID.
*/
#define MIDI_CHANNEL(channel) ((channel) - 1)
/** Constructs a MIDI event ID from a given MIDI command and a virtual MIDI cable index. This can then be
* used to create and decode \ref MIDI_EventPacket_t MIDI event packets.
*
* \param[in] virtualcable Index of the virtual MIDI cable the event relates to
* \param[in] command MIDI command to send through the virtual MIDI cable
*
* \return Constructed MIDI event ID.
*/
#define MIDI_EVENT(virtualcable, command) ((virtualcable << 4) | (command >> 4))
/* Enums: */
/** Enum for the possible MIDI jack types in a MIDI device jack descriptor. */
@ -290,8 +302,7 @@
*/
typedef struct
{
unsigned Command : 4; /**< Upper nibble of the MIDI command being sent or received in the event packet. */
unsigned CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface. */
uint8_t Event; /**< MIDI event type, constructed with the \ref MIDI_EVENT() macro. */
uint8_t Data1; /**< First byte of data in the MIDI event. */
uint8_t Data2; /**< Second byte of data in the MIDI event. */

View file

@ -48,15 +48,16 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
if ((InterfaceIndex != AudioInterfaceInfo->Config.ControlInterfaceNumber) &&
(InterfaceIndex != AudioInterfaceInfo->Config.StreamingInterfaceNumber))
return;
{
return;
}
}
else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
{
uint8_t EndpointIndex = (USB_ControlRequest.wIndex & 0xFF);
uint8_t EndpointAddress = (USB_ControlRequest.wIndex & 0xFF);
if ((EndpointIndex != (ENDPOINT_DIR_IN | AudioInterfaceInfo->Config.DataINEndpointNumber)) &&
(EndpointIndex != (ENDPOINT_DIR_OUT | AudioInterfaceInfo->Config.DataOUTEndpointNumber)))
if ((EndpointAddress != AudioInterfaceInfo->Config.DataINEndpoint.Address) &&
(EndpointAddress != AudioInterfaceInfo->Config.DataOUTEndpoint.Address))
{
return;
}
@ -88,7 +89,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
case AUDIO_REQ_SetMinimum:
case AUDIO_REQ_SetMaximum:
case AUDIO_REQ_SetResolution:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT))
if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
{
uint8_t EndpointProperty = USB_ControlRequest.bRequest;
uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex;
@ -108,7 +109,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
EndpointControl, &ValueLength, Value);
}
}
else if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_INTERFACE)
{
uint8_t Property = USB_ControlRequest.bRequest;
uint8_t Entity = (USB_ControlRequest.wIndex >> 8);
@ -134,7 +135,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
case AUDIO_REQ_GetMinimum:
case AUDIO_REQ_GetMaximum:
case AUDIO_REQ_GetResolution:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT))
if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
{
uint8_t EndpointProperty = USB_ControlRequest.bRequest;
uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex;
@ -150,7 +151,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
Endpoint_ClearOUT();
}
}
else if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_INTERFACE)
{
uint8_t Property = USB_ControlRequest.bRequest;
uint8_t Entity = (USB_ControlRequest.wIndex >> 8);
@ -174,39 +175,15 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
memset(&AudioInterfaceInfo->State, 0x00, sizeof(AudioInterfaceInfo->State));
AudioInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_ISOCHRONOUS;
AudioInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_ISOCHRONOUS;
for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
{
uint16_t Size;
uint8_t Type;
uint8_t Direction;
bool DoubleBanked;
if (!(Endpoint_ConfigureEndpointTable(&AudioInterfaceInfo->Config.DataINEndpoint, 1)))
return false;
if (EndpointNum == AudioInterfaceInfo->Config.DataINEndpointNumber)
{
Size = AudioInterfaceInfo->Config.DataINEndpointSize;
Direction = ENDPOINT_DIR_IN;
Type = EP_TYPE_ISOCHRONOUS;
DoubleBanked = true;
}
else if (EndpointNum == AudioInterfaceInfo->Config.DataOUTEndpointNumber)
{
Size = AudioInterfaceInfo->Config.DataOUTEndpointSize;
Direction = ENDPOINT_DIR_OUT;
Type = EP_TYPE_ISOCHRONOUS;
DoubleBanked = true;
}
else
{
continue;
}
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
if (!(Endpoint_ConfigureEndpointTable(&AudioInterfaceInfo->Config.DataOUTEndpoint, 1)))
return false;
return true;
}

View file

@ -86,19 +86,8 @@
* structure controls.
*/
uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming Audio Streaming data, if available
* (zero if unused).
*/
uint16_t DataINEndpointSize; /**< Size in bytes of the incoming Audio Streaming data endpoint, if available
* (zero if unused).
*/
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing Audio Streaming data, if available
* (zero if unused).
*/
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available
* (zero if unused).
*/
USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
} 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.
*/
@ -226,7 +215,7 @@
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);
Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpoint.Address);
return Endpoint_IsOUTReceived();
}
@ -247,7 +236,7 @@
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpoint.Address);
return Endpoint_IsINReady();
}
@ -341,7 +330,7 @@
{
Endpoint_Write_8(Sample);
if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpointSize)
if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpoint.Size)
Endpoint_ClearIN();
}
@ -360,7 +349,7 @@
{
Endpoint_Write_16_LE(Sample);
if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpointSize)
if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpoint.Size)
Endpoint_ClearIN();
}
@ -380,7 +369,7 @@
Endpoint_Write_16_LE(Sample);
Endpoint_Write_8(Sample >> 16);
if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpointSize)
if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpoint.Size)
Endpoint_ClearIN();
}

View file

@ -69,8 +69,12 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
{
Endpoint_ClearSETUP();
while (!(Endpoint_IsOUTReceived()));
while (!(Endpoint_IsOUTReceived()))
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
}
CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE();
CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8();
CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8();
@ -112,45 +116,18 @@ bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfac
{
memset(&CDCInterfaceInfo->State, 0x00, sizeof(CDCInterfaceInfo->State));
for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
{
uint16_t Size;
uint8_t Type;
uint8_t Direction;
bool DoubleBanked;
CDCInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
CDCInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
CDCInterfaceInfo->Config.NotificationEndpoint.Type = EP_TYPE_INTERRUPT;
if (EndpointNum == CDCInterfaceInfo->Config.DataINEndpointNumber)
{
Size = CDCInterfaceInfo->Config.DataINEndpointSize;
Direction = ENDPOINT_DIR_IN;
Type = EP_TYPE_BULK;
DoubleBanked = CDCInterfaceInfo->Config.DataINEndpointDoubleBank;
}
else if (EndpointNum == CDCInterfaceInfo->Config.DataOUTEndpointNumber)
{
Size = CDCInterfaceInfo->Config.DataOUTEndpointSize;
Direction = ENDPOINT_DIR_OUT;
Type = EP_TYPE_BULK;
DoubleBanked = CDCInterfaceInfo->Config.DataOUTEndpointDoubleBank;
}
else if (EndpointNum == CDCInterfaceInfo->Config.NotificationEndpointNumber)
{
Size = CDCInterfaceInfo->Config.NotificationEndpointSize;
Direction = ENDPOINT_DIR_IN;
Type = EP_TYPE_INTERRUPT;
DoubleBanked = CDCInterfaceInfo->Config.NotificationEndpointDoubleBank;
}
else
{
continue;
}
if (!(Endpoint_ConfigureEndpointTable(&CDCInterfaceInfo->Config.DataINEndpoint, 1)))
return false;
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
if (!(Endpoint_ConfigureEndpointTable(&CDCInterfaceInfo->Config.DataOUTEndpoint, 1)))
return false;
if (!(Endpoint_ConfigureEndpointTable(&CDCInterfaceInfo->Config.NotificationEndpoint, 1)))
return false;
return true;
}
@ -171,7 +148,7 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
return Endpoint_Write_Stream_LE(String, strlen(String), NULL);
}
@ -182,7 +159,7 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
return Endpoint_Write_Stream_LE(Buffer, Length, NULL);
}
@ -192,7 +169,7 @@ uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
if (!(Endpoint_IsReadWriteAllowed()))
{
@ -215,7 +192,7 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
uint8_t ErrorCode;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
if (!(Endpoint_BytesInEndpoint()))
return ENDPOINT_READYWAIT_NoError;
@ -240,7 +217,7 @@ uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterface
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return 0;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpoint.Address);
if (Endpoint_IsOUTReceived())
{
@ -267,7 +244,7 @@ int16_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInf
int16_t ReceivedByte = -1;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpoint.Address);
if (Endpoint_IsOUTReceived())
{
@ -286,7 +263,7 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.NotificationEndpointNumber);
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.NotificationEndpoint.Address);
USB_Request_Header_t Notification = (USB_Request_Header_t)
{

View file

@ -99,19 +99,11 @@
{
struct
{
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device. */
uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint. */
uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint. */
bool DataINEndpointDoubleBank; /**< Indicates if the CDC interface's IN data endpoint should use double banking. */
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint. */
uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint. */
bool DataOUTEndpointDoubleBank; /**< Indicates if the CDC interface's OUT data endpoint should use double banking. */
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used. */
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used. */
bool NotificationEndpointDoubleBank; /**< Indicates if the CDC interface's notification endpoint should use double banking. */
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device. */
USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
USB_Endpoint_Table_t NotificationEndpoint; /**< Notification IN Endpoint configuration table. */
} 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.
*/

View file

@ -141,13 +141,11 @@ bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfac
HIDInterfaceInfo->State.UsingReportProtocol = true;
HIDInterfaceInfo->State.IdleCount = 500;
if (!(Endpoint_ConfigureEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_IN, HIDInterfaceInfo->Config.ReportINEndpointSize,
HIDInterfaceInfo->Config.ReportINEndpointDoubleBank ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
HIDInterfaceInfo->Config.ReportINEndpoint.Type = EP_TYPE_INTERRUPT;
if (!(Endpoint_ConfigureEndpointTable(&HIDInterfaceInfo->Config.ReportINEndpoint, 1)))
return false;
return true;
}
@ -159,7 +157,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
if (HIDInterfaceInfo->State.PrevFrameNum == USB_Device_GetFrameNumber())
return;
Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber);
Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpoint.Address);
if (Endpoint_IsReadWriteAllowed())
{
@ -184,7 +182,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
{
HIDInterfaceInfo->State.IdleMSRemaining = HIDInterfaceInfo->State.IdleCount;
Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber);
Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpoint.Address);
if (ReportID)
Endpoint_Write_8(ReportID);

View file

@ -85,9 +85,7 @@
{
uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device. */
uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint. */
uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint. */
bool ReportINEndpointDoubleBank; /**< Indicates if the HID interface's IN report endpoint should use double banking. */
USB_Endpoint_Table_t ReportINEndpoint; /**< Data IN HID report endpoint configuration table. */
void* PrevReportINBuffer; /**< Pointer to a buffer where the previously created HID input report can be
* stored by the driver, for comparison purposes to detect report changes that

View file

@ -41,38 +41,14 @@ bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInter
{
memset(&MIDIInterfaceInfo->State, 0x00, sizeof(MIDIInterfaceInfo->State));
for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
{
uint16_t Size;
uint8_t Type;
uint8_t Direction;
bool DoubleBanked;
MIDIInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
MIDIInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
if (EndpointNum == MIDIInterfaceInfo->Config.DataINEndpointNumber)
{
Size = MIDIInterfaceInfo->Config.DataINEndpointSize;
Direction = ENDPOINT_DIR_IN;
Type = EP_TYPE_BULK;
DoubleBanked = MIDIInterfaceInfo->Config.DataINEndpointDoubleBank;
}
else if (EndpointNum == MIDIInterfaceInfo->Config.DataOUTEndpointNumber)
{
Size = MIDIInterfaceInfo->Config.DataOUTEndpointSize;
Direction = ENDPOINT_DIR_OUT;
Type = EP_TYPE_BULK;
DoubleBanked = MIDIInterfaceInfo->Config.DataOUTEndpointDoubleBank;
}
else
{
continue;
}
if (!(Endpoint_ConfigureEndpointTable(&MIDIInterfaceInfo->Config.DataINEndpoint, 1)))
return false;
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
if (!(Endpoint_ConfigureEndpointTable(&MIDIInterfaceInfo->Config.DataOUTEndpoint, 1)))
return false;
return true;
}
@ -95,7 +71,7 @@ uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
uint8_t ErrorCode;
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);
if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != ENDPOINT_RWSTREAM_NoError)
return ErrorCode;
@ -113,7 +89,7 @@ uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
uint8_t ErrorCode;
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);
if (Endpoint_BytesInEndpoint())
{
@ -132,7 +108,7 @@ bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
if (USB_DeviceState != DEVICE_STATE_Configured)
return false;
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpointNumber);
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpoint.Address);
if (!(Endpoint_IsReadWriteAllowed()))
return false;

View file

@ -81,13 +81,8 @@
{
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls. */
uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming MIDI IN data, if available (zero if unused). */
uint16_t DataINEndpointSize; /**< Size in bytes of the incoming MIDI IN data endpoint, if available (zero if unused). */
bool DataINEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking. */
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI OUT data, if available (zero if unused). */
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI OUT data endpoint, if available (zero if unused). */
bool DataOUTEndpointDoubleBank; /**< Indicates if the MIDI interface's OUT data endpoint should use double banking. */
USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
} 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.
*/

Some files were not shown because too many files have changed in this diff Show more