board.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-11-5 SummerGift change to new framework
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <rtthread.h>
  13. #include <stm32l4xx.h>
  14. #include "drv_common.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #ifdef BSP_USING_GPIO
  19. #include "drv_gpio.h"
  20. /* Board Pin definitions */
  21. #define LED1_PIN GET_PIN(B, 6)
  22. #define LED2_PIN GET_PIN(E, 3)
  23. #define LED3_PIN GET_PIN(D, 15)
  24. #define KEY1_PIN GET_PIN(E, 11)
  25. #define KEY2_PIN GET_PIN(E, 14)
  26. #define KEY3_PIN GET_PIN(E, 10)
  27. #endif /* BSP_USING_GPIO */
  28. /* Internal SRAM memory size[Kbytes] <8-64>, Default: 64*/
  29. #define STM32_SRAM_SIZE 320
  30. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  31. #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  32. #define STM32_FLASH_SIZE (1024 * 1024)
  33. #define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE))
  34. #if defined(__CC_ARM) || defined(__CLANG_ARM)
  35. extern int Image$$RW_IRAM1$$ZI$$Limit;
  36. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  37. #elif __ICCARM__
  38. #pragma section="CSTACK"
  39. #define HEAP_BEGIN (__segment_end("CSTACK"))
  40. #else
  41. extern int __bss_end;
  42. #define HEAP_BEGIN ((void *)&__bss_end)
  43. #endif
  44. #define HEAP_END STM32_SRAM_END
  45. void SystemClock_Config(void);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif