You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 line
1.0 KiB

  1. #ifndef PLSR_PERSISTENCE_H
  2. #define PLSR_PERSISTENCE_H
  3. #include "plsr_address_map.h"
  4. #include <stdint.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef struct
  9. {
  10. int32_t runtime[PLSR_HSD_RUNTIME_COUNT];
  11. int32_t config[PLSR_HSD_CONFIG_COUNT];
  12. } PLSR_HSD_DATA;
  13. typedef struct
  14. {
  15. int32_t config[PLSR_SFD_CONFIG_COUNT];
  16. } PLSR_SFD_DATA;
  17. typedef enum
  18. {
  19. PLSR_PERSISTENCE_OK = 0,
  20. PLSR_PERSISTENCE_DEFAULTED,
  21. PLSR_PERSISTENCE_INVALID_ARGUMENT,
  22. PLSR_PERSISTENCE_VERIFY_FAILED,
  23. PLSR_PERSISTENCE_NOT_IMPLEMENTED
  24. } PLSR_PERSISTENCE_RESULT;
  25. PLSR_PERSISTENCE_RESULT PlsrPersistenceLoadHsd(PLSR_HSD_DATA *data);
  26. PLSR_PERSISTENCE_RESULT PlsrPersistenceSaveHsd(const PLSR_HSD_DATA *data);
  27. void PlsrPersistenceResetHsd(void);
  28. PLSR_PERSISTENCE_RESULT PlsrPersistenceLoadSfd(PLSR_SFD_DATA *data);
  29. PLSR_PERSISTENCE_RESULT PlsrPersistenceSaveSfd(const PLSR_SFD_DATA *data);
  30. #ifdef PLSR_HOST_TEST
  31. void PlsrPersistenceTestResetStorage(void);
  32. void PlsrPersistenceTestCorruptNewestHsd(void);
  33. #endif
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* PLSR_PERSISTENCE_H */