board.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 <stm32l4xx.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifdef BSP_USING_GPIO
  17. #include "drv_gpio.h"
  18. /* Board Pin definitions */
  19. #define LED1_PIN GET_PIN(B, 6)
  20. #define LED2_PIN GET_PIN(E, 3)
  21. #define LED3_PIN GET_PIN(D, 15)
  22. #define KEY1_PIN GET_PIN(E, 11)
  23. #define KEY2_PIN GET_PIN(E, 14)
  24. #define KEY3_PIN GET_PIN(E, 10)
  25. #endif /* BSP_USING_GPIO */
  26. /* Internal SRAM memory size[Kbytes] <8-64>, Default: 64*/
  27. #define STM32_SRAM_SIZE 320
  28. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  29. #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  30. #define STM32_FLASH_SIZE (1024 * 1024)
  31. #define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE))
  32. #if defined(__ARMCC_VERSION)
  33. extern int Image$$RW_IRAM1$$ZI$$Limit;
  34. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  35. #elif __ICCARM__
  36. #pragma section="CSTACK"
  37. #define HEAP_BEGIN (__segment_end("CSTACK"))
  38. #else
  39. extern int __bss_end;
  40. #define HEAP_BEGIN ((void *)&__bss_end)
  41. #endif
  42. #define HEAP_END STM32_SRAM_END
  43. void SystemClock_Config(void);
  44. #ifdef RT_USING_PM
  45. void SystemClock_Config(void);
  46. void SystemClock_MSI_ON(void);
  47. void SystemClock_MSI_OFF(void);
  48. void SystemClock_80M(void);
  49. void SystemClock_24M(void);
  50. void SystemClock_2M(void);
  51. void SystemClock_ReConfig(uint8_t mode);
  52. void SystemClock_Config_fromSTOP(void);
  53. #endif
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif