Naze32 clone with Frysky receiver
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PinNames.h 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* mbed Microcontroller Library
  2. * Copyright (c) 2006-2013 ARM Limited
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef MBED_PINNAMES_H
  17. #define MBED_PINNAMES_H
  18. #include "cmsis.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef enum {
  23. PIN_INPUT,
  24. PIN_OUTPUT
  25. } PinDirection;
  26. #define PORT_SHIFT 5
  27. typedef enum {
  28. // LPC Pin Names
  29. P0_0 = LPC_GPIO0_BASE,
  30. P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31,
  31. P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31,
  32. P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15, P2_16, P2_17, P2_18, P2_19, P2_20, P2_21, P2_22, P2_23, P2_24, P2_25, P2_26, P2_27, P2_28, P2_29, P2_30, P2_31,
  33. P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15, P3_16, P3_17, P3_18, P3_19, P3_20, P3_21, P3_22, P3_23, P3_24, P3_25, P3_26, P3_27, P3_28, P3_29, P3_30, P3_31,
  34. P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15, P4_16, P4_17, P4_18, P4_19, P4_20, P4_21, P4_22, P4_23, P4_24, P4_25, P4_26, P4_27, P4_28, P4_29, P4_30, P4_31,
  35. // mbed DIP Pin Names
  36. p5 = P0_9,
  37. p6 = P0_8,
  38. p7 = P0_7,
  39. p8 = P0_6,
  40. p9 = P0_0,
  41. p10 = P0_1,
  42. p11 = P0_18,
  43. p12 = P0_17,
  44. p13 = P0_15,
  45. p14 = P0_16,
  46. p15 = P0_23,
  47. p16 = P0_24,
  48. p17 = P0_25,
  49. p18 = P0_26,
  50. p19 = P1_30,
  51. p20 = P1_31,
  52. p21 = P2_5,
  53. p22 = P2_4,
  54. p23 = P2_3,
  55. p24 = P2_2,
  56. p25 = P2_1,
  57. p26 = P2_0,
  58. p27 = P0_11,
  59. p28 = P0_10,
  60. p29 = P0_5,
  61. p30 = P0_4,
  62. // Other mbed Pin Names
  63. #ifdef MCB1700
  64. LED1 = P1_28,
  65. LED2 = P1_29,
  66. LED3 = P1_31,
  67. LED4 = P2_2,
  68. #else
  69. LED1 = P1_18,
  70. LED2 = P1_20,
  71. LED3 = P1_21,
  72. LED4 = P1_23,
  73. #endif
  74. USBTX = P0_2,
  75. USBRX = P0_3,
  76. // Arch Pro Pin Names
  77. D0 = P4_29,
  78. D1 = P4_28,
  79. D2 = P0_4,
  80. D3 = P0_5,
  81. D4 = P2_2,
  82. D5 = P2_3,
  83. D6 = P2_4,
  84. D7 = P2_5,
  85. D8 = P0_0,
  86. D9 = P0_1,
  87. D10 = P0_6,
  88. D11 = P0_9,
  89. D12 = P0_8,
  90. D13 = P0_7,
  91. D14 = P0_27,
  92. D15 = P0_28,
  93. A0 = P0_23,
  94. A1 = P0_24,
  95. A2 = P0_25,
  96. A3 = P0_26,
  97. A4 = P1_30,
  98. A5 = P1_31,
  99. I2C_SCL = D15,
  100. I2C_SDA = D14,
  101. // Not connected
  102. NC = (int)0xFFFFFFFF
  103. } PinName;
  104. typedef enum {
  105. PullUp = 0,
  106. PullDown = 3,
  107. PullNone = 2,
  108. Repeater = 1,
  109. OpenDrain = 4,
  110. PullDefault = PullDown
  111. } PinMode;
  112. // version of PINCON_TypeDef using register arrays
  113. typedef struct {
  114. __IO uint32_t PINSEL[11];
  115. uint32_t RESERVED0[5];
  116. __IO uint32_t PINMODE[10];
  117. __IO uint32_t PINMODE_OD[5];
  118. } PINCONARRAY_TypeDef;
  119. #define PINCONARRAY ((PINCONARRAY_TypeDef *)LPC_PINCON_BASE)
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123. #endif