2 ** This file is part of fsusb_picdem
4 ** fsusb_picdem is free software; you can redistribute it and/or
5 ** modify it under the terms of the GNU General Public License as
6 ** published by the Free Software Foundation; either version 2 of the
7 ** License, or (at your option) any later version.
9 ** fsusb_picdem is distributed in the hope that it will be useful, but
10 ** WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ** General Public License for more details.
14 ** You should have received a copy of the GNU General Public License
15 ** along with fsusb_picdem; if not, write to the Free Software
16 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #ifndef __BOOTLOAD_H__
21 #define __BOOTLOAD_H__
29 * 0x01: data length (usually; different action for some commands!)
30 * 0x02: address bits 7..0
31 * 0x03: address bits 15..8
32 * 0x04: address bits 23..16 (upper bits always zero)
37 * 0x3f: data[BL_DATA_LEN-1]
42 typedef unsigned char byte;
46 #define BL_PACKET_LEN 64
47 #define BL_HEADER_LEN 5 // command, len, low, high, upper
48 #define BL_DATA_LEN (BL_PACKET_LEN - BL_HEADER_LEN)
53 READ_VERSION = 0x00, // Works
54 READ_FLASH = 0x01, // Works
55 WRITE_FLASH = 0x02, // Works
56 ERASE_FLASH = 0x03, // Works
57 READ_EEDATA = 0x04, // NOT IMPLEMENTED
58 WRITE_EEDATA = 0x05, // NOT IMPLEMENTED
59 READ_CONFIG = 0x06, // NOT IMPLEMENTED
60 // (but in current firmware READ_FLASH works
61 WRITE_CONFIG = 0x07, // NOT TESTED
62 UPDATE_LED = 0x32, // NOT IMPLEMENTED
63 RESET = 0xFF // NOT IMPLEMENTED
68 typedef union _bl_packet {
78 byte data[BL_DATA_LEN];
82 #endif /* __BOOTLOAD_H__ */