api-hal-flash.c 480 B

123456789101112131415
  1. #include <api-hal-flash.h>
  2. #include <api-hal-bt.h>
  3. #include <stm32wbxx.h>
  4. void api_hal_flash_write_dword(size_t address, uint64_t data) {
  5. api_hal_bt_lock_flash();
  6. HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address, data);
  7. api_hal_bt_unlock_flash();
  8. }
  9. void api_hal_flash_write_row(size_t address, size_t source_address) {
  10. api_hal_bt_lock_flash();
  11. HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address, source_address);
  12. api_hal_bt_unlock_flash();
  13. }