board.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 Studiel AT91SAM7A3-EK board.
  17. */
  18. /*
  19. * Board identifier.
  20. */
  21. #define BOARD_STUDIEL_AT91SAM7A3_EK
  22. #define BOARD_NAME "Studiel AT91SAM7A3-EK eval. board"
  23. /*
  24. * Select your platform by modifying the following line.
  25. */
  26. #if !defined(SAM7A3_PLATFORM)
  27. #define SAM7_PLATFORM SAM7A3
  28. #endif
  29. #include "at91sam7.h"
  30. #define CLK 18432000
  31. #define MCK 48054857
  32. /*
  33. * I/O definitions.
  34. */
  35. #define PIOA_RXD0 2
  36. #define PIOA_RXD0_MASK (1 << PIOA_RXD0)
  37. #define PIOA_TXD0 3
  38. #define PIOA_TXD0_MASK (1 << PIOA_TXD0)
  39. #define PIOA_LED1 20
  40. #define PIOA_LED1_MASK (1 << PIOA_LED1)
  41. #define PIOA_LED2 21
  42. #define PIOA_LED2_MASK (1 << PIOA_LED2)
  43. #define PIOA_LED3 24
  44. #define PIOA_LED3_MASK (1 << PIOA_LED3)
  45. #define PIOA_LED4 25
  46. #define PIOA_LED4_MASK (1 << PIOA_LED4)
  47. // mmc-spi
  48. #define PIOA_SPI0_NSS 14
  49. #define PIOA_SPI0_NSS_MASK (1 << PIOA_SPI0_NSS)
  50. #define PIOA_SPI0_MISO 15
  51. #define PIOA_SPI0_MISO_MASK (1 << PIOA_SPI0_MISO)
  52. #define PIOA_SPI0_MOSI 16
  53. #define PIOA_SPI0_MOSI_MASK (1 << PIOA_SPI0_MOSI)
  54. #define PIOA_SPI0_CLK 17
  55. #define PIOA_SPI0_CLK_MASK (1 << PIOA_SPI0_CLK)
  56. /*
  57. * Initial I/O setup.
  58. */
  59. /* Output data. */
  60. #define VAL_PIOA_ODSR 0x00000000
  61. /* Direction. */
  62. #define VAL_PIOA_OSR 0x00000000 | PIOA_LED1_MASK | PIOA_LED2_MASK | \
  63. PIOA_LED3_MASK | PIOA_LED4_MASK
  64. /* Pull-up. */
  65. #define VAL_PIOA_PUSR 0xFFFFFFFF
  66. #define VAL_PIOB_ODSR 0x00000000 /* Output data. */
  67. #define VAL_PIOB_OSR 0x00000000 /* Direction. */
  68. #define VAL_PIOB_PUSR 0xFFFFFFFF /* Pull-up. */
  69. #if !defined(_FROM_ASM_)
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. void boardInit(void);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* _FROM_ASM_ */
  78. #endif /* _BOARD_H_ */