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.

47 lines
1.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include "config.h"
  5. #include "zeeprom_fs.h"
  6. void sample_data_mgr_init();
  7. #define FILE_MAX_COUNT MAX_FILE_NUM
  8. typedef struct {
  9. uint8_t year;
  10. uint8_t month;
  11. uint8_t day;
  12. uint8_t hour;
  13. uint8_t min;
  14. uint8_t sec;
  15. uint8_t placeholder[2];
  16. } sample_data_filename_t;
  17. typedef struct {
  18. uint8_t filename[8];
  19. int32_t fileuuid;
  20. int32_t size;
  21. } sample_data_fileinfo_t;
  22. typedef struct {
  23. sample_data_fileinfo_t* fileinfo[FILE_MAX_COUNT];
  24. int count;
  25. } sample_data_fileinfo_list_t;
  26. void sample_data_mgr_init();
  27. void sample_data_mgr_uninit();
  28. sample_data_fileinfo_list_t* sample_data_mgr_get_fileinfo_list();
  29. bool sample_data_mgr_storage_is_full();
  30. int32_t sample_data_mgr_get_file_num();
  31. int32_t sample_data_mgr_open(sample_data_filename_t* filename, wrflag_t flag);
  32. int32_t sample_data_mgr_close(int32_t fd);
  33. int32_t sample_data_mgr_write(int32_t fd, const uint8_t* data, int32_t size);
  34. int32_t sample_data_mgr_read(int32_t fd, uint8_t* data, int32_t size);
  35. int32_t sample_data_mgr_get_file_size_by_fd(int32_t fd);
  36. int32_t sample_data_mgr_delete_file(sample_data_filename_t* filename);