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 ISPProtocol.c.
36 #ifndef _ISP_PROTOCOL_
37 #define _ISP_PROTOCOL_
42 #include "V2Protocol.h"
44 /* Preprocessor Checks: */
45 #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
46 #undef ENABLE_ISP_PROTOCOL
48 #if !defined(ENABLE_PDI_PROTOCOL)
49 #define ENABLE_PDI_PROTOCOL
54 /** Mask for the reading or writing of the high byte in a FLASH word when issuing a low-level programming command */
55 #define READ_WRITE_HIGH_BYTE_MASK (1 << 3)
57 #define PROG_MODE_PAGED_WRITES_MASK (1 << 0)
58 #define PROG_MODE_WORD_TIMEDELAY_MASK (1 << 1)
59 #define PROG_MODE_WORD_VALUE_MASK (1 << 2)
60 #define PROG_MODE_WORD_READYBUSY_MASK (1 << 3)
61 #define PROG_MODE_PAGED_TIMEDELAY_MASK (1 << 4)
62 #define PROG_MODE_PAGED_VALUE_MASK (1 << 5)
63 #define PROG_MODE_PAGED_READYBUSY_MASK (1 << 6)
64 #define PROG_MODE_COMMIT_PAGE_MASK (1 << 7)
66 /* Function Prototypes: */
67 void ISPProtocol_EnterISPMode(void);
68 void ISPProtocol_LeaveISPMode(void);
69 void ISPProtocol_ProgramMemory(const uint8_t V2Command
);
70 void ISPProtocol_ReadMemory(const uint8_t V2Command
);
71 void ISPProtocol_ChipErase(void);
72 void ISPProtocol_ReadFuseLockSigOSCCAL(const uint8_t V2Command
);
73 void ISPProtocol_WriteFuseLock(const uint8_t V2Command
);
74 void ISPProtocol_SPIMulti(void);