f1.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #define CORTEX_M3 1
  12. /* C pointer types */
  13. #define BKP volatile struct bkp * const
  14. #define AFIO volatile struct afio * const
  15. #define DMA_CHN volatile struct dma_chn * const
  16. /* C-accessible registers. */
  17. static STK stk = (struct stk *)STK_BASE;
  18. static SCB scb = (struct scb *)SCB_BASE;
  19. static NVIC nvic = (struct nvic *)NVIC_BASE;
  20. static DBG dbg = (struct dbg *)DBG_BASE;
  21. static FLASH flash = (struct flash *)FLASH_BASE;
  22. static PWR pwr = (struct pwr *)PWR_BASE;
  23. static BKP bkp = (struct bkp *)BKP_BASE;
  24. static RCC rcc = (struct rcc *)RCC_BASE;
  25. static IWDG iwdg = (struct iwdg *)IWDG_BASE;
  26. static GPIO gpioa = (struct gpio *)GPIOA_BASE;
  27. static GPIO gpiob = (struct gpio *)GPIOB_BASE;
  28. static GPIO gpioc = (struct gpio *)GPIOC_BASE;
  29. static GPIO gpiod = (struct gpio *)GPIOD_BASE;
  30. static GPIO gpioe = (struct gpio *)GPIOE_BASE;
  31. static GPIO gpiof = (struct gpio *)GPIOF_BASE;
  32. static GPIO gpiog = (struct gpio *)GPIOG_BASE;
  33. static AFIO afio = (struct afio *)AFIO_BASE;
  34. static EXTI exti = (struct exti *)EXTI_BASE;
  35. static DMA dma1 = (struct dma *)DMA1_BASE;
  36. static DMA dma2 = (struct dma *)DMA2_BASE;
  37. static TIM tim1 = (struct tim *)TIM1_BASE;
  38. static TIM tim2 = (struct tim *)TIM2_BASE;
  39. static TIM tim3 = (struct tim *)TIM3_BASE;
  40. static TIM tim4 = (struct tim *)TIM4_BASE;
  41. static TIM tim5 = (struct tim *)TIM5_BASE;
  42. static TIM tim6 = (struct tim *)TIM6_BASE;
  43. static TIM tim7 = (struct tim *)TIM7_BASE;
  44. static SPI spi1 = (struct spi *)SPI1_BASE;
  45. static SPI spi2 = (struct spi *)SPI2_BASE;
  46. static SPI spi3 = (struct spi *)SPI3_BASE;
  47. static I2C i2c1 = (struct i2c *)I2C1_BASE;
  48. static I2C i2c2 = (struct i2c *)I2C2_BASE;
  49. static USART usart1 = (struct usart *)USART1_BASE;
  50. static USART usart2 = (struct usart *)USART2_BASE;
  51. static USART usart3 = (struct usart *)USART3_BASE;
  52. static SER_ID ser_id = (uint32_t *)0x1ffff7e8;
  53. #define SYSCLK_MHZ 72
  54. #define FLASH_PAGE_SIZE 1024
  55. /* No delay required after enabling a peripheral clock, before accessing it. */
  56. #define peripheral_clock_delay() ((void)0)
  57. /* No secondary RAM region */
  58. #define section_ext_ram
  59. extern unsigned int sram_kb;
  60. enum {
  61. F1SM_basic = 0,
  62. F1SM_plus,
  63. F1SM_plus_unbuffered,
  64. };
  65. /*
  66. * Local variables:
  67. * mode: C
  68. * c-file-style: "Linux"
  69. * c-basic-offset: 4
  70. * tab-width: 4
  71. * indent-tabs-mode: nil
  72. * End:
  73. */