board.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2006-2021, YICHIP Technology Co.,Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-09-09 WSY first version
  9. */
  10. #ifndef BOARD_H__
  11. #define BOARD_H__
  12. #include <rtthread.h>
  13. #include <yc3122.h>
  14. #include "yc_gpio.h"
  15. #include "yc_uart.h"
  16. #include "yc_exti.h"
  17. #define SRAM_BASE 0x20000
  18. #define SRAM_SIZE 0x10000
  19. #ifdef BSP_USING_EXT_SRAM
  20. #define EXT_SRAM_BASE SRAMM_BASE
  21. #define EXT_SRAM_SIZE BSP_EXT_SRAM_SIZE
  22. #define EXT_SRAM_BEGIN EXT_SRAM_BASE
  23. #define EXT_SRAM_END (EXT_SRAM_BASE + EXT_SRAM_SIZE)
  24. #endif
  25. #define SRAM_END (SRAM_BASE + SRAM_SIZE)
  26. #if defined(__ARMCC_VERSION)
  27. extern int Image$$RW_IRAM1$$ZI$$Limit;
  28. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  29. #elif __ICCARM__
  30. #pragma section = "HEAP"
  31. #define HEAP_rBEGIN (__segment_end("HEAP"))
  32. #else
  33. extern int __bss_end;
  34. #define HEAP_BEGIN ((void *)&__bss_end)
  35. #endif
  36. #define HEAP_END SRAM_END
  37. #define HEAP_SIZE (HEAP_END - (rt_uint32_t)HEAP_BEGIN)
  38. extern void rt_hw_board_init(void);
  39. #endif