Commit 8309c51e authored by Sebastian Neuser's avatar Sebastian Neuser

Implement proof of concept

parent 667b3ebc
obj/
/*.bin
/*.eep
/*.elf
/*.hex
/*.lss
/*.map
/*.sym
[submodule "lufa"]
path = lufa
path = Lib/lufa
url = https://github.com/abcminiuser/lufa.git
/*
LUFA Library
Copyright (C) Dean Camera, 2018.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2018 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 disclaims 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 LUFA Custom Board LED Hardware Driver (Template)
*
* This is a stub driver header file, for implementing custom board
* layout hardware with compatible LUFA board specific drivers. If
* the library is configured to use the BOARD_USER board mode, this
* driver file should be completed and copied into the "/Board/" folder
* inside the application's folder.
*
* This stub is for the board-specific component of the LUFA LEDs driver,
* for the LEDs (up to four) mounted on most development boards.
*/
#ifndef __LEDS_USER_H__
#define __LEDS_USER_H__
/* Includes: */
/* 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_LEDR (1 << 5)
/** LED mask for the second LED on the board. */
#define LEDS_LEDG (1 << 7)
/** LED mask for the third LED on the board. */
#define LEDS_LEDB (1 << 6)
/** LED mask for all the LEDs on the board. */
#define LEDS_ALL_LEDS (LEDS_LEDR | LEDS_LEDG | LEDS_LEDB)
/** 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;
PORTB |= LEDS_ALL_LEDS;
}
static inline void LEDs_Disable(void)
{
DDRB &= ~LEDS_ALL_LEDS;
PORTB &= ~LEDS_ALL_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
{
PORTB &= ~LedMask;
}
static inline void LEDs_TurnOffLEDs(const uint8_t LedMask)
{
PORTB |= LedMask;
}
static inline void LEDs_SetAllLEDs(const uint8_t LedMask)
{
PORTB = ((PORTB | LEDS_ALL_LEDS) & ~LedMask);
}
static inline void LEDs_ChangeLEDs(const uint8_t LedMask,
const uint8_t ActiveMask)
{
PORTB = ((PORTB | LedMask) & ~ActiveMask);
}
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PINB = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return (PORTB & LEDS_ALL_LEDS);
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
......@@ -46,21 +46,17 @@
#define AUX_LINE_PORT PORTB
#define AUX_LINE_PIN PINB
#define AUX_LINE_DDR DDRB
#if (BOARD == BOARD_U2S)
#define AUX_LINE_MASK (1 << 0)
#else
#define AUX_LINE_MASK (1 << 4)
#endif
#define AUX_LINE_MASK (1 << 0)
#define ENABLE_ISP_PROTOCOL
#define ENABLE_XPROG_PROTOCOL
// #define ENABLE_XPROG_PROTOCOL
#define VTARGET_ADC_CHANNEL 2
#define VTARGET_REF_VOLTS 5
#define VTARGET_SCALE_FACTOR 1
// #define VTARGET_ADC_CHANNEL 2
// #define VTARGET_REF_VOLTS 5
// #define VTARGET_SCALE_FACTOR 1
// #define VTARGET_USE_INTERNAL_REF
#define NO_VTARGET_DETECT
// #define XCK_RESCUE_CLOCK_ENABLE
#define XCK_RESCUE_CLOCK_ENABLE
// #define INVERTED_ISP_MISO
// #define FIRMWARE_VERSION_MINOR 0x11
......
File moved
......@@ -11,16 +11,16 @@
# Run "make help" for target help.
MCU = at90usb1287
MCU = at90usb162
ARCH = AVR8
BOARD = USBKEY
F_CPU = 8000000
BOARD = USER
F_CPU = 16000000
F_USB = $(F_CPU)
OPTIMIZATION = s
TARGET = AVRISP-MKII
TARGET = ProgBob
SRC = $(TARGET).c AVRISPDescriptors.c Lib/V2Protocol.c Lib/V2ProtocolParams.c Lib/ISP/ISPProtocol.c Lib/ISP/ISPTarget.c Lib/XPROG/XPROGProtocol.c \
Lib/XPROG/XPROGTarget.c Lib/XPROG/XMEGANVM.c Lib/XPROG/TINYNVM.c $(LUFA_SRC_USB)
LUFA_PATH = ../../LUFA
LUFA_PATH = Lib/lufa/LUFA
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
LD_FLAGS =
......
......@@ -34,7 +34,7 @@
* the project and is responsible for the initial application hardware configuration.
*/
#include "AVRISP-MKII.h"
#include "ProgBob.h"
#if (BOARD != BOARD_NONE)
/* Some board hardware definitions (e.g. the Arduino Micro) have their LEDs defined on the same pins
......
......@@ -56,22 +56,22 @@
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
#define LEDMASK_USB_NOTREADY (LEDS_LEDG | LEDS_LEDB) // cyan
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
#define LEDMASK_USB_ENUMERATING (LEDS_LED1 | LEDS_LED2)
#define LEDMASK_USB_ENUMERATING (LEDS_LEDR | LEDS_LEDG) // yellow
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
#define LEDMASK_USB_READY LEDS_LED2
#define LEDMASK_USB_READY LEDS_LEDG
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR LEDS_LED1
#define LEDMASK_USB_ERROR LEDS_LEDR
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2)
#define LEDMASK_BUSY (LEDS_LEDR | LEDS_LEDB) // magenta
/** LED mask for the library LED driver, to indicate that the target is being powered by VBUS. */
#define LEDMASK_VBUSPOWER LEDS_LED3
#define LEDMASK_VBUSPOWER LEDS_LEDB
/* Function Prototypes: */
void SetupHardware(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment