board.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 Embedded Artists LPCXpresso Base Board with LPC1114 daughter
  17. * board.
  18. */
  19. /*
  20. * Board identifiers.
  21. */
  22. #define BOARD_EA_BB_LPC1114
  23. #define BOARD_NAME "Embedded Artists LPCXpresso Base Board + LPC1114"
  24. /*
  25. * Board frequencies.
  26. */
  27. #define SYSOSCCLK 12000000
  28. /*
  29. * SCK0 connection on this board.
  30. */
  31. #define LPC11xx_SPI_SCK0_SELECTOR SCK0_IS_PIO2_11
  32. /*
  33. * GPIO 0 initial setup.
  34. */
  35. #define VAL_GPIO0DIR PAL_PORT_BIT(GPIO0_OLEDSEL) | \
  36. PAL_PORT_BIT(GPIO0_LED2)
  37. #define VAL_GPIO0DATA PAL_PORT_BIT(GPIO0_OLEDSEL) | \
  38. PAL_PORT_BIT(GPIO0_LED2)
  39. /*
  40. * GPIO 1 initial setup.
  41. */
  42. #define VAL_GPIO1DIR PAL_PORT_BIT(GPIO1_LED3B) | \
  43. PAL_PORT_BIT(GPIO1_LED3R) | \
  44. PAL_PORT_BIT(GPIO1_LED3G) | \
  45. PAL_PORT_BIT(GPIO1_SPI0SEL)
  46. #define VAL_GPIO1DATA PAL_PORT_BIT(GPIO1_LED3B) | \
  47. PAL_PORT_BIT(GPIO1_LED3R) | \
  48. PAL_PORT_BIT(GPIO1_LED3G) | \
  49. PAL_PORT_BIT(GPIO1_SPI0SEL)
  50. /*
  51. * GPIO 2 initial setup.
  52. */
  53. #define VAL_GPIO2DIR 0x00000000
  54. #define VAL_GPIO2DATA 0x00000000
  55. /*
  56. * GPIO 3 initial setup.
  57. */
  58. #define VAL_GPIO3DIR 0x00000000
  59. #define VAL_GPIO3DATA 0x00000000
  60. /*
  61. * Pin definitions.
  62. */
  63. #define GPIO0_SW3 1
  64. #define GPIO0_OLEDSEL 2
  65. #define GPIO0_LED2 7
  66. #define GPIO1_LED3B 2
  67. #define GPIO1_SW4 4
  68. #define GPIO1_LED3R 9
  69. #define GPIO1_LED3G 10
  70. #define GPIO1_SPI0SEL 11
  71. #if !defined(_FROM_ASM_)
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75. void boardInit(void);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif /* _FROM_ASM_ */
  80. #endif /* _BOARD_H_ */