board.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * File : board.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-09-22 Bernard add board.h to this bsp
  13. */
  14. // <<< Use Configuration Wizard in Context Menu >>>
  15. #ifndef __BOARD_H__
  16. #define __BOARD_H__
  17. #include <stm32l4xx.h>
  18. // <o> Internal SRAM memory size[Kbytes] <8-64>
  19. // <i>Default: 64
  20. #ifdef __ICCARM__
  21. // Use *.icf ram symbal, to avoid hardcode.
  22. extern char __ICFEDIT_region_RAM_end__;
  23. #define STM32_SRAM_END &__ICFEDIT_region_RAM_end__
  24. #else
  25. #define STM32_SRAM_SIZE 96
  26. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  27. #endif
  28. #ifdef __CC_ARM
  29. extern int Image$$RW_IRAM1$$ZI$$Limit;
  30. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  31. #elif __ICCARM__
  32. #pragma section="HEAP"
  33. #define HEAP_BEGIN (__segment_end("HEAP"))
  34. #else
  35. extern int __bss_end;
  36. #define HEAP_BEGIN (&__bss_end)
  37. #endif
  38. #define HEAP_END STM32_SRAM_END
  39. // <o> Console on USART: <0=> no console <1=>USART 1 <2=>USART 2 <3=> USART 3
  40. // <i>Default: 1
  41. #define STM32_CONSOLE_USART 1
  42. void rt_hw_board_init(void);
  43. #if STM32_CONSOLE_USART == 0
  44. #define CONSOLE_DEVICE "no"
  45. #elif STM32_CONSOLE_USART == 1
  46. #define CONSOLE_DEVICE "uart1"
  47. #elif STM32_CONSOLE_USART == 2
  48. #define CONSOLE_DEVICE "uart2"
  49. #elif STM32_CONSOLE_USART == 3
  50. #define CONSOLE_DEVICE "uart3"
  51. #endif
  52. #define FINSH_DEVICE_NAME CONSOLE_DEVICE
  53. void Error_Handler(void);
  54. #endif
  55. //*** <<< end of configuration section >>> ***