f4_discovery.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Copyright 2012 by Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de)
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. */
  34. /*
  35. * \file arch/cm3/board/f4_discovery.h
  36. * \brief STM32f4_Discovery board specific settings.
  37. *
  38. * \verbatim
  39. * $Id$
  40. * \endverbatim
  41. */
  42. /* Orange LED*/
  43. #ifndef LED1_PORT
  44. #define LED1_PORT NUTGPIO_PORTD
  45. #endif
  46. #ifndef LED1_PIN
  47. #define LED1_PIN 13
  48. #endif
  49. /* GREEN LED*/
  50. #ifndef LED2_PORT
  51. #define LED2_PORT NUTGPIO_PORTD
  52. #endif
  53. #ifndef LED2_PIN
  54. #define LED2_PIN 12
  55. #endif
  56. /* RED LED*/
  57. #ifndef LED3_PORT
  58. #define LED3_PORT NUTGPIO_PORTD
  59. #endif
  60. #ifndef LED3_PIN
  61. #define LED3_PIN 14
  62. #endif
  63. /* BLUE LED*/
  64. #ifndef LED4_PORT
  65. #define LED4_PORT NUTGPIO_PORTD
  66. #endif
  67. #ifndef LED4_PIN
  68. #define LED4_PIN 15
  69. #endif
  70. #ifndef DEF_OWIBUS
  71. #if 1
  72. #define DEF_OWIBUS owiBus0Stm32Tim
  73. #include <arch/cm3/stm/owibus_stm32tim.h>
  74. #else
  75. #define DEF_OWIBUS owiBus0Gpio
  76. #include <dev/owibus_gpio.h>
  77. #endif
  78. #endif
  79. /* Some extension*/
  80. #ifndef OWI_PORT
  81. #define OWI_PORT NUTGPIO_PORTB
  82. #endif
  83. #ifndef OWI_PIN
  84. #define OWI_PIN 1
  85. #endif
  86. #ifndef OWI_TIMER
  87. #define OWI_TIMER NUTTIMER3
  88. #endif
  89. #ifndef OWI_CHANNEL
  90. #define OWI_CHANNEL 4
  91. #endif
  92. #ifndef DEV_UART
  93. #define DEV_UART devUsartStm32_2
  94. #endif
  95. #ifndef DEV_UART_NAME
  96. #define DEV_UART_NAME devUsartStm32_2.dev_name
  97. #endif
  98. #ifndef SBBI0_MISO_BIT
  99. #define SBBI0_MISO_BIT 6
  100. #endif
  101. #ifndef SBBI0_MISO_PORT
  102. #define SBBI0_MISO_PORT NUTGPIO_PORTA
  103. #endif
  104. #ifndef SBBI0_MOSI_BIT
  105. #define SBBI0_MOSI_BIT 7
  106. #endif
  107. #ifndef SBBI0_MOSI_PORT
  108. #define SBBI0_MOSI_PORT NUTGPIO_PORTA
  109. #endif
  110. #ifndef SBBI0_SCK_BIT
  111. #define SBBI0_SCK_BIT 5
  112. #endif
  113. #ifndef SBBI0_SCK_PORT
  114. #define SBBI0_SCK_PORT NUTGPIO_PORTA
  115. #endif
  116. #ifndef SBBI0_CS0_BIT
  117. #define SBBI0_CS0_BIT 3
  118. #endif
  119. #ifndef SBBI0_CS0_PORT
  120. #define SBBI0_CS0_PORT NUTGPIO_PORTE
  121. #endif
  122. #define AUDIO_RST_PORT NUTGPIO_PORTD
  123. #define AUDIO_RST_PIN 4
  124. #ifndef DEV_CONSOLE
  125. #define DEV_CONSOLE devUsartStm32_2
  126. #endif
  127. #ifndef DEV_CONSOLE_NAME
  128. #define DEV_CONSOLE_NAME devUsartStm32_2.dev_name
  129. #endif
  130. #ifndef I2CBUS1_SDA_PIN
  131. #define I2CBUS1_SDA_PIN 9
  132. #endif
  133. #ifndef I2CBUS1_SCL_PIN
  134. #define I2CBUS1_SCL_PIN 6
  135. #endif
  136. #ifndef DEF_TWIBUS
  137. #define DEF_TWIBUS Stm32TwiBus_1
  138. #endif
  139. #ifndef DEF_I2CBUS
  140. #if 0
  141. #define DEF_I2CBUS i2cBus1Stm32
  142. #include <dev/i2cbus_stm32.h>
  143. #else
  144. #define DEF_I2CBUS i2cBus0Gpio
  145. #include <dev/i2cbus_gpio.h>
  146. #endif
  147. #endif
  148. #ifndef DEF_CANBUS
  149. #define DEF_CANBUS Stm32CanBus1
  150. #endif
  151. #ifndef DEF_CANBUS_SLAVE
  152. #define DEF_CANBUS_SLAVE Stm32CanBus1C
  153. #endif