X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm32f1%2Fstm32f1.h;fp=src%2Fstm32f1%2Fstm32f1.h;h=ba6f4db3550bdfb92401d9bbe046441dcd09172a;hb=cea0f40fff14b9d2085e0026a68b742a4b114cb9;hp=acb3b39ae14733fbc262b23a96592d3b94459c02;hpb=58f013162125b2143a5a9f1c0544cb20817e9524;p=fw%2Faltos diff --git a/src/stm32f1/stm32f1.h b/src/stm32f1/stm32f1.h index acb3b39a..ba6f4db3 100644 --- a/src/stm32f1/stm32f1.h +++ b/src/stm32f1/stm32f1.h @@ -355,6 +355,17 @@ extern struct stm_scb stm_scb; #define STM_SCB_AIRCR_VECTCLRACTIVE 1 #define STM_SCB_AIRCR_VECTRESET 0 +struct stm_dbgmcu { + uint32_t idcode; +}; + +extern struct stm_dbgmcu stm_dbgmcu; + +static inline uint16_t +stm_dev_id(void) { + return stm_dbgmcu.idcode & 0xfff; +} + struct stm_flash { vuint32_t acr; vuint32_t keyr; @@ -398,8 +409,8 @@ extern struct stm_flash stm_flash; #define STM_FLASH_CR_PG 0 #define STM_FLASH_RDPRT_KEY 0x00A5 -#define STM_FLASH_FPEC_KEY1 0x45670123 -#define STM_FLASH_FPEC_KEY2 0xCDEF89AB +#define STM_FLASH_KEYR_KEY1 0x45670123 +#define STM_FLASH_KEYR_KEY2 0xCDEF89AB struct stm_flash_data {