From e586c178073b9a0fee90d5fc8e795d266ebd7b7d Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Tue, 7 Aug 2012 16:50:46 +0200 Subject: Initial import. Most sources are split off from suzumebachi project revision 2fc77d2 as is with some path changes. New build rules introduced. --- rcc/flash.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 rcc/flash.h (limited to 'rcc/flash.h') diff --git a/rcc/flash.h b/rcc/flash.h new file mode 100644 index 0000000..30d30a5 --- /dev/null +++ b/rcc/flash.h @@ -0,0 +1,30 @@ +#ifndef FLASH_H +#define FLASH_H + +#include + +struct FLASH_t { + volatile uint32_t ACR; + volatile uint32_t KEYR; + volatile uint32_t OPTKEYR; + volatile uint32_t SR; + volatile uint32_t CR; + #if defined(STM32F1) + volatile uint32_t AR; + volatile uint32_t RESERVED; + volatile uint32_t OBR; + volatile uint32_t WRPR; + #elif defined(STM32F4) + volatile uint32_t OPTCR; + #endif +}; + +#if defined(STM32F1) +static FLASH_t& FLASH = *(FLASH_t*)0x40022000; +#elif defined(STM32F4) +static FLASH_t& FLASH = *(FLASH_t*)0x40023c00; +#endif + +void flash_init(); + +#endif -- cgit v1.2.3