Subversion Repositories pentevo

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef _IHEX_C_
  2. #define _IHEX_C_
  3.  
  4. // max length of bytes in ihex is 255, thus 512+ chars maximum length. So the value below is sane.
  5. #define IHEX_BUF_SZ (1024)
  6.  
  7. // parses intelhex file into the memory area so that low_bound<=every byte's address<high_bound.
  8. //
  9. // when a byte is put in the buffer, a 'disp' value is added to its address to
  10. // make index into 'buffer' array.
  11. //
  12. // it is assumed that low_bound+disp .. high_bound+disp-1 are all valid indices
  13. // into the 'buffer' array
  14. //
  15. // unspecified bytes are filled with 'fill' value.
  16. //
  17. // returns zero in case of any errors, otherwise non-zero.
  18. //
  19. // detected errors:
  20. // - any of file errors
  21. // - intelhex format errors (incl. unknown record types)
  22. // - addressing errors (any byte from intelhex goes outside bounds)
  23. // an appropriate error message is printed into stderr
  24. //
  25. int parse_ihex(uint8_t * buffer, int32_t disp, int32_t low_bound, int32_t high_bound, uint8_t fill, char * filename);
  26.  
  27.  
  28. #endif // _IHEX_C_
  29.  
  30.