My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fastio.h 83KB

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