board.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. * 2022-12-28 luobeihai first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <rtthread.h>
  13. #include <apm32f10x.h>
  14. #include "apm32f10x_gpio.h"
  15. #include "apm32f10x_rcm.h"
  16. #include "apm32f10x_misc.h"
  17. #include "apm32f10x_rcm.h"
  18. #include "apm32f10x_eint.h"
  19. #include "apm32f10x_usart.h"
  20. #if defined(RT_USING_ADC)
  21. #include "apm32f10x_adc.h"
  22. #endif
  23. #if defined(RT_USING_DAC)
  24. #include "apm32f10x_dac.h"
  25. #endif
  26. #if defined(RT_USING_RTC)
  27. #include "apm32f10x_rtc.h"
  28. #include "apm32f10x_pmu.h"
  29. #endif
  30. #if defined(RT_USING_SPI)
  31. #include "apm32f10x_spi.h"
  32. #endif
  33. #if defined(RT_USING_HWTIMER) || defined(RT_USING_PWM)
  34. #include "apm32f10x_tmr.h"
  35. #endif
  36. #if defined(RT_USING_WDT)
  37. #include "apm32f10x_iwdt.h"
  38. #include "apm32f10x_wwdt.h"
  39. #endif
  40. #if defined(BSP_USING_ETH)
  41. #include "apm32f10x_eth.h"
  42. #endif
  43. #if defined(BSP_USING_ON_CHIP_FLASH)
  44. #include "apm32f10x_fmc.h"
  45. #endif
  46. #if defined(RT_USING_CAN)
  47. #include "apm32f10x_can.h"
  48. #endif
  49. #include "drv_common.h"
  50. #include "drv_gpio.h"
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54. #define APM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  55. #define APM32_FLASH_SIZE (256 * 1024)
  56. #define APM32_FLASH_END_ADDRESS ((uint32_t)(APM32_FLASH_START_ADRESS + APM32_FLASH_SIZE))
  57. /* Internal SRAM memory size[Kbytes] <6-128>, Default: 64 */
  58. #define APM32_SRAM_SIZE 64
  59. #define APM32_SRAM_END (0x20000000 + APM32_SRAM_SIZE * 1024)
  60. #if defined(__ARMCC_VERSION)
  61. extern int Image$$RW_IRAM1$$ZI$$Limit;
  62. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  63. #elif __ICCARM__
  64. #pragma section="CSTACK"
  65. #define HEAP_BEGIN (__segment_end("CSTACK"))
  66. #else
  67. extern int __bss_end;
  68. #define HEAP_BEGIN ((void *)&__bss_end)
  69. #endif
  70. #define HEAP_END APM32_SRAM_END
  71. void SystemClock_Config(void);
  72. void apm32_usart_init(void);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __BOARD_H__ */