f4.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "../stm32/f1.h"
  2. #undef FLASH_PAGE_SIZE
  3. extern unsigned int FLASH_PAGE_SIZE;
  4. #define AT32F403 0x02
  5. #define AT32F413 0x04
  6. #define AT32F415 0x05
  7. #define AT32F403A 0x07
  8. #define AT32F407 0x08
  9. extern unsigned int at32f4_series;
  10. void identify_board_config(void);
  11. /* On reset, SYSCLK=HSI at 8MHz. SYSCLK runs at 1MHz. */
  12. void early_fatal(int blinks) __attribute__((noreturn));
  13. #define early_delay_ms(ms) (delay_ticks((ms)*1000))
  14. #define early_delay_us(us) (delay_ticks((us)*1))
  15. #undef SYSCLK_MHZ
  16. #define SYSCLK_MHZ 144
  17. #define AHB_MHZ (SYSCLK_MHZ / 1) /* 144MHz */
  18. #define APB1_MHZ (SYSCLK_MHZ / 2) /* 72MHz */
  19. #define APB2_MHZ (SYSCLK_MHZ / 2) /* 72MHz */
  20. enum {
  21. F4SM_v4 = 0,
  22. F4SM_v4_slim,
  23. };
  24. /* Core floppy pin assignments vary between F4 submodels (except INDEX, RDATA,
  25. * and WDATA). All the following assignments are within GPIOB. */
  26. struct core_floppy_pins {
  27. uint8_t trk0;
  28. uint8_t wrprot;
  29. uint8_t dir;
  30. uint8_t step;
  31. uint8_t wgate;
  32. uint8_t head;
  33. };
  34. extern const struct core_floppy_pins *core_floppy_pins;