board.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 Olimex LPC-P1227 board.
  17. *
  18. */
  19. /*
  20. * Board identifiers.
  21. */
  22. #define OLIMEX_LPC_P1227
  23. #define BOARD_NAME "Olimex LPC-P1227"
  24. /*
  25. * Board frequencies.
  26. */
  27. #define SYSOSCCLK 12000000
  28. /*
  29. * GPIO 0 initial setup.
  30. */
  31. #define VAL_GPIO0DIR 0x00000000
  32. #define VAL_GPIO0DATA 0x00000000
  33. /*
  34. * GPIO 1 initial setup.
  35. */
  36. #define VAL_GPIO1DIR PAL_PORT_BIT(GPIO1_LED1) | \
  37. PAL_PORT_BIT(GPIO1_LED2) | \
  38. PAL_PORT_BIT(GPIO1_BUZZER)
  39. #define VAL_GPIO1DATA PAL_PORT_BIT(GPIO1_LED1)
  40. /*
  41. * GPIO 2 initial setup.
  42. */
  43. #define VAL_GPIO2DIR PAL_PORT_BIT(GPIO2_LCD_DC) | \
  44. PAL_PORT_BIT(GPIO2_LCD_SS) | \
  45. PAL_PORT_BIT(GPIO2_LCD_RES)
  46. #define VAL_GPIO2DATA PAL_PORT_BIT(GPIO2_LCD_SS)
  47. /*
  48. * Pin definitions.
  49. */
  50. #define GPIO1_LED1 5
  51. #define GPIO1_LED2 4
  52. #define GPIO1_SW_WAKEUP 3
  53. #define GPIO1_BUZZER 6
  54. #define GPIO2_SW_USER1 12
  55. #define GPIO2_SW_USER2 11
  56. #define GPIO2_SW_USER3 10
  57. #define GPIO2_LCD_DC 15
  58. #define GPIO2_LCD_SS 14
  59. #define GPIO2_LCD_RES 13
  60. /* LCD3310 pins */
  61. #define LCD3310_RES_PIN GPIO2_LCD_RES
  62. #define LCD3310_RES_PORT GPIO2
  63. #define LCD3310_DC_PIN GPIO2_LCD_DC
  64. #define LCD3310_DC_PORT GPIO2
  65. #if !defined(_FROM_ASM_)
  66. #ifdef __cplusplus
  67. extern "C" {
  68. #endif
  69. void boardInit(void);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* _FROM_ASM_ */
  74. #endif /* _BOARD_H_ */