Rev 56 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
30 | mjames | 1 | /* |
2 | * nvram.h |
||
3 | * |
||
4 | * Created on: 4 Jun 2017 |
||
5 | * Author: Mike |
||
6 | */ |
||
64 | mjames | 7 | #include "libPLX/plx.h" |
30 | mjames | 8 | |
9 | #pragma once |
||
10 | |||
64 | mjames | 11 | |
50 | mjames | 12 | #if defined __cplusplus |
64 | mjames | 13 | extern "C" |
14 | { |
||
50 | mjames | 15 | #endif |
64 | mjames | 16 | #pragma pack(push, 1) |
17 | ///\brief State of currently displayed item |
||
18 | typedef union |
||
19 | { |
||
20 | struct |
||
21 | { |
||
22 | unsigned tag : 8; |
||
23 | unsigned : 8; |
||
24 | enum PLX_Observations observation : 8; |
||
25 | int instance : 8; |
||
26 | } data; |
||
27 | uint32_t u32; |
||
28 | } nvram_info_t; |
||
29 | #pragma pack(pop) |
||
50 | mjames | 30 | |
64 | mjames | 31 | // Allocation of NVRAM words : there are 4k bytes |
32 | #define NVRAM_WORDS (4096 / sizeof(nvram_info_t)) |
||
30 | mjames | 33 | |
56 | mjames | 34 | |
64 | mjames | 35 | // Save data according to its tag field |
36 | extern void write_nvram_data(nvram_info_t data); |
||
50 | mjames | 37 | |
64 | mjames | 38 | // find data according to the tag field or return null if no info, |
39 | extern nvram_info_t *find_nvram_data(uint8_t tag); |
||
40 | |||
50 | mjames | 41 | #if defined __cplusplus |
42 | } |
||
43 | #endif |