board.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 Arduino Mega board.
  17. */
  18. /*
  19. * Board identifier.
  20. */
  21. #define BOARD_ARDUINO_MEGA
  22. #define BOARD_NAME "Arduino Mega"
  23. /*
  24. * IO pins assignments.
  25. */
  26. #define PORTB_LED1 7
  27. /*
  28. * IO lines assignments.
  29. */
  30. #define LINE_LED1 PAL_LINE(IOPORT2, 7U)
  31. /*
  32. * Port A setup.
  33. * All inputs with pull-ups.
  34. */
  35. #define VAL_DDRA 0x00
  36. #define VAL_PORTA 0xFF
  37. /*
  38. * Port B setup.
  39. * All inputs except PB7 which has a LED connected.
  40. */
  41. #define VAL_DDRB 0x80
  42. #define VAL_PORTB 0xFF
  43. /*
  44. * Port C setup.
  45. * All inputs with pull-ups.
  46. */
  47. #define VAL_DDRC 0x00
  48. #define VAL_PORTC 0xFF
  49. /*
  50. * Port D setup.
  51. * All inputs with pull-ups.
  52. */
  53. #define VAL_DDRD 0x00
  54. #define VAL_PORTD 0xFF
  55. /*
  56. * Port E setup.
  57. * All inputs except PE1 (Serial TX0).
  58. */
  59. #define VAL_DDRE 0x02
  60. #define VAL_PORTE 0xFF
  61. /*
  62. * Port F setup.
  63. * All inputs with pull-ups.
  64. */
  65. #define VAL_DDRF 0x00
  66. #define VAL_PORTF 0xFF
  67. /*
  68. * Port G setup.
  69. * All inputs with pull-ups.
  70. */
  71. #define VAL_DDRG 0x00
  72. #define VAL_PORTG 0xFF
  73. /*
  74. * Port H setup.
  75. * All inputs with pull-ups.
  76. */
  77. #define VAL_DDRH 0x00
  78. #define VAL_PORTH 0xFF
  79. /*
  80. * Port J setup.
  81. * All inputs with pull-ups.
  82. */
  83. #define VAL_DDRJ 0x00
  84. #define VAL_PORTJ 0xFF
  85. /*
  86. * Port K setup.
  87. * All inputs with pull-ups.
  88. */
  89. #define VAL_DDRK 0x00
  90. #define VAL_PORTK 0xFF
  91. /*
  92. * Port L setup.
  93. * All inputs with pull-ups.
  94. */
  95. #define VAL_DDRL 0x00
  96. #define VAL_PORTL 0xFF
  97. #if !defined(_FROM_ASM_)
  98. #ifdef __cplusplus
  99. extern "C" {
  100. #endif
  101. void boardInit(void);
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif /* _FROM_ASM_ */
  106. #endif /* _BOARD_H_ */