tools/fsusb/rjlhex.h
author slime@unimatrix01.gamma-quadrant.de
Tue, 29 Jan 2008 22:31:52 +0100
changeset 2 2f55e5dd591d
permissions -rw-r--r--
inital checkin
     1 /*
     2 ** This file is part of fsusb_picdem
     3 **
     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.
     8 **
     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.
    13 **
    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
    17 ** 02110-1301, USA
    18 */
    19 
    20 
    21 #ifndef __RJLHEX_H__
    22 #define __RJLHEX_H__
    23 
    24 
    25 
    26 #include <stdio.h>
    27 
    28 
    29 
    30 typedef struct _hex_record {
    31   unsigned char datlen;
    32   unsigned int addr;
    33   unsigned char type;
    34   unsigned char checksum;
    35   unsigned char data[0];
    36 } hex_record;
    37 
    38 typedef struct _hex_file {
    39   FILE *f;
    40   unsigned long addr;
    41 } hex_file;
    42 
    43 
    44 
    45 // Create a hex_file from an already-open FILE *
    46 hex_file *hex_open(FILE *f);
    47 
    48 // Read the next hex_record from f
    49 hex_record *hex_read(hex_file *f);
    50 
    51 
    52 
    53 #endif /* __RJLHEX_H__ */