partition.h 662 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2016-09-20 Bernard the first version
  9. */
  10. #ifndef PARTITION_H__
  11. #define PARTITION_H__
  12. #define PARTITION_RDONLY 0x000
  13. #define PARTITION_WRITEABLE 0x100 /* Device is writable */
  14. #define PARTITION_POWERUP_LOCK 0x200 /* Always locked after reset */
  15. struct rt_partition
  16. {
  17. char name[8];
  18. rt_uint32_t offset;
  19. rt_uint32_t size;
  20. rt_uint32_t flags;
  21. };
  22. int rt_partition_init(const char* flash_device, const struct rt_partition* parts, rt_size_t num);
  23. #endif