Bootload from SD card to sector 0, and jump to sector 24 where new firmware resides

Dependencies:   FatFS mbed

Fork of Panel-Controller-Bootloader by Emma

Revision:
0:c3a652eff606
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flash.h	Tue Apr 21 09:30:11 2015 +0000
@@ -0,0 +1,22 @@
+#ifndef FLASH_H_
+#define FLASH_H_
+
+#include "main.h"
+#include "stm32f10x_flash.h"
+#include "ff.h"
+
+/* Private typedef */
+typedef enum {
+	FLASH_OK = 0,				/* (0) Succeeded */
+	FLASH_NO_SD_CARD,			/* (1) No SD Card Inserted */
+	FLASH_NO_FILE,				/* (2) No New firmware.bin file */
+	FLASH_DISK_ERR,				/* (3) Error reading firmware from sd card */
+	FLASH_MEMORY_MISMATCH		/* (4) Flashed Memory does not match value */
+} FLASH_RESULT;
+
+uint32_t CheckFirmware(FIL *file);
+FLASH_RESULT FlashFirmware(void);
+uint32_t FLASH_PagesMask(__IO uint32_t Size);
+void FLASH_DisableWriteProtectionPages(void);
+
+#endif /* FLASH_H_ */