fastio.h 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210
  1. /*
  2. This code contibuted by Triffid_Hunter and modified by Kliment
  3. why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
  4. */
  5. #ifndef _ARDUINO_H
  6. #define _ARDUINO_H
  7. #include <avr/io.h>
  8. /*
  9. utility functions
  10. */
  11. #ifndef MASK
  12. /// MASKING- returns \f$2^PIN\f$
  13. #define MASK(PIN) (1 << PIN)
  14. #endif
  15. /*
  16. magic I/O routines
  17. now you can simply SET_OUTPUT(STEP); WRITE(STEP, 1); WRITE(STEP, 0);
  18. */
  19. /// Read a pin
  20. #define _READ(IO) ((bool)(DIO ## IO ## _RPORT & MASK(DIO ## IO ## _PIN)))
  21. /// write to a pin
  22. #define _WRITE(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
  23. /// toggle a pin
  24. #define _TOGGLE(IO) do {DIO ## IO ## _RPORT = MASK(DIO ## IO ## _PIN); } while (0)
  25. /// set pin as input
  26. #define _SET_INPUT(IO) do {DIO ## IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0)
  27. /// set pin as output
  28. #define _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= MASK(DIO ## IO ## _PIN); } while (0)
  29. /// check if pin is an input
  30. #define _GET_INPUT(IO) ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) == 0)
  31. /// check if pin is an output
  32. #define _GET_OUTPUT(IO) ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) != 0)
  33. // why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
  34. /// Read a pin wrapper
  35. #define READ(IO) _READ(IO)
  36. /// Write to a pin wrapper
  37. #define WRITE(IO, v) _WRITE(IO, v)
  38. /// toggle a pin wrapper
  39. #define TOGGLE(IO) _TOGGLE(IO)
  40. /// set pin as input wrapper
  41. #define SET_INPUT(IO) _SET_INPUT(IO)
  42. /// set pin as output wrapper
  43. #define SET_OUTPUT(IO) _SET_OUTPUT(IO)
  44. /// check if pin is an input wrapper
  45. #define GET_INPUT(IO) _GET_INPUT(IO)
  46. /// check if pin is an output wrapper
  47. #define GET_OUTPUT(IO) _GET_OUTPUT(IO)
  48. /*
  49. ports and functions
  50. added as necessary or if I feel like it- not a comprehensive list!
  51. */
  52. #if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
  53. // UART
  54. #define RXD DIO0
  55. #define TXD DIO1
  56. // SPI
  57. #define SCK DIO13
  58. #define MISO DIO12
  59. #define MOSI DIO11
  60. #define SS DIO10
  61. // TWI (I2C)
  62. #define SCL AIO5
  63. #define SDA AIO4
  64. // timers and PWM
  65. #define OC0A DIO6
  66. #define OC0B DIO5
  67. #define OC1A DIO9
  68. #define OC1B DIO10
  69. #define OC2A DIO11
  70. #define OC2B DIO3
  71. #define DEBUG_LED AIO5
  72. /*
  73. pins
  74. */
  75. #define DIO0_PIN PIND0
  76. #define DIO0_RPORT PIND
  77. #define DIO0_WPORT PORTD
  78. #define DIO0_DDR DDRD
  79. #define DIO0_PWM NULL
  80. #define DIO1_PIN PIND1
  81. #define DIO1_RPORT PIND
  82. #define DIO1_WPORT PORTD
  83. #define DIO1_DDR DDRD
  84. #define DIO1_PWM NULL
  85. #define DIO2_PIN PIND2
  86. #define DIO2_RPORT PIND
  87. #define DIO2_WPORT PORTD
  88. #define DIO2_DDR DDRD
  89. #define DIO2_PWM NULL
  90. #define DIO3_PIN PIND3
  91. #define DIO3_RPORT PIND
  92. #define DIO3_WPORT PORTD
  93. #define DIO3_DDR DDRD
  94. #define DIO3_PWM &OCR2B
  95. #define DIO4_PIN PIND4
  96. #define DIO4_RPORT PIND
  97. #define DIO4_WPORT PORTD
  98. #define DIO4_DDR DDRD
  99. #define DIO4_PWM NULL
  100. #define DIO5_PIN PIND5
  101. #define DIO5_RPORT PIND
  102. #define DIO5_WPORT PORTD
  103. #define DIO5_DDR DDRD
  104. #define DIO5_PWM &OCR0B
  105. #define DIO6_PIN PIND6
  106. #define DIO6_RPORT PIND
  107. #define DIO6_WPORT PORTD
  108. #define DIO6_DDR DDRD
  109. #define DIO6_PWM &OCR0A
  110. #define DIO7_PIN PIND7
  111. #define DIO7_RPORT PIND
  112. #define DIO7_WPORT PORTD
  113. #define DIO7_DDR DDRD
  114. #define DIO7_PWM NULL
  115. #define DIO8_PIN PINB0
  116. #define DIO8_RPORT PINB
  117. #define DIO8_WPORT PORTB
  118. #define DIO8_DDR DDRB
  119. #define DIO8_PWM NULL
  120. #define DIO9_PIN PINB1
  121. #define DIO9_RPORT PINB
  122. #define DIO9_WPORT PORTB
  123. #define DIO9_DDR DDRB
  124. #define DIO9_PWM NULL
  125. #define DIO10_PIN PINB2
  126. #define DIO10_RPORT PINB
  127. #define DIO10_WPORT PORTB
  128. #define DIO10_DDR DDRB
  129. #define DIO10_PWM NULL
  130. #define DIO11_PIN PINB3
  131. #define DIO11_RPORT PINB
  132. #define DIO11_WPORT PORTB
  133. #define DIO11_DDR DDRB
  134. #define DIO11_PWM &OCR2A
  135. #define DIO12_PIN PINB4
  136. #define DIO12_RPORT PINB
  137. #define DIO12_WPORT PORTB
  138. #define DIO12_DDR DDRB
  139. #define DIO12_PWM NULL
  140. #define DIO13_PIN PINB5
  141. #define DIO13_RPORT PINB
  142. #define DIO13_WPORT PORTB
  143. #define DIO13_DDR DDRB
  144. #define DIO13_PWM NULL
  145. #define DIO14_PIN PINC0
  146. #define DIO14_RPORT PINC
  147. #define DIO14_WPORT PORTC
  148. #define DIO14_DDR DDRC
  149. #define DIO14_PWM NULL
  150. #define DIO15_PIN PINC1
  151. #define DIO15_RPORT PINC
  152. #define DIO15_WPORT PORTC
  153. #define DIO15_DDR DDRC
  154. #define DIO15_PWM NULL
  155. #define DIO16_PIN PINC2
  156. #define DIO16_RPORT PINC
  157. #define DIO16_WPORT PORTC
  158. #define DIO16_DDR DDRC
  159. #define DIO16_PWM NULL
  160. #define DIO17_PIN PINC3
  161. #define DIO17_RPORT PINC
  162. #define DIO17_WPORT PORTC
  163. #define DIO17_DDR DDRC
  164. #define DIO17_PWM NULL
  165. #define DIO18_PIN PINC4
  166. #define DIO18_RPORT PINC
  167. #define DIO18_WPORT PORTC
  168. #define DIO18_DDR DDRC
  169. #define DIO18_PWM NULL
  170. #define DIO19_PIN PINC5
  171. #define DIO19_RPORT PINC
  172. #define DIO19_WPORT PORTC
  173. #define DIO19_DDR DDRC
  174. #define DIO19_PWM NULL
  175. #define DIO20_PIN PINC6
  176. #define DIO20_RPORT PINC
  177. #define DIO20_WPORT PORTC
  178. #define DIO20_DDR DDRC
  179. #define DIO20_PWM NULL
  180. #define DIO21_PIN PINC7
  181. #define DIO21_RPORT PINC
  182. #define DIO21_WPORT PORTC
  183. #define DIO21_DDR DDRC
  184. #define DIO21_PWM NULL
  185. #undef PB0
  186. #define PB0_PIN PINB0
  187. #define PB0_RPORT PINB
  188. #define PB0_WPORT PORTB
  189. #define PB0_DDR DDRB
  190. #define PB0_PWM NULL
  191. #undef PB1
  192. #define PB1_PIN PINB1
  193. #define PB1_RPORT PINB
  194. #define PB1_WPORT PORTB
  195. #define PB1_DDR DDRB
  196. #define PB1_PWM NULL
  197. #undef PB2
  198. #define PB2_PIN PINB2
  199. #define PB2_RPORT PINB
  200. #define PB2_WPORT PORTB
  201. #define PB2_DDR DDRB
  202. #define PB2_PWM NULL
  203. #undef PB3
  204. #define PB3_PIN PINB3
  205. #define PB3_RPORT PINB
  206. #define PB3_WPORT PORTB
  207. #define PB3_DDR DDRB
  208. #define PB3_PWM &OCR2A
  209. #undef PB4
  210. #define PB4_PIN PINB4
  211. #define PB4_RPORT PINB
  212. #define PB4_WPORT PORTB
  213. #define PB4_DDR DDRB
  214. #define PB4_PWM NULL
  215. #undef PB5
  216. #define PB5_PIN PINB5
  217. #define PB5_RPORT PINB
  218. #define PB5_WPORT PORTB
  219. #define PB5_DDR DDRB
  220. #define PB5_PWM NULL
  221. #undef PB6
  222. #define PB6_PIN PINB6
  223. #define PB6_RPORT PINB
  224. #define PB6_WPORT PORTB
  225. #define PB6_DDR DDRB
  226. #define PB6_PWM NULL
  227. #undef PB7
  228. #define PB7_PIN PINB7
  229. #define PB7_RPORT PINB
  230. #define PB7_WPORT PORTB
  231. #define PB7_DDR DDRB
  232. #define PB7_PWM NULL
  233. #undef PC0
  234. #define PC0_PIN PINC0
  235. #define PC0_RPORT PINC
  236. #define PC0_WPORT PORTC
  237. #define PC0_DDR DDRC
  238. #define PC0_PWM NULL
  239. #undef PC1
  240. #define PC1_PIN PINC1
  241. #define PC1_RPORT PINC
  242. #define PC1_WPORT PORTC
  243. #define PC1_DDR DDRC
  244. #define PC1_PWM NULL
  245. #undef PC2
  246. #define PC2_PIN PINC2
  247. #define PC2_RPORT PINC
  248. #define PC2_WPORT PORTC
  249. #define PC2_DDR DDRC
  250. #define PC2_PWM NULL
  251. #undef PC3
  252. #define PC3_PIN PINC3
  253. #define PC3_RPORT PINC
  254. #define PC3_WPORT PORTC
  255. #define PC3_DDR DDRC
  256. #define PC3_PWM NULL
  257. #undef PC4
  258. #define PC4_PIN PINC4
  259. #define PC4_RPORT PINC
  260. #define PC4_WPORT PORTC
  261. #define PC4_DDR DDRC
  262. #define PC4_PWM NULL
  263. #undef PC5
  264. #define PC5_PIN PINC5
  265. #define PC5_RPORT PINC
  266. #define PC5_WPORT PORTC
  267. #define PC5_DDR DDRC
  268. #define PC5_PWM NULL
  269. #undef PC6
  270. #define PC6_PIN PINC6
  271. #define PC6_RPORT PINC
  272. #define PC6_WPORT PORTC
  273. #define PC6_DDR DDRC
  274. #define PC6_PWM NULL
  275. #undef PC7
  276. #define PC7_PIN PINC7
  277. #define PC7_RPORT PINC
  278. #define PC7_WPORT PORTC
  279. #define PC7_DDR DDRC
  280. #define PC7_PWM NULL
  281. #undef PD0
  282. #define PD0_PIN PIND0
  283. #define PD0_RPORT PIND
  284. #define PD0_WPORT PORTD
  285. #define PD0_DDR DDRD
  286. #define PD0_PWM NULL
  287. #undef PD1
  288. #define PD1_PIN PIND1
  289. #define PD1_RPORT PIND
  290. #define PD1_WPORT PORTD
  291. #define PD1_DDR DDRD
  292. #define PD1_PWM NULL
  293. #undef PD2
  294. #define PD2_PIN PIND2
  295. #define PD2_RPORT PIND
  296. #define PD2_WPORT PORTD
  297. #define PD2_DDR DDRD
  298. #define PD2_PWM NULL
  299. #undef PD3
  300. #define PD3_PIN PIND3
  301. #define PD3_RPORT PIND
  302. #define PD3_WPORT PORTD
  303. #define PD3_DDR DDRD
  304. #define PD3_PWM &OCR2B
  305. #undef PD4
  306. #define PD4_PIN PIND4
  307. #define PD4_RPORT PIND
  308. #define PD4_WPORT PORTD
  309. #define PD4_DDR DDRD
  310. #define PD4_PWM NULL
  311. #undef PD5
  312. #define PD5_PIN PIND5
  313. #define PD5_RPORT PIND
  314. #define PD5_WPORT PORTD
  315. #define PD5_DDR DDRD
  316. #define PD5_PWM &OCR0B
  317. #undef PD6
  318. #define PD6_PIN PIND6
  319. #define PD6_RPORT PIND
  320. #define PD6_WPORT PORTD
  321. #define PD6_DDR DDRD
  322. #define PD6_PWM &OCR0A
  323. #undef PD7
  324. #define PD7_PIN PIND7
  325. #define PD7_RPORT PIND
  326. #define PD7_WPORT PORTD
  327. #define PD7_DDR DDRD
  328. #define PD7_PWM NULL
  329. #endif /* _AVR_ATmega{168,328,328P}__ */
  330. #if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
  331. // UART
  332. #define RXD DIO8
  333. #define TXD DIO9
  334. #define RXD0 DIO8
  335. #define TXD0 DIO9
  336. #define RXD1 DIO10
  337. #define TXD1 DIO11
  338. // SPI
  339. #define SCK DIO7
  340. #define MISO DIO6
  341. #define MOSI DIO5
  342. #define SS DIO4
  343. // TWI (I2C)
  344. #define SCL DIO16
  345. #define SDA DIO17
  346. // timers and PWM
  347. #define OC0A DIO3
  348. #define OC0B DIO4
  349. #define OC1A DIO13
  350. #define OC1B DIO12
  351. #define OC2A DIO15
  352. #define OC2B DIO14
  353. #define DEBUG_LED DIO0
  354. /*
  355. pins
  356. */
  357. #define DIO0_PIN PINB0
  358. #define DIO0_RPORT PINB
  359. #define DIO0_WPORT PORTB
  360. #define DIO0_DDR DDRB
  361. #define DIO0_PWM NULL
  362. #define DIO1_PIN PINB1
  363. #define DIO1_RPORT PINB
  364. #define DIO1_WPORT PORTB
  365. #define DIO1_DDR DDRB
  366. #define DIO1_PWM NULL
  367. #define DIO2_PIN PINB2
  368. #define DIO2_RPORT PINB
  369. #define DIO2_WPORT PORTB
  370. #define DIO2_DDR DDRB
  371. #define DIO2_PWM NULL
  372. #define DIO3_PIN PINB3
  373. #define DIO3_RPORT PINB
  374. #define DIO3_WPORT PORTB
  375. #define DIO3_DDR DDRB
  376. #define DIO3_PWM &OCR0A
  377. #define DIO4_PIN PINB4
  378. #define DIO4_RPORT PINB
  379. #define DIO4_WPORT PORTB
  380. #define DIO4_DDR DDRB
  381. #define DIO4_PWM &OCR0B
  382. #define DIO5_PIN PINB5
  383. #define DIO5_RPORT PINB
  384. #define DIO5_WPORT PORTB
  385. #define DIO5_DDR DDRB
  386. #define DIO5_PWM NULL
  387. #define DIO6_PIN PINB6
  388. #define DIO6_RPORT PINB
  389. #define DIO6_WPORT PORTB
  390. #define DIO6_DDR DDRB
  391. #define DIO6_PWM NULL
  392. #define DIO7_PIN PINB7
  393. #define DIO7_RPORT PINB
  394. #define DIO7_WPORT PORTB
  395. #define DIO7_DDR DDRB
  396. #define DIO7_PWM NULL
  397. #define DIO8_PIN PIND0
  398. #define DIO8_RPORT PIND
  399. #define DIO8_WPORT PORTD
  400. #define DIO8_DDR DDRD
  401. #define DIO8_PWM NULL
  402. #define DIO9_PIN PIND1
  403. #define DIO9_RPORT PIND
  404. #define DIO9_WPORT PORTD
  405. #define DIO9_DDR DDRD
  406. #define DIO9_PWM NULL
  407. #define DIO10_PIN PIND2
  408. #define DIO10_RPORT PIND
  409. #define DIO10_WPORT PORTD
  410. #define DIO10_DDR DDRD
  411. #define DIO10_PWM NULL
  412. #define DIO11_PIN PIND3
  413. #define DIO11_RPORT PIND
  414. #define DIO11_WPORT PORTD
  415. #define DIO11_DDR DDRD
  416. #define DIO11_PWM NULL
  417. #define DIO12_PIN PIND4
  418. #define DIO12_RPORT PIND
  419. #define DIO12_WPORT PORTD
  420. #define DIO12_DDR DDRD
  421. #define DIO12_PWM NULL
  422. #define DIO13_PIN PIND5
  423. #define DIO13_RPORT PIND
  424. #define DIO13_WPORT PORTD
  425. #define DIO13_DDR DDRD
  426. #define DIO13_PWM NULL
  427. #define DIO14_PIN PIND6
  428. #define DIO14_RPORT PIND
  429. #define DIO14_WPORT PORTD
  430. #define DIO14_DDR DDRD
  431. #define DIO14_PWM &OCR2B
  432. #define DIO15_PIN PIND7
  433. #define DIO15_RPORT PIND
  434. #define DIO15_WPORT PORTD
  435. #define DIO15_DDR DDRD
  436. #define DIO15_PWM &OCR2A
  437. #define DIO16_PIN PINC0
  438. #define DIO16_RPORT PINC
  439. #define DIO16_WPORT PORTC
  440. #define DIO16_DDR DDRC
  441. #define DIO16_PWM NULL
  442. #define DIO17_PIN PINC1
  443. #define DIO17_RPORT PINC
  444. #define DIO17_WPORT PORTC
  445. #define DIO17_DDR DDRC
  446. #define DIO17_PWM NULL
  447. #define DIO18_PIN PINC2
  448. #define DIO18_RPORT PINC
  449. #define DIO18_WPORT PORTC
  450. #define DIO18_DDR DDRC
  451. #define DIO18_PWM NULL
  452. #define DIO19_PIN PINC3
  453. #define DIO19_RPORT PINC
  454. #define DIO19_WPORT PORTC
  455. #define DIO19_DDR DDRC
  456. #define DIO19_PWM NULL
  457. #define DIO20_PIN PINC4
  458. #define DIO20_RPORT PINC
  459. #define DIO20_WPORT PORTC
  460. #define DIO20_DDR DDRC
  461. #define DIO20_PWM NULL
  462. #define DIO21_PIN PINC5
  463. #define DIO21_RPORT PINC
  464. #define DIO21_WPORT PORTC
  465. #define DIO21_DDR DDRC
  466. #define DIO21_PWM NULL
  467. #define DIO22_PIN PINC6
  468. #define DIO22_RPORT PINC
  469. #define DIO22_WPORT PORTC
  470. #define DIO22_DDR DDRC
  471. #define DIO22_PWM NULL
  472. #define DIO23_PIN PINC7
  473. #define DIO23_RPORT PINC
  474. #define DIO23_WPORT PORTC
  475. #define DIO23_DDR DDRC
  476. #define DIO23_PWM NULL
  477. #define DIO24_PIN PINA7
  478. #define DIO24_RPORT PINA
  479. #define DIO24_WPORT PORTA
  480. #define DIO24_DDR DDRA
  481. #define DIO24_PWM NULL
  482. #define DIO25_PIN PINA6
  483. #define DIO25_RPORT PINA
  484. #define DIO25_WPORT PORTA
  485. #define DIO25_DDR DDRA
  486. #define DIO25_PWM NULL
  487. #define DIO26_PIN PINA5
  488. #define DIO26_RPORT PINA
  489. #define DIO26_WPORT PORTA
  490. #define DIO26_DDR DDRA
  491. #define DIO26_PWM NULL
  492. #define DIO27_PIN PINA4
  493. #define DIO27_RPORT PINA
  494. #define DIO27_WPORT PORTA
  495. #define DIO27_DDR DDRA
  496. #define DIO27_PWM NULL
  497. #define DIO28_PIN PINA3
  498. #define DIO28_RPORT PINA
  499. #define DIO28_WPORT PORTA
  500. #define DIO28_DDR DDRA
  501. #define DIO28_PWM NULL
  502. #define DIO29_PIN PINA2
  503. #define DIO29_RPORT PINA
  504. #define DIO29_WPORT PORTA
  505. #define DIO29_DDR DDRA
  506. #define DIO29_PWM NULL
  507. #define DIO30_PIN PINA1
  508. #define DIO30_RPORT PINA
  509. #define DIO30_WPORT PORTA
  510. #define DIO30_DDR DDRA
  511. #define DIO30_PWM NULL
  512. #define DIO31_PIN PINA0
  513. #define DIO31_RPORT PINA
  514. #define DIO31_WPORT PORTA
  515. #define DIO31_DDR DDRA
  516. #define DIO31_PWM NULL
  517. #define AIO0_PIN PINA0
  518. #define AIO0_RPORT PINA
  519. #define AIO0_WPORT PORTA
  520. #define AIO0_DDR DDRA
  521. #define AIO0_PWM NULL
  522. #define AIO1_PIN PINA1
  523. #define AIO1_RPORT PINA
  524. #define AIO1_WPORT PORTA
  525. #define AIO1_DDR DDRA
  526. #define AIO1_PWM NULL
  527. #define AIO2_PIN PINA2
  528. #define AIO2_RPORT PINA
  529. #define AIO2_WPORT PORTA
  530. #define AIO2_DDR DDRA
  531. #define AIO2_PWM NULL
  532. #define AIO3_PIN PINA3
  533. #define AIO3_RPORT PINA
  534. #define AIO3_WPORT PORTA
  535. #define AIO3_DDR DDRA
  536. #define AIO3_PWM NULL
  537. #define AIO4_PIN PINA4
  538. #define AIO4_RPORT PINA
  539. #define AIO4_WPORT PORTA
  540. #define AIO4_DDR DDRA
  541. #define AIO4_PWM NULL
  542. #define AIO5_PIN PINA5
  543. #define AIO5_RPORT PINA
  544. #define AIO5_WPORT PORTA
  545. #define AIO5_DDR DDRA
  546. #define AIO5_PWM NULL
  547. #define AIO6_PIN PINA6
  548. #define AIO6_RPORT PINA
  549. #define AIO6_WPORT PORTA
  550. #define AIO6_DDR DDRA
  551. #define AIO6_PWM NULL
  552. #define AIO7_PIN PINA7
  553. #define AIO7_RPORT PINA
  554. #define AIO7_WPORT PORTA
  555. #define AIO7_DDR DDRA
  556. #define AIO7_PWM NULL
  557. #undef PA0
  558. #define PA0_PIN PINA0
  559. #define PA0_RPORT PINA
  560. #define PA0_WPORT PORTA
  561. #define PA0_DDR DDRA
  562. #define PA0_PWM NULL
  563. #undef PA1
  564. #define PA1_PIN PINA1
  565. #define PA1_RPORT PINA
  566. #define PA1_WPORT PORTA
  567. #define PA1_DDR DDRA
  568. #define PA1_PWM NULL
  569. #undef PA2
  570. #define PA2_PIN PINA2
  571. #define PA2_RPORT PINA
  572. #define PA2_WPORT PORTA
  573. #define PA2_DDR DDRA
  574. #define PA2_PWM NULL
  575. #undef PA3
  576. #define PA3_PIN PINA3
  577. #define PA3_RPORT PINA
  578. #define PA3_WPORT PORTA
  579. #define PA3_DDR DDRA
  580. #define PA3_PWM NULL
  581. #undef PA4
  582. #define PA4_PIN PINA4
  583. #define PA4_RPORT PINA
  584. #define PA4_WPORT PORTA
  585. #define PA4_DDR DDRA
  586. #define PA4_PWM NULL
  587. #undef PA5
  588. #define PA5_PIN PINA5
  589. #define PA5_RPORT PINA
  590. #define PA5_WPORT PORTA
  591. #define PA5_DDR DDRA
  592. #define PA5_PWM NULL
  593. #undef PA6
  594. #define PA6_PIN PINA6
  595. #define PA6_RPORT PINA
  596. #define PA6_WPORT PORTA
  597. #define PA6_DDR DDRA
  598. #define PA6_PWM NULL
  599. #undef PA7
  600. #define PA7_PIN PINA7
  601. #define PA7_RPORT PINA
  602. #define PA7_WPORT PORTA
  603. #define PA7_DDR DDRA
  604. #define PA7_PWM NULL
  605. #undef PB0
  606. #define PB0_PIN PINB0
  607. #define PB0_RPORT PINB
  608. #define PB0_WPORT PORTB
  609. #define PB0_DDR DDRB
  610. #define PB0_PWM NULL
  611. #undef PB1
  612. #define PB1_PIN PINB1
  613. #define PB1_RPORT PINB
  614. #define PB1_WPORT PORTB
  615. #define PB1_DDR DDRB
  616. #define PB1_PWM NULL
  617. #undef PB2
  618. #define PB2_PIN PINB2
  619. #define PB2_RPORT PINB
  620. #define PB2_WPORT PORTB
  621. #define PB2_DDR DDRB
  622. #define PB2_PWM NULL
  623. #undef PB3
  624. #define PB3_PIN PINB3
  625. #define PB3_RPORT PINB
  626. #define PB3_WPORT PORTB
  627. #define PB3_DDR DDRB
  628. #define PB3_PWM &OCR0A
  629. #undef PB4
  630. #define PB4_PIN PINB4
  631. #define PB4_RPORT PINB
  632. #define PB4_WPORT PORTB
  633. #define PB4_DDR DDRB
  634. #define PB4_PWM &OCR0B
  635. #undef PB5
  636. #define PB5_PIN PINB5
  637. #define PB5_RPORT PINB
  638. #define PB5_WPORT PORTB
  639. #define PB5_DDR DDRB
  640. #define PB5_PWM NULL
  641. #undef PB6
  642. #define PB6_PIN PINB6
  643. #define PB6_RPORT PINB
  644. #define PB6_WPORT PORTB
  645. #define PB6_DDR DDRB
  646. #define PB6_PWM NULL
  647. #undef PB7
  648. #define PB7_PIN PINB7
  649. #define PB7_RPORT PINB
  650. #define PB7_WPORT PORTB
  651. #define PB7_DDR DDRB
  652. #define PB7_PWM NULL
  653. #undef PC0
  654. #define PC0_PIN PINC0
  655. #define PC0_RPORT PINC
  656. #define PC0_WPORT PORTC
  657. #define PC0_DDR DDRC
  658. #define PC0_PWM NULL
  659. #undef PC1
  660. #define PC1_PIN PINC1
  661. #define PC1_RPORT PINC
  662. #define PC1_WPORT PORTC
  663. #define PC1_DDR DDRC
  664. #define PC1_PWM NULL
  665. #undef PC2
  666. #define PC2_PIN PINC2
  667. #define PC2_RPORT PINC
  668. #define PC2_WPORT PORTC
  669. #define PC2_DDR DDRC
  670. #define PC2_PWM NULL
  671. #undef PC3
  672. #define PC3_PIN PINC3
  673. #define PC3_RPORT PINC
  674. #define PC3_WPORT PORTC
  675. #define PC3_DDR DDRC
  676. #define PC3_PWM NULL
  677. #undef PC4
  678. #define PC4_PIN PINC4
  679. #define PC4_RPORT PINC
  680. #define PC4_WPORT PORTC
  681. #define PC4_DDR DDRC
  682. #define PC4_PWM NULL
  683. #undef PC5
  684. #define PC5_PIN PINC5
  685. #define PC5_RPORT PINC
  686. #define PC5_WPORT PORTC
  687. #define PC5_DDR DDRC
  688. #define PC5_PWM NULL
  689. #undef PC6
  690. #define PC6_PIN PINC6
  691. #define PC6_RPORT PINC
  692. #define PC6_WPORT PORTC
  693. #define PC6_DDR DDRC
  694. #define PC6_PWM NULL
  695. #undef PC7
  696. #define PC7_PIN PINC7
  697. #define PC7_RPORT PINC
  698. #define PC7_WPORT PORTC
  699. #define PC7_DDR DDRC
  700. #define PC7_PWM NULL
  701. #undef PD0
  702. #define PD0_PIN PIND0
  703. #define PD0_RPORT PIND
  704. #define PD0_WPORT PORTD
  705. #define PD0_DDR DDRD
  706. #define PD0_PWM NULL
  707. #undef PD1
  708. #define PD1_PIN PIND1
  709. #define PD1_RPORT PIND
  710. #define PD1_WPORT PORTD
  711. #define PD1_DDR DDRD
  712. #define PD1_PWM NULL
  713. #undef PD2
  714. #define PD2_PIN PIND2
  715. #define PD2_RPORT PIND
  716. #define PD2_WPORT PORTD
  717. #define PD2_DDR DDRD
  718. #define PD2_PWM NULL
  719. #undef PD3
  720. #define PD3_PIN PIND3
  721. #define PD3_RPORT PIND
  722. #define PD3_WPORT PORTD
  723. #define PD3_DDR DDRD
  724. #define PD3_PWM NULL
  725. #undef PD4
  726. #define PD4_PIN PIND4
  727. #define PD4_RPORT PIND
  728. #define PD4_WPORT PORTD
  729. #define PD4_DDR DDRD
  730. #define PD4_PWM NULL
  731. #undef PD5
  732. #define PD5_PIN PIND5
  733. #define PD5_RPORT PIND
  734. #define PD5_WPORT PORTD
  735. #define PD5_DDR DDRD
  736. #define PD5_PWM NULL
  737. #undef PD6
  738. #define PD6_PIN PIND6
  739. #define PD6_RPORT PIND
  740. #define PD6_WPORT PORTD
  741. #define PD6_DDR DDRD
  742. #define PD6_PWM &OCR2B
  743. #undef PD7
  744. #define PD7_PIN PIND7
  745. #define PD7_RPORT PIND
  746. #define PD7_WPORT PORTD
  747. #define PD7_DDR DDRD
  748. #define PD7_PWM &OCR2A
  749. #endif /* _AVR_ATmega{644,644P,644PA,1284P}__ */
  750. #if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)
  751. // UART
  752. #define RXD DIO0
  753. #define TXD DIO1
  754. // SPI
  755. #define SCK DIO52
  756. #define MISO DIO50
  757. #define MOSI DIO51
  758. #define SS DIO53
  759. // TWI (I2C)
  760. #define SCL DIO21
  761. #define SDA DIO20
  762. // timers and PWM
  763. #define OC0A DIO13
  764. #define OC0B DIO4
  765. #define OC1A DIO11
  766. #define OC1B DIO12
  767. #define OC2A DIO10
  768. #define OC2B DIO9
  769. #define OC3A DIO5
  770. #define OC3B DIO2
  771. #define OC3C DIO3
  772. #define OC4A DIO6
  773. #define OC4B DIO7
  774. #define OC4C DIO8
  775. #define OC5A DIO46
  776. #define OC5B DIO45
  777. #define OC5C DIO44
  778. // change for your board
  779. #define DEBUG_LED DIO21
  780. /*
  781. pins
  782. */
  783. #define DIO0_PIN PINE0
  784. #define DIO0_RPORT PINE
  785. #define DIO0_WPORT PORTE
  786. #define DIO0_DDR DDRE
  787. #define DIO0_PWM NULL
  788. #define DIO1_PIN PINE1
  789. #define DIO1_RPORT PINE
  790. #define DIO1_WPORT PORTE
  791. #define DIO1_DDR DDRE
  792. #define DIO1_PWM NULL
  793. #define DIO2_PIN PINE4
  794. #define DIO2_RPORT PINE
  795. #define DIO2_WPORT PORTE
  796. #define DIO2_DDR DDRE
  797. #define DIO2_PWM &OCR3BL
  798. #define DIO3_PIN PINE5
  799. #define DIO3_RPORT PINE
  800. #define DIO3_WPORT PORTE
  801. #define DIO3_DDR DDRE
  802. #define DIO3_PWM &OCR3CL
  803. #define DIO4_PIN PING5
  804. #define DIO4_RPORT PING
  805. #define DIO4_WPORT PORTG
  806. #define DIO4_DDR DDRG
  807. #define DIO4_PWM &OCR0B
  808. #define DIO5_PIN PINE3
  809. #define DIO5_RPORT PINE
  810. #define DIO5_WPORT PORTE
  811. #define DIO5_DDR DDRE
  812. #define DIO5_PWM &OCR3AL
  813. #define DIO6_PIN PINH3
  814. #define DIO6_RPORT PINH
  815. #define DIO6_WPORT PORTH
  816. #define DIO6_DDR DDRH
  817. #define DIO6_PWM &OCR4AL
  818. #define DIO7_PIN PINH4
  819. #define DIO7_RPORT PINH
  820. #define DIO7_WPORT PORTH
  821. #define DIO7_DDR DDRH
  822. #define DIO7_PWM &OCR4BL
  823. #define DIO8_PIN PINH5
  824. #define DIO8_RPORT PINH
  825. #define DIO8_WPORT PORTH
  826. #define DIO8_DDR DDRH
  827. #define DIO8_PWM &OCR4CL
  828. #define DIO9_PIN PINH6
  829. #define DIO9_RPORT PINH
  830. #define DIO9_WPORT PORTH
  831. #define DIO9_DDR DDRH
  832. #define DIO9_PWM &OCR2B
  833. #define DIO10_PIN PINB4
  834. #define DIO10_RPORT PINB
  835. #define DIO10_WPORT PORTB
  836. #define DIO10_DDR DDRB
  837. #define DIO10_PWM &OCR2A
  838. #define DIO11_PIN PINB5
  839. #define DIO11_RPORT PINB
  840. #define DIO11_WPORT PORTB
  841. #define DIO11_DDR DDRB
  842. #define DIO11_PWM NULL
  843. #define DIO12_PIN PINB6
  844. #define DIO12_RPORT PINB
  845. #define DIO12_WPORT PORTB
  846. #define DIO12_DDR DDRB
  847. #define DIO12_PWM NULL
  848. #define DIO13_PIN PINB7
  849. #define DIO13_RPORT PINB
  850. #define DIO13_WPORT PORTB
  851. #define DIO13_DDR DDRB
  852. #define DIO13_PWM &OCR0A
  853. #define DIO14_PIN PINJ1
  854. #define DIO14_RPORT PINJ
  855. #define DIO14_WPORT PORTJ
  856. #define DIO14_DDR DDRJ
  857. #define DIO14_PWM NULL
  858. #define DIO15_PIN PINJ0
  859. #define DIO15_RPORT PINJ
  860. #define DIO15_WPORT PORTJ
  861. #define DIO15_DDR DDRJ
  862. #define DIO15_PWM NULL
  863. #define DIO16_PIN PINH1
  864. #define DIO16_RPORT PINH
  865. #define DIO16_WPORT PORTH
  866. #define DIO16_DDR DDRH
  867. #define DIO16_PWM NULL
  868. #define DIO17_PIN PINH0
  869. #define DIO17_RPORT PINH
  870. #define DIO17_WPORT PORTH
  871. #define DIO17_DDR DDRH
  872. #define DIO17_PWM NULL
  873. #define DIO18_PIN PIND3
  874. #define DIO18_RPORT PIND
  875. #define DIO18_WPORT PORTD
  876. #define DIO18_DDR DDRD
  877. #define DIO18_PWM NULL
  878. #define DIO19_PIN PIND2
  879. #define DIO19_RPORT PIND
  880. #define DIO19_WPORT PORTD
  881. #define DIO19_DDR DDRD
  882. #define DIO19_PWM NULL
  883. #define DIO20_PIN PIND1
  884. #define DIO20_RPORT PIND
  885. #define DIO20_WPORT PORTD
  886. #define DIO20_DDR DDRD
  887. #define DIO20_PWM NULL
  888. #define DIO21_PIN PIND0
  889. #define DIO21_RPORT PIND
  890. #define DIO21_WPORT PORTD
  891. #define DIO21_DDR DDRD
  892. #define DIO21_PWM NULL
  893. #define DIO22_PIN PINA0
  894. #define DIO22_RPORT PINA
  895. #define DIO22_WPORT PORTA
  896. #define DIO22_DDR DDRA
  897. #define DIO22_PWM NULL
  898. #define DIO23_PIN PINA1
  899. #define DIO23_RPORT PINA
  900. #define DIO23_WPORT PORTA
  901. #define DIO23_DDR DDRA
  902. #define DIO23_PWM NULL
  903. #define DIO24_PIN PINA2
  904. #define DIO24_RPORT PINA
  905. #define DIO24_WPORT PORTA
  906. #define DIO24_DDR DDRA
  907. #define DIO24_PWM NULL
  908. #define DIO25_PIN PINA3
  909. #define DIO25_RPORT PINA
  910. #define DIO25_WPORT PORTA
  911. #define DIO25_DDR DDRA
  912. #define DIO25_PWM NULL
  913. #define DIO26_PIN PINA4
  914. #define DIO26_RPORT PINA
  915. #define DIO26_WPORT PORTA
  916. #define DIO26_DDR DDRA
  917. #define DIO26_PWM NULL
  918. #define DIO27_PIN PINA5
  919. #define DIO27_RPORT PINA
  920. #define DIO27_WPORT PORTA
  921. #define DIO27_DDR DDRA
  922. #define DIO27_PWM NULL
  923. #define DIO28_PIN PINA6
  924. #define DIO28_RPORT PINA
  925. #define DIO28_WPORT PORTA
  926. #define DIO28_DDR DDRA
  927. #define DIO28_PWM NULL
  928. #define DIO29_PIN PINA7
  929. #define DIO29_RPORT PINA
  930. #define DIO29_WPORT PORTA
  931. #define DIO29_DDR DDRA
  932. #define DIO29_PWM NULL
  933. #define DIO30_PIN PINC7
  934. #define DIO30_RPORT PINC
  935. #define DIO30_WPORT PORTC
  936. #define DIO30_DDR DDRC
  937. #define DIO30_PWM NULL
  938. #define DIO31_PIN PINC6
  939. #define DIO31_RPORT PINC
  940. #define DIO31_WPORT PORTC
  941. #define DIO31_DDR DDRC
  942. #define DIO31_PWM NULL
  943. #define DIO32_PIN PINC5
  944. #define DIO32_RPORT PINC
  945. #define DIO32_WPORT PORTC
  946. #define DIO32_DDR DDRC
  947. #define DIO32_PWM NULL
  948. #define DIO33_PIN PINC4
  949. #define DIO33_RPORT PINC
  950. #define DIO33_WPORT PORTC
  951. #define DIO33_DDR DDRC
  952. #define DIO33_PWM NULL
  953. #define DIO34_PIN PINC3
  954. #define DIO34_RPORT PINC
  955. #define DIO34_WPORT PORTC
  956. #define DIO34_DDR DDRC
  957. #define DIO34_PWM NULL
  958. #define DIO35_PIN PINC2
  959. #define DIO35_RPORT PINC
  960. #define DIO35_WPORT PORTC
  961. #define DIO35_DDR DDRC
  962. #define DIO35_PWM NULL
  963. #define DIO36_PIN PINC1
  964. #define DIO36_RPORT PINC
  965. #define DIO36_WPORT PORTC
  966. #define DIO36_DDR DDRC
  967. #define DIO36_PWM NULL
  968. #define DIO37_PIN PINC0
  969. #define DIO37_RPORT PINC
  970. #define DIO37_WPORT PORTC
  971. #define DIO37_DDR DDRC
  972. #define DIO37_PWM NULL
  973. #define DIO38_PIN PIND7
  974. #define DIO38_RPORT PIND
  975. #define DIO38_WPORT PORTD
  976. #define DIO38_DDR DDRD
  977. #define DIO38_PWM NULL
  978. #define DIO39_PIN PING2
  979. #define DIO39_RPORT PING
  980. #define DIO39_WPORT PORTG
  981. #define DIO39_DDR DDRG
  982. #define DIO39_PWM NULL
  983. #define DIO40_PIN PING1
  984. #define DIO40_RPORT PING
  985. #define DIO40_WPORT PORTG
  986. #define DIO40_DDR DDRG
  987. #define DIO40_PWM NULL
  988. #define DIO41_PIN PING0
  989. #define DIO41_RPORT PING
  990. #define DIO41_WPORT PORTG
  991. #define DIO41_DDR DDRG
  992. #define DIO41_PWM NULL
  993. #define DIO42_PIN PINL7
  994. #define DIO42_RPORT PINL
  995. #define DIO42_WPORT PORTL
  996. #define DIO42_DDR DDRL
  997. #define DIO42_PWM NULL
  998. #define DIO43_PIN PINL6
  999. #define DIO43_RPORT PINL
  1000. #define DIO43_WPORT PORTL
  1001. #define DIO43_DDR DDRL
  1002. #define DIO43_PWM NULL
  1003. #define DIO44_PIN PINL5
  1004. #define DIO44_RPORT PINL
  1005. #define DIO44_WPORT PORTL
  1006. #define DIO44_DDR DDRL
  1007. #define DIO44_PWM &OCR5CL
  1008. #define DIO45_PIN PINL4
  1009. #define DIO45_RPORT PINL
  1010. #define DIO45_WPORT PORTL
  1011. #define DIO45_DDR DDRL
  1012. #define DIO45_PWM &OCR5BL
  1013. #define DIO46_PIN PINL3
  1014. #define DIO46_RPORT PINL
  1015. #define DIO46_WPORT PORTL
  1016. #define DIO46_DDR DDRL
  1017. #define DIO46_PWM &OCR5AL
  1018. #define DIO47_PIN PINL2
  1019. #define DIO47_RPORT PINL
  1020. #define DIO47_WPORT PORTL
  1021. #define DIO47_DDR DDRL
  1022. #define DIO47_PWM NULL
  1023. #define DIO48_PIN PINL1
  1024. #define DIO48_RPORT PINL
  1025. #define DIO48_WPORT PORTL
  1026. #define DIO48_DDR DDRL
  1027. #define DIO48_PWM NULL
  1028. #define DIO49_PIN PINL0
  1029. #define DIO49_RPORT PINL
  1030. #define DIO49_WPORT PORTL
  1031. #define DIO49_DDR DDRL
  1032. #define DIO49_PWM NULL
  1033. #define DIO50_PIN PINB3
  1034. #define DIO50_RPORT PINB
  1035. #define DIO50_WPORT PORTB
  1036. #define DIO50_DDR DDRB
  1037. #define DIO50_PWM NULL
  1038. #define DIO51_PIN PINB2
  1039. #define DIO51_RPORT PINB
  1040. #define DIO51_WPORT PORTB
  1041. #define DIO51_DDR DDRB
  1042. #define DIO51_PWM NULL
  1043. #define DIO52_PIN PINB1
  1044. #define DIO52_RPORT PINB
  1045. #define DIO52_WPORT PORTB
  1046. #define DIO52_DDR DDRB
  1047. #define DIO52_PWM NULL
  1048. #define DIO53_PIN PINB0
  1049. #define DIO53_RPORT PINB
  1050. #define DIO53_WPORT PORTB
  1051. #define DIO53_DDR DDRB
  1052. #define DIO53_PWM NULL
  1053. #define DIO54_PIN PINF0
  1054. #define DIO54_RPORT PINF
  1055. #define DIO54_WPORT PORTF
  1056. #define DIO54_DDR DDRF
  1057. #define DIO54_PWM NULL
  1058. #define DIO55_PIN PINF1
  1059. #define DIO55_RPORT PINF
  1060. #define DIO55_WPORT PORTF
  1061. #define DIO55_DDR DDRF
  1062. #define DIO55_PWM NULL
  1063. #define DIO56_PIN PINF2
  1064. #define DIO56_RPORT PINF
  1065. #define DIO56_WPORT PORTF
  1066. #define DIO56_DDR DDRF
  1067. #define DIO56_PWM NULL
  1068. #define DIO57_PIN PINF3
  1069. #define DIO57_RPORT PINF
  1070. #define DIO57_WPORT PORTF
  1071. #define DIO57_DDR DDRF
  1072. #define DIO57_PWM NULL
  1073. #define DIO58_PIN PINF4
  1074. #define DIO58_RPORT PINF
  1075. #define DIO58_WPORT PORTF
  1076. #define DIO58_DDR DDRF
  1077. #define DIO58_PWM NULL
  1078. #define DIO59_PIN PINF5
  1079. #define DIO59_RPORT PINF
  1080. #define DIO59_WPORT PORTF
  1081. #define DIO59_DDR DDRF
  1082. #define DIO59_PWM NULL
  1083. #define DIO60_PIN PINF6
  1084. #define DIO60_RPORT PINF
  1085. #define DIO60_WPORT PORTF
  1086. #define DIO60_DDR DDRF
  1087. #define DIO60_PWM NULL
  1088. #define DIO61_PIN PINF7
  1089. #define DIO61_RPORT PINF
  1090. #define DIO61_WPORT PORTF
  1091. #define DIO61_DDR DDRF
  1092. #define DIO61_PWM NULL
  1093. #define DIO62_PIN PINK0
  1094. #define DIO62_RPORT PINK
  1095. #define DIO62_WPORT PORTK
  1096. #define DIO62_DDR DDRK
  1097. #define DIO62_PWM NULL
  1098. #define DIO63_PIN PINK1
  1099. #define DIO63_RPORT PINK
  1100. #define DIO63_WPORT PORTK
  1101. #define DIO63_DDR DDRK
  1102. #define DIO63_PWM NULL
  1103. #define DIO64_PIN PINK2
  1104. #define DIO64_RPORT PINK
  1105. #define DIO64_WPORT PORTK
  1106. #define DIO64_DDR DDRK
  1107. #define DIO64_PWM NULL
  1108. #define DIO65_PIN PINK3
  1109. #define DIO65_RPORT PINK
  1110. #define DIO65_WPORT PORTK
  1111. #define DIO65_DDR DDRK
  1112. #define DIO65_PWM NULL
  1113. #define DIO66_PIN PINK4
  1114. #define DIO66_RPORT PINK
  1115. #define DIO66_WPORT PORTK
  1116. #define DIO66_DDR DDRK
  1117. #define DIO66_PWM NULL
  1118. #define DIO67_PIN PINK5
  1119. #define DIO67_RPORT PINK
  1120. #define DIO67_WPORT PORTK
  1121. #define DIO67_DDR DDRK
  1122. #define DIO67_PWM NULL
  1123. #define DIO68_PIN PINK6
  1124. #define DIO68_RPORT PINK
  1125. #define DIO68_WPORT PORTK
  1126. #define DIO68_DDR DDRK
  1127. #define DIO68_PWM NULL
  1128. #define DIO69_PIN PINK7
  1129. #define DIO69_RPORT PINK
  1130. #define DIO69_WPORT PORTK
  1131. #define DIO69_DDR DDRK
  1132. #define DIO69_PWM NULL
  1133. #undef PA0
  1134. #define PA0_PIN PINA0
  1135. #define PA0_RPORT PINA
  1136. #define PA0_WPORT PORTA
  1137. #define PA0_DDR DDRA
  1138. #define PA0_PWM NULL
  1139. #undef PA1
  1140. #define PA1_PIN PINA1
  1141. #define PA1_RPORT PINA
  1142. #define PA1_WPORT PORTA
  1143. #define PA1_DDR DDRA
  1144. #define PA1_PWM NULL
  1145. #undef PA2
  1146. #define PA2_PIN PINA2
  1147. #define PA2_RPORT PINA
  1148. #define PA2_WPORT PORTA
  1149. #define PA2_DDR DDRA
  1150. #define PA2_PWM NULL
  1151. #undef PA3
  1152. #define PA3_PIN PINA3
  1153. #define PA3_RPORT PINA
  1154. #define PA3_WPORT PORTA
  1155. #define PA3_DDR DDRA
  1156. #define PA3_PWM NULL
  1157. #undef PA4
  1158. #define PA4_PIN PINA4
  1159. #define PA4_RPORT PINA
  1160. #define PA4_WPORT PORTA
  1161. #define PA4_DDR DDRA
  1162. #define PA4_PWM NULL
  1163. #undef PA5
  1164. #define PA5_PIN PINA5
  1165. #define PA5_RPORT PINA
  1166. #define PA5_WPORT PORTA
  1167. #define PA5_DDR DDRA
  1168. #define PA5_PWM NULL
  1169. #undef PA6
  1170. #define PA6_PIN PINA6
  1171. #define PA6_RPORT PINA
  1172. #define PA6_WPORT PORTA
  1173. #define PA6_DDR DDRA
  1174. #define PA6_PWM NULL
  1175. #undef PA7
  1176. #define PA7_PIN PINA7
  1177. #define PA7_RPORT PINA
  1178. #define PA7_WPORT PORTA
  1179. #define PA7_DDR DDRA
  1180. #define PA7_PWM NULL
  1181. #undef PB0
  1182. #define PB0_PIN PINB0
  1183. #define PB0_RPORT PINB
  1184. #define PB0_WPORT PORTB
  1185. #define PB0_DDR DDRB
  1186. #define PB0_PWM NULL
  1187. #undef PB1
  1188. #define PB1_PIN PINB1
  1189. #define PB1_RPORT PINB
  1190. #define PB1_WPORT PORTB
  1191. #define PB1_DDR DDRB
  1192. #define PB1_PWM NULL
  1193. #undef PB2
  1194. #define PB2_PIN PINB2
  1195. #define PB2_RPORT PINB
  1196. #define PB2_WPORT PORTB
  1197. #define PB2_DDR DDRB
  1198. #define PB2_PWM NULL
  1199. #undef PB3
  1200. #define PB3_PIN PINB3
  1201. #define PB3_RPORT PINB
  1202. #define PB3_WPORT PORTB
  1203. #define PB3_DDR DDRB
  1204. #define PB3_PWM NULL
  1205. #undef PB4
  1206. #define PB4_PIN PINB4
  1207. #define PB4_RPORT PINB
  1208. #define PB4_WPORT PORTB
  1209. #define PB4_DDR DDRB
  1210. #define PB4_PWM &OCR2A
  1211. #undef PB5
  1212. #define PB5_PIN PINB5
  1213. #define PB5_RPORT PINB
  1214. #define PB5_WPORT PORTB
  1215. #define PB5_DDR DDRB
  1216. #define PB5_PWM NULL
  1217. #undef PB6
  1218. #define PB6_PIN PINB6
  1219. #define PB6_RPORT PINB
  1220. #define PB6_WPORT PORTB
  1221. #define PB6_DDR DDRB
  1222. #define PB6_PWM NULL
  1223. #undef PB7
  1224. #define PB7_PIN PINB7
  1225. #define PB7_RPORT PINB
  1226. #define PB7_WPORT PORTB
  1227. #define PB7_DDR DDRB
  1228. #define PB7_PWM &OCR0A
  1229. #undef PC0
  1230. #define PC0_PIN PINC0
  1231. #define PC0_RPORT PINC
  1232. #define PC0_WPORT PORTC
  1233. #define PC0_DDR DDRC
  1234. #define PC0_PWM NULL
  1235. #undef PC1
  1236. #define PC1_PIN PINC1
  1237. #define PC1_RPORT PINC
  1238. #define PC1_WPORT PORTC
  1239. #define PC1_DDR DDRC
  1240. #define PC1_PWM NULL
  1241. #undef PC2
  1242. #define PC2_PIN PINC2
  1243. #define PC2_RPORT PINC
  1244. #define PC2_WPORT PORTC
  1245. #define PC2_DDR DDRC
  1246. #define PC2_PWM NULL
  1247. #undef PC3
  1248. #define PC3_PIN PINC3
  1249. #define PC3_RPORT PINC
  1250. #define PC3_WPORT PORTC
  1251. #define PC3_DDR DDRC
  1252. #define PC3_PWM NULL
  1253. #undef PC4
  1254. #define PC4_PIN PINC4
  1255. #define PC4_RPORT PINC
  1256. #define PC4_WPORT PORTC
  1257. #define PC4_DDR DDRC
  1258. #define PC4_PWM NULL
  1259. #undef PC5
  1260. #define PC5_PIN PINC5
  1261. #define PC5_RPORT PINC
  1262. #define PC5_WPORT PORTC
  1263. #define PC5_DDR DDRC
  1264. #define PC5_PWM NULL
  1265. #undef PC6
  1266. #define PC6_PIN PINC6
  1267. #define PC6_RPORT PINC
  1268. #define PC6_WPORT PORTC
  1269. #define PC6_DDR DDRC
  1270. #define PC6_PWM NULL
  1271. #undef PC7
  1272. #define PC7_PIN PINC7
  1273. #define PC7_RPORT PINC
  1274. #define PC7_WPORT PORTC
  1275. #define PC7_DDR DDRC
  1276. #define PC7_PWM NULL
  1277. #undef PD0
  1278. #define PD0_PIN PIND0
  1279. #define PD0_RPORT PIND
  1280. #define PD0_WPORT PORTD
  1281. #define PD0_DDR DDRD
  1282. #define PD0_PWM NULL
  1283. #undef PD1
  1284. #define PD1_PIN PIND1
  1285. #define PD1_RPORT PIND
  1286. #define PD1_WPORT PORTD
  1287. #define PD1_DDR DDRD
  1288. #define PD1_PWM NULL
  1289. #undef PD2
  1290. #define PD2_PIN PIND2
  1291. #define PD2_RPORT PIND
  1292. #define PD2_WPORT PORTD
  1293. #define PD2_DDR DDRD
  1294. #define PD2_PWM NULL
  1295. #undef PD3
  1296. #define PD3_PIN PIND3
  1297. #define PD3_RPORT PIND
  1298. #define PD3_WPORT PORTD
  1299. #define PD3_DDR DDRD
  1300. #define PD3_PWM NULL
  1301. #undef PD4
  1302. #define PD4_PIN PIND4
  1303. #define PD4_RPORT PIND
  1304. #define PD4_WPORT PORTD
  1305. #define PD4_DDR DDRD
  1306. #define PD4_PWM NULL
  1307. #undef PD5
  1308. #define PD5_PIN PIND5
  1309. #define PD5_RPORT PIND
  1310. #define PD5_WPORT PORTD
  1311. #define PD5_DDR DDRD
  1312. #define PD5_PWM NULL
  1313. #undef PD6
  1314. #define PD6_PIN PIND6
  1315. #define PD6_RPORT PIND
  1316. #define PD6_WPORT PORTD
  1317. #define PD6_DDR DDRD
  1318. #define PD6_PWM NULL
  1319. #undef PD7
  1320. #define PD7_PIN PIND7
  1321. #define PD7_RPORT PIND
  1322. #define PD7_WPORT PORTD
  1323. #define PD7_DDR DDRD
  1324. #define PD7_PWM NULL
  1325. #undef PE0
  1326. #define PE0_PIN PINE0
  1327. #define PE0_RPORT PINE
  1328. #define PE0_WPORT PORTE
  1329. #define PE0_DDR DDRE
  1330. #define PE0_PWM NULL
  1331. #undef PE1
  1332. #define PE1_PIN PINE1
  1333. #define PE1_RPORT PINE
  1334. #define PE1_WPORT PORTE
  1335. #define PE1_DDR DDRE
  1336. #define PE1_PWM NULL
  1337. #undef PE2
  1338. #define PE2_PIN PINE2
  1339. #define PE2_RPORT PINE
  1340. #define PE2_WPORT PORTE
  1341. #define PE2_DDR DDRE
  1342. #define PE2_PWM NULL
  1343. #undef PE3
  1344. #define PE3_PIN PINE3
  1345. #define PE3_RPORT PINE
  1346. #define PE3_WPORT PORTE
  1347. #define PE3_DDR DDRE
  1348. #define PE3_PWM &OCR3AL
  1349. #undef PE4
  1350. #define PE4_PIN PINE4
  1351. #define PE4_RPORT PINE
  1352. #define PE4_WPORT PORTE
  1353. #define PE4_DDR DDRE
  1354. #define PE4_PWM &OCR3BL
  1355. #undef PE5
  1356. #define PE5_PIN PINE5
  1357. #define PE5_RPORT PINE
  1358. #define PE5_WPORT PORTE
  1359. #define PE5_DDR DDRE
  1360. #define PE5_PWM &OCR3CL
  1361. #undef PE6
  1362. #define PE6_PIN PINE6
  1363. #define PE6_RPORT PINE
  1364. #define PE6_WPORT PORTE
  1365. #define PE6_DDR DDRE
  1366. #define PE6_PWM NULL
  1367. #undef PE7
  1368. #define PE7_PIN PINE7
  1369. #define PE7_RPORT PINE
  1370. #define PE7_WPORT PORTE
  1371. #define PE7_DDR DDRE
  1372. #define PE7_PWM NULL
  1373. #undef PF0
  1374. #define PF0_PIN PINF0
  1375. #define PF0_RPORT PINF
  1376. #define PF0_WPORT PORTF
  1377. #define PF0_DDR DDRF
  1378. #define PF0_PWM NULL
  1379. #undef PF1
  1380. #define PF1_PIN PINF1
  1381. #define PF1_RPORT PINF
  1382. #define PF1_WPORT PORTF
  1383. #define PF1_DDR DDRF
  1384. #define PF1_PWM NULL
  1385. #undef PF2
  1386. #define PF2_PIN PINF2
  1387. #define PF2_RPORT PINF
  1388. #define PF2_WPORT PORTF
  1389. #define PF2_DDR DDRF
  1390. #define PF2_PWM NULL
  1391. #undef PF3
  1392. #define PF3_PIN PINF3
  1393. #define PF3_RPORT PINF
  1394. #define PF3_WPORT PORTF
  1395. #define PF3_DDR DDRF
  1396. #define PF3_PWM NULL
  1397. #undef PF4
  1398. #define PF4_PIN PINF4
  1399. #define PF4_RPORT PINF
  1400. #define PF4_WPORT PORTF
  1401. #define PF4_DDR DDRF
  1402. #define PF4_PWM NULL
  1403. #undef PF5
  1404. #define PF5_PIN PINF5
  1405. #define PF5_RPORT PINF
  1406. #define PF5_WPORT PORTF
  1407. #define PF5_DDR DDRF
  1408. #define PF5_PWM NULL
  1409. #undef PF6
  1410. #define PF6_PIN PINF6
  1411. #define PF6_RPORT PINF
  1412. #define PF6_WPORT PORTF
  1413. #define PF6_DDR DDRF
  1414. #define PF6_PWM NULL
  1415. #undef PF7
  1416. #define PF7_PIN PINF7
  1417. #define PF7_RPORT PINF
  1418. #define PF7_WPORT PORTF
  1419. #define PF7_DDR DDRF
  1420. #define PF7_PWM NULL
  1421. #undef PG0
  1422. #define PG0_PIN PING0
  1423. #define PG0_RPORT PING
  1424. #define PG0_WPORT PORTG
  1425. #define PG0_DDR DDRG
  1426. #define PG0_PWM NULL
  1427. #undef PG1
  1428. #define PG1_PIN PING1
  1429. #define PG1_RPORT PING
  1430. #define PG1_WPORT PORTG
  1431. #define PG1_DDR DDRG
  1432. #define PG1_PWM NULL
  1433. #undef PG2
  1434. #define PG2_PIN PING2
  1435. #define PG2_RPORT PING
  1436. #define PG2_WPORT PORTG
  1437. #define PG2_DDR DDRG
  1438. #define PG2_PWM NULL
  1439. #undef PG3
  1440. #define PG3_PIN PING3
  1441. #define PG3_RPORT PING
  1442. #define PG3_WPORT PORTG
  1443. #define PG3_DDR DDRG
  1444. #define PG3_PWM NULL
  1445. #undef PG4
  1446. #define PG4_PIN PING4
  1447. #define PG4_RPORT PING
  1448. #define PG4_WPORT PORTG
  1449. #define PG4_DDR DDRG
  1450. #define PG4_PWM NULL
  1451. #undef PG5
  1452. #define PG5_PIN PING5
  1453. #define PG5_RPORT PING
  1454. #define PG5_WPORT PORTG
  1455. #define PG5_DDR DDRG
  1456. #define PG5_PWM &OCR0B
  1457. #undef PG6
  1458. #define PG6_PIN PING6
  1459. #define PG6_RPORT PING
  1460. #define PG6_WPORT PORTG
  1461. #define PG6_DDR DDRG
  1462. #define PG6_PWM NULL
  1463. #undef PG7
  1464. #define PG7_PIN PING7
  1465. #define PG7_RPORT PING
  1466. #define PG7_WPORT PORTG
  1467. #define PG7_DDR DDRG
  1468. #define PG7_PWM NULL
  1469. #undef PH0
  1470. #define PH0_PIN PINH0
  1471. #define PH0_RPORT PINH
  1472. #define PH0_WPORT PORTH
  1473. #define PH0_DDR DDRH
  1474. #define PH0_PWM NULL
  1475. #undef PH1
  1476. #define PH1_PIN PINH1
  1477. #define PH1_RPORT PINH
  1478. #define PH1_WPORT PORTH
  1479. #define PH1_DDR DDRH
  1480. #define PH1_PWM NULL
  1481. #undef PH2
  1482. #define PH2_PIN PINH2
  1483. #define PH2_RPORT PINH
  1484. #define PH2_WPORT PORTH
  1485. #define PH2_DDR DDRH
  1486. #define PH2_PWM NULL
  1487. #undef PH3
  1488. #define PH3_PIN PINH3
  1489. #define PH3_RPORT PINH
  1490. #define PH3_WPORT PORTH
  1491. #define PH3_DDR DDRH
  1492. #define PH3_PWM &OCR4AL
  1493. #undef PH4
  1494. #define PH4_PIN PINH4
  1495. #define PH4_RPORT PINH
  1496. #define PH4_WPORT PORTH
  1497. #define PH4_DDR DDRH
  1498. #define PH4_PWM &OCR4BL
  1499. #undef PH5
  1500. #define PH5_PIN PINH5
  1501. #define PH5_RPORT PINH
  1502. #define PH5_WPORT PORTH
  1503. #define PH5_DDR DDRH
  1504. #define PH5_PWM &OCR4CL
  1505. #undef PH6
  1506. #define PH6_PIN PINH6
  1507. #define PH6_RPORT PINH
  1508. #define PH6_WPORT PORTH
  1509. #define PH6_DDR DDRH
  1510. #define PH6_PWM &OCR2B
  1511. #undef PH7
  1512. #define PH7_PIN PINH7
  1513. #define PH7_RPORT PINH
  1514. #define PH7_WPORT PORTH
  1515. #define PH7_DDR DDRH
  1516. #define PH7_PWM NULL
  1517. #undef PJ0
  1518. #define PJ0_PIN PINJ0
  1519. #define PJ0_RPORT PINJ
  1520. #define PJ0_WPORT PORTJ
  1521. #define PJ0_DDR DDRJ
  1522. #define PJ0_PWM NULL
  1523. #undef PJ1
  1524. #define PJ1_PIN PINJ1
  1525. #define PJ1_RPORT PINJ
  1526. #define PJ1_WPORT PORTJ
  1527. #define PJ1_DDR DDRJ
  1528. #define PJ1_PWM NULL
  1529. #undef PJ2
  1530. #define PJ2_PIN PINJ2
  1531. #define PJ2_RPORT PINJ
  1532. #define PJ2_WPORT PORTJ
  1533. #define PJ2_DDR DDRJ
  1534. #define PJ2_PWM NULL
  1535. #undef PJ3
  1536. #define PJ3_PIN PINJ3
  1537. #define PJ3_RPORT PINJ
  1538. #define PJ3_WPORT PORTJ
  1539. #define PJ3_DDR DDRJ
  1540. #define PJ3_PWM NULL
  1541. #undef PJ4
  1542. #define PJ4_PIN PINJ4
  1543. #define PJ4_RPORT PINJ
  1544. #define PJ4_WPORT PORTJ
  1545. #define PJ4_DDR DDRJ
  1546. #define PJ4_PWM NULL
  1547. #undef PJ5
  1548. #define PJ5_PIN PINJ5
  1549. #define PJ5_RPORT PINJ
  1550. #define PJ5_WPORT PORTJ
  1551. #define PJ5_DDR DDRJ
  1552. #define PJ5_PWM NULL
  1553. #undef PJ6
  1554. #define PJ6_PIN PINJ6
  1555. #define PJ6_RPORT PINJ
  1556. #define PJ6_WPORT PORTJ
  1557. #define PJ6_DDR DDRJ
  1558. #define PJ6_PWM NULL
  1559. #undef PJ7
  1560. #define PJ7_PIN PINJ7
  1561. #define PJ7_RPORT PINJ
  1562. #define PJ7_WPORT PORTJ
  1563. #define PJ7_DDR DDRJ
  1564. #define PJ7_PWM NULL
  1565. #undef PK0
  1566. #define PK0_PIN PINK0
  1567. #define PK0_RPORT PINK
  1568. #define PK0_WPORT PORTK
  1569. #define PK0_DDR DDRK
  1570. #define PK0_PWM NULL
  1571. #undef PK1
  1572. #define PK1_PIN PINK1
  1573. #define PK1_RPORT PINK
  1574. #define PK1_WPORT PORTK
  1575. #define PK1_DDR DDRK
  1576. #define PK1_PWM NULL
  1577. #undef PK2
  1578. #define PK2_PIN PINK2
  1579. #define PK2_RPORT PINK
  1580. #define PK2_WPORT PORTK
  1581. #define PK2_DDR DDRK
  1582. #define PK2_PWM NULL
  1583. #undef PK3
  1584. #define PK3_PIN PINK3
  1585. #define PK3_RPORT PINK
  1586. #define PK3_WPORT PORTK
  1587. #define PK3_DDR DDRK
  1588. #define PK3_PWM NULL
  1589. #undef PK4
  1590. #define PK4_PIN PINK4
  1591. #define PK4_RPORT PINK
  1592. #define PK4_WPORT PORTK
  1593. #define PK4_DDR DDRK
  1594. #define PK4_PWM NULL
  1595. #undef PK5
  1596. #define PK5_PIN PINK5
  1597. #define PK5_RPORT PINK
  1598. #define PK5_WPORT PORTK
  1599. #define PK5_DDR DDRK
  1600. #define PK5_PWM NULL
  1601. #undef PK6
  1602. #define PK6_PIN PINK6
  1603. #define PK6_RPORT PINK
  1604. #define PK6_WPORT PORTK
  1605. #define PK6_DDR DDRK
  1606. #define PK6_PWM NULL
  1607. #undef PK7
  1608. #define PK7_PIN PINK7
  1609. #define PK7_RPORT PINK
  1610. #define PK7_WPORT PORTK
  1611. #define PK7_DDR DDRK
  1612. #define PK7_PWM NULL
  1613. #undef PL0
  1614. #define PL0_PIN PINL0
  1615. #define PL0_RPORT PINL
  1616. #define PL0_WPORT PORTL
  1617. #define PL0_DDR DDRL
  1618. #define PL0_PWM NULL
  1619. #undef PL1
  1620. #define PL1_PIN PINL1
  1621. #define PL1_RPORT PINL
  1622. #define PL1_WPORT PORTL
  1623. #define PL1_DDR DDRL
  1624. #define PL1_PWM NULL
  1625. #undef PL2
  1626. #define PL2_PIN PINL2
  1627. #define PL2_RPORT PINL
  1628. #define PL2_WPORT PORTL
  1629. #define PL2_DDR DDRL
  1630. #define PL2_PWM NULL
  1631. #undef PL3
  1632. #define PL3_PIN PINL3
  1633. #define PL3_RPORT PINL
  1634. #define PL3_WPORT PORTL
  1635. #define PL3_DDR DDRL
  1636. #define PL3_PWM &OCR5AL
  1637. #undef PL4
  1638. #define PL4_PIN PINL4
  1639. #define PL4_RPORT PINL
  1640. #define PL4_WPORT PORTL
  1641. #define PL4_DDR DDRL
  1642. #define PL4_PWM &OCR5BL
  1643. #undef PL5
  1644. #define PL5_PIN PINL5
  1645. #define PL5_RPORT PINL
  1646. #define PL5_WPORT PORTL
  1647. #define PL5_DDR DDRL
  1648. #define PL5_PWM &OCR5CL
  1649. #undef PL6
  1650. #define PL6_PIN PINL6
  1651. #define PL6_RPORT PINL
  1652. #define PL6_WPORT PORTL
  1653. #define PL6_DDR DDRL
  1654. #define PL6_PWM NULL
  1655. #undef PL7
  1656. #define PL7_PIN PINL7
  1657. #define PL7_RPORT PINL
  1658. #define PL7_WPORT PORTL
  1659. #define PL7_DDR DDRL
  1660. #define PL7_PWM NULL
  1661. #endif
  1662. #if defined (__AVR_AT90USB646__)
  1663. // SPI
  1664. #define SCK DIO9
  1665. #define MISO DIO11
  1666. #define MOSI DIO10
  1667. #define SS DIO8
  1668. // change for your board
  1669. #define DEBUG_LED DIO31 /* led D5 red */
  1670. /*
  1671. pins
  1672. */
  1673. #define DIO0_PIN PINA0
  1674. #define DIO0_RPORT PINA
  1675. #define DIO0_WPORT PORTA
  1676. #define DIO0_PWM NULL
  1677. #define DIO0_DDR DDRA
  1678. #define DIO1_PIN PINA1
  1679. #define DIO1_RPORT PINA
  1680. #define DIO1_WPORT PORTA
  1681. #define DIO1_PWM NULL
  1682. #define DIO1_DDR DDRA
  1683. #define DIO2_PIN PINA2
  1684. #define DIO2_RPORT PINA
  1685. #define DIO2_WPORT PORTA
  1686. #define DIO2_PWM NULL
  1687. #define DIO2_DDR DDRA
  1688. #define DIO3_PIN PINA3
  1689. #define DIO3_RPORT PINA
  1690. #define DIO3_WPORT PORTA
  1691. #define DIO3_PWM NULL
  1692. #define DIO3_DDR DDRA
  1693. #define DIO4_PIN PINA4
  1694. #define DIO4_RPORT PINA
  1695. #define DIO4_WPORT PORTA
  1696. #define DIO4_PWM NULL
  1697. #define DIO4_DDR DDRA
  1698. #define DIO5_PIN PINA5
  1699. #define DIO5_RPORT PINA
  1700. #define DIO5_WPORT PORTA
  1701. #define DIO5_PWM NULL
  1702. #define DIO5_DDR DDRA
  1703. #define DIO6_PIN PINA6
  1704. #define DIO6_RPORT PINA
  1705. #define DIO6_WPORT PORTA
  1706. #define DIO6_PWM NULL
  1707. #define DIO6_DDR DDRA
  1708. #define DIO7_PIN PINA7
  1709. #define DIO7_RPORT PINA
  1710. #define DIO7_WPORT PORTA
  1711. #define DIO7_PWM NULL
  1712. #define DIO7_DDR DDRA
  1713. #define DIO8_PIN PINB0
  1714. #define DIO8_RPORT PINB
  1715. #define DIO8_WPORT PORTB
  1716. #define DIO8_PWM NULL
  1717. #define DIO8_DDR DDRB
  1718. #define DIO9_PIN PINB1
  1719. #define DIO9_RPORT PINB
  1720. #define DIO9_WPORT PORTB
  1721. #define DIO9_PWM NULL
  1722. #define DIO9_DDR DDRB
  1723. #define DIO10_PIN PINB2
  1724. #define DIO10_RPORT PINB
  1725. #define DIO10_WPORT PORTB
  1726. #define DIO10_PWM NULL
  1727. #define DIO10_DDR DDRB
  1728. #define DIO11_PIN PINB3
  1729. #define DIO11_RPORT PINB
  1730. #define DIO11_WPORT PORTB
  1731. #define DIO11_PWM NULL
  1732. #define DIO11_DDR DDRB
  1733. #define DIO12_PIN PINB4
  1734. #define DIO12_RPORT PINB
  1735. #define DIO12_WPORT PORTB
  1736. #define DIO12_PWM NULL
  1737. #define DIO12_DDR DDRB
  1738. #define DIO13_PIN PINB5
  1739. #define DIO13_RPORT PINB
  1740. #define DIO13_WPORT PORTB
  1741. #define DIO13_PWM NULL
  1742. #define DIO13_DDR DDRB
  1743. #define DIO14_PIN PINB6
  1744. #define DIO14_RPORT PINB
  1745. #define DIO14_WPORT PORTB
  1746. #define DIO14_PWM NULL
  1747. #define DIO14_DDR DDRB
  1748. #define DIO15_PIN PINB7
  1749. #define DIO15_RPORT PINB
  1750. #define DIO15_WPORT PORTB
  1751. #define DIO15_PWM NULL
  1752. #define DIO15_DDR DDRB
  1753. #define DIO16_PIN PINC0
  1754. #define DIO16_RPORT PINC
  1755. #define DIO16_WPORT PORTC
  1756. #define DIO16_PWM NULL
  1757. #define DIO16_DDR DDRC
  1758. #define DIO17_PIN PINC1
  1759. #define DIO17_RPORT PINC
  1760. #define DIO17_WPORT PORTC
  1761. #define DIO17_PWM NULL
  1762. #define DIO17_DDR DDRC
  1763. #define DIO18_PIN PINC2
  1764. #define DIO18_RPORT PINC
  1765. #define DIO18_WPORT PORTC
  1766. #define DIO18_PWM NULL
  1767. #define DIO18_DDR DDRC
  1768. #define DIO19_PIN PINC3
  1769. #define DIO19_RPORT PINC
  1770. #define DIO19_WPORT PORTC
  1771. #define DIO19_PWM NULL
  1772. #define DIO19_DDR DDRC
  1773. #define DIO20_PIN PINC4
  1774. #define DIO20_RPORT PINC
  1775. #define DIO20_WPORT PORTC
  1776. #define DIO20_PWM NULL
  1777. #define DIO20_DDR DDRC
  1778. #define DIO21_PIN PINC5
  1779. #define DIO21_RPORT PINC
  1780. #define DIO21_WPORT PORTC
  1781. #define DIO21_PWM NULL
  1782. #define DIO21_DDR DDRC
  1783. #define DIO22_PIN PINC6
  1784. #define DIO22_RPORT PINC
  1785. #define DIO22_WPORT PORTC
  1786. #define DIO22_PWM NULL
  1787. #define DIO22_DDR DDRC
  1788. #define DIO23_PIN PINC7
  1789. #define DIO23_RPORT PINC
  1790. #define DIO23_WPORT PORTC
  1791. #define DIO23_PWM NULL
  1792. #define DIO23_DDR DDRC
  1793. #define DIO24_PIN PIND0
  1794. #define DIO24_RPORT PIND
  1795. #define DIO24_WPORT PORTD
  1796. #define DIO24_PWM NULL
  1797. #define DIO24_DDR DDRD
  1798. #define DIO25_PIN PIND1
  1799. #define DIO25_RPORT PIND
  1800. #define DIO25_WPORT PORTD
  1801. #define DIO25_PWM NULL
  1802. #define DIO25_DDR DDRD
  1803. #define DIO26_PIN PIND2
  1804. #define DIO26_RPORT PIND
  1805. #define DIO26_WPORT PORTD
  1806. #define DIO26_PWM NULL
  1807. #define DIO26_DDR DDRD
  1808. #define DIO27_PIN PIND3
  1809. #define DIO27_RPORT PIND
  1810. #define DIO27_WPORT PORTD
  1811. #define DIO27_PWM NULL
  1812. #define DIO27_DDR DDRD
  1813. #define DIO28_PIN PIND4
  1814. #define DIO28_RPORT PIND
  1815. #define DIO28_WPORT PORTD
  1816. #define DIO28_PWM NULL
  1817. #define DIO28_DDR DDRD
  1818. #define DIO29_PIN PIND5
  1819. #define DIO29_RPORT PIND
  1820. #define DIO29_WPORT PORTD
  1821. #define DIO29_PWM NULL
  1822. #define DIO29_DDR DDRD
  1823. #define DIO30_PIN PIND6
  1824. #define DIO30_RPORT PIND
  1825. #define DIO30_WPORT PORTD
  1826. #define DIO30_PWM NULL
  1827. #define DIO30_DDR DDRD
  1828. #define DIO31_PIN PIND7
  1829. #define DIO31_RPORT PIND
  1830. #define DIO31_WPORT PORTD
  1831. #define DIO31_PWM NULL
  1832. #define DIO31_DDR DDRD
  1833. #define DIO32_PIN PINE0
  1834. #define DIO32_RPORT PINE
  1835. #define DIO32_WPORT PORTE
  1836. #define DIO32_PWM NULL
  1837. #define DIO32_DDR DDRE
  1838. #define DIO33_PIN PINE1
  1839. #define DIO33_RPORT PINE
  1840. #define DIO33_WPORT PORTE
  1841. #define DIO33_PWM NULL
  1842. #define DIO33_DDR DDRE
  1843. #define DIO34_PIN PINE2
  1844. #define DIO34_RPORT PINE
  1845. #define DIO34_WPORT PORTE
  1846. #define DIO34_PWM NULL
  1847. #define DIO34_DDR DDRE
  1848. #define DIO35_PIN PINE3
  1849. #define DIO35_RPORT PINE
  1850. #define DIO35_WPORT PORTE
  1851. #define DIO35_PWM NULL
  1852. #define DIO35_DDR DDRE
  1853. #define DIO36_PIN PINE4
  1854. #define DIO36_RPORT PINE
  1855. #define DIO36_WPORT PORTE
  1856. #define DIO36_PWM NULL
  1857. #define DIO36_DDR DDRE
  1858. #define DIO37_PIN PINE5
  1859. #define DIO37_RPORT PINE
  1860. #define DIO37_WPORT PORTE
  1861. #define DIO37_PWM NULL
  1862. #define DIO37_DDR DDRE
  1863. #define DIO38_PIN PINE6
  1864. #define DIO38_RPORT PINE
  1865. #define DIO38_WPORT PORTE
  1866. #define DIO38_PWM NULL
  1867. #define DIO38_DDR DDRE
  1868. #define DIO39_PIN PINE7
  1869. #define DIO39_RPORT PINE
  1870. #define DIO39_WPORT PORTE
  1871. #define DIO39_PWM NULL
  1872. #define DIO39_DDR DDRE
  1873. #define AIO0_PIN PINF0
  1874. #define AIO0_RPORT PINF
  1875. #define AIO0_WPORT PORTF
  1876. #define AIO0_PWM NULL
  1877. #define AIO0_DDR DDRF
  1878. #define AIO1_PIN PINF1
  1879. #define AIO1_RPORT PINF
  1880. #define AIO1_WPORT PORTF
  1881. #define AIO1_PWM NULL
  1882. #define AIO1_DDR DDRF
  1883. #define AIO2_PIN PINF2
  1884. #define AIO2_RPORT PINF
  1885. #define AIO2_WPORT PORTF
  1886. #define AIO2_PWM NULL
  1887. #define AIO2_DDR DDRF
  1888. #define AIO3_PIN PINF3
  1889. #define AIO3_RPORT PINF
  1890. #define AIO3_WPORT PORTF
  1891. #define AIO3_PWM NULL
  1892. #define AIO3_DDR DDRF
  1893. #define AIO4_PIN PINF4
  1894. #define AIO4_RPORT PINF
  1895. #define AIO4_WPORT PORTF
  1896. #define AIO4_PWM NULL
  1897. #define AIO4_DDR DDRF
  1898. #define AIO5_PIN PINF5
  1899. #define AIO5_RPORT PINF
  1900. #define AIO5_WPORT PORTF
  1901. #define AIO5_PWM NULL
  1902. #define AIO5_DDR DDRF
  1903. #define AIO6_PIN PINF6
  1904. #define AIO6_RPORT PINF
  1905. #define AIO6_WPORT PORTF
  1906. #define AIO6_PWM NULL
  1907. #define AIO6_DDR DDRF
  1908. #define AIO7_PIN PINF7
  1909. #define AIO7_RPORT PINF
  1910. #define AIO7_WPORT PORTF
  1911. #define AIO7_PWM NULL
  1912. #define AIO7_DDR DDRF
  1913. #define DIO40_PIN PINF0
  1914. #define DIO40_RPORT PINF
  1915. #define DIO40_WPORT PORTF
  1916. #define DIO40_PWM NULL
  1917. #define DIO40_DDR DDRF
  1918. #define DIO41_PIN PINF1
  1919. #define DIO41_RPORT PINF
  1920. #define DIO41_WPORT PORTF
  1921. #define DIO41_PWM NULL
  1922. #define DIO41_DDR DDRF
  1923. #define DIO42_PIN PINF2
  1924. #define DIO42_RPORT PINF
  1925. #define DIO42_WPORT PORTF
  1926. #define DIO42_PWM NULL
  1927. #define DIO42_DDR DDRF
  1928. #define DIO43_PIN PINF3
  1929. #define DIO43_RPORT PINF
  1930. #define DIO43_WPORT PORTF
  1931. #define DIO43_PWM NULL
  1932. #define DIO43_DDR DDRF
  1933. #define DIO44_PIN PINF4
  1934. #define DIO44_RPORT PINF
  1935. #define DIO44_WPORT PORTF
  1936. #define DIO44_PWM NULL
  1937. #define DIO44_DDR DDRF
  1938. #define DIO45_PIN PINF5
  1939. #define DIO45_RPORT PINF
  1940. #define DIO45_WPORT PORTF
  1941. #define DIO45_PWM NULL
  1942. #define DIO45_DDR DDRF
  1943. #define DIO46_PIN PINF6
  1944. #define DIO46_RPORT PINF
  1945. #define DIO46_WPORT PORTF
  1946. #define DIO46_PWM NULL
  1947. #define DIO46_DDR DDRF
  1948. #define DIO47_PIN PINF7
  1949. #define DIO47_RPORT PINF
  1950. #define DIO47_WPORT PORTF
  1951. #define DIO47_PWM NULL
  1952. #define DIO47_DDR DDRF
  1953. #undef PA0
  1954. #define PA0_PIN PINA0
  1955. #define PA0_RPORT PINA
  1956. #define PA0_WPORT PORTA
  1957. #define PA0_PWM NULL
  1958. #define PA0_DDR DDRA
  1959. #undef PA1
  1960. #define PA1_PIN PINA1
  1961. #define PA1_RPORT PINA
  1962. #define PA1_WPORT PORTA
  1963. #define PA1_PWM NULL
  1964. #define PA1_DDR DDRA
  1965. #undef PA2
  1966. #define PA2_PIN PINA2
  1967. #define PA2_RPORT PINA
  1968. #define PA2_WPORT PORTA
  1969. #define PA2_PWM NULL
  1970. #define PA2_DDR DDRA
  1971. #undef PA3
  1972. #define PA3_PIN PINA3
  1973. #define PA3_RPORT PINA
  1974. #define PA3_WPORT PORTA
  1975. #define PA3_PWM NULL
  1976. #define PA3_DDR DDRA
  1977. #undef PA4
  1978. #define PA4_PIN PINA4
  1979. #define PA4_RPORT PINA
  1980. #define PA4_WPORT PORTA
  1981. #define PA4_PWM NULL
  1982. #define PA4_DDR DDRA
  1983. #undef PA5
  1984. #define PA5_PIN PINA5
  1985. #define PA5_RPORT PINA
  1986. #define PA5_WPORT PORTA
  1987. #define PA5_PWM NULL
  1988. #define PA5_DDR DDRA
  1989. #undef PA6
  1990. #define PA6_PIN PINA6
  1991. #define PA6_RPORT PINA
  1992. #define PA6_WPORT PORTA
  1993. #define PA6_PWM NULL
  1994. #define PA6_DDR DDRA
  1995. #undef PA7
  1996. #define PA7_PIN PINA7
  1997. #define PA7_RPORT PINA
  1998. #define PA7_WPORT PORTA
  1999. #define PA7_PWM NULL
  2000. #define PA7_DDR DDRA
  2001. #undef PB0
  2002. #define PB0_PIN PINB0
  2003. #define PB0_RPORT PINB
  2004. #define PB0_WPORT PORTB
  2005. #define PB0_PWM NULL
  2006. #define PB0_DDR DDRB
  2007. #undef PB1
  2008. #define PB1_PIN PINB1
  2009. #define PB1_RPORT PINB
  2010. #define PB1_WPORT PORTB
  2011. #define PB1_PWM NULL
  2012. #define PB1_DDR DDRB
  2013. #undef PB2
  2014. #define PB2_PIN PINB2
  2015. #define PB2_RPORT PINB
  2016. #define PB2_WPORT PORTB
  2017. #define PB2_PWM NULL
  2018. #define PB2_DDR DDRB
  2019. #undef PB3
  2020. #define PB3_PIN PINB3
  2021. #define PB3_RPORT PINB
  2022. #define PB3_WPORT PORTB
  2023. #define PB3_PWM NULL
  2024. #define PB3_DDR DDRB
  2025. #undef PB4
  2026. #define PB4_PIN PINB4
  2027. #define PB4_RPORT PINB
  2028. #define PB4_WPORT PORTB
  2029. #define PB4_PWM NULL
  2030. #define PB4_DDR DDRB
  2031. #undef PB5
  2032. #define PB5_PIN PINB5
  2033. #define PB5_RPORT PINB
  2034. #define PB5_WPORT PORTB
  2035. #define PB5_PWM NULL
  2036. #define PB5_DDR DDRB
  2037. #undef PB6
  2038. #define PB6_PIN PINB6
  2039. #define PB6_RPORT PINB
  2040. #define PB6_WPORT PORTB
  2041. #define PB6_PWM NULL
  2042. #define PB6_DDR DDRB
  2043. #undef PB7
  2044. #define PB7_PIN PINB7
  2045. #define PB7_RPORT PINB
  2046. #define PB7_WPORT PORTB
  2047. #define PB7_PWM NULL
  2048. #define PB7_DDR DDRB
  2049. #undef PC0
  2050. #define PC0_PIN PINC0
  2051. #define PC0_RPORT PINC
  2052. #define PC0_WPORT PORTC
  2053. #define PC0_PWM NULL
  2054. #define PC0_DDR DDRC
  2055. #undef PC1
  2056. #define PC1_PIN PINC1
  2057. #define PC1_RPORT PINC
  2058. #define PC1_WPORT PORTC
  2059. #define PC1_PWM NULL
  2060. #define PC1_DDR DDRC
  2061. #undef PC2
  2062. #define PC2_PIN PINC2
  2063. #define PC2_RPORT PINC
  2064. #define PC2_WPORT PORTC
  2065. #define PC2_PWM NULL
  2066. #define PC2_DDR DDRC
  2067. #undef PC3
  2068. #define PC3_PIN PINC3
  2069. #define PC3_RPORT PINC
  2070. #define PC3_WPORT PORTC
  2071. #define PC3_PWM NULL
  2072. #define PC3_DDR DDRC
  2073. #undef PC4
  2074. #define PC4_PIN PINC4
  2075. #define PC4_RPORT PINC
  2076. #define PC4_WPORT PORTC
  2077. #define PC4_PWM NULL
  2078. #define PC4_DDR DDRC
  2079. #undef PC5
  2080. #define PC5_PIN PINC5
  2081. #define PC5_RPORT PINC
  2082. #define PC5_WPORT PORTC
  2083. #define PC5_PWM NULL
  2084. #define PC5_DDR DDRC
  2085. #undef PC6
  2086. #define PC6_PIN PINC6
  2087. #define PC6_RPORT PINC
  2088. #define PC6_WPORT PORTC
  2089. #define PC6_PWM NULL
  2090. #define PC6_DDR DDRC
  2091. #undef PC7
  2092. #define PC7_PIN PINC7
  2093. #define PC7_RPORT PINC
  2094. #define PC7_WPORT PORTC
  2095. #define PC7_PWM NULL
  2096. #define PC7_DDR DDRC
  2097. #undef PD0
  2098. #define PD0_PIN PIND0
  2099. #define PD0_RPORT PIND
  2100. #define PD0_WPORT PORTD
  2101. #define PD0_PWM NULL
  2102. #define PD0_DDR DDRD
  2103. #undef PD1
  2104. #define PD1_PIN PIND1
  2105. #define PD1_RPORT PIND
  2106. #define PD1_WPORT PORTD
  2107. #define PD1_PWM NULL
  2108. #define PD1_DDR DDRD
  2109. #undef PD2
  2110. #define PD2_PIN PIND2
  2111. #define PD2_RPORT PIND
  2112. #define PD2_WPORT PORTD
  2113. #define PD2_PWM NULL
  2114. #define PD2_DDR DDRD
  2115. #undef PD3
  2116. #define PD3_PIN PIND3
  2117. #define PD3_RPORT PIND
  2118. #define PD3_WPORT PORTD
  2119. #define PD3_PWM NULL
  2120. #define PD3_DDR DDRD
  2121. #undef PD4
  2122. #define PD4_PIN PIND4
  2123. #define PD4_RPORT PIND
  2124. #define PD4_WPORT PORTD
  2125. #define PD4_PWM NULL
  2126. #define PD4_DDR DDRD
  2127. #undef PD5
  2128. #define PD5_PIN PIND5
  2129. #define PD5_RPORT PIND
  2130. #define PD5_WPORT PORTD
  2131. #define PD5_PWM NULL
  2132. #define PD5_DDR DDRD
  2133. #undef PD6
  2134. #define PD6_PIN PIND6
  2135. #define PD6_RPORT PIND
  2136. #define PD6_WPORT PORTD
  2137. #define PD6_PWM NULL
  2138. #define PD6_DDR DDRD
  2139. #undef PD7
  2140. #define PD7_PIN PIND7
  2141. #define PD7_RPORT PIND
  2142. #define PD7_WPORT PORTD
  2143. #define PD7_PWM NULL
  2144. #define PD7_DDR DDRD
  2145. #undef PE0
  2146. #define PE0_PIN PINE0
  2147. #define PE0_RPORT PINE
  2148. #define PE0_WPORT PORTE
  2149. #define PE0_PWM NULL
  2150. #define PE0_DDR DDRE
  2151. #undef PE1
  2152. #define PE1_PIN PINE1
  2153. #define PE1_RPORT PINE
  2154. #define PE1_WPORT PORTE
  2155. #define PE1_PWM NULL
  2156. #define PE1_DDR DDRE
  2157. #undef PE2
  2158. #define PE2_PIN PINE2
  2159. #define PE2_RPORT PINE
  2160. #define PE2_WPORT PORTE
  2161. #define PE2_PWM NULL
  2162. #define PE2_DDR DDRE
  2163. #undef PE3
  2164. #define PE3_PIN PINE3
  2165. #define PE3_RPORT PINE
  2166. #define PE3_WPORT PORTE
  2167. #define PE3_PWM NULL
  2168. #define PE3_DDR DDRE
  2169. #undef PE4
  2170. #define PE4_PIN PINE4
  2171. #define PE4_RPORT PINE
  2172. #define PE4_WPORT PORTE
  2173. #define PE4_PWM NULL
  2174. #define PE4_DDR DDRE
  2175. #undef PE5
  2176. #define PE5_PIN PINE5
  2177. #define PE5_RPORT PINE
  2178. #define PE5_WPORT PORTE
  2179. #define PE5_PWM NULL
  2180. #define PE5_DDR DDRE
  2181. #undef PE6
  2182. #define PE6_PIN PINE6
  2183. #define PE6_RPORT PINE
  2184. #define PE6_WPORT PORTE
  2185. #define PE6_PWM NULL
  2186. #define PE6_DDR DDRE
  2187. #undef PE7
  2188. #define PE7_PIN PINE7
  2189. #define PE7_RPORT PINE
  2190. #define PE7_WPORT PORTE
  2191. #define PE7_PWM NULL
  2192. #define PE7_DDR DDRE
  2193. #undef PF0
  2194. #define PF0_PIN PINF0
  2195. #define PF0_RPORT PINF
  2196. #define PF0_WPORT PORTF
  2197. #define PF0_PWM NULL
  2198. #define PF0_DDR DDRF
  2199. #undef PF1
  2200. #define PF1_PIN PINF1
  2201. #define PF1_RPORT PINF
  2202. #define PF1_WPORT PORTF
  2203. #define PF1_PWM NULL
  2204. #define PF1_DDR DDRF
  2205. #undef PF2
  2206. #define PF2_PIN PINF2
  2207. #define PF2_RPORT PINF
  2208. #define PF2_WPORT PORTF
  2209. #define PF2_PWM NULL
  2210. #define PF2_DDR DDRF
  2211. #undef PF3
  2212. #define PF3_PIN PINF3
  2213. #define PF3_RPORT PINF
  2214. #define PF3_WPORT PORTF
  2215. #define PF3_PWM NULL
  2216. #define PF3_DDR DDRF
  2217. #undef PF4
  2218. #define PF4_PIN PINF4
  2219. #define PF4_RPORT PINF
  2220. #define PF4_WPORT PORTF
  2221. #define PF4_PWM NULL
  2222. #define PF4_DDR DDRF
  2223. #undef PF5
  2224. #define PF5_PIN PINF5
  2225. #define PF5_RPORT PINF
  2226. #define PF5_WPORT PORTF
  2227. #define PF5_PWM NULL
  2228. #define PF5_DDR DDRF
  2229. #undef PF6
  2230. #define PF6_PIN PINF6
  2231. #define PF6_RPORT PINF
  2232. #define PF6_WPORT PORTF
  2233. #define PF6_PWM NULL
  2234. #define PF6_DDR DDRF
  2235. #undef PF7
  2236. #define PF7_PIN PINF7
  2237. #define PF7_RPORT PINF
  2238. #define PF7_WPORT PORTF
  2239. #define PF7_PWM NULL
  2240. #define PF7_DDR DDRF
  2241. #endif
  2242. #if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__)
  2243. // SPI
  2244. #define SCK DIO9
  2245. #define MISO DIO11
  2246. #define MOSI DIO10
  2247. #define SS DIO8
  2248. // change for your board
  2249. #define DEBUG_LED DIO31 /* led D5 red */
  2250. /*
  2251. pins
  2252. */
  2253. #define DIO0_PIN PIND0
  2254. #define DIO0_RPORT PIND
  2255. #define DIO0_WPORT PORTD
  2256. #define DIO0_PWM NULL
  2257. #define DIO0_DDR DDRD
  2258. #define DIO1_PIN PIND1
  2259. #define DIO1_RPORT PIND
  2260. #define DIO1_WPORT PORTD
  2261. #define DIO1_PWM NULL
  2262. #define DIO1_DDR DDRD
  2263. #define DIO2_PIN PIND2
  2264. #define DIO2_RPORT PIND
  2265. #define DIO2_WPORT PORTD
  2266. #define DIO2_PWM NULL
  2267. #define DIO2_DDR DDRD
  2268. #define DIO3_PIN PIND3
  2269. #define DIO3_RPORT PIND
  2270. #define DIO3_WPORT PORTD
  2271. #define DIO3_PWM NULL
  2272. #define DIO3_DDR DDRD
  2273. #define DIO4_PIN PIND4
  2274. #define DIO4_RPORT PIND
  2275. #define DIO4_WPORT PORTD
  2276. #define DIO4_PWM NULL
  2277. #define DIO4_DDR DDRD
  2278. #define DIO5_PIN PIND5
  2279. #define DIO5_RPORT PIND
  2280. #define DIO5_WPORT PORTD
  2281. #define DIO5_PWM NULL
  2282. #define DIO5_DDR DDRD
  2283. #define DIO6_PIN PIND6
  2284. #define DIO6_RPORT PIND
  2285. #define DIO6_WPORT PORTD
  2286. #define DIO6_PWM NULL
  2287. #define DIO6_DDR DDRD
  2288. #define DIO7_PIN PIND7
  2289. #define DIO7_RPORT PIND
  2290. #define DIO7_WPORT PORTD
  2291. #define DIO7_PWM NULL
  2292. #define DIO7_DDR DDRD
  2293. #define DIO8_PIN PINE0
  2294. #define DIO8_RPORT PINE
  2295. #define DIO8_WPORT PORTE
  2296. #define DIO8_PWM NULL
  2297. #define DIO8_DDR DDRE
  2298. #define DIO9_PIN PINE1
  2299. #define DIO9_RPORT PINE
  2300. #define DIO9_WPORT PORTE
  2301. #define DIO9_PWM NULL
  2302. #define DIO9_DDR DDRE
  2303. #define DIO10_PIN PINC0
  2304. #define DIO10_RPORT PINC
  2305. #define DIO10_WPORT PORTC
  2306. #define DIO10_PWM NULL
  2307. #define DIO10_DDR DDRC
  2308. #define DIO11_PIN PINC1
  2309. #define DIO11_RPORT PINC
  2310. #define DIO11_WPORT PORTC
  2311. #define DIO11_PWM NULL
  2312. #define DIO11_DDR DDRC
  2313. #define DIO12_PIN PINC2
  2314. #define DIO12_RPORT PINC
  2315. #define DIO12_WPORT PORTC
  2316. #define DIO12_PWM NULL
  2317. #define DIO12_DDR DDRC
  2318. #define DIO13_PIN PINC3
  2319. #define DIO13_RPORT PINC
  2320. #define DIO13_WPORT PORTC
  2321. #define DIO13_PWM NULL
  2322. #define DIO13_DDR DDRC
  2323. #define DIO14_PIN PINC4
  2324. #define DIO14_RPORT PINC
  2325. #define DIO14_WPORT PORTC
  2326. #define DIO14_PWM NULL
  2327. #define DIO14_DDR DDRC
  2328. #define DIO15_PIN PINC5
  2329. #define DIO15_RPORT PINC
  2330. #define DIO15_WPORT PORTC
  2331. #define DIO15_PWM NULL
  2332. #define DIO15_DDR DDRC
  2333. #define DIO16_PIN PINC6
  2334. #define DIO16_RPORT PINC
  2335. #define DIO16_WPORT PORTC
  2336. #define DIO16_PWM NULL
  2337. #define DIO16_DDR DDRC
  2338. #define DIO17_PIN PINC7
  2339. #define DIO17_RPORT PINC
  2340. #define DIO17_WPORT PORTC
  2341. #define DIO17_PWM NULL
  2342. #define DIO17_DDR DDRC
  2343. #define DIO18_PIN PINE6
  2344. #define DIO18_RPORT PINE
  2345. #define DIO18_WPORT PORTE
  2346. #define DIO18_PWM NULL
  2347. #define DIO18_DDR DDRE
  2348. #define DIO19_PIN PINE7
  2349. #define DIO19_RPORT PINE
  2350. #define DIO19_WPORT PORTE
  2351. #define DIO19_PWM NULL
  2352. #define DIO19_DDR DDRE
  2353. #define DIO20_PIN PINB0
  2354. #define DIO20_RPORT PINB
  2355. #define DIO20_WPORT PORTB
  2356. #define DIO20_PWM NULL
  2357. #define DIO20_DDR DDRB
  2358. #define DIO21_PIN PINB1
  2359. #define DIO21_RPORT PINB
  2360. #define DIO21_WPORT PORTB
  2361. #define DIO21_PWM NULL
  2362. #define DIO21_DDR DDRB
  2363. #define DIO22_PIN PINB2
  2364. #define DIO22_RPORT PINB
  2365. #define DIO22_WPORT PORTB
  2366. #define DIO22_PWM NULL
  2367. #define DIO22_DDR DDRB
  2368. #define DIO23_PIN PINB3
  2369. #define DIO23_RPORT PINB
  2370. #define DIO23_WPORT PORTB
  2371. #define DIO23_PWM NULL
  2372. #define DIO23_DDR DDRB
  2373. #define DIO24_PIN PINB4
  2374. #define DIO24_RPORT PINB
  2375. #define DIO24_WPORT PORTB
  2376. #define DIO24_PWM NULL
  2377. #define DIO24_DDR DDRB
  2378. #define DIO25_PIN PINB5
  2379. #define DIO25_RPORT PINB
  2380. #define DIO25_WPORT PORTB
  2381. #define DIO25_PWM NULL
  2382. #define DIO25_DDR DDRB
  2383. #define DIO26_PIN PINB6
  2384. #define DIO26_RPORT PINB
  2385. #define DIO26_WPORT PORTB
  2386. #define DIO26_PWM NULL
  2387. #define DIO26_DDR DDRB
  2388. #define DIO27_PIN PINB7
  2389. #define DIO27_RPORT PINB
  2390. #define DIO27_WPORT PORTB
  2391. #define DIO27_PWM NULL
  2392. #define DIO27_DDR DDRB
  2393. #define DIO28_PIN PINA0
  2394. #define DIO28_RPORT PINA
  2395. #define DIO28_WPORT PORTA
  2396. #define DIO28_PWM NULL
  2397. #define DIO28_DDR DDRA
  2398. #define DIO29_PIN PINA1
  2399. #define DIO29_RPORT PINA
  2400. #define DIO29_WPORT PORTA
  2401. #define DIO29_PWM NULL
  2402. #define DIO29_DDR DDRA
  2403. #define DIO30_PIN PINA2
  2404. #define DIO30_RPORT PINA
  2405. #define DIO30_WPORT PORTA
  2406. #define DIO30_PWM NULL
  2407. #define DIO30_DDR DDRA
  2408. #define DIO31_PIN PINA3
  2409. #define DIO31_RPORT PINA
  2410. #define DIO31_WPORT PORTA
  2411. #define DIO31_PWM NULL
  2412. #define DIO31_DDR DDRA
  2413. #define DIO32_PIN PINA4
  2414. #define DIO32_RPORT PINA
  2415. #define DIO32_WPORT PORTA
  2416. #define DIO32_PWM NULL
  2417. #define DIO32_DDR DDRA
  2418. #define DIO33_PIN PINA5
  2419. #define DIO33_RPORT PINA
  2420. #define DIO33_WPORT PORTA
  2421. #define DIO33_PWM NULL
  2422. #define DIO33_DDR DDRA
  2423. #define DIO34_PIN PINA6
  2424. #define DIO34_RPORT PINA
  2425. #define DIO34_WPORT PORTA
  2426. #define DIO34_PWM NULL
  2427. #define DIO34_DDR DDRA
  2428. #define DIO35_PIN PINA7
  2429. #define DIO35_RPORT PINA
  2430. #define DIO35_WPORT PORTA
  2431. #define DIO35_PWM NULL
  2432. #define DIO35_DDR DDRA
  2433. #define DIO36_PIN PINE4
  2434. #define DIO36_RPORT PINE
  2435. #define DIO36_WPORT PORTE
  2436. #define DIO36_PWM NULL
  2437. #define DIO36_DDR DDRE
  2438. #define DIO37_PIN PINE5
  2439. #define DIO37_RPORT PINE
  2440. #define DIO37_WPORT PORTE
  2441. #define DIO37_PWM NULL
  2442. #define DIO37_DDR DDRE
  2443. #define DIO38_PIN PINF0
  2444. #define DIO38_RPORT PINF
  2445. #define DIO38_WPORT PORTF
  2446. #define DIO38_PWM NULL
  2447. #define DIO38_DDR DDRF
  2448. #define DIO39_PIN PINF1
  2449. #define DIO39_RPORT PINF
  2450. #define DIO39_WPORT PORTF
  2451. #define DIO39_PWM NULL
  2452. #define DIO39_DDR DDRF
  2453. #define DIO40_PIN PINF2
  2454. #define DIO40_RPORT PINF
  2455. #define DIO40_WPORT PORTF
  2456. #define DIO40_PWM NULL
  2457. #define DIO40_DDR DDRF
  2458. #define DIO41_PIN PINF3
  2459. #define DIO41_RPORT PINF
  2460. #define DIO41_WPORT PORTF
  2461. #define DIO41_PWM NULL
  2462. #define DIO41_DDR DDRF
  2463. #define DIO42_PIN PINF4
  2464. #define DIO42_RPORT PINF
  2465. #define DIO42_WPORT PORTF
  2466. #define DIO42_PWM NULL
  2467. #define DIO42_DDR DDRF
  2468. #define DIO43_PIN PINF5
  2469. #define DIO43_RPORT PINF
  2470. #define DIO43_WPORT PORTF
  2471. #define DIO43_PWM NULL
  2472. #define DIO43_DDR DDRF
  2473. #define DIO44_PIN PINF6
  2474. #define DIO44_RPORT PINF
  2475. #define DIO44_WPORT PORTF
  2476. #define DIO44_PWM NULL
  2477. #define DIO44_DDR DDRF
  2478. #define DIO45_PIN PINF7
  2479. #define DIO45_RPORT PINF
  2480. #define DIO45_WPORT PORTF
  2481. #define DIO45_PWM NULL
  2482. #define DIO45_DDR DDRF
  2483. #define AIO0_PIN PINF0
  2484. #define AIO0_RPORT PINF
  2485. #define AIO0_WPORT PORTF
  2486. #define AIO0_PWM NULL
  2487. #define AIO0_DDR DDRF
  2488. #define AIO1_PIN PINF1
  2489. #define AIO1_RPORT PINF
  2490. #define AIO1_WPORT PORTF
  2491. #define AIO1_PWM NULL
  2492. #define AIO1_DDR DDRF
  2493. #define AIO2_PIN PINF2
  2494. #define AIO2_RPORT PINF
  2495. #define AIO2_WPORT PORTF
  2496. #define AIO2_PWM NULL
  2497. #define AIO2_DDR DDRF
  2498. #define AIO3_PIN PINF3
  2499. #define AIO3_RPORT PINF
  2500. #define AIO3_WPORT PORTF
  2501. #define AIO3_PWM NULL
  2502. #define AIO3_DDR DDRF
  2503. #define AIO4_PIN PINF4
  2504. #define AIO4_RPORT PINF
  2505. #define AIO4_WPORT PORTF
  2506. #define AIO4_PWM NULL
  2507. #define AIO4_DDR DDRF
  2508. #define AIO5_PIN PINF5
  2509. #define AIO5_RPORT PINF
  2510. #define AIO5_WPORT PORTF
  2511. #define AIO5_PWM NULL
  2512. #define AIO5_DDR DDRF
  2513. #define AIO6_PIN PINF6
  2514. #define AIO6_RPORT PINF
  2515. #define AIO6_WPORT PORTF
  2516. #define AIO6_PWM NULL
  2517. #define AIO6_DDR DDRF
  2518. #define AIO7_PIN PINF7
  2519. #define AIO7_RPORT PINF
  2520. #define AIO7_WPORT PORTF
  2521. #define AIO7_PWM NULL
  2522. #define AIO7_DDR DDRF
  2523. //-- Begin not supported by Teensyduino
  2524. //-- don't use Arduino functions on these pins pinMode/digitalWrite/etc
  2525. #define DIO46_PIN PINE2
  2526. #define DIO46_RPORT PINE
  2527. #define DIO46_WPORT PORTE
  2528. #define DIO46_PWM NULL
  2529. #define DIO46_DDR DDRE
  2530. #define DIO47_PIN PINE3
  2531. #define DIO47_RPORT PINE
  2532. #define DIO47_WPORT PORTE
  2533. #define DIO47_PWM NULL
  2534. #define DIO47_DDR DDRE
  2535. //-- end not supported by Teensyduino
  2536. #undef PA0
  2537. #define PA0_PIN PINA0
  2538. #define PA0_RPORT PINA
  2539. #define PA0_WPORT PORTA
  2540. #define PA0_PWM NULL
  2541. #define PA0_DDR DDRA
  2542. #undef PA1
  2543. #define PA1_PIN PINA1
  2544. #define PA1_RPORT PINA
  2545. #define PA1_WPORT PORTA
  2546. #define PA1_PWM NULL
  2547. #define PA1_DDR DDRA
  2548. #undef PA2
  2549. #define PA2_PIN PINA2
  2550. #define PA2_RPORT PINA
  2551. #define PA2_WPORT PORTA
  2552. #define PA2_PWM NULL
  2553. #define PA2_DDR DDRA
  2554. #undef PA3
  2555. #define PA3_PIN PINA3
  2556. #define PA3_RPORT PINA
  2557. #define PA3_WPORT PORTA
  2558. #define PA3_PWM NULL
  2559. #define PA3_DDR DDRA
  2560. #undef PA4
  2561. #define PA4_PIN PINA4
  2562. #define PA4_RPORT PINA
  2563. #define PA4_WPORT PORTA
  2564. #define PA4_PWM NULL
  2565. #define PA4_DDR DDRA
  2566. #undef PA5
  2567. #define PA5_PIN PINA5
  2568. #define PA5_RPORT PINA
  2569. #define PA5_WPORT PORTA
  2570. #define PA5_PWM NULL
  2571. #define PA5_DDR DDRA
  2572. #undef PA6
  2573. #define PA6_PIN PINA6
  2574. #define PA6_RPORT PINA
  2575. #define PA6_WPORT PORTA
  2576. #define PA6_PWM NULL
  2577. #define PA6_DDR DDRA
  2578. #undef PA7
  2579. #define PA7_PIN PINA7
  2580. #define PA7_RPORT PINA
  2581. #define PA7_WPORT PORTA
  2582. #define PA7_PWM NULL
  2583. #define PA7_DDR DDRA
  2584. #undef PB0
  2585. #define PB0_PIN PINB0
  2586. #define PB0_RPORT PINB
  2587. #define PB0_WPORT PORTB
  2588. #define PB0_PWM NULL
  2589. #define PB0_DDR DDRB
  2590. #undef PB1
  2591. #define PB1_PIN PINB1
  2592. #define PB1_RPORT PINB
  2593. #define PB1_WPORT PORTB
  2594. #define PB1_PWM NULL
  2595. #define PB1_DDR DDRB
  2596. #undef PB2
  2597. #define PB2_PIN PINB2
  2598. #define PB2_RPORT PINB
  2599. #define PB2_WPORT PORTB
  2600. #define PB2_PWM NULL
  2601. #define PB2_DDR DDRB
  2602. #undef PB3
  2603. #define PB3_PIN PINB3
  2604. #define PB3_RPORT PINB
  2605. #define PB3_WPORT PORTB
  2606. #define PB3_PWM NULL
  2607. #define PB3_DDR DDRB
  2608. #undef PB4
  2609. #define PB4_PIN PINB4
  2610. #define PB4_RPORT PINB
  2611. #define PB4_WPORT PORTB
  2612. #define PB4_PWM NULL
  2613. #define PB4_DDR DDRB
  2614. #undef PB5
  2615. #define PB5_PIN PINB5
  2616. #define PB5_RPORT PINB
  2617. #define PB5_WPORT PORTB
  2618. #define PB5_PWM NULL
  2619. #define PB5_DDR DDRB
  2620. #undef PB6
  2621. #define PB6_PIN PINB6
  2622. #define PB6_RPORT PINB
  2623. #define PB6_WPORT PORTB
  2624. #define PB6_PWM NULL
  2625. #define PB6_DDR DDRB
  2626. #undef PB7
  2627. #define PB7_PIN PINB7
  2628. #define PB7_RPORT PINB
  2629. #define PB7_WPORT PORTB
  2630. #define PB7_PWM NULL
  2631. #define PB7_DDR DDRB
  2632. #undef PC0
  2633. #define PC0_PIN PINC0
  2634. #define PC0_RPORT PINC
  2635. #define PC0_WPORT PORTC
  2636. #define PC0_PWM NULL
  2637. #define PC0_DDR DDRC
  2638. #undef PC1
  2639. #define PC1_PIN PINC1
  2640. #define PC1_RPORT PINC
  2641. #define PC1_WPORT PORTC
  2642. #define PC1_PWM NULL
  2643. #define PC1_DDR DDRC
  2644. #undef PC2
  2645. #define PC2_PIN PINC2
  2646. #define PC2_RPORT PINC
  2647. #define PC2_WPORT PORTC
  2648. #define PC2_PWM NULL
  2649. #define PC2_DDR DDRC
  2650. #undef PC3
  2651. #define PC3_PIN PINC3
  2652. #define PC3_RPORT PINC
  2653. #define PC3_WPORT PORTC
  2654. #define PC3_PWM NULL
  2655. #define PC3_DDR DDRC
  2656. #undef PC4
  2657. #define PC4_PIN PINC4
  2658. #define PC4_RPORT PINC
  2659. #define PC4_WPORT PORTC
  2660. #define PC4_PWM NULL
  2661. #define PC4_DDR DDRC
  2662. #undef PC5
  2663. #define PC5_PIN PINC5
  2664. #define PC5_RPORT PINC
  2665. #define PC5_WPORT PORTC
  2666. #define PC5_PWM NULL
  2667. #define PC5_DDR DDRC
  2668. #undef PC6
  2669. #define PC6_PIN PINC6
  2670. #define PC6_RPORT PINC
  2671. #define PC6_WPORT PORTC
  2672. #define PC6_PWM NULL
  2673. #define PC6_DDR DDRC
  2674. #undef PC7
  2675. #define PC7_PIN PINC7
  2676. #define PC7_RPORT PINC
  2677. #define PC7_WPORT PORTC
  2678. #define PC7_PWM NULL
  2679. #define PC7_DDR DDRC
  2680. #undef PD0
  2681. #define PD0_PIN PIND0
  2682. #define PD0_RPORT PIND
  2683. #define PD0_WPORT PORTD
  2684. #define PD0_PWM NULL
  2685. #define PD0_DDR DDRD
  2686. #undef PD1
  2687. #define PD1_PIN PIND1
  2688. #define PD1_RPORT PIND
  2689. #define PD1_WPORT PORTD
  2690. #define PD1_PWM NULL
  2691. #define PD1_DDR DDRD
  2692. #undef PD2
  2693. #define PD2_PIN PIND2
  2694. #define PD2_RPORT PIND
  2695. #define PD2_WPORT PORTD
  2696. #define PD2_PWM NULL
  2697. #define PD2_DDR DDRD
  2698. #undef PD3
  2699. #define PD3_PIN PIND3
  2700. #define PD3_RPORT PIND
  2701. #define PD3_WPORT PORTD
  2702. #define PD3_PWM NULL
  2703. #define PD3_DDR DDRD
  2704. #undef PD4
  2705. #define PD4_PIN PIND4
  2706. #define PD4_RPORT PIND
  2707. #define PD4_WPORT PORTD
  2708. #define PD4_PWM NULL
  2709. #define PD4_DDR DDRD
  2710. #undef PD5
  2711. #define PD5_PIN PIND5
  2712. #define PD5_RPORT PIND
  2713. #define PD5_WPORT PORTD
  2714. #define PD5_PWM NULL
  2715. #define PD5_DDR DDRD
  2716. #undef PD6
  2717. #define PD6_PIN PIND6
  2718. #define PD6_RPORT PIND
  2719. #define PD6_WPORT PORTD
  2720. #define PD6_PWM NULL
  2721. #define PD6_DDR DDRD
  2722. #undef PD7
  2723. #define PD7_PIN PIND7
  2724. #define PD7_RPORT PIND
  2725. #define PD7_WPORT PORTD
  2726. #define PD7_PWM NULL
  2727. #define PD7_DDR DDRD
  2728. #undef PE0
  2729. #define PE0_PIN PINE0
  2730. #define PE0_RPORT PINE
  2731. #define PE0_WPORT PORTE
  2732. #define PE0_PWM NULL
  2733. #define PE0_DDR DDRE
  2734. #undef PE1
  2735. #define PE1_PIN PINE1
  2736. #define PE1_RPORT PINE
  2737. #define PE1_WPORT PORTE
  2738. #define PE1_PWM NULL
  2739. #define PE1_DDR DDRE
  2740. #undef PE2
  2741. #define PE2_PIN PINE2
  2742. #define PE2_RPORT PINE
  2743. #define PE2_WPORT PORTE
  2744. #define PE2_PWM NULL
  2745. #define PE2_DDR DDRE
  2746. #undef PE3
  2747. #define PE3_PIN PINE3
  2748. #define PE3_RPORT PINE
  2749. #define PE3_WPORT PORTE
  2750. #define PE3_PWM NULL
  2751. #define PE3_DDR DDRE
  2752. #undef PE4
  2753. #define PE4_PIN PINE4
  2754. #define PE4_RPORT PINE
  2755. #define PE4_WPORT PORTE
  2756. #define PE4_PWM NULL
  2757. #define PE4_DDR DDRE
  2758. #undef PE5
  2759. #define PE5_PIN PINE5
  2760. #define PE5_RPORT PINE
  2761. #define PE5_WPORT PORTE
  2762. #define PE5_PWM NULL
  2763. #define PE5_DDR DDRE
  2764. #undef PE6
  2765. #define PE6_PIN PINE6
  2766. #define PE6_RPORT PINE
  2767. #define PE6_WPORT PORTE
  2768. #define PE6_PWM NULL
  2769. #define PE6_DDR DDRE
  2770. #undef PE7
  2771. #define PE7_PIN PINE7
  2772. #define PE7_RPORT PINE
  2773. #define PE7_WPORT PORTE
  2774. #define PE7_PWM NULL
  2775. #define PE7_DDR DDRE
  2776. #undef PF0
  2777. #define PF0_PIN PINF0
  2778. #define PF0_RPORT PINF
  2779. #define PF0_WPORT PORTF
  2780. #define PF0_PWM NULL
  2781. #define PF0_DDR DDRF
  2782. #undef PF1
  2783. #define PF1_PIN PINF1
  2784. #define PF1_RPORT PINF
  2785. #define PF1_WPORT PORTF
  2786. #define PF1_PWM NULL
  2787. #define PF1_DDR DDRF
  2788. #undef PF2
  2789. #define PF2_PIN PINF2
  2790. #define PF2_RPORT PINF
  2791. #define PF2_WPORT PORTF
  2792. #define PF2_PWM NULL
  2793. #define PF2_DDR DDRF
  2794. #undef PF3
  2795. #define PF3_PIN PINF3
  2796. #define PF3_RPORT PINF
  2797. #define PF3_WPORT PORTF
  2798. #define PF3_PWM NULL
  2799. #define PF3_DDR DDRF
  2800. #undef PF4
  2801. #define PF4_PIN PINF4
  2802. #define PF4_RPORT PINF
  2803. #define PF4_WPORT PORTF
  2804. #define PF4_PWM NULL
  2805. #define PF4_DDR DDRF
  2806. #undef PF5
  2807. #define PF5_PIN PINF5
  2808. #define PF5_RPORT PINF
  2809. #define PF5_WPORT PORTF
  2810. #define PF5_PWM NULL
  2811. #define PF5_DDR DDRF
  2812. #undef PF6
  2813. #define PF6_PIN PINF6
  2814. #define PF6_RPORT PINF
  2815. #define PF6_WPORT PORTF
  2816. #define PF6_PWM NULL
  2817. #define PF6_DDR DDRF
  2818. #undef PF7
  2819. #define PF7_PIN PINF7
  2820. #define PF7_RPORT PINF
  2821. #define PF7_WPORT PORTF
  2822. #define PF7_PWM NULL
  2823. #define PF7_DDR DDRF
  2824. #endif
  2825. #ifndef DIO0_PIN
  2826. #error pins for this chip not defined in arduino.h! If you write an appropriate pin definition and have this firmware work on your chip, please submit a pull request
  2827. #endif
  2828. #endif /* _ARDUINO_H */