hpgl_xy/stm32f103t8u6-bootloader/src/flash.h
2021-04-04 20:33:45 +02:00

22 lines
No EOL
528 B
C

#pragma once
#include "stm32f103x6.h"
#define FLASH_PAGE_BYTES 1024U
#define FLASH_BOOTLOADER_PAGES 2U
#define FLASH_PAGES 64U
typedef enum
{
FLASH_SUCCESS = 0,
FLASH_PROHIBITED = 1,
FLASH_VERIFY_FAILED = 2
} Flash_Status_t;
#define FLASH_APPLICATION_BASE (FLASH_BASE \
+ FLASH_BOOTLOADER_PAGES * FLASH_PAGE_BYTES)
Flash_Status_t Flash_ErasePage(unsigned int page);
void Flash_ProgramFromPMA(uint32_t flash_adress, uint16_t pma_offset,
uint32_t length);