board.h 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. * 2021-07-01 lik first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <rtthread.h>
  13. #include <rthw.h>
  14. #include <rtdevice.h>
  15. #include <string.h>
  16. #include <SWM341.h>
  17. #include "drv_gpio.h"
  18. #include "drv_uart.h"
  19. #include "drv_sdram.h"
  20. #ifdef __cplusplus
  21. extern "C"
  22. {
  23. #endif
  24. #define SRAM_BASE 0x20000000
  25. #define SRAM_SIZE 0x10000
  26. #define SRAM_END (SRAM_BASE + SRAM_SIZE)
  27. #if defined(__ARMCC_VERSION)
  28. extern int Image$$RW_IRAM1$$ZI$$Limit;
  29. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  30. #elif __ICCARM__
  31. #pragma section = "HEAP"
  32. #define HEAP_BEGIN (__segment_end("HEAP"))
  33. #else
  34. extern int __bss_end;
  35. #define HEAP_BEGIN ((void *)&__bss_end)
  36. #endif
  37. #define HEAP_END SRAM_END
  38. #define HEAP_SIZE (HEAP_END - (rt_uint32_t)HEAP_BEGIN)
  39. void rt_hw_board_init(void);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif /* __BOARD_H__ */