board.h 1.9 KB

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