1 /* 2 * Copyright (c) 2006-2023, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2023-03-26 luobeihai first version 9 */ 10 11 #ifndef __BOARD_H__ 12 #define __BOARD_H__ 13 14 #include <rtthread.h> 15 #include <apm32e10x.h> 16 17 #include "apm32e10x_gpio.h" 18 #include "apm32e10x_rcm.h" 19 #include "apm32e10x_misc.h" 20 #include "apm32e10x_rcm.h" 21 #include "apm32e10x_eint.h" 22 #include "apm32e10x_usart.h" 23 #include "apm32e10x_dma.h" 24 25 #if defined(RT_USING_ADC) 26 #include "apm32e10x_adc.h" 27 #endif 28 #if defined(RT_USING_DAC) 29 #include "apm32e10x_dac.h" 30 #endif 31 #if defined(RT_USING_RTC) 32 #include "apm32e10x_rtc.h" 33 #include "apm32e10x_pmu.h" 34 #endif 35 #if defined(RT_USING_SPI) 36 #include "apm32e10x_spi.h" 37 #endif 38 #if defined(RT_USING_HWTIMER) || defined(RT_USING_PWM) 39 #include "apm32e10x_tmr.h" 40 #endif 41 #if defined(RT_USING_WDT) 42 #include "apm32e10x_iwdt.h" 43 #include "apm32e10x_wwdt.h" 44 #endif 45 #if defined(BSP_USING_SDCARD) 46 #include "apm32e10x_sdio.h" 47 #endif 48 #if defined(BSP_USING_ON_CHIP_FLASH) 49 #include "apm32e10x_fmc.h" 50 #endif 51 #if defined(RT_USING_CAN) 52 #include "apm32e10x_can.h" 53 #endif 54 #if defined(BSP_USING_SDRAM) 55 #include "apm32e10x_dmc.h" 56 #endif 57 58 #include "drv_common.h" 59 #include "drv_gpio.h" 60 61 #ifdef __cplusplus 62 extern "C" { 63 #endif 64 65 #define APM32_FLASH_START_ADRESS ((uint32_t)0x08000000) 66 #define APM32_FLASH_SIZE (512 * 1024) 67 #define APM32_FLASH_END_ADDRESS ((uint32_t)(APM32_FLASH_START_ADRESS + APM32_FLASH_SIZE)) 68 69 /* Internal SRAM memory size[Kbytes] <6-128>, Default: 128 */ 70 #define APM32_SRAM_SIZE 128 71 #define APM32_SRAM_END (0x20000000 + APM32_SRAM_SIZE * 1024) 72 73 #if defined(__ARMCC_VERSION) 74 extern int Image$$RW_IRAM1$$ZI$$Limit; 75 #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit) 76 #elif __ICCARM__ 77 #pragma section="CSTACK" 78 #define HEAP_BEGIN (__segment_end("CSTACK")) 79 #else 80 extern int __bss_end; 81 #define HEAP_BEGIN ((void *)&__bss_end) 82 #endif 83 84 #define HEAP_END APM32_SRAM_END 85 86 void SystemClock_Config(void); 87 88 void apm32_usart_init(void); 89 90 #ifdef __cplusplus 91 } 92 #endif 93 94 #endif /* __BOARD_H__ */ 95