board.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * File : board.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2009-09-22 Bernard add board.h to this bsp
  23. */
  24. // <<< Use Configuration Wizard in Context Menu >>>
  25. #ifndef __BOARD_H__
  26. #define __BOARD_H__
  27. #include <stm32l4xx.h>
  28. // <o> Internal SRAM memory size[Kbytes] <8-64>
  29. // <i>Default: 64
  30. #ifdef __ICCARM__
  31. // Use *.icf ram symbal, to avoid hardcode.
  32. extern char __ICFEDIT_region_RAM_end__;
  33. #define STM32_SRAM_END &__ICFEDIT_region_RAM_end__
  34. #else
  35. #define STM32_SRAM_SIZE 96
  36. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  37. #endif
  38. #ifdef __CC_ARM
  39. extern int Image$$RW_IRAM1$$ZI$$Limit;
  40. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  41. #elif __ICCARM__
  42. #pragma section="HEAP"
  43. #define HEAP_BEGIN (__segment_end("HEAP"))
  44. #else
  45. extern int __bss_end;
  46. #define HEAP_BEGIN (&__bss_end)
  47. #endif
  48. #define HEAP_END STM32_SRAM_END
  49. // <o> Console on USART: <0=> no console <1=>USART 1 <2=>USART 2 <3=> USART 3
  50. // <i>Default: 1
  51. #define STM32_CONSOLE_USART 2
  52. void rt_hw_board_init(void);
  53. #if STM32_CONSOLE_USART == 0
  54. #define CONSOLE_DEVICE "no"
  55. #elif STM32_CONSOLE_USART == 1
  56. #define CONSOLE_DEVICE "uart1"
  57. #elif STM32_CONSOLE_USART == 2
  58. #define CONSOLE_DEVICE "uart2"
  59. #elif STM32_CONSOLE_USART == 3
  60. #define CONSOLE_DEVICE "uart3"
  61. #elif STM32_CONSOLE_USART == 4
  62. #define CONSOLE_DEVICE "uart4"
  63. #elif STM32_CONSOLE_USART == 5
  64. #define CONSOLE_DEVICE "uart5"
  65. #elif STM32_CONSOLE_USART == 6
  66. #define CONSOLE_DEVICE "lpuart1"
  67. #endif
  68. #define FINSH_DEVICE_NAME CONSOLE_DEVICE
  69. void Error_Handler(void);
  70. #endif
  71. //*** <<< end of configuration section >>> ***