api-hal-flash.h 829 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. /*
  6. * Erase Flash
  7. * Locking operation, uses HSEM to manage shared access.
  8. * @param page, page number
  9. * @param count, page count to erase
  10. */
  11. bool api_hal_flash_erase(uint8_t page, uint8_t count);
  12. /*
  13. * Write double word (64 bits)
  14. * Locking operation, uses HSEM to manage shared access.
  15. * @param address - destination address, must be double word aligned.
  16. * @param data - data to write
  17. */
  18. bool api_hal_flash_write_dword(size_t address, uint64_t data);
  19. /*
  20. * Write page (4096 bytes or 64 rows of double words).
  21. * Locking operation, uses HSEM to manage shared access.
  22. * @param address - destination address, must be page aligned
  23. * @param source_address - source address
  24. */
  25. bool api_hal_flash_write_page(size_t address, size_t source_address);