altos/test: Handle new eeprom file format. Give up on telem files.
[fw/altos] / src / test / ao_eeprom_read.h
1 /*
2  * Copyright © 2017 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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
15 #ifndef _AO_EEPROM_READ_H_
16 #define _AO_EEPROM_READ_H_
17
18 #define __pdata
19 #define __data
20 #define __xdata
21 #define __code
22 #define __reentrant
23
24 #include <stdint.h>
25 #include <stdio.h>
26 #include <ao_telemetry.h>
27 #include <ao_config.h>
28 #include <ao_ms5607.h>
29 #include <ao_log.h>
30
31 struct ao_eeprom {
32         struct ao_config        config;
33         struct ao_ms5607_prom   ms5607_prom;
34         int                     log_format;
35         uint16_t                serial_number;
36         uint8_t                 *data;
37         uint32_t                len;
38         uint32_t                size;
39 };
40
41 struct ao_eeprom *ao_eeprom_read(FILE *file);
42
43 struct ao_eeprom *ao_eeprom_read_old(FILE *file);
44
45 void ao_eeprom_free_data(struct ao_eeprom *ao_eeprom);
46
47 #endif /* _AO_EEPROM_READ_H_ */