partition.h 660 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * File : partition.h
  3. * COPYRIGHT (C) 2016, Shanghai Real-Thread Technology Co., Ltd
  4. *
  5. * Change Logs:
  6. * Date Author Notes
  7. * 2016-09-20 Bernard the first version
  8. */
  9. #ifndef PARTITION_H__
  10. #define PARTITION_H__
  11. #define PARTITION_RDONLY 0x000
  12. #define PARTITION_WRITEABLE 0x100 /* Device is writable */
  13. #define PARTITION_POWERUP_LOCK 0x200 /* Always locked after reset */
  14. struct rt_partition
  15. {
  16. const char* name;
  17. rt_uint32_t offset;
  18. rt_uint32_t size;
  19. rt_uint32_t flags;
  20. };
  21. int rt_partition_init(const char* flash_device, const struct rt_partition* parts, rt_size_t num);
  22. #endif