1 /* Read ".HEX" files and store it in memory 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 3 Craig Franklin 4 5 This file is part of gputils. 6 7 gputils is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2, or (at your option) 10 any later version. 11 12 gputils is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with gputils; see the file COPYING. If not, write to 19 the Free Software Foundation, 59 Temple Place - Suite 330, 20 Boston, MA 02111-1307, USA. */ 21 22 #ifndef __GPREADHEX_H__ 23 #define __GPREADHEX_H__ 24 25 #define IHEX_RECTYPE_DATA 0 26 #define IHEX_RECTYPE_EOF 1 27 #define IHEX_RECTYPE_EXT_SEG_ADDR 2 28 #define IHEX_RECTYPE_START_SEG_ADDR 3 29 #define IHEX_RECTYPE_EXT_LIN_ADDR 4 30 #define IHEX_RECTYPE_START_LIN_ADDR 5 31 32 /* 33 INHX8 Have 16 bit addresses. 34 Used types: IHEX_RECTYPE_DATA 35 IHEX_RECTYPE_EOF 36 37 INHX16 Have 20 bit addresses. 38 Used types: IHEX_RECTYPE_DATA 39 IHEX_RECTYPE_EOF 40 IHEX_RECTYPE_EXT_SEG_ADDR 41 IHEX_RECTYPE_START_SEG_ADDR 42 43 INHX32 Have 32 bit addresses. 44 Used types: IHEX_RECTYPE_DATA 45 IHEX_RECTYPE_EOF 46 IHEX_RECTYPE_EXT_LIN_ADDR 47 IHEX_RECTYPE_START_LIN_ADDR 48 */ 49 50 typedef struct hex_data { 51 enum formats hex_format; 52 int size; 53 gp_boolean error; 54 } hex_data_t; 55 56 extern hex_data_t *gp_readhex(const char *filename, MemBlock_t *m); 57 58 #endif 59