SRTOS
Loading...
Searching...
No Matches
mcu_macros.h
Go to the documentation of this file.
1
9#ifndef MCU_MACROS_H_
10#define MCU_MACROS_H_
11
12#define GPIOD_START_ADDR 0x40020C00
13#define RCC_START_ADDR 0x40023800
14#define RCC_AHB1ENR *((volatile uint32_t *)(RCC_START_ADDR + 0x30))
15#define GPIOD_MODER *((volatile uint32_t *)GPIOD_START_ADDR)
16#define GPIOD_ODR *((volatile uint32_t *)(GPIOD_START_ADDR + 0x14))
17#define RCC_CR *((volatile uint32_t *)(RCC_START_ADDR))
18#define RCC_CFGR *((volatile uint32_t *)(RCC_START_ADDR + 0x08))
19#define SYSTICK_CSR *((volatile uint32_t *)(0xE000E010))
20#define SYSTICK_RELOAD *((volatile uint32_t *)(0xE000E014))
21#define SYSTICK_CURRENT *((volatile uint32_t *)(0xE000E018))
22#define ICSR *((volatile uint32_t *)(0xE000ED04))
23#define SHPR3 *((volatile uint32_t *)(0xE000ED20))
24#define PENDSV_PRIORITY_START_BIT 16
25#define SYSTICK_PRIORITY_START_BIT 24
26#define STACK_OVERFLOW_CANARY_VALUE 0xDEADBEEF
27#define STACK_USAGE_WATERMARK 0xBAADF00D
28#define FLASH_REGISTERS_START_ADDR 0x40023C00
29#define FLASH_KEYR *((volatile uint32_t *)(FLASH_REGISTERS_START_ADDR + 0x04))
30#define FLASH_UNLOCK_KEY1 0x45670123
31#define FLASH_UNLOCK_KEY2 0xCDEF89AB
32#define FLASH_SR *((volatile uint32_t *)(FLASH_REGISTERS_START_ADDR + 0x0C))
33#define FLASH_SR_BSY_BIT 16
34#define FLASH_CR *((volatile uint32_t *)(FLASH_REGISTERS_START_ADDR + 0x10))
35#define FLASH_CR_PSIZE_BIT_START 8
36#define FLASH_CR_SER_BIT 1
37#define FLASH_CR_SNB_BIT_START 3
38#define FLASH_CR_STRT_BIT 16
39#define FLASH_CR_PG_BIT 0
40#define FAULT_DATA_FLASH_START_ADDR 0x08060000
41
42#endif