diff --git a/src/flash.h b/src/flash.h new file mode 100644 index 0000000..780cee5 --- /dev/null +++ b/src/flash.h @@ -0,0 +1,35 @@ +#ifndef FLASH_H_ +#define FLASH_H_ + +#include + +struct flash { + volatile uint32_t ACR; // Flash access control register + volatile uint32_t KEYR; // Flash key register + volatile uint32_t OPTKEYR; // Flash option key register + volatile uint32_t SR; // Flash status register + volatile uint32_t CR; // Flash control register + volatile uint32_t OPTCR; // Flash option control register +}; + +#define FLASH_BASE_ADDR (0x40023C00U) +#define FLASH ((struct flash *) FLASH_BASE_ADDR) + +// ACR Register +// Data cache enable + +#define FLASH_ACR_DCEN_BIT 10 +#define FLASH_ACR_DCEN_ENABLE (1 <