PinNames.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /* mbed Microcontroller Library
  2. *******************************************************************************
  3. * Copyright (c) 2018, STMicroelectronics
  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 are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice,
  10. * this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  19. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  22. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  24. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  25. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *******************************************************************************
  29. */
  30. #ifndef MBED_PINNAMES_H
  31. #define MBED_PINNAMES_H
  32. #include "cmsis.h"
  33. #include "PinNamesTypes.h"
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. typedef enum {
  38. ALT0 = 0x100,
  39. ALT1 = 0x200,
  40. ALT2 = 0x300,
  41. ALT3 = 0x400
  42. } ALTx;
  43. typedef enum {
  44. PA_0 = 0x00,
  45. PA_1 = 0x01,
  46. PA_2 = 0x02,
  47. PA_2_ALT0 = PA_2 | ALT0,
  48. PA_3 = 0x03,
  49. PA_3_ALT0 = PA_3 | ALT0,
  50. PA_4 = 0x04,
  51. PA_4_ALT0 = PA_4 | ALT0,
  52. PA_5 = 0x05,
  53. PA_6 = 0x06,
  54. PA_7 = 0x07,
  55. PA_8 = 0x08,
  56. PA_9 = 0x09,
  57. PA_10 = 0x0A,
  58. PA_11 = 0x0B,
  59. PA_12 = 0x0C,
  60. PA_13 = 0x0D,
  61. PA_14 = 0x0E,
  62. PA_15 = 0x0F,
  63. PA_15_ALT0 = PA_15 | ALT0,
  64. PB_0 = 0x10,
  65. PB_1 = 0x11,
  66. PB_2 = 0x12,
  67. PB_3 = 0x13,
  68. PB_3_ALT0 = PB_3 | ALT0,
  69. PB_4 = 0x14,
  70. PB_4_ALT0 = PB_4 | ALT0,
  71. PB_5 = 0x15,
  72. PB_5_ALT0 = PB_5 | ALT0,
  73. PB_6 = 0x16,
  74. PB_7 = 0x17,
  75. PC_14 = 0x2E,
  76. PC_15 = 0x2F,
  77. // ADC internal channels
  78. ADC_TEMP = 0xF0,
  79. ADC_VREF = 0xF1,
  80. ADC_VBAT = 0xF2,
  81. // Arduino connector namings
  82. A0 = PA_0,
  83. A1 = PA_1,
  84. A2 = PA_3,
  85. A3 = PA_4,
  86. A4 = PA_5,
  87. A5 = PA_6,
  88. A6 = PA_7,
  89. A7 = PA_2,
  90. D0 = PA_10,
  91. D1 = PA_9,
  92. D2 = PA_12,
  93. D3 = PB_0,
  94. D4 = PB_7,
  95. D5 = PB_6,
  96. D6 = PB_1,
  97. D7 = PC_14,
  98. D8 = PC_15,
  99. D9 = PA_8,
  100. D10 = PA_11,
  101. D11 = PB_5,
  102. D12 = PB_4,
  103. D13 = PB_3,
  104. // STDIO for console print
  105. #ifdef MBED_CONF_TARGET_STDIO_UART_TX
  106. STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
  107. #else
  108. STDIO_UART_TX = PA_2,
  109. #endif
  110. #ifdef MBED_CONF_TARGET_STDIO_UART_RX
  111. STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
  112. #else
  113. STDIO_UART_RX = PA_15,
  114. #endif
  115. // Generic signals namings
  116. LED1 = PB_3,
  117. LED2 = PB_3,
  118. LED3 = PB_3,
  119. LED4 = PB_3,
  120. SERIAL_TX = STDIO_UART_TX,
  121. SERIAL_RX = STDIO_UART_RX,
  122. USBTX = STDIO_UART_TX,
  123. USBRX = STDIO_UART_RX,
  124. I2C_SCL = PB_6,
  125. I2C_SDA = PB_7,
  126. SPI_MOSI = PB_5,
  127. SPI_MISO = PB_4,
  128. SPI_SCK = PB_3,
  129. SPI_CS = PA_11,
  130. PWM_OUT = PB_0,
  131. /**** USB pins ****/
  132. USB_DM = PA_11,
  133. USB_DP = PA_12,
  134. USB_NOE = PA_13,
  135. /**** OSCILLATOR pins ****/
  136. RCC_OSC32_IN = PC_14,
  137. RCC_OSC32_OUT = PC_15,
  138. /**** DEBUG pins ****/
  139. SYS_JTCK_SWCLK = PA_14,
  140. SYS_JTDI = PA_15,
  141. SYS_JTDO_SWO = PB_3,
  142. SYS_JTMS_SWDIO = PA_13,
  143. SYS_JTRST = PB_4,
  144. SYS_PVD_IN = PB_7,
  145. SYS_WKUP1 = PA_0,
  146. SYS_WKUP4 = PA_2,
  147. // Not connected
  148. NC = (int)0xFFFFFFFF
  149. } PinName;
  150. #ifdef __cplusplus
  151. }
  152. #endif
  153. #endif