Subversion Repositories EDIS_Ignition

Rev

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

  1. /*
  2.  * nvram.h
  3.  *
  4.  *  Created on: 4 Jun 2017
  5.  *      Author: Mike
  6.  */
  7. #include "libPLX/plx.h"
  8.  
  9. #pragma once
  10.  
  11.  
  12. #if defined __cplusplus
  13. extern "C"
  14. {
  15. #endif
  16. #pragma pack(push, 1)
  17.  
  18.     ///\brief State of item
  19.     /// this is expected to be packed into 32 bits
  20.     typedef union
  21.     {
  22.         struct
  23.         {
  24.             unsigned tag : 8;
  25.             int val : 8;
  26.         } data;
  27.         uint16_t u16;
  28.     } nvram_info_t;
  29. #pragma pack(pop)
  30.  
  31.  
  32.     // Save data according to its tag field
  33.     extern void write_nvram_data(nvram_info_t data);
  34.  
  35.     // find data according to the tag field or return null if no info
  36.     extern nvram_info_t *find_nvram_data(uint8_t tag);
  37.  
  38. #if defined __cplusplus
  39. }
  40. #endif
  41.