Create flash register map
This commit is contained in:
parent
dd6d5fbdd1
commit
7f7cb077dc
97
drivers/flash_regs.h
Normal file
97
drivers/flash_regs.h
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/** @file flash_regs.h
|
||||||
|
* Module defining flash memory interface registers.
|
||||||
|
*
|
||||||
|
* Mainly made to be used by the rcc module. It is recommanded to go through
|
||||||
|
* the functions provided by that module instead of directly using the registers
|
||||||
|
* defined here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _FLASH_REGS_H_
|
||||||
|
#define _FLASH_REGS_H_
|
||||||
|
|
||||||
|
//--includes--------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
|
|
||||||
|
//--type definitions------------------------------------------------------------
|
||||||
|
|
||||||
|
#define FLASH_BASE_ADDRESS 0x40022000
|
||||||
|
|
||||||
|
union FLASH_ACR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t LATENCY:3;
|
||||||
|
uint32_t HLFCYA:1;
|
||||||
|
uint32_t PRFTBE:1;
|
||||||
|
uint32_t PRFTBS:1;
|
||||||
|
uint32_t reserved1:26;
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_KEYR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_OPTKEYR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_SR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_CR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_AR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_OBR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
union FLASH_WRPR {
|
||||||
|
struct __attribute__((packed)) {
|
||||||
|
uint32_t reserved1; //TODO
|
||||||
|
};
|
||||||
|
uint32_t word;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct __attribute__((packed)) FLASH {
|
||||||
|
union FLASH_ACR ACR;
|
||||||
|
union FLASH_KEYR KEYR;
|
||||||
|
union FLASH_OPTKEYR OPTKEYR;
|
||||||
|
union FLASH_SR SR;
|
||||||
|
union FLASH_CR CR;
|
||||||
|
union FLASH_AR AR;
|
||||||
|
uint32_t reserved1;
|
||||||
|
union FLASH_OBR OBR;
|
||||||
|
union FLASH_WRPR WRPR;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//--functions-------------------------------------------------------------------
|
||||||
|
|
||||||
|
#endif //_FLASH_REGS_H_
|
||||||
|
|
||||||
@ -270,6 +270,7 @@ struct __attribute__((packed)) RCC {
|
|||||||
union RCC_CSR CSR;
|
union RCC_CSR CSR;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//--functions-------------------------------------------------------------------
|
//--functions-------------------------------------------------------------------
|
||||||
|
|
||||||
#endif //_RCC_REGS_H_
|
#endif //_RCC_REGS_H_
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user