board.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-08-20 Abbcc first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <rtthread.h>
  13. #include <apm32f0xx.h>
  14. #include "apm32f0xx_gpio.h"
  15. #include "apm32f0xx_syscfg.h"
  16. #include "apm32f0xx_rcm.h"
  17. #include "apm32f0xx_misc.h"
  18. #include "apm32f0xx_eint.h"
  19. #include "apm32f0xx_usart.h"
  20. #if defined(RT_USING_ADC)
  21. #include "apm32f0xx_adc.h"
  22. #endif
  23. #if defined(RT_USING_DAC)
  24. #include "apm32f0xx_dac.h"
  25. #endif
  26. #if defined(RT_USING_RTC)
  27. #include "apm32f0xx_rtc.h"
  28. #include "apm32f0xx_pmu.h"
  29. #endif
  30. #if defined(RT_USING_SPI)
  31. #include "apm32f0xx_spi.h"
  32. #endif
  33. #if defined(RT_USING_HWTIMER) || defined(RT_USING_PWM)
  34. #include "apm32f0xx_tmr.h"
  35. #endif
  36. #if defined(RT_USING_WDT)
  37. #include "apm32f0xx_iwdt.h"
  38. #include "apm32f0xx_wwdt.h"
  39. #endif
  40. #if defined(BSP_USING_ON_CHIP_FLASH)
  41. #include "apm32f0xx_fmc.h"
  42. #endif
  43. #if defined(RT_USING_CAN)
  44. #include "apm32f0xx_can.h"
  45. #endif
  46. #include "drv_common.h"
  47. #include "drv_gpio.h"
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. #define APM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  52. #define APM32_FLASH_SIZE (128 * 1024)
  53. #define APM32_FLASH_END_ADDRESS ((uint32_t)(APM32_FLASH_START_ADRESS + APM32_FLASH_SIZE))
  54. /* Internal SRAM memory size[Kbytes] <8-64>, Default: 64 */
  55. #define APM32_SRAM_SIZE 16
  56. #define APM32_SRAM_END (0x20000000 + APM32_SRAM_SIZE * 1024)
  57. #if defined(__ARMCC_VERSION)
  58. extern int Image$$RW_IRAM1$$ZI$$Limit;
  59. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  60. #elif __ICCARM__
  61. #pragma section="CSTACK"
  62. #define HEAP_BEGIN (__segment_end("CSTACK"))
  63. #else
  64. extern int __bss_end;
  65. #define HEAP_BEGIN ((void *)&__bss_end)
  66. #endif
  67. #define HEAP_END APM32_SRAM_END
  68. void SystemClock_Config(void);
  69. void apm32_usart_init(void);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* __BOARD_H__ */