board.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2006-2022, 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. #include "drv_gpio.h"
  19. #include "drv_uart.h"
  20. #ifdef __cplusplus
  21. extern "C"
  22. {
  23. #endif
  24. #define SRAM_BASE 0x20000000
  25. #define SRAM_SIZE 0x20000
  26. #define SRAM_END (SRAM_BASE + SRAM_SIZE)
  27. #ifdef BSP_USING_EXT_SRAM
  28. #define EXT_SRAM_BASE SRAMM_BASE
  29. #define EXT_SRAM_SIZE BSP_EXT_SRAM_SIZE
  30. #define EXT_SRAM_BEGIN EXT_SRAM_BASE
  31. #define EXT_SRAM_END (EXT_SRAM_BASE + EXT_SRAM_SIZE)
  32. #endif
  33. #if defined(__ARMCC_VERSION)
  34. extern int Image$$RW_IRAM1$$ZI$$Limit;
  35. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  36. #elif __ICCARM__
  37. #pragma section = "HEAP"
  38. #define HEAP_BEGIN (__segment_end("HEAP"))
  39. #else
  40. extern int __bss_end;
  41. #define HEAP_BEGIN ((void *)&__bss_end)
  42. #endif
  43. #define HEAP_END SRAM_END
  44. #define HEAP_SIZE (HEAP_END - (rt_uint32_t)HEAP_BEGIN)
  45. void rt_hw_board_init(void);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* __BOARD_H__ */