hardware.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. // defining the hardware connections
  2. #ifdef __AVR_ATmega328P__
  3. // Arduino Hardware
  4. const byte Din_0 = 0;
  5. const byte Din_1 = 1;
  6. const byte Din_2 = 2;
  7. const byte Din_3 = 3;
  8. const byte Dout_0 = 4;
  9. const byte Dout_1 = 5;
  10. const byte Dout_2 = 6;
  11. const byte Dout_3 = 7;
  12. const byte ADC_0 = 0; //(15)
  13. const byte ADC_1 = 1; //(16)
  14. const byte PWM_1 = 9;
  15. const byte PWM_2 = 10;
  16. #ifdef SPS_RCRECEIVER
  17. const byte RC_0 = 18;
  18. const byte RC_1 = 19;
  19. #endif
  20. #ifdef SPS_SERVO
  21. const byte SERVO_1 = 9;
  22. const byte SERVO_2 = 10;
  23. #endif
  24. const byte SW_PRG = 8;
  25. const byte SW_SEL = 11;
  26. #ifdef SPS_USE_DISPLAY
  27. const byte DIGIT_DATA_IO = 12;
  28. const byte DIGIT_CLOCK = 13;
  29. #endif
  30. #endif
  31. #ifdef __AVR_ATtiny84__
  32. // ATTiny84 Hardware
  33. const byte Dout_0 = 6;
  34. const byte Dout_1 = 5;
  35. const byte Dout_2 = 4;
  36. const byte Dout_3 = 1;
  37. const byte Din_0 = 10;
  38. const byte Din_1 = 9;
  39. const byte Din_2 = 8;
  40. const byte Din_3 = 7;
  41. const byte ADC_0 = 0;
  42. const byte ADC_1 = 1;
  43. const byte PWM_1 = 2;
  44. const byte PWM_2 = 3;
  45. #ifdef SPS_RCRECEIVER
  46. const byte RC_0 = 10;
  47. const byte RC_1 = 9;
  48. #endif
  49. #ifdef SPS_SERVO
  50. const byte SERVO_1 = 2;
  51. const byte SERVO_2 = 3;
  52. #endif
  53. const byte SW_PRG = 0;
  54. const byte SW_SEL = 8;
  55. #ifdef SPS_USE_DISPLAY
  56. const byte DIGIT_DATA_IO = 4;
  57. const byte DIGIT_CLOCK = 5;
  58. #endif
  59. #endif
  60. #ifdef __AVR_ATtiny4313__
  61. // ATTiny4313 Hardware
  62. const byte Dout_0 = 0;
  63. const byte Dout_1 = 1;
  64. const byte Dout_2 = 2;
  65. const byte Dout_3 = 3;
  66. const byte Din_0 = 4;
  67. const byte Din_1 = 5;
  68. const byte Din_2 = 6;
  69. const byte Din_3 = 7;
  70. const byte ADC_0 = 13;
  71. const byte ADC_1 = 14;
  72. const byte PWM_1 = 11;
  73. const byte PWM_2 = 12;
  74. #ifdef SPS_RCRECEIVER
  75. const byte RC_0 = 15;
  76. const byte RC_1 = 16;
  77. #endif
  78. #ifdef SPS_SERVO
  79. const byte SERVO_1 = 11;
  80. const byte SERVO_2 = 12;
  81. #endif
  82. const byte SW_PRG = 9;
  83. const byte SW_SEL = 8;
  84. #endif
  85. #ifdef __AVR_ATtiny861__
  86. // ATTiny4313 Hardware
  87. const byte Dout_0 = 0;
  88. const byte Dout_1 = 1;
  89. const byte Dout_2 = 2;
  90. const byte Dout_3 = 3;
  91. const byte Din_0 = 4;
  92. const byte Din_1 = 5;
  93. const byte Din_2 = 6;
  94. const byte Din_3 = 7;
  95. const byte ADC_0 = 13;
  96. const byte ADC_1 = 14;
  97. const byte PWM_1 = 11;
  98. const byte PWM_2 = 12;
  99. #ifdef SPS_RCRECEIVER
  100. const byte RC_0 = 15;
  101. const byte RC_1 = 16;
  102. #endif
  103. #ifdef SPS_SERVO
  104. const byte SERVO_1 = 11;
  105. const byte SERVO_2 = 12;
  106. #endif
  107. const byte SW_PRG = 9;
  108. const byte SW_SEL = 8;
  109. #endif
  110. #ifdef _MICROBIT_V2_
  111. // Microbit V2 Hardware
  112. const byte Din_0 = 0;
  113. const byte Din_1 = 1;
  114. const byte Din_2 = 2;
  115. const byte Din_3 = 3;
  116. const byte Dout_0 = 4;
  117. const byte Dout_1 = 5;
  118. const byte Dout_2 = 6;
  119. const byte Dout_3 = 7;
  120. const byte ADC_0 = 0; //(15)
  121. const byte ADC_1 = 1; //(16)
  122. const byte PWM_1 = 9;
  123. const byte PWM_2 = 10;
  124. #ifdef SPS_RCRECEIVER
  125. const byte RC_0 = 18;
  126. const byte RC_1 = 19;
  127. #endif
  128. #ifdef SPS_SERVO
  129. const byte SERVO_1 = 9;
  130. const byte SERVO_2 = 10;
  131. #endif
  132. const byte SW_PRG = 8;
  133. const byte SW_SEL = 11;
  134. #ifdef SPS_USE_DISPLAY
  135. const byte DIGIT_DATA_IO = 12;
  136. const byte DIGIT_CLOCK = 13;
  137. #endif
  138. #endif
  139. #ifdef ESP32
  140. // ESP 32 Hardware
  141. const byte Din_0 = 26;
  142. const byte Din_1 = 18;
  143. const byte Din_2 = 19;
  144. const byte Din_3 = 23;
  145. const byte Dout_0 = 22;
  146. const byte Dout_1 = 21;
  147. const byte Dout_2 = 17;
  148. const byte Dout_3 = 16;
  149. const byte ADC_0 = 36;
  150. const byte ADC_1 = 39;
  151. const byte PWM_1 = 27;
  152. const byte PWM_2 = 25;
  153. #ifdef SPS_RCRECEIVER
  154. const byte RC_0 = 34;
  155. const byte RC_1 = 35;
  156. #endif
  157. #ifdef SPS_SERVO
  158. const byte SERVO_1 = 27;
  159. const byte SERVO_2 = 25;
  160. #endif
  161. const byte SW_PRG = 13;
  162. const byte SW_SEL = 12;
  163. #ifdef SPS_USE_DISPLAY
  164. const byte DIGIT_DATA_IO = 32;
  165. const byte DIGIT_CLOCK = 33;
  166. #endif
  167. #endif