fastio.h 84 KB

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