board.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) 2006-2018, Synwit Technology Co.,Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-05-31 ZYH first version
  9. * 2018-12-10 Zohar_Lee format file
  10. */
  11. #ifndef __BOARD_H__
  12. #define __BOARD_H__
  13. #include <rtthread.h>
  14. #include <rthw.h>
  15. #include <rtdevice.h>
  16. #include <string.h>
  17. #include <SWM320.h>
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. #define SRAM_BASE 0x20000000
  23. #define SRAM_SIZE 0x20000
  24. #define SRAM_END (SRAM_BASE + SRAM_SIZE)
  25. #ifdef BSP_USING_EXT_SRAM
  26. #define EXT_SRAM_BASE SRAMM_BASE
  27. #define EXT_SRAM_SIZE BSP_EXT_SRAM_SIZE
  28. #define EXT_SRAM_BEGIN EXT_SRAM_BASE
  29. #define EXT_SRAM_END (EXT_SRAM_BASE + EXT_SRAM_SIZE)
  30. #endif
  31. #if defined(__ARMCC_VERSION)
  32. extern int Image$$RW_IRAM1$$ZI$$Limit;
  33. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  34. #elif __ICCARM__
  35. #pragma section = "HEAP"
  36. #define HEAP_BEGIN (__segment_end("HEAP"))
  37. #else
  38. extern int __bss_end;
  39. #define HEAP_BEGIN ((void *)&__bss_end)
  40. #endif
  41. #define HEAP_END SRAM_END
  42. #define HEAP_SIZE (HEAP_END - (rt_uint32_t)HEAP_BEGIN)
  43. void rt_hw_board_init(void);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* __BOARD_H__ */