board.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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-11 luobeihai 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. #include "drv_common.h"
  41. #include "drv_gpio.h"
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #define APM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  46. #define APM32_FLASH_SIZE (64 * 1024)
  47. #define APM32_FLASH_END_ADDRESS ((uint32_t)(APM32_FLASH_START_ADRESS + APM32_FLASH_SIZE))
  48. /* Internal SRAM memory size[Kbytes] <4-8>, Default: 8 */
  49. #define APM32_SRAM_SIZE 8
  50. #define APM32_SRAM_END (0x20000000 + APM32_SRAM_SIZE * 1024)
  51. #if defined(__ARMCC_VERSION)
  52. extern int Image$$RW_IRAM1$$ZI$$Limit;
  53. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  54. #elif __ICCARM__
  55. #pragma section="CSTACK"
  56. #define HEAP_BEGIN (__segment_end("CSTACK"))
  57. #else
  58. extern int __bss_end;
  59. #define HEAP_BEGIN ((void *)&__bss_end)
  60. #endif
  61. #define HEAP_END APM32_SRAM_END
  62. void SystemClock_Config(void);
  63. void apm32_usart_init(void);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* __BOARD_H__ */