3 Copyright (C) Dean Camera, 2009.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
33 * Header file for ISPTarget.c.
41 #include <util/delay.h>
43 #include <LUFA/Drivers/USB/USB.h>
44 #include <LUFA/Drivers/Peripheral/SPI.h>
46 #include "../Descriptors.h"
47 #include "V2ProtocolConstants.h"
48 #include "V2ProtocolParams.h"
50 /* Preprocessor Checks: */
51 #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
52 #undef ENABLE_ISP_PROTOCOL
54 #if !defined(ENABLE_PDI_PROTOCOL)
55 #define ENABLE_PDI_PROTOCOL
60 /** Total number of allowable ISP programming speeds supported by the device */
61 #define TOTAL_ISP_PROGRAMMING_SPEEDS 7
63 /* Function Prototypes: */
64 uint8_t ISPTarget_GetSPIPrescalerMask(void);
65 void ISPTarget_ChangeTargetResetLine(bool ResetTarget
);
66 uint8_t ISPTarget_WaitForProgComplete(uint8_t ProgrammingMode
, uint16_t PollAddress
, uint8_t PollValue
,
67 uint8_t DelayMS
, uint8_t ReadMemCommand
);
68 uint8_t ISPTarget_WaitWhileTargetBusy(void);
69 void ISPTarget_LoadExtendedAddress(void);