reflow-oven-control-sw/stm-firmware/updater/ram-code/hex-parser.h
Mario Hüttel caabde39d2 Updater RAM Code
* Add Fatfs for reading from SD card
* Add structure of Hex parser
2020-12-21 17:21:04 +01:00

27 lines
597 B
C

#ifndef _HEX_PARSER_H_
#define _HEX_PARSER_H_
#include <stdint.h>
#include <fatfs/ff.h>
#include <stddef.h>
enum hex_parser_ret {
HEX_PARSER_OK,
HEX_PARSER_DATA_OK,
HEX_PARSER_ERROR,
HEX_PARSER_FILE_END,
};
struct hex_parser {
FIL file;
uint32_t current_address_offset;
};
enum hex_parser_ret hex_parser_open(struct hex_parser *parser, const char *file_name);
enum hex_parser_ret hex_parser_parse(struct hex_parser *parser, uint32_t *address, char *data, size_t data_len);
enum hex_parser_ret hex_parser_close(struct hex_parser *parser);
#endif /* _HEX_PARSER_H_ */