Flash.h 506 B

123456789101112131415161718
  1. /*
  2. interface to flash read/write
  3. */
  4. #pragma once
  5. #include <stdint.h>
  6. #include "AP_HAL_Namespace.h"
  7. class AP_HAL::Flash {
  8. public:
  9. virtual uint32_t getpageaddr(uint32_t page) = 0;
  10. virtual uint32_t getpagesize(uint32_t page) = 0;
  11. virtual uint32_t getnumpages(void) = 0;
  12. virtual bool erasepage(uint32_t page) = 0;
  13. virtual bool write(uint32_t addr, const void *buf, uint32_t count) = 0;
  14. virtual void keep_unlocked(bool set) = 0;
  15. virtual bool ispageerased(uint32_t page) = 0;
  16. };