12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef GD32F10X_MISC_H
- #define GD32F10X_MISC_H
- #include "gd32f10x.h"
- #define NVIC_VECTTAB_RAM ((uint32_t)0x20000000)
- #define NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
- #define NVIC_VECTTAB_OFFSET_MASK ((uint32_t)0x1FFFFF80)
- #define NVIC_AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)
- #define NVIC_PRIGROUP_PRE0_SUB4 ((uint32_t)0x700)
- #define NVIC_PRIGROUP_PRE1_SUB3 ((uint32_t)0x600)
- #define NVIC_PRIGROUP_PRE2_SUB2 ((uint32_t)0x500)
- #define NVIC_PRIGROUP_PRE3_SUB1 ((uint32_t)0x400)
- #define NVIC_PRIGROUP_PRE4_SUB0 ((uint32_t)0x300)
- #define SCB_SCR_SLEEPONEXIT ((uint8_t)0x02)
- #define SCB_SCR_SLEEPDEEP ((uint8_t)0x04)
- #define SCB_SCR_SEVONPEND ((uint8_t)0x10)
- #define SCB_LPM_SLEEP_EXIT_ISR SCB_SCR_SLEEPONEXIT
- #define SCB_LPM_DEEPSLEEP SCB_SCR_SLEEPDEEP
- #define SCB_LPM_WAKE_BY_ALL_INT SCB_SCR_SEVONPEND
- #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0xFFFFFFFBU)
- #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004U)
- void nvic_priority_group_set(uint32_t nvic_prigroup);
- void nvic_irq_enable(uint8_t nvic_irq, uint8_t nvic_irq_pre_priority, uint8_t nvic_irq_sub_priority);
- void nvic_irq_disable(uint8_t nvic_irq);
- void nvic_vector_table_set(uint32_t nvic_vict_tab, uint32_t offset);
- void system_lowpower_set(uint8_t lowpower_mode);
- void system_lowpower_reset(uint8_t lowpower_mode);
- void systick_clksource_set(uint32_t systick_clksource);
- #endif
|