f1.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * stm32/f1.h
  3. *
  4. * Core and peripheral registers.
  5. *
  6. * Written & released by Keir Fraser <keir.xen@gmail.com>
  7. *
  8. * This is free and unencumbered software released into the public domain.
  9. * See the file COPYING for more details, or visit <http://unlicense.org>.
  10. */
  11. /* C pointer types */
  12. #define BKP volatile struct bkp * const
  13. #define AFIO volatile struct afio * const
  14. /* C-accessible registers. */
  15. static STK stk = (struct stk *)STK_BASE;
  16. static SCB scb = (struct scb *)SCB_BASE;
  17. static NVIC nvic = (struct nvic *)NVIC_BASE;
  18. static DBG dbg = (struct dbg *)DBG_BASE;
  19. static FLASH flash = (struct flash *)FLASH_BASE;
  20. static PWR pwr = (struct pwr *)PWR_BASE;
  21. static BKP bkp = (struct bkp *)BKP_BASE;
  22. static RCC rcc = (struct rcc *)RCC_BASE;
  23. static IWDG iwdg = (struct iwdg *)IWDG_BASE;
  24. static GPIO gpioa = (struct gpio *)GPIOA_BASE;
  25. static GPIO gpiob = (struct gpio *)GPIOB_BASE;
  26. static GPIO gpioc = (struct gpio *)GPIOC_BASE;
  27. static GPIO gpiod = (struct gpio *)GPIOD_BASE;
  28. static GPIO gpioe = (struct gpio *)GPIOE_BASE;
  29. static GPIO gpiof = (struct gpio *)GPIOF_BASE;
  30. static GPIO gpiog = (struct gpio *)GPIOG_BASE;
  31. static AFIO afio = (struct afio *)AFIO_BASE;
  32. static EXTI exti = (struct exti *)EXTI_BASE;
  33. static DMA dma1 = (struct dma *)DMA1_BASE;
  34. static DMA dma2 = (struct dma *)DMA2_BASE;
  35. static TIM tim1 = (struct tim *)TIM1_BASE;
  36. static TIM tim2 = (struct tim *)TIM2_BASE;
  37. static TIM tim3 = (struct tim *)TIM3_BASE;
  38. static TIM tim4 = (struct tim *)TIM4_BASE;
  39. static TIM tim5 = (struct tim *)TIM5_BASE;
  40. static TIM tim6 = (struct tim *)TIM6_BASE;
  41. static TIM tim7 = (struct tim *)TIM7_BASE;
  42. static SPI spi1 = (struct spi *)SPI1_BASE;
  43. static SPI spi2 = (struct spi *)SPI2_BASE;
  44. static SPI spi3 = (struct spi *)SPI3_BASE;
  45. static I2C i2c1 = (struct i2c *)I2C1_BASE;
  46. static I2C i2c2 = (struct i2c *)I2C2_BASE;
  47. static USART usart1 = (struct usart *)USART1_BASE;
  48. static USART usart2 = (struct usart *)USART2_BASE;
  49. static USART usart3 = (struct usart *)USART3_BASE;
  50. #define SYSCLK_MHZ 72
  51. #define FLASH_PAGE_SIZE 1024
  52. /* No delay required after enabling a peripheral clock, before accessing it. */
  53. #define peripheral_clock_delay() ((void)0)
  54. /*
  55. * Local variables:
  56. * mode: C
  57. * c-file-style: "Linux"
  58. * c-basic-offset: 4
  59. * tab-width: 4
  60. * indent-tabs-mode: nil
  61. * End:
  62. */