board.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. *
  3. * SPDX-License-Identifier: Apache-2.0
  4. *
  5. * Change Logs:
  6. * Date Author Notes
  7. * 2020-10-30 DongBowen first version
  8. */
  9. #ifndef __BOARD_H__
  10. #define __BOARD_H__
  11. #include <rtthread.h>
  12. #include "hc32l196_ddl.h"
  13. #include "drv_gpio.h"
  14. /* board configuration */
  15. #define SRAM_BASE 0x20000000
  16. #define SRAM_SIZE 0x8000
  17. #define SRAM_END (SRAM_BASE + SRAM_SIZE)
  18. /* High speed sram. */
  19. #ifdef __CC_ARM
  20. extern int Image$$RW_IRAM1$$ZI$$Limit;
  21. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  22. #elif __ICCARM__
  23. #pragma section="HEAP"
  24. #define HEAP_BEGIN (__segment_end("HEAP"))
  25. #else
  26. extern int __bss_end;
  27. #define HEAP_BEGIN (&__bss_end)
  28. #endif
  29. #ifdef __ICCARM__
  30. // Use *.icf ram symbal, to avoid hardcode.
  31. extern char __ICFEDIT_region_RAM_end__;
  32. #define HEAP_END (&__ICFEDIT_region_RAM_end__)
  33. #else
  34. #define HEAP_END SRAM_END
  35. #endif
  36. void rt_hw_board_init(void);
  37. void rt_hw_us_delay(rt_uint32_t us);
  38. #endif