board.h 1.0 KB

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