2020-12-18 20:15:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-08 04:42:48 +00:00
|
|
|
#include <stdbool.h>
|
2020-12-18 20:15:29 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2021-01-08 04:42:48 +00:00
|
|
|
/*
|
|
|
|
* Erase Flash
|
|
|
|
* Locking operation, uses HSEM to manage shared access.
|
|
|
|
* @param page, page number
|
|
|
|
* @param count, page count to erase
|
|
|
|
*/
|
|
|
|
bool api_hal_flash_erase(uint8_t page, uint8_t count);
|
|
|
|
|
2020-12-18 20:15:29 +00:00
|
|
|
/*
|
|
|
|
* Write double word (64 bits)
|
|
|
|
* Locking operation, uses HSEM to manage shared access.
|
|
|
|
* @param address - destination address, must be double word aligned.
|
|
|
|
* @param data - data to write
|
|
|
|
*/
|
2021-01-08 04:42:48 +00:00
|
|
|
bool api_hal_flash_write_dword(size_t address, uint64_t data);
|
2020-12-18 20:15:29 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Write page (4096 bytes or 64 rows of double words).
|
|
|
|
* Locking operation, uses HSEM to manage shared access.
|
|
|
|
* @param address - destination address, must be page aligned
|
|
|
|
* @param source_address - source address
|
|
|
|
*/
|
2021-01-08 04:42:48 +00:00
|
|
|
bool api_hal_flash_write_page(size_t address, size_t source_address);
|