board.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 AVR-CAN proto board.
  17. */
  18. /*
  19. * Board identifier.
  20. */
  21. #define BOARD_OLIMEX_AVR_CAN
  22. #define BOARD_NAME "Olimex AVR-CAN"
  23. /*
  24. * All inputs with pullups.
  25. */
  26. #define VAL_DDRA 0x00
  27. #define VAL_PORTA 0xFF
  28. /*
  29. * All inputs with pullups.
  30. */
  31. #define VAL_DDRB 0x00
  32. #define VAL_PORTB 0xFF
  33. /*
  34. * All inputs with pullups.
  35. */
  36. #define VAL_DDRC 0x00
  37. #define VAL_PORTC 0xFF
  38. /* PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0
  39. * IN IN OUT IN OUT IN IN IN
  40. * DDRD 0 0 1 0 1 0 0 0
  41. * PU HiZ VAL PU VAL HiZ HiZ HiZ
  42. * PORTD 1 0 ?1 1 1 0 0 0
  43. */
  44. #define VAL_DDRD 0x28
  45. #define VAL_PORTD 0xB8
  46. /* PE7 PE6 BUT LED PE3 PE2 PE1 PE0
  47. * IN IN IN OUT IN IN OUT IN
  48. * DDRE 0 0 0 1 0 0 1 0
  49. * PU PU HiZ VAL PU PU VAL HiZ
  50. * PORTE 1 1 0 1 1 1 1 0
  51. */
  52. #define VAL_DDRE 0x12
  53. #define VAL_PORTE 0xDE
  54. /* TDI TDO TMS TCK PF3 PF2 PF1 PF0
  55. * x x x x IN IN IN IN
  56. * DDRF 0 0 0 0 0 0 0 0
  57. * x x x x PU PU PU PU
  58. * PORTF 0 0 0 0 1 1 1 1
  59. *
  60. */
  61. #define VAL_DDRF 0x00
  62. #define VAL_PORTF 0x0F
  63. /* x x x x x PG2 PG1 PG0
  64. * x x x x x IN IN IN
  65. * DDRG 0 0 0 0 0 0 0 0
  66. * x x x x x PU PU PU
  67. * PORTG 0 0 0 0 0 1 1 1
  68. *
  69. */
  70. #define VAL_DDRG 0x00
  71. #define VAL_PORTG 0x07
  72. #define PORTE_LED 4
  73. #define PORTE_BUTTON 5
  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_ */