board.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 the Olimex LPC-P1343 proto board.
  17. */
  18. /*
  19. * Board identifiers.
  20. */
  21. #define BOARD_OLIMEX_LPC_P1343
  22. #define BOARD_NAME "Olimex LPC-P1343"
  23. /*
  24. * Board frequencies.
  25. */
  26. #define SYSOSCCLK 12000000
  27. /*
  28. * GPIO 0 initial setup.
  29. */
  30. #define VAL_GPIO0DIR 0x00000000
  31. #define VAL_GPIO0DATA 0x00000000
  32. /*
  33. * GPIO 1 initial setup.
  34. */
  35. #define VAL_GPIO1DIR PAL_PORT_BIT(GPIO1_SW2)
  36. #define VAL_GPIO1DATA PAL_PORT_BIT(GPIO1_SW2)
  37. /*
  38. * GPIO 2 initial setup.
  39. */
  40. #define VAL_GPIO2DIR PAL_PORT_BIT(GPIO2_SW1) | \
  41. PAL_PORT_BIT(GPIO2_LED5) | \
  42. PAL_PORT_BIT(GPIO2_LED6) | \
  43. PAL_PORT_BIT(GPIO2_LED7) | \
  44. PAL_PORT_BIT(GPIO2_LED8)
  45. #define VAL_GPIO2DATA PAL_PORT_BIT(GPIO2_LED5) | \
  46. PAL_PORT_BIT(GPIO2_LED6) | \
  47. PAL_PORT_BIT(GPIO2_LED7) | \
  48. PAL_PORT_BIT(GPIO2_LED8)
  49. /*
  50. * GPIO 3 initial setup.
  51. */
  52. #define VAL_GPIO3DIR PAL_PORT_BIT(GPIO3_LED1) | \
  53. PAL_PORT_BIT(GPIO3_LED2) | \
  54. PAL_PORT_BIT(GPIO3_LED3) | \
  55. PAL_PORT_BIT(GPIO3_LED4)
  56. #define VAL_GPIO3DATA PAL_PORT_BIT(GPIO3_LED1) | \
  57. PAL_PORT_BIT(GPIO3_LED2) | \
  58. PAL_PORT_BIT(GPIO3_LED3) | \
  59. PAL_PORT_BIT(GPIO3_LED4)
  60. /*
  61. * Pin definitions.
  62. */
  63. #define GPIO1_SW2 4
  64. #define GPIO1_SPI0SEL 11
  65. #define GPIO2_SW1 9
  66. #define GPIO3_LED1 0
  67. #define GPIO3_LED2 1
  68. #define GPIO3_LED3 2
  69. #define GPIO3_LED4 3
  70. #define GPIO2_LED5 4
  71. #define GPIO2_LED6 5
  72. #define GPIO2_LED7 6
  73. #define GPIO2_LED8 7
  74. #if !defined(_FROM_ASM_)
  75. #ifdef __cplusplus
  76. extern "C" {
  77. #endif
  78. void boardInit(void);
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* _FROM_ASM_ */
  83. #endif /* _BOARD_H_ */