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

fastio.h 69KB

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