diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-24 01:55:53 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-24 01:55:53 +0000 |
commit | ce044844eaf33ab4dacf199e136abc190125f284 (patch) | |
tree | ffcac62479e5e44711a8b4cd987c99364ac9f214 /Projects/AVRISP | |
parent | 26bc1f3cfdf1aa44d08d12f0985bd214c396d315 (diff) | |
download | lufa-ce044844eaf33ab4dacf199e136abc190125f284.tar.gz lufa-ce044844eaf33ab4dacf199e136abc190125f284.tar.bz2 lufa-ce044844eaf33ab4dacf199e136abc190125f284.zip |
Combine AVRISP project TPI and PDI lib directories - these protocols use the same underlying XPROG wrapper for the host-to-programmer command wrapping.
Diffstat (limited to 'Projects/AVRISP')
-rw-r--r-- | Projects/AVRISP/AVRISP.c | 1 | ||||
-rw-r--r-- | Projects/AVRISP/AVRISP.h | 1 | ||||
-rw-r--r-- | Projects/AVRISP/AVRISP.txt | 2 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/V2Protocol.c | 4 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/V2Protocol.h | 1 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/PDIProtocol.c (renamed from Projects/AVRISP/Lib/PDI/PDIProtocol.c) | 2 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/PDIProtocol.h (renamed from Projects/AVRISP/Lib/PDI/PDIProtocol.h) | 1 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/PDITarget.c (renamed from Projects/AVRISP/Lib/PDI/PDITarget.c) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/PDITarget.h (renamed from Projects/AVRISP/Lib/PDI/PDITarget.h) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TINYNVM.c (renamed from Projects/AVRISP/Lib/TPI/TINYNVM.c) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TINYNVM.h (renamed from Projects/AVRISP/Lib/TPI/TINYNVM.h) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TPIProtocol.c (renamed from Projects/AVRISP/Lib/TPI/TPIProtocol.c) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TPIProtocol.h (renamed from Projects/AVRISP/Lib/TPI/TPIProtocol.h) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TPITarget.c (renamed from Projects/AVRISP/Lib/TPI/TPITarget.c) | 2 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/TPITarget.h (renamed from Projects/AVRISP/Lib/TPI/TPITarget.h) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/XMEGANVM.c (renamed from Projects/AVRISP/Lib/PDI/XMEGANVM.c) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/XPROG/XMEGANVM.h (renamed from Projects/AVRISP/Lib/PDI/XMEGANVM.h) | 0 | ||||
-rw-r--r-- | Projects/AVRISP/makefile | 13 |
18 files changed, 18 insertions, 9 deletions
diff --git a/Projects/AVRISP/AVRISP.c b/Projects/AVRISP/AVRISP.c index c0572fca2..48a90e3e4 100644 --- a/Projects/AVRISP/AVRISP.c +++ b/Projects/AVRISP/AVRISP.c @@ -70,6 +70,7 @@ void SetupHardware(void) /* Hardware Initialization */
LEDs_Init();
USB_Init();
+ Serial_Init(9600, true);
#if defined(ADC)
/* Initialize the ADC converter for VTARGET level detection on supported AVR models */
diff --git a/Projects/AVRISP/AVRISP.h b/Projects/AVRISP/AVRISP.h index a0f4d5e79..cdd551636 100644 --- a/Projects/AVRISP/AVRISP.h +++ b/Projects/AVRISP/AVRISP.h @@ -45,6 +45,7 @@ #include "Descriptors.h"
#include <LUFA/Version.h>
+ #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
diff --git a/Projects/AVRISP/AVRISP.txt b/Projects/AVRISP/AVRISP.txt index 20e0cce0e..10361ac7b 100644 --- a/Projects/AVRISP/AVRISP.txt +++ b/Projects/AVRISP/AVRISP.txt @@ -162,7 +162,7 @@ * <tr>
* <td><b>Programmer Pin:</b></td>
* <td><b>Target Device Pin:</b></td>
- * <td><b>PDI 6 Pin Layout:</b></td>
+ * <td><b>TPI 6 Pin Layout:</b></td>
* </tr>
* <tr>
* <td>MISO</td>
diff --git a/Projects/AVRISP/Lib/V2Protocol.c b/Projects/AVRISP/Lib/V2Protocol.c index 3bfcc11af..eae2e830f 100644 --- a/Projects/AVRISP/Lib/V2Protocol.c +++ b/Projects/AVRISP/Lib/V2Protocol.c @@ -50,7 +50,9 @@ bool MustSetAddress; void V2Protocol_ProcessCommand(void)
{
uint8_t V2Command = Endpoint_Read_Byte();
-
+
+ Serial_TxByte(V2Command);
+
switch (V2Command)
{
case CMD_SIGN_ON:
diff --git a/Projects/AVRISP/Lib/V2Protocol.h b/Projects/AVRISP/Lib/V2Protocol.h index c7c1a7350..02579a341 100644 --- a/Projects/AVRISP/Lib/V2Protocol.h +++ b/Projects/AVRISP/Lib/V2Protocol.h @@ -39,6 +39,7 @@ /* Includes: */ #include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/Peripheral/SPI.h>
+ #include <LUFA/Drivers/Peripheral/Serial.h>
#include "../Descriptors.h" #include "V2ProtocolConstants.h"
diff --git a/Projects/AVRISP/Lib/PDI/PDIProtocol.c b/Projects/AVRISP/Lib/XPROG/PDIProtocol.c index 16ac209df..ed5146063 100644 --- a/Projects/AVRISP/Lib/PDI/PDIProtocol.c +++ b/Projects/AVRISP/Lib/XPROG/PDIProtocol.c @@ -58,6 +58,8 @@ void PDIProtocol_XPROG_SetMode(void) Endpoint_ClearOUT();
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
+ Serial_TxByte(SetMode_XPROG_Params.Protocol);
+
Endpoint_Write_Byte(CMD_XPROG_SETMODE);
Endpoint_Write_Byte((SetMode_XPROG_Params.Protocol == XPRG_PROTOCOL_PDI) ? STATUS_CMD_OK : STATUS_CMD_FAILED);
Endpoint_ClearIN();
diff --git a/Projects/AVRISP/Lib/PDI/PDIProtocol.h b/Projects/AVRISP/Lib/XPROG/PDIProtocol.h index c3cafb4ec..9a10abbce 100644 --- a/Projects/AVRISP/Lib/PDI/PDIProtocol.h +++ b/Projects/AVRISP/Lib/XPROG/PDIProtocol.h @@ -100,6 +100,7 @@ #define XPRG_PROTOCOL_PDI 0x00
#define XPRG_PROTOCOL_JTAG 0x01
+ #define XPRG_PROTOCOL_TPI 0x02
#define XPRG_PAGEMODE_WRITE (1 << 1)
#define XPRG_PAGEMODE_ERASE (1 << 0)
diff --git a/Projects/AVRISP/Lib/PDI/PDITarget.c b/Projects/AVRISP/Lib/XPROG/PDITarget.c index 2c6ffd9a6..2c6ffd9a6 100644 --- a/Projects/AVRISP/Lib/PDI/PDITarget.c +++ b/Projects/AVRISP/Lib/XPROG/PDITarget.c diff --git a/Projects/AVRISP/Lib/PDI/PDITarget.h b/Projects/AVRISP/Lib/XPROG/PDITarget.h index cf7780c17..cf7780c17 100644 --- a/Projects/AVRISP/Lib/PDI/PDITarget.h +++ b/Projects/AVRISP/Lib/XPROG/PDITarget.h diff --git a/Projects/AVRISP/Lib/TPI/TINYNVM.c b/Projects/AVRISP/Lib/XPROG/TINYNVM.c index 206ea39f2..206ea39f2 100644 --- a/Projects/AVRISP/Lib/TPI/TINYNVM.c +++ b/Projects/AVRISP/Lib/XPROG/TINYNVM.c diff --git a/Projects/AVRISP/Lib/TPI/TINYNVM.h b/Projects/AVRISP/Lib/XPROG/TINYNVM.h index eca3c98b8..eca3c98b8 100644 --- a/Projects/AVRISP/Lib/TPI/TINYNVM.h +++ b/Projects/AVRISP/Lib/XPROG/TINYNVM.h diff --git a/Projects/AVRISP/Lib/TPI/TPIProtocol.c b/Projects/AVRISP/Lib/XPROG/TPIProtocol.c index a95e94b60..a95e94b60 100644 --- a/Projects/AVRISP/Lib/TPI/TPIProtocol.c +++ b/Projects/AVRISP/Lib/XPROG/TPIProtocol.c diff --git a/Projects/AVRISP/Lib/TPI/TPIProtocol.h b/Projects/AVRISP/Lib/XPROG/TPIProtocol.h index 11894a333..11894a333 100644 --- a/Projects/AVRISP/Lib/TPI/TPIProtocol.h +++ b/Projects/AVRISP/Lib/XPROG/TPIProtocol.h diff --git a/Projects/AVRISP/Lib/TPI/TPITarget.c b/Projects/AVRISP/Lib/XPROG/TPITarget.c index 464d40305..f7943bfa1 100644 --- a/Projects/AVRISP/Lib/TPI/TPITarget.c +++ b/Projects/AVRISP/Lib/XPROG/TPITarget.c @@ -320,7 +320,7 @@ bool TPITarget_WaitWhileNVMBusBusy(void) /* Poll the STATUS register to check to see if NVM access has been enabled */
while (TimeoutMS)
{
- /* Send the LDCS command to read the TPI STATUS register to see the NVM bus is active */
+ /* Send the SLDCS command to read the TPI STATUS register to see the NVM bus is active */
TPITarget_SendByte(TPI_CMD_SLDCS | TPI_STATUS_REG);
if (TPITarget_ReceiveByte() & TPI_STATUS_NVM)
return true;
diff --git a/Projects/AVRISP/Lib/TPI/TPITarget.h b/Projects/AVRISP/Lib/XPROG/TPITarget.h index 596bdce21..596bdce21 100644 --- a/Projects/AVRISP/Lib/TPI/TPITarget.h +++ b/Projects/AVRISP/Lib/XPROG/TPITarget.h diff --git a/Projects/AVRISP/Lib/PDI/XMEGANVM.c b/Projects/AVRISP/Lib/XPROG/XMEGANVM.c index ed8719c4e..ed8719c4e 100644 --- a/Projects/AVRISP/Lib/PDI/XMEGANVM.c +++ b/Projects/AVRISP/Lib/XPROG/XMEGANVM.c diff --git a/Projects/AVRISP/Lib/PDI/XMEGANVM.h b/Projects/AVRISP/Lib/XPROG/XMEGANVM.h index c31c7e8f1..c31c7e8f1 100644 --- a/Projects/AVRISP/Lib/PDI/XMEGANVM.h +++ b/Projects/AVRISP/Lib/XPROG/XMEGANVM.h diff --git a/Projects/AVRISP/makefile b/Projects/AVRISP/makefile index 6f8ee4031..12f31546e 100644 --- a/Projects/AVRISP/makefile +++ b/Projects/AVRISP/makefile @@ -131,12 +131,13 @@ SRC = $(TARGET).c \ Lib/V2ProtocolParams.c \
Lib/ISP/ISPProtocol.c \
Lib/ISP/ISPTarget.c \
- Lib/PDI/PDIProtocol.c \
- Lib/PDI/PDITarget.c \
- Lib/PDI/XMEGANVM.c \
- Lib/TPI/TPIProtocol.c \
- Lib/TPI/TPITarget.c \
- Lib/TPI/TINYNVM.c \
+ Lib/XPROG/PDIProtocol.c \
+ Lib/XPROG/PDITarget.c \
+ Lib/XPROG/XMEGANVM.c \
+ Lib/XPROG/TPIProtocol.c \
+ Lib/XPROG/TPITarget.c \
+ Lib/XPROG/TINYNVM.c \
+ $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \
$(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c \
$(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c \
$(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c \
|