1
0

board.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-01-10 luobeihai first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <rtthread.h>
  13. #include <apm32f4xx.h>
  14. #include "apm32f4xx_gpio.h"
  15. #include "apm32f4xx_syscfg.h"
  16. #include "apm32f4xx_rcm.h"
  17. #include "apm32f4xx_misc.h"
  18. #include "apm32f4xx_rcm.h"
  19. #include "apm32f4xx_eint.h"
  20. #include "apm32f4xx_usart.h"
  21. #include "apm32f4xx_dma.h"
  22. #if defined(RT_USING_ADC)
  23. #include "apm32f4xx_adc.h"
  24. #endif
  25. #if defined(RT_USING_DAC)
  26. #include "apm32f4xx_dac.h"
  27. #endif
  28. #if defined(RT_USING_RTC)
  29. #include "apm32f4xx_rtc.h"
  30. #include "apm32f4xx_pmu.h"
  31. #endif
  32. #if defined(RT_USING_SPI)
  33. #include "apm32f4xx_spi.h"
  34. #endif
  35. #if defined(RT_USING_HWTIMER) || defined(RT_USING_PWM)
  36. #include "apm32f4xx_tmr.h"
  37. #endif
  38. #if defined(RT_USING_WDT)
  39. #include "apm32f4xx_iwdt.h"
  40. #include "apm32f4xx_wwdt.h"
  41. #endif
  42. #if defined(BSP_USING_ETH)
  43. #include "apm32f4xx_eth.h"
  44. #endif
  45. #if defined(BSP_USING_SDCARD)
  46. #include "apm32f4xx_sdio.h"
  47. #endif
  48. #if defined(BSP_USING_ON_CHIP_FLASH)
  49. #include "apm32f4xx_fmc.h"
  50. #endif
  51. #if defined(RT_USING_CAN)
  52. #include "apm32f4xx_can.h"
  53. #endif
  54. #if defined(BSP_USING_SDRAM)
  55. #include "apm32f4xx_dmc.h"
  56. #endif
  57. #include "drv_common.h"
  58. #include "drv_gpio.h"
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62. #define APM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  63. #define APM32_FLASH_SIZE (1024 * 1024)
  64. #define APM32_FLASH_END_ADDRESS ((uint32_t)(APM32_FLASH_START_ADRESS + APM32_FLASH_SIZE))
  65. /* Internal SRAM memory size[Kbytes] <6-128>, Default: 128 */
  66. #define APM32_SRAM_SIZE 128
  67. #define APM32_SRAM_END (0x20000000 + APM32_SRAM_SIZE * 1024)
  68. #if defined(__ARMCC_VERSION)
  69. extern int Image$$RW_IRAM1$$ZI$$Limit;
  70. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  71. #elif __ICCARM__
  72. #pragma section="CSTACK"
  73. #define HEAP_BEGIN (__segment_end("CSTACK"))
  74. #else
  75. extern int __bss_end;
  76. #define HEAP_BEGIN ((void *)&__bss_end)
  77. #endif
  78. #define HEAP_END APM32_SRAM_END
  79. void SystemClock_Config(void);
  80. void apm32_usart_init(void);
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif /* __BOARD_H__ */