board.h 1.2 KB

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