diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-05-28 16:15:15 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-05-28 16:15:15 +0200 |
commit | d2e75eee1d017a7632faf017f40780a5255897f5 (patch) | |
tree | 0bca544eb7ec4a8da4da6c3ed6faaf0d02411bca /stm32.h | |
parent | 422a7785c423d64b97f9ae06baf19921a859e380 (diff) |
Started rewrite from scratch.
Diffstat (limited to 'stm32.h')
-rw-r--r-- | stm32.h | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -0,0 +1,47 @@ +#ifndef STM32_H +#define STM32_H + +#include <stdint.h> + +struct RCC_t { + volatile uint32_t CR; + volatile uint32_t CFGR; + volatile uint32_t CIR; + volatile uint32_t APB2RSTR; + volatile uint32_t APB1RSTR; + volatile uint32_t AHBENR; + volatile uint32_t APB2ENR; + volatile uint32_t APB1ENR; + volatile uint32_t BDCR; + volatile uint32_t CSR; +}; + +static RCC_t& RCC = *(RCC_t*)0x40021000; + +struct FLASH_t { + volatile uint32_t ACR; + volatile uint32_t KEYR; + volatile uint32_t OPTKEYR; + volatile uint32_t SR; + volatile uint32_t CR; + volatile uint32_t AR; + volatile uint32_t RESERVED; + volatile uint32_t OBR; + volatile uint32_t WRPR; +}; + +static FLASH_t& FLASH = *(FLASH_t*)0x40022000; + +struct GPIO_t { + volatile uint32_t CRL; + volatile uint32_t CRH; + volatile uint32_t IDR; + volatile uint32_t ODR; + volatile uint32_t BSRR; + volatile uint32_t BRR; + volatile uint32_t LCKR; +}; + +static GPIO_t& GPIOA = *(GPIO_t*)0x40010800; + +#endif |