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 * 2022-06-29 Rbb666 first version 9 * 2022-07-26 Rbb666 Add Flash Config 10 */ 11 12 #ifndef __BOARD_H__ 13 #define __BOARD_H__ 14 15 #include <rtthread.h> 16 #include "drv_common.h" 17 #include "drv_gpio.h" 18 19 #include "cy_result.h" 20 #include "cybsp_types.h" 21 #include "cyhal.h" 22 #include "cybsp.h" 23 24 #ifdef BSP_USING_USBD 25 #include "cy_usb_dev.h" 26 #include "cy_usb_dev_hid.h" 27 #endif 28 29 /*FLASH CONFIG*/ 30 #define IFX_FLASH_START_ADRESS ((uint32_t)0x10000000) 31 #define IFX_FLASH_PAGE_SIZE (256 * 1024) 32 #define IFX_FLASH_SIZE (2 * 1024 * 1024) 33 #define IFX_FLASH_END_ADDRESS ((uint32_t)(IFX_FLASH_START_ADRESS + IFX_FLASH_SIZE)) 34 35 /*EFLASH CONFIG*/ 36 #define IFX_EFLASH_START_ADRESS ((uint32_t)0x14000000) 37 #define IFX_EFLASH_PAGE_SIZE (32 * 1024) 38 #define IFX_EFLASH_SIZE (32 * 1024) 39 #define IFX_EFLASH_END_ADDRESS ((uint32_t)(IFX_EFLASH_START_ADRESS + IFX_EFLASH_SIZE)) 40 41 /*SRAM CONFIG*/ 42 #define IFX_SRAM_SIZE (1010) 43 #define IFX_SRAM_END (0x08002000 + IFX_SRAM_SIZE * 1024) 44 45 #ifdef __ARMCC_VERSION 46 extern int Image$$RW_IRAM1$$ZI$$Limit; 47 #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) 48 #define HEAP_END IFX_SRAM_END 49 #elif __ICCARM__ 50 #pragma section="HEAP" 51 #define HEAP_BEGIN (__segment_end("HEAP")) 52 #else 53 extern unsigned int __end__; 54 extern unsigned int __HeapLimit; 55 #define HEAP_BEGIN (void*)&__end__ 56 #define HEAP_END (void*)&__HeapLimit 57 #endif 58 59 void cy_bsp_all_init(void); 60 61 #endif 62 63