board.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2006-2021, 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 <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. #include "drv_common.h"
  21. #include "drv_gpio.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #define APM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  26. #define APM32_FLASH_SIZE (512 * 1024)
  27. #define APM32_FLASH_END_ADDRESS ((uint32_t)(APM32_FLASH_START_ADRESS + APM32_FLASH_SIZE))
  28. /* Internal SRAM memory size[Kbytes] <6-128>, Default: 128 */
  29. #define APM32_SRAM_SIZE 128
  30. #define APM32_SRAM_END (0x20000000 + APM32_SRAM_SIZE * 1024)
  31. #if defined(__CC_ARM) || defined(__CLANG_ARM)
  32. extern int Image$$RW_IRAM1$$ZI$$Limit;
  33. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  34. #elif __ICCARM__
  35. #pragma section="CSTACK"
  36. #define HEAP_BEGIN (__segment_end("CSTACK"))
  37. #else
  38. extern int __bss_end;
  39. #define HEAP_BEGIN ((void *)&__bss_end)
  40. #endif
  41. #define HEAP_END APM32_SRAM_END
  42. void SystemClock_Config(void);
  43. void apm32_usart_init(void);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* __BOARD_H__ */