aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP/Lib/V2ProtocolTarget.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-12-02 12:02:01 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-12-02 12:02:01 +0000
commit1ed6925b5bf417848b83887b32e3ede05a1c691b (patch)
treee99aac1a5cbf4e1be0006e6f5fa8939afa1f00e4 /Projects/AVRISP/Lib/V2ProtocolTarget.c
parent1645c3d243e57134228d36c23687c2ab664c3f9c (diff)
downloadlufa-1ed6925b5bf417848b83887b32e3ede05a1c691b.tar.gz
lufa-1ed6925b5bf417848b83887b32e3ede05a1c691b.tar.bz2
lufa-1ed6925b5bf417848b83887b32e3ede05a1c691b.zip
Factor out all the ISP related code into a seperate ISPProtocol set of files in the AVRISP Clone programmer project, to clearly seperate out the programming protocols when PDI programming is implemented.
Diffstat (limited to 'Projects/AVRISP/Lib/V2ProtocolTarget.c')
-rw-r--r--Projects/AVRISP/Lib/V2ProtocolTarget.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/Projects/AVRISP/Lib/V2ProtocolTarget.c b/Projects/AVRISP/Lib/V2ProtocolTarget.c
index 80e8be1e8..b5de9ba4f 100644
--- a/Projects/AVRISP/Lib/V2ProtocolTarget.c
+++ b/Projects/AVRISP/Lib/V2ProtocolTarget.c
@@ -30,20 +30,17 @@
/** \file
*
- * Target-related functions for the V2 Protocol decoder.
+ * Target-related functions for the ISP Protocol decoder.
*/
#include "V2ProtocolTarget.h"
-/** Current memory address for FLASH/EEPROM memory read/write commands */
-uint32_t CurrentAddress;
-
/** Converts the given AVR Studio SCK duration parameter (set by a SET PARAM command from the host) to the nearest
* possible SPI clock prescaler mask for passing to the SPI_Init() routine.
*
* \return Nearest SPI prescaler mask for the given SCK frequency
*/
-uint8_t V2Protocol_GetSPIPrescalerMask(void)
+uint8_t ISPTarget_GetSPIPrescalerMask(void)
{
static const uint8_t SPIMaskFromSCKDuration[] =
{
@@ -81,7 +78,7 @@ uint8_t V2Protocol_GetSPIPrescalerMask(void)
*
* \param[in] ResetTarget Boolean true when the target should be held in reset, false otherwise
*/
-void V2Protocol_ChangeTargetResetLine(bool ResetTarget)
+void ISPTarget_ChangeTargetResetLine(bool ResetTarget)
{
if (ResetTarget)
{
@@ -109,8 +106,8 @@ void V2Protocol_ChangeTargetResetLine(bool ResetTarget)
* \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT or
* \ref STATUS_CMD_TOUT otherwise
*/
-uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAddress, uint8_t PollValue,
- uint8_t DelayMS, uint8_t ReadMemCommand)
+uint8_t ISPTarget_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAddress, uint8_t PollValue,
+ uint8_t DelayMS, uint8_t ReadMemCommand)
{
uint8_t ProgrammingStatus = STATUS_CMD_OK;
@@ -139,7 +136,7 @@ uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAdd
break;
case PROG_MODE_WORD_READYBUSY_MASK:
case PROG_MODE_PAGED_READYBUSY_MASK:
- ProgrammingStatus = V2Protocol_WaitWhileTargetBusy();
+ ProgrammingStatus = ISPTarget_WaitWhileTargetBusy();
break;
}
@@ -151,7 +148,7 @@ uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAdd
*
* \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT otherwise
*/
-uint8_t V2Protocol_WaitWhileTargetBusy(void)
+uint8_t ISPTarget_WaitWhileTargetBusy(void)
{
TCNT0 = 0;
@@ -174,7 +171,7 @@ uint8_t V2Protocol_WaitWhileTargetBusy(void)
* 64KB boundary. This sends the command with the correct address as indicated by the current address
* pointer variable set by the host when a SET ADDRESS command is issued.
*/
-void V2Protocol_LoadExtendedAddress(void)
+void ISPTarget_LoadExtendedAddress(void)
{
SPI_SendByte(0x4D);
SPI_SendByte(0x00);