board.h 1.7 KB

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