diff -Nurb LUFA-111009/LUFA/Common/BoardTypes.h olimexisp/LUFA/Common/BoardTypes.h --- LUFA-111009/LUFA/Common/BoardTypes.h 2011-06-28 00:40:18.000000000 -0600 +++ olimexisp/LUFA/Common/BoardTypes.h 2011-10-15 16:24:41.000000000 -0600 @@ -156,6 +156,9 @@ /** Selects the Atmel EVK1104 specific board drivers, including the Button and LED drivers. */ #define BOARD_EVK1104 30 + /** Selects the Atmel EVK1104 specific board drivers, including the Button and LED drivers. */ + #define BOARD_OLIMEXISP500 31 + #if !defined(__DOXYGEN__) #define BOARD_ BOARD_NONE diff -Nurb LUFA-111009/LUFA/Drivers/Board/AVR8/OLIMEXISP500/Buttons.h olimexisp/LUFA/Drivers/Board/AVR8/OLIMEXISP500/Buttons.h --- LUFA-111009/LUFA/Drivers/Board/AVR8/OLIMEXISP500/Buttons.h 1969-12-31 17:00:00.000000000 -0700 +++ olimexisp/LUFA/Drivers/Board/AVR8/OLIMEXISP500/Buttons.h 2011-10-16 00:36:29.000000000 -0600 @@ -0,0 +1,92 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2011. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2011 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-162 Development Board. + * \copydetails Group_Buttons_OLIMEXISP500 + * + * \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_OLIMEXISP500 OLIMEXISP500 + * \brief Board specific Buttons driver header for the Olimex ISP 500 Programmer. + * + * Board specific Buttons driver header for the Olimex ISP-500 programmer Board. + * + * @{ + */ + +#ifndef __BUTTONS_OLIMEXISP500_H__ +#define __BUTTONS_OLIMEXISP500_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 << 7) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD |= BUTTONS_BUTTON1; + } + + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Buttons_GetStatus(void) + { + return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff -Nurb LUFA-111009/LUFA/Drivers/Board/AVR8/OLIMEXISP500/LEDs.h olimexisp/LUFA/Drivers/Board/AVR8/OLIMEXISP500/LEDs.h --- LUFA-111009/LUFA/Drivers/Board/AVR8/OLIMEXISP500/LEDs.h 1969-12-31 17:00:00.000000000 -0700 +++ olimexisp/LUFA/Drivers/Board/AVR8/OLIMEXISP500/LEDs.h 2011-10-16 00:35:45.000000000 -0600 @@ -0,0 +1,126 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2011. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2011 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 ISP500. + * \copydetails Group_LEDs_OLIMEXISP500 + * + * \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_OLIMEXISP500 OLIMEXISP500 + * \brief Board specific LED driver header for the OLIMEX ISP500. + * + * + * @{ + */ + +#ifndef __LEDS_OLIMEXISP500_H__ +#define __LEDS_OLIMEXISP500_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 << 6) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 5) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 ) + + /** 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_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) + { + PORTC ^= 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 + +/** @} */ + diff -Nurb LUFA-111009/LUFA/Drivers/Board/Buttons.h olimexisp/LUFA/Drivers/Board/Buttons.h --- LUFA-111009/LUFA/Drivers/Board/Buttons.h 2011-07-06 12:56:46.000000000 -0600 +++ olimexisp/LUFA/Drivers/Board/Buttons.h 2011-10-15 16:27:14.000000000 -0600 @@ -131,6 +131,8 @@ #include "UC3/EVK1100/Buttons.h" #elif (BOARD == BOARD_EVK1104) #include "UC3/EVK1104/Buttons.h" + #elif (BOARD == BOARD_OLIMEXISP500) + #include "AVR8/OLIMEXISP500/Buttons.h" #else #include "Board/Buttons.h" #endif diff -Nurb LUFA-111009/LUFA/Drivers/Board/LEDs.h olimexisp/LUFA/Drivers/Board/LEDs.h --- LUFA-111009/LUFA/Drivers/Board/LEDs.h 2011-07-11 22:00:18.000000000 -0600 +++ olimexisp/LUFA/Drivers/Board/LEDs.h 2011-10-15 16:27:41.000000000 -0600 @@ -171,6 +171,8 @@ #include "UC3/EVK1100/LEDs.h" #elif (BOARD == BOARD_EVK1104) #include "UC3/EVK1104/LEDs.h" + #elif (BOARD == BOARD_OLIMEXISP500) + #include "AVR8/OLIMEXISP500/LEDs.h" #else #include "Board/LEDs.h" #endif diff -Nurb LUFA-111009/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h olimexisp/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h --- LUFA-111009/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h 2011-06-21 02:02:02.000000000 -0600 +++ olimexisp/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h 2011-10-17 22:05:50.000000000 -0600 @@ -104,10 +104,17 @@ */ static inline uint8_t ISPTarget_ReceiveByte(void) { +#if (BOARD == BOARD_OLIMEXISP500) + if (HardwareSPIMode) + return ~SPI_ReceiveByte(); + else + return ~ISPTarget_TransferSoftSPIByte(0x00); +#else if (HardwareSPIMode) return SPI_ReceiveByte(); else return ISPTarget_TransferSoftSPIByte(0x00); +#endif } /** Sends and receives a byte of ISP data to and from the attached target, using the @@ -119,10 +126,17 @@ */ static inline uint8_t ISPTarget_TransferByte(const uint8_t Byte) { +#if (BOARD == BOARD_OLIMEXISP500) + if (HardwareSPIMode) + return ~SPI_TransferByte(Byte); + else + return ~ISPTarget_TransferSoftSPIByte(Byte); +#else if (HardwareSPIMode) return SPI_TransferByte(Byte); else return ISPTarget_TransferSoftSPIByte(Byte); +#endif } #endif diff -Nurb LUFA-111009/Projects/AVRISP-MKII/makefile olimexisp/Projects/AVRISP-MKII/makefile --- LUFA-111009/Projects/AVRISP-MKII/makefile 2011-10-07 15:30:46.000000000 -0600 +++ olimexisp/Projects/AVRISP-MKII/makefile 2011-10-15 17:16:46.000000000 -0600 @@ -70,7 +70,7 @@ # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. -BOARD = USBTINYMKII +BOARD = OLIMEXISP500 # Processor frequency. @@ -137,13 +137,13 @@ LUFA_OPTS += -D AUX_LINE_MASK="(1 << 4)" LUFA_OPTS += -D ENABLE_ISP_PROTOCOL LUFA_OPTS += -D ENABLE_XPROG_PROTOCOL -LUFA_OPTS += -D VTARGET_ADC_CHANNEL=2 +LUFA_OPTS += -D VTARGET_ADC_CHANNEL=1 LUFA_OPTS += -D VTARGET_REF_VOLTS=5 LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1 #LUFA_OPTS += -D VTARGET_USE_INTERNAL_REF #LUFA_OPTS += -D NO_VTARGET_DETECT -#LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT -#LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE +LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT +LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE # Create the LUFA source path variables by including the LUFA root makefile diff -Nurb LUFA-111009/makefile olimexisp/makefile --- LUFA-111009/makefile 2011-06-21 02:02:04.000000000 -0600 +++ olimexisp/makefile 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2011. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# - -# Makefile to build the LUFA library, projects and demos. - -# Call with "make all" to rebuild everything, "make clean" to clean everything, -# "make clean_list" to remove all intermediatary files but preserve any binaries, -# "make doxygen" to document everything with Doxygen (if installed) and -# "make clean_doxygen" to remove generated Doxygen documentation from everything. - -all: -%: - @echo Executing \"make $@\" on all LUFA library elements. - @echo - $(MAKE) -C LUFA $@ -s - $(MAKE) -C Demos $@ -s - $(MAKE) -C Projects $@ -s - $(MAKE) -C Bootloaders $@ -s - @echo - @echo LUFA \"make $@\" operation complete. -