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 67KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276
  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. #undef PA0
  1152. #define PA0_PIN PINA0
  1153. #define PA0_RPORT PINA
  1154. #define PA0_WPORT PORTA
  1155. #define PA0_DDR DDRA
  1156. #define PA0_PWM NULL
  1157. #undef PA1
  1158. #define PA1_PIN PINA1
  1159. #define PA1_RPORT PINA
  1160. #define PA1_WPORT PORTA
  1161. #define PA1_DDR DDRA
  1162. #define PA1_PWM NULL
  1163. #undef PA2
  1164. #define PA2_PIN PINA2
  1165. #define PA2_RPORT PINA
  1166. #define PA2_WPORT PORTA
  1167. #define PA2_DDR DDRA
  1168. #define PA2_PWM NULL
  1169. #undef PA3
  1170. #define PA3_PIN PINA3
  1171. #define PA3_RPORT PINA
  1172. #define PA3_WPORT PORTA
  1173. #define PA3_DDR DDRA
  1174. #define PA3_PWM NULL
  1175. #undef PA4
  1176. #define PA4_PIN PINA4
  1177. #define PA4_RPORT PINA
  1178. #define PA4_WPORT PORTA
  1179. #define PA4_DDR DDRA
  1180. #define PA4_PWM NULL
  1181. #undef PA5
  1182. #define PA5_PIN PINA5
  1183. #define PA5_RPORT PINA
  1184. #define PA5_WPORT PORTA
  1185. #define PA5_DDR DDRA
  1186. #define PA5_PWM NULL
  1187. #undef PA6
  1188. #define PA6_PIN PINA6
  1189. #define PA6_RPORT PINA
  1190. #define PA6_WPORT PORTA
  1191. #define PA6_DDR DDRA
  1192. #define PA6_PWM NULL
  1193. #undef PA7
  1194. #define PA7_PIN PINA7
  1195. #define PA7_RPORT PINA
  1196. #define PA7_WPORT PORTA
  1197. #define PA7_DDR DDRA
  1198. #define PA7_PWM NULL
  1199. #undef PB0
  1200. #define PB0_PIN PINB0
  1201. #define PB0_RPORT PINB
  1202. #define PB0_WPORT PORTB
  1203. #define PB0_DDR DDRB
  1204. #define PB0_PWM NULL
  1205. #undef PB1
  1206. #define PB1_PIN PINB1
  1207. #define PB1_RPORT PINB
  1208. #define PB1_WPORT PORTB
  1209. #define PB1_DDR DDRB
  1210. #define PB1_PWM NULL
  1211. #undef PB2
  1212. #define PB2_PIN PINB2
  1213. #define PB2_RPORT PINB
  1214. #define PB2_WPORT PORTB
  1215. #define PB2_DDR DDRB
  1216. #define PB2_PWM NULL
  1217. #undef PB3
  1218. #define PB3_PIN PINB3
  1219. #define PB3_RPORT PINB
  1220. #define PB3_WPORT PORTB
  1221. #define PB3_DDR DDRB
  1222. #define PB3_PWM NULL
  1223. #undef PB4
  1224. #define PB4_PIN PINB4
  1225. #define PB4_RPORT PINB
  1226. #define PB4_WPORT PORTB
  1227. #define PB4_DDR DDRB
  1228. #define PB4_PWM &OCR2A
  1229. #undef PB5
  1230. #define PB5_PIN PINB5
  1231. #define PB5_RPORT PINB
  1232. #define PB5_WPORT PORTB
  1233. #define PB5_DDR DDRB
  1234. #define PB5_PWM NULL
  1235. #undef PB6
  1236. #define PB6_PIN PINB6
  1237. #define PB6_RPORT PINB
  1238. #define PB6_WPORT PORTB
  1239. #define PB6_DDR DDRB
  1240. #define PB6_PWM NULL
  1241. #undef PB7
  1242. #define PB7_PIN PINB7
  1243. #define PB7_RPORT PINB
  1244. #define PB7_WPORT PORTB
  1245. #define PB7_DDR DDRB
  1246. #define PB7_PWM &OCR0A
  1247. #undef PC0
  1248. #define PC0_PIN PINC0
  1249. #define PC0_RPORT PINC
  1250. #define PC0_WPORT PORTC
  1251. #define PC0_DDR DDRC
  1252. #define PC0_PWM NULL
  1253. #undef PC1
  1254. #define PC1_PIN PINC1
  1255. #define PC1_RPORT PINC
  1256. #define PC1_WPORT PORTC
  1257. #define PC1_DDR DDRC
  1258. #define PC1_PWM NULL
  1259. #undef PC2
  1260. #define PC2_PIN PINC2
  1261. #define PC2_RPORT PINC
  1262. #define PC2_WPORT PORTC
  1263. #define PC2_DDR DDRC
  1264. #define PC2_PWM NULL
  1265. #undef PC3
  1266. #define PC3_PIN PINC3
  1267. #define PC3_RPORT PINC
  1268. #define PC3_WPORT PORTC
  1269. #define PC3_DDR DDRC
  1270. #define PC3_PWM NULL
  1271. #undef PC4
  1272. #define PC4_PIN PINC4
  1273. #define PC4_RPORT PINC
  1274. #define PC4_WPORT PORTC
  1275. #define PC4_DDR DDRC
  1276. #define PC4_PWM NULL
  1277. #undef PC5
  1278. #define PC5_PIN PINC5
  1279. #define PC5_RPORT PINC
  1280. #define PC5_WPORT PORTC
  1281. #define PC5_DDR DDRC
  1282. #define PC5_PWM NULL
  1283. #undef PC6
  1284. #define PC6_PIN PINC6
  1285. #define PC6_RPORT PINC
  1286. #define PC6_WPORT PORTC
  1287. #define PC6_DDR DDRC
  1288. #define PC6_PWM NULL
  1289. #undef PC7
  1290. #define PC7_PIN PINC7
  1291. #define PC7_RPORT PINC
  1292. #define PC7_WPORT PORTC
  1293. #define PC7_DDR DDRC
  1294. #define PC7_PWM NULL
  1295. #undef PD0
  1296. #define PD0_PIN PIND0
  1297. #define PD0_RPORT PIND
  1298. #define PD0_WPORT PORTD
  1299. #define PD0_DDR DDRD
  1300. #define PD0_PWM NULL
  1301. #undef PD1
  1302. #define PD1_PIN PIND1
  1303. #define PD1_RPORT PIND
  1304. #define PD1_WPORT PORTD
  1305. #define PD1_DDR DDRD
  1306. #define PD1_PWM NULL
  1307. #undef PD2
  1308. #define PD2_PIN PIND2
  1309. #define PD2_RPORT PIND
  1310. #define PD2_WPORT PORTD
  1311. #define PD2_DDR DDRD
  1312. #define PD2_PWM NULL
  1313. #undef PD3
  1314. #define PD3_PIN PIND3
  1315. #define PD3_RPORT PIND
  1316. #define PD3_WPORT PORTD
  1317. #define PD3_DDR DDRD
  1318. #define PD3_PWM NULL
  1319. #undef PD4
  1320. #define PD4_PIN PIND4
  1321. #define PD4_RPORT PIND
  1322. #define PD4_WPORT PORTD
  1323. #define PD4_DDR DDRD
  1324. #define PD4_PWM NULL
  1325. #undef PD5
  1326. #define PD5_PIN PIND5
  1327. #define PD5_RPORT PIND
  1328. #define PD5_WPORT PORTD
  1329. #define PD5_DDR DDRD
  1330. #define PD5_PWM NULL
  1331. #undef PD6
  1332. #define PD6_PIN PIND6
  1333. #define PD6_RPORT PIND
  1334. #define PD6_WPORT PORTD
  1335. #define PD6_DDR DDRD
  1336. #define PD6_PWM NULL
  1337. #undef PD7
  1338. #define PD7_PIN PIND7
  1339. #define PD7_RPORT PIND
  1340. #define PD7_WPORT PORTD
  1341. #define PD7_DDR DDRD
  1342. #define PD7_PWM NULL
  1343. #undef PE0
  1344. #define PE0_PIN PINE0
  1345. #define PE0_RPORT PINE
  1346. #define PE0_WPORT PORTE
  1347. #define PE0_DDR DDRE
  1348. #define PE0_PWM NULL
  1349. #undef PE1
  1350. #define PE1_PIN PINE1
  1351. #define PE1_RPORT PINE
  1352. #define PE1_WPORT PORTE
  1353. #define PE1_DDR DDRE
  1354. #define PE1_PWM NULL
  1355. #undef PE2
  1356. #define PE2_PIN PINE2
  1357. #define PE2_RPORT PINE
  1358. #define PE2_WPORT PORTE
  1359. #define PE2_DDR DDRE
  1360. #define PE2_PWM NULL
  1361. #undef PE3
  1362. #define PE3_PIN PINE3
  1363. #define PE3_RPORT PINE
  1364. #define PE3_WPORT PORTE
  1365. #define PE3_DDR DDRE
  1366. #define PE3_PWM &OCR3AL
  1367. #undef PE4
  1368. #define PE4_PIN PINE4
  1369. #define PE4_RPORT PINE
  1370. #define PE4_WPORT PORTE
  1371. #define PE4_DDR DDRE
  1372. #define PE4_PWM &OCR3BL
  1373. #undef PE5
  1374. #define PE5_PIN PINE5
  1375. #define PE5_RPORT PINE
  1376. #define PE5_WPORT PORTE
  1377. #define PE5_DDR DDRE
  1378. #define PE5_PWM &OCR3CL
  1379. #undef PE6
  1380. #define PE6_PIN PINE6
  1381. #define PE6_RPORT PINE
  1382. #define PE6_WPORT PORTE
  1383. #define PE6_DDR DDRE
  1384. #define PE6_PWM NULL
  1385. #undef PE7
  1386. #define PE7_PIN PINE7
  1387. #define PE7_RPORT PINE
  1388. #define PE7_WPORT PORTE
  1389. #define PE7_DDR DDRE
  1390. #define PE7_PWM NULL
  1391. #undef PF0
  1392. #define PF0_PIN PINF0
  1393. #define PF0_RPORT PINF
  1394. #define PF0_WPORT PORTF
  1395. #define PF0_DDR DDRF
  1396. #define PF0_PWM NULL
  1397. #undef PF1
  1398. #define PF1_PIN PINF1
  1399. #define PF1_RPORT PINF
  1400. #define PF1_WPORT PORTF
  1401. #define PF1_DDR DDRF
  1402. #define PF1_PWM NULL
  1403. #undef PF2
  1404. #define PF2_PIN PINF2
  1405. #define PF2_RPORT PINF
  1406. #define PF2_WPORT PORTF
  1407. #define PF2_DDR DDRF
  1408. #define PF2_PWM NULL
  1409. #undef PF3
  1410. #define PF3_PIN PINF3
  1411. #define PF3_RPORT PINF
  1412. #define PF3_WPORT PORTF
  1413. #define PF3_DDR DDRF
  1414. #define PF3_PWM NULL
  1415. #undef PF4
  1416. #define PF4_PIN PINF4
  1417. #define PF4_RPORT PINF
  1418. #define PF4_WPORT PORTF
  1419. #define PF4_DDR DDRF
  1420. #define PF4_PWM NULL
  1421. #undef PF5
  1422. #define PF5_PIN PINF5
  1423. #define PF5_RPORT PINF
  1424. #define PF5_WPORT PORTF
  1425. #define PF5_DDR DDRF
  1426. #define PF5_PWM NULL
  1427. #undef PF6
  1428. #define PF6_PIN PINF6
  1429. #define PF6_RPORT PINF
  1430. #define PF6_WPORT PORTF
  1431. #define PF6_DDR DDRF
  1432. #define PF6_PWM NULL
  1433. #undef PF7
  1434. #define PF7_PIN PINF7
  1435. #define PF7_RPORT PINF
  1436. #define PF7_WPORT PORTF
  1437. #define PF7_DDR DDRF
  1438. #define PF7_PWM NULL
  1439. #undef PG0
  1440. #define PG0_PIN PING0
  1441. #define PG0_RPORT PING
  1442. #define PG0_WPORT PORTG
  1443. #define PG0_DDR DDRG
  1444. #define PG0_PWM NULL
  1445. #undef PG1
  1446. #define PG1_PIN PING1
  1447. #define PG1_RPORT PING
  1448. #define PG1_WPORT PORTG
  1449. #define PG1_DDR DDRG
  1450. #define PG1_PWM NULL
  1451. #undef PG2
  1452. #define PG2_PIN PING2
  1453. #define PG2_RPORT PING
  1454. #define PG2_WPORT PORTG
  1455. #define PG2_DDR DDRG
  1456. #define PG2_PWM NULL
  1457. #undef PG3
  1458. #define PG3_PIN PING3
  1459. #define PG3_RPORT PING
  1460. #define PG3_WPORT PORTG
  1461. #define PG3_DDR DDRG
  1462. #define PG3_PWM NULL
  1463. #undef PG4
  1464. #define PG4_PIN PING4
  1465. #define PG4_RPORT PING
  1466. #define PG4_WPORT PORTG
  1467. #define PG4_DDR DDRG
  1468. #define PG4_PWM NULL
  1469. #undef PG5
  1470. #define PG5_PIN PING5
  1471. #define PG5_RPORT PING
  1472. #define PG5_WPORT PORTG
  1473. #define PG5_DDR DDRG
  1474. #define PG5_PWM &OCR0B
  1475. #undef PG6
  1476. #define PG6_PIN PING6
  1477. #define PG6_RPORT PING
  1478. #define PG6_WPORT PORTG
  1479. #define PG6_DDR DDRG
  1480. #define PG6_PWM NULL
  1481. #undef PG7
  1482. #define PG7_PIN PING7
  1483. #define PG7_RPORT PING
  1484. #define PG7_WPORT PORTG
  1485. #define PG7_DDR DDRG
  1486. #define PG7_PWM NULL
  1487. #undef PH0
  1488. #define PH0_PIN PINH0
  1489. #define PH0_RPORT PINH
  1490. #define PH0_WPORT PORTH
  1491. #define PH0_DDR DDRH
  1492. #define PH0_PWM NULL
  1493. #undef PH1
  1494. #define PH1_PIN PINH1
  1495. #define PH1_RPORT PINH
  1496. #define PH1_WPORT PORTH
  1497. #define PH1_DDR DDRH
  1498. #define PH1_PWM NULL
  1499. #undef PH2
  1500. #define PH2_PIN PINH2
  1501. #define PH2_RPORT PINH
  1502. #define PH2_WPORT PORTH
  1503. #define PH2_DDR DDRH
  1504. #define PH2_PWM NULL
  1505. #undef PH3
  1506. #define PH3_PIN PINH3
  1507. #define PH3_RPORT PINH
  1508. #define PH3_WPORT PORTH
  1509. #define PH3_DDR DDRH
  1510. #define PH3_PWM &OCR4AL
  1511. #undef PH4
  1512. #define PH4_PIN PINH4
  1513. #define PH4_RPORT PINH
  1514. #define PH4_WPORT PORTH
  1515. #define PH4_DDR DDRH
  1516. #define PH4_PWM &OCR4BL
  1517. #undef PH5
  1518. #define PH5_PIN PINH5
  1519. #define PH5_RPORT PINH
  1520. #define PH5_WPORT PORTH
  1521. #define PH5_DDR DDRH
  1522. #define PH5_PWM &OCR4CL
  1523. #undef PH6
  1524. #define PH6_PIN PINH6
  1525. #define PH6_RPORT PINH
  1526. #define PH6_WPORT PORTH
  1527. #define PH6_DDR DDRH
  1528. #define PH6_PWM &OCR2B
  1529. #undef PH7
  1530. #define PH7_PIN PINH7
  1531. #define PH7_RPORT PINH
  1532. #define PH7_WPORT PORTH
  1533. #define PH7_DDR DDRH
  1534. #define PH7_PWM NULL
  1535. #undef PJ0
  1536. #define PJ0_PIN PINJ0
  1537. #define PJ0_RPORT PINJ
  1538. #define PJ0_WPORT PORTJ
  1539. #define PJ0_DDR DDRJ
  1540. #define PJ0_PWM NULL
  1541. #undef PJ1
  1542. #define PJ1_PIN PINJ1
  1543. #define PJ1_RPORT PINJ
  1544. #define PJ1_WPORT PORTJ
  1545. #define PJ1_DDR DDRJ
  1546. #define PJ1_PWM NULL
  1547. #undef PJ2
  1548. #define PJ2_PIN PINJ2
  1549. #define PJ2_RPORT PINJ
  1550. #define PJ2_WPORT PORTJ
  1551. #define PJ2_DDR DDRJ
  1552. #define PJ2_PWM NULL
  1553. #undef PJ3
  1554. #define PJ3_PIN PINJ3
  1555. #define PJ3_RPORT PINJ
  1556. #define PJ3_WPORT PORTJ
  1557. #define PJ3_DDR DDRJ
  1558. #define PJ3_PWM NULL
  1559. #undef PJ4
  1560. #define PJ4_PIN PINJ4
  1561. #define PJ4_RPORT PINJ
  1562. #define PJ4_WPORT PORTJ
  1563. #define PJ4_DDR DDRJ
  1564. #define PJ4_PWM NULL
  1565. #undef PJ5
  1566. #define PJ5_PIN PINJ5
  1567. #define PJ5_RPORT PINJ
  1568. #define PJ5_WPORT PORTJ
  1569. #define PJ5_DDR DDRJ
  1570. #define PJ5_PWM NULL
  1571. #undef PJ6
  1572. #define PJ6_PIN PINJ6
  1573. #define PJ6_RPORT PINJ
  1574. #define PJ6_WPORT PORTJ
  1575. #define PJ6_DDR DDRJ
  1576. #define PJ6_PWM NULL
  1577. #undef PJ7
  1578. #define PJ7_PIN PINJ7
  1579. #define PJ7_RPORT PINJ
  1580. #define PJ7_WPORT PORTJ
  1581. #define PJ7_DDR DDRJ
  1582. #define PJ7_PWM NULL
  1583. #undef PK0
  1584. #define PK0_PIN PINK0
  1585. #define PK0_RPORT PINK
  1586. #define PK0_WPORT PORTK
  1587. #define PK0_DDR DDRK
  1588. #define PK0_PWM NULL
  1589. #undef PK1
  1590. #define PK1_PIN PINK1
  1591. #define PK1_RPORT PINK
  1592. #define PK1_WPORT PORTK
  1593. #define PK1_DDR DDRK
  1594. #define PK1_PWM NULL
  1595. #undef PK2
  1596. #define PK2_PIN PINK2
  1597. #define PK2_RPORT PINK
  1598. #define PK2_WPORT PORTK
  1599. #define PK2_DDR DDRK
  1600. #define PK2_PWM NULL
  1601. #undef PK3
  1602. #define PK3_PIN PINK3
  1603. #define PK3_RPORT PINK
  1604. #define PK3_WPORT PORTK
  1605. #define PK3_DDR DDRK
  1606. #define PK3_PWM NULL
  1607. #undef PK4
  1608. #define PK4_PIN PINK4
  1609. #define PK4_RPORT PINK
  1610. #define PK4_WPORT PORTK
  1611. #define PK4_DDR DDRK
  1612. #define PK4_PWM NULL
  1613. #undef PK5
  1614. #define PK5_PIN PINK5
  1615. #define PK5_RPORT PINK
  1616. #define PK5_WPORT PORTK
  1617. #define PK5_DDR DDRK
  1618. #define PK5_PWM NULL
  1619. #undef PK6
  1620. #define PK6_PIN PINK6
  1621. #define PK6_RPORT PINK
  1622. #define PK6_WPORT PORTK
  1623. #define PK6_DDR DDRK
  1624. #define PK6_PWM NULL
  1625. #undef PK7
  1626. #define PK7_PIN PINK7
  1627. #define PK7_RPORT PINK
  1628. #define PK7_WPORT PORTK
  1629. #define PK7_DDR DDRK
  1630. #define PK7_PWM NULL
  1631. #undef PL0
  1632. #define PL0_PIN PINL0
  1633. #define PL0_RPORT PINL
  1634. #define PL0_WPORT PORTL
  1635. #define PL0_DDR DDRL
  1636. #define PL0_PWM NULL
  1637. #undef PL1
  1638. #define PL1_PIN PINL1
  1639. #define PL1_RPORT PINL
  1640. #define PL1_WPORT PORTL
  1641. #define PL1_DDR DDRL
  1642. #define PL1_PWM NULL
  1643. #undef PL2
  1644. #define PL2_PIN PINL2
  1645. #define PL2_RPORT PINL
  1646. #define PL2_WPORT PORTL
  1647. #define PL2_DDR DDRL
  1648. #define PL2_PWM NULL
  1649. #undef PL3
  1650. #define PL3_PIN PINL3
  1651. #define PL3_RPORT PINL
  1652. #define PL3_WPORT PORTL
  1653. #define PL3_DDR DDRL
  1654. #define PL3_PWM &OCR5AL
  1655. #undef PL4
  1656. #define PL4_PIN PINL4
  1657. #define PL4_RPORT PINL
  1658. #define PL4_WPORT PORTL
  1659. #define PL4_DDR DDRL
  1660. #define PL4_PWM &OCR5BL
  1661. #undef PL5
  1662. #define PL5_PIN PINL5
  1663. #define PL5_RPORT PINL
  1664. #define PL5_WPORT PORTL
  1665. #define PL5_DDR DDRL
  1666. #define PL5_PWM &OCR5CL
  1667. #undef PL6
  1668. #define PL6_PIN PINL6
  1669. #define PL6_RPORT PINL
  1670. #define PL6_WPORT PORTL
  1671. #define PL6_DDR DDRL
  1672. #define PL6_PWM NULL
  1673. #undef PL7
  1674. #define PL7_PIN PINL7
  1675. #define PL7_RPORT PINL
  1676. #define PL7_WPORT PORTL
  1677. #define PL7_DDR DDRL
  1678. #define PL7_PWM NULL
  1679. #endif
  1680. #if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) || defined (__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
  1681. // SPI
  1682. #define SCK DIO9
  1683. #define MISO DIO11
  1684. #define MOSI DIO10
  1685. #define SS DIO8
  1686. // change for your board
  1687. #define DEBUG_LED DIO31 /* led D5 red */
  1688. /*
  1689. pins
  1690. */
  1691. #define DIO0_PIN PINA0
  1692. #define DIO0_RPORT PINA
  1693. #define DIO0_WPORT PORTA
  1694. #define DIO0_PWM NULL
  1695. #define DIO0_DDR DDRA
  1696. #define DIO1_PIN PINA1
  1697. #define DIO1_RPORT PINA
  1698. #define DIO1_WPORT PORTA
  1699. #define DIO1_PWM NULL
  1700. #define DIO1_DDR DDRA
  1701. #define DIO2_PIN PINA2
  1702. #define DIO2_RPORT PINA
  1703. #define DIO2_WPORT PORTA
  1704. #define DIO2_PWM NULL
  1705. #define DIO2_DDR DDRA
  1706. #define DIO3_PIN PINA3
  1707. #define DIO3_RPORT PINA
  1708. #define DIO3_WPORT PORTA
  1709. #define DIO3_PWM NULL
  1710. #define DIO3_DDR DDRA
  1711. #define DIO4_PIN PINA4
  1712. #define DIO4_RPORT PINA
  1713. #define DIO4_WPORT PORTA
  1714. #define DIO4_PWM NULL
  1715. #define DIO4_DDR DDRA
  1716. #define DIO5_PIN PINA5
  1717. #define DIO5_RPORT PINA
  1718. #define DIO5_WPORT PORTA
  1719. #define DIO5_PWM NULL
  1720. #define DIO5_DDR DDRA
  1721. #define DIO6_PIN PINA6
  1722. #define DIO6_RPORT PINA
  1723. #define DIO6_WPORT PORTA
  1724. #define DIO6_PWM NULL
  1725. #define DIO6_DDR DDRA
  1726. #define DIO7_PIN PINA7
  1727. #define DIO7_RPORT PINA
  1728. #define DIO7_WPORT PORTA
  1729. #define DIO7_PWM NULL
  1730. #define DIO7_DDR DDRA
  1731. #define DIO8_PIN PINB0
  1732. #define DIO8_RPORT PINB
  1733. #define DIO8_WPORT PORTB
  1734. #define DIO8_PWM NULL
  1735. #define DIO8_DDR DDRB
  1736. #define DIO9_PIN PINB1
  1737. #define DIO9_RPORT PINB
  1738. #define DIO9_WPORT PORTB
  1739. #define DIO9_PWM NULL
  1740. #define DIO9_DDR DDRB
  1741. #define DIO10_PIN PINB2
  1742. #define DIO10_RPORT PINB
  1743. #define DIO10_WPORT PORTB
  1744. #define DIO10_PWM NULL
  1745. #define DIO10_DDR DDRB
  1746. #define DIO11_PIN PINB3
  1747. #define DIO11_RPORT PINB
  1748. #define DIO11_WPORT PORTB
  1749. #define DIO11_PWM NULL
  1750. #define DIO11_DDR DDRB
  1751. #define DIO12_PIN PINB4
  1752. #define DIO12_RPORT PINB
  1753. #define DIO12_WPORT PORTB
  1754. #define DIO12_PWM NULL
  1755. #define DIO12_DDR DDRB
  1756. #define DIO13_PIN PINB5
  1757. #define DIO13_RPORT PINB
  1758. #define DIO13_WPORT PORTB
  1759. #define DIO13_PWM NULL
  1760. #define DIO13_DDR DDRB
  1761. #define DIO14_PIN PINB6
  1762. #define DIO14_RPORT PINB
  1763. #define DIO14_WPORT PORTB
  1764. #define DIO14_PWM NULL
  1765. #define DIO14_DDR DDRB
  1766. #define DIO15_PIN PINB7
  1767. #define DIO15_RPORT PINB
  1768. #define DIO15_WPORT PORTB
  1769. #define DIO15_PWM NULL
  1770. #define DIO15_DDR DDRB
  1771. #define DIO16_PIN PINC0
  1772. #define DIO16_RPORT PINC
  1773. #define DIO16_WPORT PORTC
  1774. #define DIO16_PWM NULL
  1775. #define DIO16_DDR DDRC
  1776. #define DIO17_PIN PINC1
  1777. #define DIO17_RPORT PINC
  1778. #define DIO17_WPORT PORTC
  1779. #define DIO17_PWM NULL
  1780. #define DIO17_DDR DDRC
  1781. #define DIO18_PIN PINC2
  1782. #define DIO18_RPORT PINC
  1783. #define DIO18_WPORT PORTC
  1784. #define DIO18_PWM NULL
  1785. #define DIO18_DDR DDRC
  1786. #define DIO19_PIN PINC3
  1787. #define DIO19_RPORT PINC
  1788. #define DIO19_WPORT PORTC
  1789. #define DIO19_PWM NULL
  1790. #define DIO19_DDR DDRC
  1791. #define DIO20_PIN PINC4
  1792. #define DIO20_RPORT PINC
  1793. #define DIO20_WPORT PORTC
  1794. #define DIO20_PWM NULL
  1795. #define DIO20_DDR DDRC
  1796. #define DIO21_PIN PINC5
  1797. #define DIO21_RPORT PINC
  1798. #define DIO21_WPORT PORTC
  1799. #define DIO21_PWM NULL
  1800. #define DIO21_DDR DDRC
  1801. #define DIO22_PIN PINC6
  1802. #define DIO22_RPORT PINC
  1803. #define DIO22_WPORT PORTC
  1804. #define DIO22_PWM NULL
  1805. #define DIO22_DDR DDRC
  1806. #define DIO23_PIN PINC7
  1807. #define DIO23_RPORT PINC
  1808. #define DIO23_WPORT PORTC
  1809. #define DIO23_PWM NULL
  1810. #define DIO23_DDR DDRC
  1811. #define DIO24_PIN PIND0
  1812. #define DIO24_RPORT PIND
  1813. #define DIO24_WPORT PORTD
  1814. #define DIO24_PWM NULL
  1815. #define DIO24_DDR DDRD
  1816. #define DIO25_PIN PIND1
  1817. #define DIO25_RPORT PIND
  1818. #define DIO25_WPORT PORTD
  1819. #define DIO25_PWM NULL
  1820. #define DIO25_DDR DDRD
  1821. #define DIO26_PIN PIND2
  1822. #define DIO26_RPORT PIND
  1823. #define DIO26_WPORT PORTD
  1824. #define DIO26_PWM NULL
  1825. #define DIO26_DDR DDRD
  1826. #define DIO27_PIN PIND3
  1827. #define DIO27_RPORT PIND
  1828. #define DIO27_WPORT PORTD
  1829. #define DIO27_PWM NULL
  1830. #define DIO27_DDR DDRD
  1831. #define DIO28_PIN PIND4
  1832. #define DIO28_RPORT PIND
  1833. #define DIO28_WPORT PORTD
  1834. #define DIO28_PWM NULL
  1835. #define DIO28_DDR DDRD
  1836. #define DIO29_PIN PIND5
  1837. #define DIO29_RPORT PIND
  1838. #define DIO29_WPORT PORTD
  1839. #define DIO29_PWM NULL
  1840. #define DIO29_DDR DDRD
  1841. #define DIO30_PIN PIND6
  1842. #define DIO30_RPORT PIND
  1843. #define DIO30_WPORT PORTD
  1844. #define DIO30_PWM NULL
  1845. #define DIO30_DDR DDRD
  1846. #define DIO31_PIN PIND7
  1847. #define DIO31_RPORT PIND
  1848. #define DIO31_WPORT PORTD
  1849. #define DIO31_PWM NULL
  1850. #define DIO31_DDR DDRD
  1851. #define DIO32_PIN PINE0
  1852. #define DIO32_RPORT PINE
  1853. #define DIO32_WPORT PORTE
  1854. #define DIO32_PWM NULL
  1855. #define DIO32_DDR DDRE
  1856. #define DIO33_PIN PINE1
  1857. #define DIO33_RPORT PINE
  1858. #define DIO33_WPORT PORTE
  1859. #define DIO33_PWM NULL
  1860. #define DIO33_DDR DDRE
  1861. #define DIO34_PIN PINE2
  1862. #define DIO34_RPORT PINE
  1863. #define DIO34_WPORT PORTE
  1864. #define DIO34_PWM NULL
  1865. #define DIO34_DDR DDRE
  1866. #define DIO35_PIN PINE3
  1867. #define DIO35_RPORT PINE
  1868. #define DIO35_WPORT PORTE
  1869. #define DIO35_PWM NULL
  1870. #define DIO35_DDR DDRE
  1871. #define DIO36_PIN PINE4
  1872. #define DIO36_RPORT PINE
  1873. #define DIO36_WPORT PORTE
  1874. #define DIO36_PWM NULL
  1875. #define DIO36_DDR DDRE
  1876. #define DIO37_PIN PINE5
  1877. #define DIO37_RPORT PINE
  1878. #define DIO37_WPORT PORTE
  1879. #define DIO37_PWM NULL
  1880. #define DIO37_DDR DDRE
  1881. #define DIO38_PIN PINE6
  1882. #define DIO38_RPORT PINE
  1883. #define DIO38_WPORT PORTE
  1884. #define DIO38_PWM NULL
  1885. #define DIO38_DDR DDRE
  1886. #define DIO39_PIN PINE7
  1887. #define DIO39_RPORT PINE
  1888. #define DIO39_WPORT PORTE
  1889. #define DIO39_PWM NULL
  1890. #define DIO39_DDR DDRE
  1891. #define AIO0_PIN PINF0
  1892. #define AIO0_RPORT PINF
  1893. #define AIO0_WPORT PORTF
  1894. #define AIO0_PWM NULL
  1895. #define AIO0_DDR DDRF
  1896. #define AIO1_PIN PINF1
  1897. #define AIO1_RPORT PINF
  1898. #define AIO1_WPORT PORTF
  1899. #define AIO1_PWM NULL
  1900. #define AIO1_DDR DDRF
  1901. #define AIO2_PIN PINF2
  1902. #define AIO2_RPORT PINF
  1903. #define AIO2_WPORT PORTF
  1904. #define AIO2_PWM NULL
  1905. #define AIO2_DDR DDRF
  1906. #define AIO3_PIN PINF3
  1907. #define AIO3_RPORT PINF
  1908. #define AIO3_WPORT PORTF
  1909. #define AIO3_PWM NULL
  1910. #define AIO3_DDR DDRF
  1911. #define AIO4_PIN PINF4
  1912. #define AIO4_RPORT PINF
  1913. #define AIO4_WPORT PORTF
  1914. #define AIO4_PWM NULL
  1915. #define AIO4_DDR DDRF
  1916. #define AIO5_PIN PINF5
  1917. #define AIO5_RPORT PINF
  1918. #define AIO5_WPORT PORTF
  1919. #define AIO5_PWM NULL
  1920. #define AIO5_DDR DDRF
  1921. #define AIO6_PIN PINF6
  1922. #define AIO6_RPORT PINF
  1923. #define AIO6_WPORT PORTF
  1924. #define AIO6_PWM NULL
  1925. #define AIO6_DDR DDRF
  1926. #define AIO7_PIN PINF7
  1927. #define AIO7_RPORT PINF
  1928. #define AIO7_WPORT PORTF
  1929. #define AIO7_PWM NULL
  1930. #define AIO7_DDR DDRF
  1931. #define DIO40_PIN PINF0
  1932. #define DIO40_RPORT PINF
  1933. #define DIO40_WPORT PORTF
  1934. #define DIO40_PWM NULL
  1935. #define DIO40_DDR DDRF
  1936. #define DIO41_PIN PINF1
  1937. #define DIO41_RPORT PINF
  1938. #define DIO41_WPORT PORTF
  1939. #define DIO41_PWM NULL
  1940. #define DIO41_DDR DDRF
  1941. #define DIO42_PIN PINF2
  1942. #define DIO42_RPORT PINF
  1943. #define DIO42_WPORT PORTF
  1944. #define DIO42_PWM NULL
  1945. #define DIO42_DDR DDRF
  1946. #define DIO43_PIN PINF3
  1947. #define DIO43_RPORT PINF
  1948. #define DIO43_WPORT PORTF
  1949. #define DIO43_PWM NULL
  1950. #define DIO43_DDR DDRF
  1951. #define DIO44_PIN PINF4
  1952. #define DIO44_RPORT PINF
  1953. #define DIO44_WPORT PORTF
  1954. #define DIO44_PWM NULL
  1955. #define DIO44_DDR DDRF
  1956. #define DIO45_PIN PINF5
  1957. #define DIO45_RPORT PINF
  1958. #define DIO45_WPORT PORTF
  1959. #define DIO45_PWM NULL
  1960. #define DIO45_DDR DDRF
  1961. #define DIO46_PIN PINF6
  1962. #define DIO46_RPORT PINF
  1963. #define DIO46_WPORT PORTF
  1964. #define DIO46_PWM NULL
  1965. #define DIO46_DDR DDRF
  1966. #define DIO47_PIN PINF7
  1967. #define DIO47_RPORT PINF
  1968. #define DIO47_WPORT PORTF
  1969. #define DIO47_PWM NULL
  1970. #define DIO47_DDR DDRF
  1971. #undef PA0
  1972. #define PA0_PIN PINA0
  1973. #define PA0_RPORT PINA
  1974. #define PA0_WPORT PORTA
  1975. #define PA0_PWM NULL
  1976. #define PA0_DDR DDRA
  1977. #undef PA1
  1978. #define PA1_PIN PINA1
  1979. #define PA1_RPORT PINA
  1980. #define PA1_WPORT PORTA
  1981. #define PA1_PWM NULL
  1982. #define PA1_DDR DDRA
  1983. #undef PA2
  1984. #define PA2_PIN PINA2
  1985. #define PA2_RPORT PINA
  1986. #define PA2_WPORT PORTA
  1987. #define PA2_PWM NULL
  1988. #define PA2_DDR DDRA
  1989. #undef PA3
  1990. #define PA3_PIN PINA3
  1991. #define PA3_RPORT PINA
  1992. #define PA3_WPORT PORTA
  1993. #define PA3_PWM NULL
  1994. #define PA3_DDR DDRA
  1995. #undef PA4
  1996. #define PA4_PIN PINA4
  1997. #define PA4_RPORT PINA
  1998. #define PA4_WPORT PORTA
  1999. #define PA4_PWM NULL
  2000. #define PA4_DDR DDRA
  2001. #undef PA5
  2002. #define PA5_PIN PINA5
  2003. #define PA5_RPORT PINA
  2004. #define PA5_WPORT PORTA
  2005. #define PA5_PWM NULL
  2006. #define PA5_DDR DDRA
  2007. #undef PA6
  2008. #define PA6_PIN PINA6
  2009. #define PA6_RPORT PINA
  2010. #define PA6_WPORT PORTA
  2011. #define PA6_PWM NULL
  2012. #define PA6_DDR DDRA
  2013. #undef PA7
  2014. #define PA7_PIN PINA7
  2015. #define PA7_RPORT PINA
  2016. #define PA7_WPORT PORTA
  2017. #define PA7_PWM NULL
  2018. #define PA7_DDR DDRA
  2019. #undef PB0
  2020. #define PB0_PIN PINB0
  2021. #define PB0_RPORT PINB
  2022. #define PB0_WPORT PORTB
  2023. #define PB0_PWM NULL
  2024. #define PB0_DDR DDRB
  2025. #undef PB1
  2026. #define PB1_PIN PINB1
  2027. #define PB1_RPORT PINB
  2028. #define PB1_WPORT PORTB
  2029. #define PB1_PWM NULL
  2030. #define PB1_DDR DDRB
  2031. #undef PB2
  2032. #define PB2_PIN PINB2
  2033. #define PB2_RPORT PINB
  2034. #define PB2_WPORT PORTB
  2035. #define PB2_PWM NULL
  2036. #define PB2_DDR DDRB
  2037. #undef PB3
  2038. #define PB3_PIN PINB3
  2039. #define PB3_RPORT PINB
  2040. #define PB3_WPORT PORTB
  2041. #define PB3_PWM NULL
  2042. #define PB3_DDR DDRB
  2043. #undef PB4
  2044. #define PB4_PIN PINB4
  2045. #define PB4_RPORT PINB
  2046. #define PB4_WPORT PORTB
  2047. #define PB4_PWM NULL
  2048. #define PB4_DDR DDRB
  2049. #undef PB5
  2050. #define PB5_PIN PINB5
  2051. #define PB5_RPORT PINB
  2052. #define PB5_WPORT PORTB
  2053. #define PB5_PWM NULL
  2054. #define PB5_DDR DDRB
  2055. #undef PB6
  2056. #define PB6_PIN PINB6
  2057. #define PB6_RPORT PINB
  2058. #define PB6_WPORT PORTB
  2059. #define PB6_PWM NULL
  2060. #define PB6_DDR DDRB
  2061. #undef PB7
  2062. #define PB7_PIN PINB7
  2063. #define PB7_RPORT PINB
  2064. #define PB7_WPORT PORTB
  2065. #define PB7_PWM NULL
  2066. #define PB7_DDR DDRB
  2067. #undef PC0
  2068. #define PC0_PIN PINC0
  2069. #define PC0_RPORT PINC
  2070. #define PC0_WPORT PORTC
  2071. #define PC0_PWM NULL
  2072. #define PC0_DDR DDRC
  2073. #undef PC1
  2074. #define PC1_PIN PINC1
  2075. #define PC1_RPORT PINC
  2076. #define PC1_WPORT PORTC
  2077. #define PC1_PWM NULL
  2078. #define PC1_DDR DDRC
  2079. #undef PC2
  2080. #define PC2_PIN PINC2
  2081. #define PC2_RPORT PINC
  2082. #define PC2_WPORT PORTC
  2083. #define PC2_PWM NULL
  2084. #define PC2_DDR DDRC
  2085. #undef PC3
  2086. #define PC3_PIN PINC3
  2087. #define PC3_RPORT PINC
  2088. #define PC3_WPORT PORTC
  2089. #define PC3_PWM NULL
  2090. #define PC3_DDR DDRC
  2091. #undef PC4
  2092. #define PC4_PIN PINC4
  2093. #define PC4_RPORT PINC
  2094. #define PC4_WPORT PORTC
  2095. #define PC4_PWM NULL
  2096. #define PC4_DDR DDRC
  2097. #undef PC5
  2098. #define PC5_PIN PINC5
  2099. #define PC5_RPORT PINC
  2100. #define PC5_WPORT PORTC
  2101. #define PC5_PWM NULL
  2102. #define PC5_DDR DDRC
  2103. #undef PC6
  2104. #define PC6_PIN PINC6
  2105. #define PC6_RPORT PINC
  2106. #define PC6_WPORT PORTC
  2107. #define PC6_PWM NULL
  2108. #define PC6_DDR DDRC
  2109. #undef PC7
  2110. #define PC7_PIN PINC7
  2111. #define PC7_RPORT PINC
  2112. #define PC7_WPORT PORTC
  2113. #define PC7_PWM NULL
  2114. #define PC7_DDR DDRC
  2115. #undef PD0
  2116. #define PD0_PIN PIND0
  2117. #define PD0_RPORT PIND
  2118. #define PD0_WPORT PORTD
  2119. #define PD0_PWM NULL
  2120. #define PD0_DDR DDRD
  2121. #undef PD1
  2122. #define PD1_PIN PIND1
  2123. #define PD1_RPORT PIND
  2124. #define PD1_WPORT PORTD
  2125. #define PD1_PWM NULL
  2126. #define PD1_DDR DDRD
  2127. #undef PD2
  2128. #define PD2_PIN PIND2
  2129. #define PD2_RPORT PIND
  2130. #define PD2_WPORT PORTD
  2131. #define PD2_PWM NULL
  2132. #define PD2_DDR DDRD
  2133. #undef PD3
  2134. #define PD3_PIN PIND3
  2135. #define PD3_RPORT PIND
  2136. #define PD3_WPORT PORTD
  2137. #define PD3_PWM NULL
  2138. #define PD3_DDR DDRD
  2139. #undef PD4
  2140. #define PD4_PIN PIND4
  2141. #define PD4_RPORT PIND
  2142. #define PD4_WPORT PORTD
  2143. #define PD4_PWM NULL
  2144. #define PD4_DDR DDRD
  2145. #undef PD5
  2146. #define PD5_PIN PIND5
  2147. #define PD5_RPORT PIND
  2148. #define PD5_WPORT PORTD
  2149. #define PD5_PWM NULL
  2150. #define PD5_DDR DDRD
  2151. #undef PD6
  2152. #define PD6_PIN PIND6
  2153. #define PD6_RPORT PIND
  2154. #define PD6_WPORT PORTD
  2155. #define PD6_PWM NULL
  2156. #define PD6_DDR DDRD
  2157. #undef PD7
  2158. #define PD7_PIN PIND7
  2159. #define PD7_RPORT PIND
  2160. #define PD7_WPORT PORTD
  2161. #define PD7_PWM NULL
  2162. #define PD7_DDR DDRD
  2163. #undef PE0
  2164. #define PE0_PIN PINE0
  2165. #define PE0_RPORT PINE
  2166. #define PE0_WPORT PORTE
  2167. #define PE0_PWM NULL
  2168. #define PE0_DDR DDRE
  2169. #undef PE1
  2170. #define PE1_PIN PINE1
  2171. #define PE1_RPORT PINE
  2172. #define PE1_WPORT PORTE
  2173. #define PE1_PWM NULL
  2174. #define PE1_DDR DDRE
  2175. #undef PE2
  2176. #define PE2_PIN PINE2
  2177. #define PE2_RPORT PINE
  2178. #define PE2_WPORT PORTE
  2179. #define PE2_PWM NULL
  2180. #define PE2_DDR DDRE
  2181. #undef PE3
  2182. #define PE3_PIN PINE3
  2183. #define PE3_RPORT PINE
  2184. #define PE3_WPORT PORTE
  2185. #define PE3_PWM NULL
  2186. #define PE3_DDR DDRE
  2187. #undef PE4
  2188. #define PE4_PIN PINE4
  2189. #define PE4_RPORT PINE
  2190. #define PE4_WPORT PORTE
  2191. #define PE4_PWM NULL
  2192. #define PE4_DDR DDRE
  2193. #undef PE5
  2194. #define PE5_PIN PINE5
  2195. #define PE5_RPORT PINE
  2196. #define PE5_WPORT PORTE
  2197. #define PE5_PWM NULL
  2198. #define PE5_DDR DDRE
  2199. #undef PE6
  2200. #define PE6_PIN PINE6
  2201. #define PE6_RPORT PINE
  2202. #define PE6_WPORT PORTE
  2203. #define PE6_PWM NULL
  2204. #define PE6_DDR DDRE
  2205. #undef PE7
  2206. #define PE7_PIN PINE7
  2207. #define PE7_RPORT PINE
  2208. #define PE7_WPORT PORTE
  2209. #define PE7_PWM NULL
  2210. #define PE7_DDR DDRE
  2211. #undef PF0
  2212. #define PF0_PIN PINF0
  2213. #define PF0_RPORT PINF
  2214. #define PF0_WPORT PORTF
  2215. #define PF0_PWM NULL
  2216. #define PF0_DDR DDRF
  2217. #undef PF1
  2218. #define PF1_PIN PINF1
  2219. #define PF1_RPORT PINF
  2220. #define PF1_WPORT PORTF
  2221. #define PF1_PWM NULL
  2222. #define PF1_DDR DDRF
  2223. #undef PF2
  2224. #define PF2_PIN PINF2
  2225. #define PF2_RPORT PINF
  2226. #define PF2_WPORT PORTF
  2227. #define PF2_PWM NULL
  2228. #define PF2_DDR DDRF
  2229. #undef PF3
  2230. #define PF3_PIN PINF3
  2231. #define PF3_RPORT PINF
  2232. #define PF3_WPORT PORTF
  2233. #define PF3_PWM NULL
  2234. #define PF3_DDR DDRF
  2235. #undef PF4
  2236. #define PF4_PIN PINF4
  2237. #define PF4_RPORT PINF
  2238. #define PF4_WPORT PORTF
  2239. #define PF4_PWM NULL
  2240. #define PF4_DDR DDRF
  2241. #undef PF5
  2242. #define PF5_PIN PINF5
  2243. #define PF5_RPORT PINF
  2244. #define PF5_WPORT PORTF
  2245. #define PF5_PWM NULL
  2246. #define PF5_DDR DDRF
  2247. #undef PF6
  2248. #define PF6_PIN PINF6
  2249. #define PF6_RPORT PINF
  2250. #define PF6_WPORT PORTF
  2251. #define PF6_PWM NULL
  2252. #define PF6_DDR DDRF
  2253. #undef PF7
  2254. #define PF7_PIN PINF7
  2255. #define PF7_RPORT PINF
  2256. #define PF7_WPORT PORTF
  2257. #define PF7_PWM NULL
  2258. #define PF7_DDR DDRF
  2259. #endif
  2260. #if defined (__AVR_ATmega1281__) || defined (__AVR_ATmega2561__)
  2261. // UART
  2262. #define RXD DIO0
  2263. #define TXD DIO1
  2264. // SPI
  2265. #define SCK DIO10
  2266. #define MISO DIO12
  2267. #define MOSI DIO11
  2268. #define SS DIO16
  2269. // TWI (I2C)
  2270. #define SCL DIO17
  2271. #define SDA DIO18
  2272. // timers and PWM
  2273. #define OC0A DIO9
  2274. #define OC0B DIO4
  2275. #define OC1A DIO7
  2276. #define OC1B DIO8
  2277. #define OC2A DIO6
  2278. #define OC3A DIO5
  2279. #define OC3B DIO2
  2280. #define OC3C DIO3
  2281. // change for your board
  2282. #define DEBUG_LED DIO46
  2283. /*
  2284. pins
  2285. */
  2286. #define DIO0_PIN PINE0
  2287. #define DIO0_RPORT PINE
  2288. #define DIO0_WPORT PORTE
  2289. #define DIO0_DDR DDRE
  2290. #define DIO0_PWM NULL
  2291. #define DIO1_PIN PINE1
  2292. #define DIO1_RPORT PINE
  2293. #define DIO1_WPORT PORTE
  2294. #define DIO1_DDR DDRE
  2295. #define DIO1_PWM NULL
  2296. #define DIO2_PIN PINE4
  2297. #define DIO2_RPORT PINE
  2298. #define DIO2_WPORT PORTE
  2299. #define DIO2_DDR DDRE
  2300. #define DIO2_PWM &OCR3BL
  2301. #define DIO3_PIN PINE5
  2302. #define DIO3_RPORT PINE
  2303. #define DIO3_WPORT PORTE
  2304. #define DIO3_DDR DDRE
  2305. #define DIO3_PWM &OCR3CL
  2306. #define DIO4_PIN PING5
  2307. #define DIO4_RPORT PING
  2308. #define DIO4_WPORT PORTG
  2309. #define DIO4_DDR DDRG
  2310. #define DIO4_PWM &OCR0B
  2311. #define DIO5_PIN PINE3
  2312. #define DIO5_RPORT PINE
  2313. #define DIO5_WPORT PORTE
  2314. #define DIO5_DDR DDRE
  2315. #define DIO5_PWM &OCR3AL
  2316. #define DIO6_PIN PINB4
  2317. #define DIO6_RPORT PINB
  2318. #define DIO6_WPORT PORTB
  2319. #define DIO6_DDR DDRB
  2320. #define DIO6_PWM &OCR2AL
  2321. #define DIO7_PIN PINB5
  2322. #define DIO7_RPORT PINB
  2323. #define DIO7_WPORT PORTB
  2324. #define DIO7_DDR DDRB
  2325. #define DIO7_PWM &OCR1AL
  2326. #define DIO8_PIN PINB6
  2327. #define DIO8_RPORT PINB
  2328. #define DIO8_WPORT PORTB
  2329. #define DIO8_DDR DDRB
  2330. #define DIO8_PWM &OCR1BL
  2331. #define DIO9_PIN PINB7
  2332. #define DIO9_RPORT PINB
  2333. #define DIO9_WPORT PORTB
  2334. #define DIO9_DDR DDRB
  2335. #define DIO9_PWM &OCR0AL
  2336. #define DIO10_PIN PINB1
  2337. #define DIO10_RPORT PINB
  2338. #define DIO10_WPORT PORTB
  2339. #define DIO10_DDR DDRB
  2340. #define DIO10_PWM NULL
  2341. #define DIO11_PIN PINB2
  2342. #define DIO11_RPORT PINB
  2343. #define DIO11_WPORT PORTB
  2344. #define DIO11_DDR DDRB
  2345. #define DIO11_PWM NULL
  2346. #define DIO12_PIN PINB3
  2347. #define DIO12_RPORT PINB
  2348. #define DIO12_WPORT PORTB
  2349. #define DIO12_DDR DDRB
  2350. #define DIO12_PWM NULL
  2351. #define DIO13_PIN PINE2
  2352. #define DIO13_RPORT PINE
  2353. #define DIO13_WPORT PORTE
  2354. #define DIO13_DDR DDRE
  2355. #define DIO13_PWM NULL
  2356. #define DIO14_PIN PINE6
  2357. #define DIO14_RPORT PINE
  2358. #define DIO14_WPORT PORTE
  2359. #define DIO14_DDR DDRE
  2360. #define DIO14_PWM NULL
  2361. #define DIO15_PIN PINE7
  2362. #define DIO15_RPORT PINE
  2363. #define DIO15_WPORT PORTE
  2364. #define DIO15_DDR DDRE
  2365. #define DIO15_PWM NULL
  2366. #define DIO16_PIN PINB0
  2367. #define DIO16_RPORT PINB
  2368. #define DIO16_WPORT PORTB
  2369. #define DIO16_DDR DDRB
  2370. #define DIO16_PWM NULL
  2371. #define DIO17_PIN PIND0
  2372. #define DIO17_RPORT PIND
  2373. #define DIO17_WPORT PORTD
  2374. #define DIO17_DDR DDRD
  2375. #define DIO17_PWM NULL
  2376. #define DIO18_PIN PIND1
  2377. #define DIO18_RPORT PIND
  2378. #define DIO18_WPORT PORTD
  2379. #define DIO18_DDR DDRD
  2380. #define DIO18_PWM NULL
  2381. #define DIO19_PIN PIND2
  2382. #define DIO19_RPORT PIND
  2383. #define DIO19_WPORT PORTD
  2384. #define DIO19_DDR DDRD
  2385. #define DIO19_PWM NULL
  2386. #define DIO20_PIN PIND3
  2387. #define DIO20_RPORT PIND
  2388. #define DIO20_WPORT PORTD
  2389. #define DIO20_DDR DDRD
  2390. #define DIO20_PWM NULL
  2391. #define DIO21_PIN PIND4
  2392. #define DIO21_RPORT PIND
  2393. #define DIO21_WPORT PORTD
  2394. #define DIO21_DDR DDRD
  2395. #define DIO21_PWM NULL
  2396. #define DIO22_PIN PIND5
  2397. #define DIO22_RPORT PIND
  2398. #define DIO22_WPORT PORTD
  2399. #define DIO22_DDR DDRD
  2400. #define DIO22_PWM NULL
  2401. #define DIO23_PIN PIND6
  2402. #define DIO23_RPORT PIND
  2403. #define DIO23_WPORT PORTD
  2404. #define DIO23_DDR DDRD
  2405. #define DIO23_PWM NULL
  2406. #define DIO24_PIN PIND7
  2407. #define DIO24_RPORT PIND
  2408. #define DIO24_WPORT PORTD
  2409. #define DIO24_DDR DDRD
  2410. #define DIO24_PWM NULL
  2411. #define DIO25_PIN PING0
  2412. #define DIO25_RPORT PING
  2413. #define DIO25_WPORT PORTG
  2414. #define DIO25_DDR DDRG
  2415. #define DIO25_PWM NULL
  2416. #define DIO26_PIN PING1
  2417. #define DIO26_RPORT PING
  2418. #define DIO26_WPORT PORTG
  2419. #define DIO26_DDR DDRG
  2420. #define DIO26_PWM NULL
  2421. #define DIO27_PIN PING2
  2422. #define DIO27_RPORT PING
  2423. #define DIO27_WPORT PORTG
  2424. #define DIO27_DDR DDRG
  2425. #define DIO27_PWM NULL
  2426. #define DIO28_PIN PING3
  2427. #define DIO28_RPORT PING
  2428. #define DIO28_WPORT PORTG
  2429. #define DIO28_DDR DDRG
  2430. #define DIO28_PWM NULL
  2431. #define DIO29_PIN PING4
  2432. #define DIO29_RPORT PING
  2433. #define DIO29_WPORT PORTG
  2434. #define DIO29_DDR DDRG
  2435. #define DIO29_PWM NULL
  2436. #define DIO30_PIN PINC0
  2437. #define DIO30_RPORT PINC
  2438. #define DIO30_WPORT PORTC
  2439. #define DIO30_DDR DDRC
  2440. #define DIO30_PWM NULL
  2441. #define DIO31_PIN PINC1
  2442. #define DIO31_RPORT PINC
  2443. #define DIO31_WPORT PORTC
  2444. #define DIO31_DDR DDRC
  2445. #define DIO31_PWM NULL
  2446. #define DIO32_PIN PINC2
  2447. #define DIO32_RPORT PINC
  2448. #define DIO32_WPORT PORTC
  2449. #define DIO32_DDR DDRC
  2450. #define DIO32_PWM NULL
  2451. #define DIO33_PIN PINC3
  2452. #define DIO33_RPORT PINC
  2453. #define DIO33_WPORT PORTC
  2454. #define DIO33_DDR DDRC
  2455. #define DIO33_PWM NULL
  2456. #define DIO34_PIN PINC4
  2457. #define DIO34_RPORT PINC
  2458. #define DIO34_WPORT PORTC
  2459. #define DIO34_DDR DDRC
  2460. #define DIO34_PWM NULL
  2461. #define DIO35_PIN PINC5
  2462. #define DIO35_RPORT PINC
  2463. #define DIO35_WPORT PORTC
  2464. #define DIO35_DDR DDRC
  2465. #define DIO35_PWM NULL
  2466. #define DIO36_PIN PINC6
  2467. #define DIO36_RPORT PINC
  2468. #define DIO36_WPORT PORTC
  2469. #define DIO36_DDR DDRC
  2470. #define DIO36_PWM NULL
  2471. #define DIO37_PIN PINC7
  2472. #define DIO37_RPORT PINC
  2473. #define DIO37_WPORT PORTC
  2474. #define DIO37_DDR DDRC
  2475. #define DIO37_PWM NULL
  2476. #define DIO38_PIN PINA0
  2477. #define DIO38_RPORT PINA
  2478. #define DIO38_WPORT PORTA
  2479. #define DIO38_DDR DDRA
  2480. #define DIO38_PWM NULL
  2481. #define DIO39_PIN PINA1
  2482. #define DIO39_RPORT PINA
  2483. #define DIO39_WPORT PORTA
  2484. #define DIO39_DDR DDRA
  2485. #define DIO39_PWM NULL
  2486. #define DIO40_PIN PINA2
  2487. #define DIO40_RPORT PINA
  2488. #define DIO40_WPORT PORTA
  2489. #define DIO40_DDR DDRA
  2490. #define DIO40_PWM NULL
  2491. #define DIO41_PIN PINA3
  2492. #define DIO41_RPORT PINA
  2493. #define DIO41_WPORT PORTA
  2494. #define DIO41_DDR DDRA
  2495. #define DIO41_PWM NULL
  2496. #define DIO42_PIN PINA4
  2497. #define DIO42_RPORT PINA
  2498. #define DIO42_WPORT PORTA
  2499. #define DIO42_DDR DDRA
  2500. #define DIO42_PWM NULL
  2501. #define DIO43_PIN PINA5
  2502. #define DIO43_RPORT PINA
  2503. #define DIO43_WPORT PORTA
  2504. #define DIO43_DDR DDRA
  2505. #define DIO43_PWM NULL
  2506. #define DIO44_PIN PINA6
  2507. #define DIO44_RPORT PINA
  2508. #define DIO44_WPORT PORTA
  2509. #define DIO44_DDR DDRA
  2510. #define DIO44_PWM NULL
  2511. #define DIO45_PIN PINA7
  2512. #define DIO45_RPORT PINA
  2513. #define DIO45_WPORT PORTA
  2514. #define DIO45_DDR DDRA
  2515. #define DIO45_PWM NULL
  2516. #define DIO46_PIN PINF0
  2517. #define DIO46_RPORT PINF
  2518. #define DIO46_WPORT PORTF
  2519. #define DIO46_DDR DDRF
  2520. #define DIO46_PWM NULL
  2521. #define DIO47_PIN PINF1
  2522. #define DIO47_RPORT PINF
  2523. #define DIO47_WPORT PORTF
  2524. #define DIO47_DDR DDRF
  2525. #define DIO47_PWM NULL
  2526. #define DIO48_PIN PINF2
  2527. #define DIO48_RPORT PINF
  2528. #define DIO48_WPORT PORTF
  2529. #define DIO48_DDR DDRF
  2530. #define DIO48_PWM NULL
  2531. #define DIO49_PIN PINF3
  2532. #define DIO49_RPORT PINF
  2533. #define DIO49_WPORT PORTF
  2534. #define DIO49_DDR DDRF
  2535. #define DIO49_PWM NULL
  2536. #define DIO50_PIN PINF4
  2537. #define DIO50_RPORT PINF
  2538. #define DIO50_WPORT PORTF
  2539. #define DIO50_DDR DDRF
  2540. #define DIO50_PWM NULL
  2541. #define DIO51_PIN PINF5
  2542. #define DIO51_RPORT PINF
  2543. #define DIO51_WPORT PORTF
  2544. #define DIO51_DDR DDRF
  2545. #define DIO51_PWM NULL
  2546. #define DIO52_PIN PINF6
  2547. #define DIO52_RPORT PINF
  2548. #define DIO52_WPORT PORTF
  2549. #define DIO52_DDR DDRF
  2550. #define DIO52_PWM NULL
  2551. #define DIO53_PIN PINF7
  2552. #define DIO53_RPORT PINF
  2553. #define DIO53_WPORT PORTF
  2554. #define DIO53_DDR DDRF
  2555. #define DIO53_PWM NULL
  2556. #undef PA0
  2557. #define PA0_PIN PINA0
  2558. #define PA0_RPORT PINA
  2559. #define PA0_WPORT PORTA
  2560. #define PA0_DDR DDRA
  2561. #define PA0_PWM NULL
  2562. #undef PA1
  2563. #define PA1_PIN PINA1
  2564. #define PA1_RPORT PINA
  2565. #define PA1_WPORT PORTA
  2566. #define PA1_DDR DDRA
  2567. #define PA1_PWM NULL
  2568. #undef PA2
  2569. #define PA2_PIN PINA2
  2570. #define PA2_RPORT PINA
  2571. #define PA2_WPORT PORTA
  2572. #define PA2_DDR DDRA
  2573. #define PA2_PWM NULL
  2574. #undef PA3
  2575. #define PA3_PIN PINA3
  2576. #define PA3_RPORT PINA
  2577. #define PA3_WPORT PORTA
  2578. #define PA3_DDR DDRA
  2579. #define PA3_PWM NULL
  2580. #undef PA4
  2581. #define PA4_PIN PINA4
  2582. #define PA4_RPORT PINA
  2583. #define PA4_WPORT PORTA
  2584. #define PA4_DDR DDRA
  2585. #define PA4_PWM NULL
  2586. #undef PA5
  2587. #define PA5_PIN PINA5
  2588. #define PA5_RPORT PINA
  2589. #define PA5_WPORT PORTA
  2590. #define PA5_DDR DDRA
  2591. #define PA5_PWM NULL
  2592. #undef PA6
  2593. #define PA6_PIN PINA6
  2594. #define PA6_RPORT PINA
  2595. #define PA6_WPORT PORTA
  2596. #define PA6_DDR DDRA
  2597. #define PA6_PWM NULL
  2598. #undef PA7
  2599. #define PA7_PIN PINA7
  2600. #define PA7_RPORT PINA
  2601. #define PA7_WPORT PORTA
  2602. #define PA7_DDR DDRA
  2603. #define PA7_PWM NULL
  2604. #undef PB0
  2605. #define PB0_PIN PINB0
  2606. #define PB0_RPORT PINB
  2607. #define PB0_WPORT PORTB
  2608. #define PB0_DDR DDRB
  2609. #define PB0_PWM NULL
  2610. #undef PB1
  2611. #define PB1_PIN PINB1
  2612. #define PB1_RPORT PINB
  2613. #define PB1_WPORT PORTB
  2614. #define PB1_DDR DDRB
  2615. #define PB1_PWM NULL
  2616. #undef PB2
  2617. #define PB2_PIN PINB2
  2618. #define PB2_RPORT PINB
  2619. #define PB2_WPORT PORTB
  2620. #define PB2_DDR DDRB
  2621. #define PB2_PWM NULL
  2622. #undef PB3
  2623. #define PB3_PIN PINB3
  2624. #define PB3_RPORT PINB
  2625. #define PB3_WPORT PORTB
  2626. #define PB3_DDR DDRB
  2627. #define PB3_PWM NULL
  2628. #undef PB4
  2629. #define PB4_PIN PINB4
  2630. #define PB4_RPORT PINB
  2631. #define PB4_WPORT PORTB
  2632. #define PB4_DDR DDRB
  2633. #define PB4_PWM &OCR2A
  2634. #undef PB5
  2635. #define PB5_PIN PINB5
  2636. #define PB5_RPORT PINB
  2637. #define PB5_WPORT PORTB
  2638. #define PB5_DDR DDRB
  2639. #define PB5_PWM NULL
  2640. #undef PB6
  2641. #define PB6_PIN PINB6
  2642. #define PB6_RPORT PINB
  2643. #define PB6_WPORT PORTB
  2644. #define PB6_DDR DDRB
  2645. #define PB6_PWM NULL
  2646. #undef PB7
  2647. #define PB7_PIN PINB7
  2648. #define PB7_RPORT PINB
  2649. #define PB7_WPORT PORTB
  2650. #define PB7_DDR DDRB
  2651. #define PB7_PWM &OCR0A
  2652. #undef PC0
  2653. #define PC0_PIN PINC0
  2654. #define PC0_RPORT PINC
  2655. #define PC0_WPORT PORTC
  2656. #define PC0_DDR DDRC
  2657. #define PC0_PWM NULL
  2658. #undef PC1
  2659. #define PC1_PIN PINC1
  2660. #define PC1_RPORT PINC
  2661. #define PC1_WPORT PORTC
  2662. #define PC1_DDR DDRC
  2663. #define PC1_PWM NULL
  2664. #undef PC2
  2665. #define PC2_PIN PINC2
  2666. #define PC2_RPORT PINC
  2667. #define PC2_WPORT PORTC
  2668. #define PC2_DDR DDRC
  2669. #define PC2_PWM NULL
  2670. #undef PC3
  2671. #define PC3_PIN PINC3
  2672. #define PC3_RPORT PINC
  2673. #define PC3_WPORT PORTC
  2674. #define PC3_DDR DDRC
  2675. #define PC3_PWM NULL
  2676. #undef PC4
  2677. #define PC4_PIN PINC4
  2678. #define PC4_RPORT PINC
  2679. #define PC4_WPORT PORTC
  2680. #define PC4_DDR DDRC
  2681. #define PC4_PWM NULL
  2682. #undef PC5
  2683. #define PC5_PIN PINC5
  2684. #define PC5_RPORT PINC
  2685. #define PC5_WPORT PORTC
  2686. #define PC5_DDR DDRC
  2687. #define PC5_PWM NULL
  2688. #undef PC6
  2689. #define PC6_PIN PINC6
  2690. #define PC6_RPORT PINC
  2691. #define PC6_WPORT PORTC
  2692. #define PC6_DDR DDRC
  2693. #define PC6_PWM NULL
  2694. #undef PC7
  2695. #define PC7_PIN PINC7
  2696. #define PC7_RPORT PINC
  2697. #define PC7_WPORT PORTC
  2698. #define PC7_DDR DDRC
  2699. #define PC7_PWM NULL
  2700. #undef PD0
  2701. #define PD0_PIN PIND0
  2702. #define PD0_RPORT PIND
  2703. #define PD0_WPORT PORTD
  2704. #define PD0_DDR DDRD
  2705. #define PD0_PWM NULL
  2706. #undef PD1
  2707. #define PD1_PIN PIND1
  2708. #define PD1_RPORT PIND
  2709. #define PD1_WPORT PORTD
  2710. #define PD1_DDR DDRD
  2711. #define PD1_PWM NULL
  2712. #undef PD2
  2713. #define PD2_PIN PIND2
  2714. #define PD2_RPORT PIND
  2715. #define PD2_WPORT PORTD
  2716. #define PD2_DDR DDRD
  2717. #define PD2_PWM NULL
  2718. #undef PD3
  2719. #define PD3_PIN PIND3
  2720. #define PD3_RPORT PIND
  2721. #define PD3_WPORT PORTD
  2722. #define PD3_DDR DDRD
  2723. #define PD3_PWM NULL
  2724. #undef PD4
  2725. #define PD4_PIN PIND4
  2726. #define PD4_RPORT PIND
  2727. #define PD4_WPORT PORTD
  2728. #define PD4_DDR DDRD
  2729. #define PD4_PWM NULL
  2730. #undef PD5
  2731. #define PD5_PIN PIND5
  2732. #define PD5_RPORT PIND
  2733. #define PD5_WPORT PORTD
  2734. #define PD5_DDR DDRD
  2735. #define PD5_PWM NULL
  2736. #undef PD6
  2737. #define PD6_PIN PIND6
  2738. #define PD6_RPORT PIND
  2739. #define PD6_WPORT PORTD
  2740. #define PD6_DDR DDRD
  2741. #define PD6_PWM NULL
  2742. #undef PD7
  2743. #define PD7_PIN PIND7
  2744. #define PD7_RPORT PIND
  2745. #define PD7_WPORT PORTD
  2746. #define PD7_DDR DDRD
  2747. #define PD7_PWM NULL
  2748. #undef PE0
  2749. #define PE0_PIN PINE0
  2750. #define PE0_RPORT PINE
  2751. #define PE0_WPORT PORTE
  2752. #define PE0_DDR DDRE
  2753. #define PE0_PWM NULL
  2754. #undef PE1
  2755. #define PE1_PIN PINE1
  2756. #define PE1_RPORT PINE
  2757. #define PE1_WPORT PORTE
  2758. #define PE1_DDR DDRE
  2759. #define PE1_PWM NULL
  2760. #undef PE2
  2761. #define PE2_PIN PINE2
  2762. #define PE2_RPORT PINE
  2763. #define PE2_WPORT PORTE
  2764. #define PE2_DDR DDRE
  2765. #define PE2_PWM NULL
  2766. #undef PE3
  2767. #define PE3_PIN PINE3
  2768. #define PE3_RPORT PINE
  2769. #define PE3_WPORT PORTE
  2770. #define PE3_DDR DDRE
  2771. #define PE3_PWM &OCR3AL
  2772. #undef PE4
  2773. #define PE4_PIN PINE4
  2774. #define PE4_RPORT PINE
  2775. #define PE4_WPORT PORTE
  2776. #define PE4_DDR DDRE
  2777. #define PE4_PWM &OCR3BL
  2778. #undef PE5
  2779. #define PE5_PIN PINE5
  2780. #define PE5_RPORT PINE
  2781. #define PE5_WPORT PORTE
  2782. #define PE5_DDR DDRE
  2783. #define PE5_PWM &OCR3CL
  2784. #undef PE6
  2785. #define PE6_PIN PINE6
  2786. #define PE6_RPORT PINE
  2787. #define PE6_WPORT PORTE
  2788. #define PE6_DDR DDRE
  2789. #define PE6_PWM NULL
  2790. #undef PE7
  2791. #define PE7_PIN PINE7
  2792. #define PE7_RPORT PINE
  2793. #define PE7_WPORT PORTE
  2794. #define PE7_DDR DDRE
  2795. #define PE7_PWM NULL
  2796. #undef PF0
  2797. #define PF0_PIN PINF0
  2798. #define PF0_RPORT PINF
  2799. #define PF0_WPORT PORTF
  2800. #define PF0_DDR DDRF
  2801. #define PF0_PWM NULL
  2802. #undef PF1
  2803. #define PF1_PIN PINF1
  2804. #define PF1_RPORT PINF
  2805. #define PF1_WPORT PORTF
  2806. #define PF1_DDR DDRF
  2807. #define PF1_PWM NULL
  2808. #undef PF2
  2809. #define PF2_PIN PINF2
  2810. #define PF2_RPORT PINF
  2811. #define PF2_WPORT PORTF
  2812. #define PF2_DDR DDRF
  2813. #define PF2_PWM NULL
  2814. #undef PF3
  2815. #define PF3_PIN PINF3
  2816. #define PF3_RPORT PINF
  2817. #define PF3_WPORT PORTF
  2818. #define PF3_DDR DDRF
  2819. #define PF3_PWM NULL
  2820. #undef PF4
  2821. #define PF4_PIN PINF4
  2822. #define PF4_RPORT PINF
  2823. #define PF4_WPORT PORTF
  2824. #define PF4_DDR DDRF
  2825. #define PF4_PWM NULL
  2826. #undef PF5
  2827. #define PF5_PIN PINF5
  2828. #define PF5_RPORT PINF
  2829. #define PF5_WPORT PORTF
  2830. #define PF5_DDR DDRF
  2831. #define PF5_PWM NULL
  2832. #undef PF6
  2833. #define PF6_PIN PINF6
  2834. #define PF6_RPORT PINF
  2835. #define PF6_WPORT PORTF
  2836. #define PF6_DDR DDRF
  2837. #define PF6_PWM NULL
  2838. #undef PF7
  2839. #define PF7_PIN PINF7
  2840. #define PF7_RPORT PINF
  2841. #define PF7_WPORT PORTF
  2842. #define PF7_DDR DDRF
  2843. #define PF7_PWM NULL
  2844. #undef PG0
  2845. #define PG0_PIN PING0
  2846. #define PG0_RPORT PING
  2847. #define PG0_WPORT PORTG
  2848. #define PG0_DDR DDRG
  2849. #define PG0_PWM NULL
  2850. #undef PG1
  2851. #define PG1_PIN PING1
  2852. #define PG1_RPORT PING
  2853. #define PG1_WPORT PORTG
  2854. #define PG1_DDR DDRG
  2855. #define PG1_PWM NULL
  2856. #undef PG2
  2857. #define PG2_PIN PING2
  2858. #define PG2_RPORT PING
  2859. #define PG2_WPORT PORTG
  2860. #define PG2_DDR DDRG
  2861. #define PG2_PWM NULL
  2862. #undef PG3
  2863. #define PG3_PIN PING3
  2864. #define PG3_RPORT PING
  2865. #define PG3_WPORT PORTG
  2866. #define PG3_DDR DDRG
  2867. #define PG3_PWM NULL
  2868. #undef PG4
  2869. #define PG4_PIN PING4
  2870. #define PG4_RPORT PING
  2871. #define PG4_WPORT PORTG
  2872. #define PG4_DDR DDRG
  2873. #define PG4_PWM NULL
  2874. #undef PG5
  2875. #define PG5_PIN PING5
  2876. #define PG5_RPORT PING
  2877. #define PG5_WPORT PORTG
  2878. #define PG5_DDR DDRG
  2879. #define PG5_PWM &OCR0B
  2880. #endif
  2881. #ifndef DIO0_PIN
  2882. #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
  2883. #endif
  2884. #endif /* _FASTIO_ARDUINO_H */