1
0

board.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * 2021-12-18 BruceOu first implementation
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include "gd32f10x.h"
  13. #include "drv_usart.h"
  14. #include "drv_gpio.h"
  15. #include "gd32f10x_exti.h"
  16. #define EXT_SDRAM_BEGIN (0xC0000000U) /* the begining address of external SDRAM */
  17. #define EXT_SDRAM_END (EXT_SDRAM_BEGIN + (32U * 1024 * 1024)) /* the end address of external SDRAM */
  18. // <o> Internal SRAM memory size[Kbytes] <8-96>
  19. // <i>Default: 96
  20. #ifdef __ICCARM__
  21. // Use *.icf ram symbal, to avoid hardcode.
  22. extern char __ICFEDIT_region_RAM_end__;
  23. #define GD32_SRAM_END &__ICFEDIT_region_RAM_end__
  24. #else
  25. #define GD32_SRAM_SIZE 96
  26. #define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
  27. #endif
  28. #ifdef __CC_ARM
  29. extern int Image$$RW_IRAM1$$ZI$$Limit;
  30. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  31. #elif __ICCARM__
  32. #pragma section="HEAP"
  33. #define HEAP_BEGIN (__segment_end("HEAP"))
  34. #else
  35. extern int __bss_end;
  36. #define HEAP_BEGIN (&__bss_end)
  37. #endif
  38. #define HEAP_END GD32_SRAM_END
  39. #endif