board_lpc.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * @brief NXP LPCXpresso LPC824 board file
  3. *
  4. * @note
  5. * Copyright(C) NXP Semiconductors, 2012
  6. * All rights reserved.
  7. *
  8. * @par
  9. * Software that is described herein is for illustrative purposes only
  10. * which provides customers with programming information regarding the
  11. * LPC products. This software is supplied "AS IS" without any warranties of
  12. * any kind, and NXP Semiconductors and its licensor disclaim any and
  13. * all warranties, express or implied, including all implied warranties of
  14. * merchantability, fitness for a particular purpose and non-infringement of
  15. * intellectual property rights. NXP Semiconductors assumes no responsibility
  16. * or liability for the use of the software, conveys no license or rights under any
  17. * patent, copyright, mask work right, or any other intellectual property rights in
  18. * or to any products. NXP Semiconductors reserves the right to make changes
  19. * in the software without notification. NXP Semiconductors also makes no
  20. * representation or warranty that such application will be suitable for the
  21. * specified use without further testing or modification.
  22. *
  23. * @par
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors' and its
  26. * licensor's relevant copyrights in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers. This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. */
  31. #ifndef __BOARD_H_
  32. #define __BOARD_H_
  33. #include "chip.h"
  34. /* board_api.h is included at the bottom of this file after DEBUG setup */
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. /** @defgroup BOARD_NXP_LPCXPRESSO_824 NXP LPC824 LPCXpresso board support software API functions
  39. * @ingroup LPCOPEN_8XX_BOARD_LPCXPRESSO_824
  40. * The board support software API functions provide some simple abstracted
  41. * functions used across multiple LPCOpen board examples. See @ref BOARD_COMMON_API
  42. * for the functions defined by this board support layer.<br>
  43. * @{
  44. */
  45. /** @defgroup LPCOPEN_8XX_BOARD_LPCXPRESSO_824_OPTIONS BOARD: LPC824 LPCXpresso board build options
  46. * This board has options that configure its operation at build-time.<br>
  47. * @{
  48. */
  49. /** Define the frequency in Hz, of the main oscillator (from Xtal)
  50. * Note that it only takes effect if main oscillator is selected as clock source
  51. */
  52. #define MAIN_OSC_XTAL_FREQ_HZ 12000000
  53. /** Define the frequency in Hz, of the external clock input.
  54. * Note that it only takes effect if external clock is selected as clock source
  55. */
  56. #define EXT_CLOCK_IN_FREQ_HZ 0
  57. //#define USE_IRC_AS_ROOT_CLOCK /*注释掉使用外部晶体 打开定义则是使用内部IRC*/
  58. #define BOARD_LED_CNT 8
  59. #define BOARD_KEY_CNT 3
  60. typedef enum _enum_boardKeys
  61. {
  62. BOARD_KEY_0 = 0,
  63. BOARD_KEY_1 = 1,
  64. BOARD_KEY_2 = 2,
  65. }enum_boardKeys;
  66. // define LED bits (bit <--> pin on port 0) only if in board.c file
  67. #ifdef _BOARD_C_
  68. static const uint8_t ledBits[BOARD_LED_CNT] = {7, 13, 16, 17, 19, 27, 28, 18};
  69. static const uint8_t cs_keyBits[BOARD_KEY_CNT] = {12, 4 , 1};
  70. static const uint8_t cs_keyIoConNdce[BOARD_KEY_CNT] = {IOCON_PIO12, IOCON_PIO4, IOCON_PIO1};
  71. #endif
  72. /** Define DEBUG_ENABLE to enable IO via the DEBUGSTR, DEBUGOUT, and
  73. DEBUGIN macros. If not defined, DEBUG* functions will be optimized
  74. out of the code at build time.
  75. */
  76. #define DEBUG_ENABLE
  77. /** Define DEBUG_SEMIHOSTING along with DEBUG_ENABLE to enable IO support
  78. via semihosting. You may need to use a C library that supports
  79. semihosting with this option.
  80. */
  81. //#define DEBUG_SEMIHOSTING
  82. /** Board UART used for debug output and input using the DEBUG* macros. This
  83. is also the port used for Board_UARTPutChar, Board_UARTGetChar, and
  84. Board_UARTPutSTR functions. Although you can setup multiple UARTs here,
  85. the board code only supoprts UART0 in the Board_UART_Init() fucntion,
  86. so be sure to change it there too if not using UART0.
  87. */
  88. #define DEBUG_UART LPC_USART1
  89. /**
  90. * @}
  91. */
  92. /* Board name */
  93. #define BOARD_NXP_LPCXPRESSO_824
  94. #include "board_api.h"
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* __BOARD_H_ */