board.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 SAM7-EX256 development board.
  17. */
  18. /*
  19. * Board identifier.
  20. */
  21. #define BOARD_OLIMEX_SAM7_EX256
  22. #define BOARD_NAME "Olimex SAM7-EX256"
  23. /*
  24. * Select your platform by modifying the following line.
  25. */
  26. #if !defined(SAM7_PLATFORM)
  27. #define SAM7_PLATFORM SAM7X256
  28. #endif
  29. #include "at91sam7.h"
  30. #define CLK 18432000
  31. #define MCK 48054857
  32. /*
  33. * Initial I/O setup.
  34. */
  35. #define VAL_PIOA_ODSR 0x00000000 /* Output data. */
  36. #define VAL_PIOA_OSR 0x00000000 /* Direction. */
  37. #define VAL_PIOA_PUSR 0xFFFFFFFF /* Pull-up. */
  38. #define VAL_PIOB_ODSR 0x00000000 /* Output data. */
  39. #define VAL_PIOB_OSR 0x00000000 /* Direction. */
  40. #define VAL_PIOB_PUSR 0xFFFFFFFF /* Pull-up. */
  41. /*
  42. * I/O definitions.
  43. */
  44. #define PIOA_LCD_RESET 2
  45. #define PIOA_LCD_RESET_MASK (1 << PIOA_LCD_RESET)
  46. #define PIOA_B1 7
  47. #define PIOA_B1_MASK (1 << PIOA_B1)
  48. #define PIOA_B2 8
  49. #define PIOA_B2_MASK (1 << PIOA_B2)
  50. #define PIOA_B3 9
  51. #define PIOA_B3_MASK (1 << PIOA_B3)
  52. #define PIOA_B4 14
  53. #define PIOA_B4_MASK (1 << PIOA_B4)
  54. #define PIOA_B5 15
  55. #define PIOA_B5_MASK (1 << PIOA_B5)
  56. #define PIOA_USB_PUP 25
  57. #define PIOA_USB_PUP_MASK (1 << PIOA_USB_PUP)
  58. #define PIOA_USB_PR 26
  59. #define PIOA_USB_PR_MASK (1 << PIOA_USB_PR)
  60. #define PIOA_CS_MMC 13
  61. #define PIOB_PHY_PD 18
  62. #define PIOB_PHY_PD_MASK (1 << PIOB_PHY_PD)
  63. #define PIOB_AUDIO_OUT 19
  64. #define PIOB_AUDIO_OUT_MASK (1 << PIOB_AUDIO_OUT)
  65. #define PIOB_LCD_BL 20
  66. #define PIOB_LCD_BL_MASK (1 << PIOB_LCD_BL)
  67. #define PIOB_MMC_WP 22
  68. #define PIOB_MMC_WP_MASK (1 << PIOB_MMC_WP)
  69. #define PIOB_MMC_CP 23
  70. #define PIOB_MMC_CP_MASK (1 << PIOB_MMC_CP)
  71. #define PIOB_SW1 24
  72. #define PIOB_SW1_MASK (1 << PIOB_SW1)
  73. #define PIOB_SW2 25
  74. #define PIOB_SW2_MASK (1 << PIOB_SW2)
  75. #define PIOB_PHY_IRQ 26
  76. #define PIOB_PHY_IRQ_MASK (1 << PIOB_PHY_IRQ)
  77. #if !defined(_FROM_ASM_)
  78. #ifdef __cplusplus
  79. extern "C" {
  80. #endif
  81. void boardInit(void);
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* _FROM_ASM_ */
  86. #endif /* _BOARD_H_ */