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 
10 #ifndef __BOARD_H__
11 #define __BOARD_H__
12 
13 #include <rtthread.h>
14 #include "hc32l196_ddl.h"
15 #include "drv_gpio.h"
16 
17 /* board configuration */
18 #define SRAM_BASE 0x20000000
19 #define SRAM_SIZE 0x8000
20 #define SRAM_END (SRAM_BASE + SRAM_SIZE)
21 
22 /* High speed sram. */
23 #ifdef __CC_ARM
24     extern int Image$$RW_IRAM1$$ZI$$Limit;
25     #define HEAP_BEGIN              (&Image$$RW_IRAM1$$ZI$$Limit)
26 #elif __ICCARM__
27     #pragma section="HEAP"
28     #define HEAP_BEGIN              (__segment_end("HEAP"))
29 #else
30     extern int __bss_end;
31     #define HEAP_BEGIN              (&__bss_end)
32 #endif
33 
34 #ifdef __ICCARM__
35     // Use *.icf ram symbal, to avoid hardcode.
36     extern char __ICFEDIT_region_RAM_end__;
37     #define HEAP_END                (&__ICFEDIT_region_RAM_end__)
38 #else
39     #define HEAP_END                SRAM_END
40 #endif
41 
42 void rt_hw_board_init(void);
43 void rt_hw_us_delay(rt_uint32_t us);
44 
45 #endif
46