My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

fastio.h 96KB

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