board.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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-P2148 proto board.
  17. */
  18. /*
  19. * Board identifier.
  20. */
  21. #define BOARD_OLIMEX_LPC_P2148
  22. #define BOARD_NAME "Olimex LPC-P2148"
  23. /*
  24. * The following values are implementation dependent. You may change them in
  25. * order to match your HW.
  26. */
  27. #define FOSC 12000000
  28. #define CCLK 48000000
  29. #define PCLK 12000000
  30. /*
  31. * Pins configuration for Olimex LPC-P2148.
  32. *
  33. * PINSEL0
  34. * P0 P0 P0 P0 P0 P0 RXD TXD SSE MOS MIS SCK SDA SCL RXD TXD
  35. * 15 14 13 12 11 10 1 1 L0 I0 O0 0 0 0 0 0
  36. * 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 01
  37. * FIO0DIR (15...0)
  38. * IN IN OUT OUT OUT OUT -- -- -- -- -- -- -- -- -- --
  39. * 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0
  40. *
  41. * PINSEL1
  42. * P0 AD P0 P0 -- -- AO -- VB P0 P0 P0 MOS MIS SCK P0
  43. * 31 03 29 28 -- -- UT -- US 22 21 20 I1 O1 1 16
  44. * 00 01 00 00 00 00 10 00 01 00 00 00 10 10 10 00
  45. * FIO0DIR (31...16)
  46. * OUT -- OUT OUT -- -- -- -- -- OUT OUT OUT -- -- -- IN
  47. * 1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0
  48. *
  49. * FIO1DIR (31...16)
  50. * -- -- -- -- -- IN IN OUT OUT OUT OUT OUT OUT OUT OUT OUT
  51. * 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
  52. */
  53. #define VAL_PINSEL0 0x00055555
  54. #define VAL_PINSEL1 0x100840A8
  55. #define VAL_PINSEL2 0x00000004 /* Do not modify */
  56. #define VAL_FIO0DIR 0xB0703C00
  57. #define VAL_FIO1DIR 0x01FF0000
  58. #define VAL_FIO0PIN 0xFFFFFFFF
  59. #define VAL_FIO1PIN 0xFFFFFFFF
  60. #define PA_LED1 10
  61. #define PA_LED2 11
  62. #define PA_BUZZ1 12
  63. #define PA_BUZZ2 13
  64. #define PA_BSL 14
  65. #define PA_BUTTON1 15
  66. #define PA_BUTTON2 16
  67. #define PA_SSEL1 20
  68. #define PA_LEDUSB 31
  69. #define PB_WP1 24
  70. #define PB_CP1 25
  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_ */