![](/media/cache/profiles/827ccb0eea8a706c4c34a16891f84e7b.jpg.50x50_q85.jpg)
Bootload from SD card to sector 0, and jump to sector 24 where new firmware resides
Fork of Panel-Controller-Bootloader by
Diff: main.h
- Revision:
- 0:c3a652eff606
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.h Tue Apr 21 09:30:11 2015 +0000 @@ -0,0 +1,34 @@ +#ifndef MAIN_H_ +#define MAIN_H_ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +void SD_LowLevel_Init(void); +void SD_LowLevel_DeInit(void); + +#define ApplicationAddress (0x8006000) +#define PAGE_SIZE (0x400) /* 1 Kbyte */ +#define FLASH_SIZE (0x20000) /* 128 KBytes */ + +/* SD Card */ +#define SD_SPI SPI1 +#define SD_SPI_CLK RCC_APB2Periph_SPI1 +#define SD_SPI_SCK_PIN GPIO_Pin_5 +#define SD_SPI_SCK_GPIO_PORT GPIOA +#define SD_SPI_SCK_GPIO_CLK RCC_APB2Periph_GPIOA +#define SD_SPI_MISO_PIN GPIO_Pin_6 +#define SD_SPI_MISO_GPIO_PORT GPIOA +#define SD_SPI_MISO_GPIO_CLK RCC_APB2Periph_GPIOA +#define SD_SPI_MOSI_PIN GPIO_Pin_7 +#define SD_SPI_MOSI_GPIO_PORT GPIOA +#define SD_SPI_MOSI_GPIO_CLK RCC_APB2Periph_GPIOA +#define SD_CS_PIN GPIO_Pin_12 +#define SD_CS_GPIO_PORT GPIOC +#define SD_CS_GPIO_CLK RCC_APB2Periph_GPIOC +#define SD_DETECT_PIN GPIO_Pin_7 +#define SD_DETECT_GPIO_PORT GPIOB +#define SD_DETECT_GPIO_CLK RCC_APB2Periph_GPIOB + +#endif /* MAIN_H_ */