board.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #ifndef _BOARD_H_
  14. #define _BOARD_H_
  15. /*
  16. * Setup for NGX BlueBoard LPC11U14.
  17. */
  18. /*
  19. * Board identifiers.
  20. */
  21. #define BOARD_NGX_BB_LPC11U14
  22. #define BOARD_NAME "NGX BlueBoard LPC11U14"
  23. /*
  24. * Board frequencies.
  25. */
  26. #define SYSOSCCLK 12000000
  27. /*
  28. * Pin definitions.
  29. */
  30. /* GPIO Port0 */
  31. #define BUTTON_ISP_PORT GPIO0
  32. #define BUTTON_ISP 1
  33. #define LCD_ERD_PORT GPIO0
  34. #define LCD_ERD 12
  35. #define LCD_RWR_PORT GPIO0
  36. #define LCD_RWR 13
  37. #define LCD_RS_PORT GPIO0
  38. #define LCD_RS 14
  39. #define LED_PORT GPIO0
  40. #define LED_TEST1 22
  41. #define LED_TEST2 23
  42. /* GPIO Port1 */
  43. #define LCD_RST_PORT GPIO1
  44. #define LCD_RST 0
  45. #define LCD_CS_PORT GPIO1
  46. #define LCD_CS 13
  47. #define LCD_BL_PORT GPIO1
  48. #define LCD_BL 14
  49. #define LCD_VCCEN_PORT GPIO1
  50. #define LCD_VCCEN 14
  51. #define WHEEL_SENSOR_PORT GPIO0
  52. #define WHEEL_SENSOR 21
  53. #define LCD_DATA_PORT GPIO1
  54. #define LCD_D0 19
  55. #define LCD_D1 20
  56. #define LCD_D2 21
  57. #define LCD_D3 22
  58. #define LCD_D4 26
  59. #define LCD_D5 27
  60. #define LCD_D6 28
  61. #define LCD_D7 31
  62. #define LCD_DATA_MASK PAL_PORT_BIT(LCD_D0) | \
  63. PAL_PORT_BIT(LCD_D1) | \
  64. PAL_PORT_BIT(LCD_D2) | \
  65. PAL_PORT_BIT(LCD_D3) | \
  66. PAL_PORT_BIT(LCD_D4) | \
  67. PAL_PORT_BIT(LCD_D5) | \
  68. PAL_PORT_BIT(LCD_D6) | \
  69. PAL_PORT_BIT(LCD_D7)
  70. /*
  71. * GPIO 0 initial setup.
  72. */
  73. #define VAL_GPIO0DIR PAL_PORT_BIT(LCD_ERD) | \
  74. PAL_PORT_BIT(LCD_RWR) | \
  75. PAL_PORT_BIT(LCD_RS) | \
  76. PAL_PORT_BIT(LED_TEST1) | \
  77. PAL_PORT_BIT(LED_TEST2)
  78. #define VAL_GPIO0DATA PAL_PORT_BIT(LCD_ERD) | \
  79. PAL_PORT_BIT(LCD_RWR) | \
  80. PAL_PORT_BIT(LED_TEST1) | \
  81. PAL_PORT_BIT(LED_TEST2)
  82. /*
  83. * GPIO 1 initial setup.
  84. */
  85. #define VAL_GPIO1DIR PAL_PORT_BIT(LCD_RST) | \
  86. PAL_PORT_BIT(LCD_CS) | \
  87. PAL_PORT_BIT(LCD_BL) | \
  88. LCD_DATA_MASK
  89. #define VAL_GPIO1DATA 0x00000000
  90. #if !defined(_FROM_ASM_)
  91. #ifdef __cplusplus
  92. extern "C" {
  93. #endif
  94. void boardInit(void);
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif
  99. #endif