fastio.h 84 KB

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