pic18f2455.h 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676
  1. /*
  2. * This declarations of the PIC18F2455 MCU.
  3. *
  4. * This file is part of the GNU PIC library for SDCC, originally
  5. * created by Molnar Karoly <molnarkaroly@users.sf.net> 2012.
  6. *
  7. * This file is generated automatically by the cinc2h.pl, 2012-11-01 17:30:32 UTC.
  8. *
  9. * SDCC is licensed under the GNU Public license (GPL) v2. Note that
  10. * this license covers the code to the compiler and other executables,
  11. * but explicitly does not cover any code or objects generated by sdcc.
  12. *
  13. * For pic device libraries and header files which are derived from
  14. * Microchip header (.inc) and linker script (.lkr) files Microchip
  15. * requires that "The header files should state that they are only to be
  16. * used with authentic Microchip devices" which makes them incompatible
  17. * with the GPL. Pic device libraries and header files are located at
  18. * non-free/lib and non-free/include directories respectively.
  19. * Sdcc should be run with the --use-non-free command line option in
  20. * order to include non-free header files and libraries.
  21. *
  22. * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
  23. */
  24. #ifndef __PIC18F2455_H__
  25. #define __PIC18F2455_H__
  26. //==============================================================================
  27. //==============================================================================
  28. //
  29. // Register Definitions
  30. //
  31. //==============================================================================
  32. extern __at(0x0F66) __sfr UFRM;
  33. //==============================================================================
  34. // UFRML Bits
  35. extern __at(0x0F66) __sfr UFRML;
  36. typedef struct
  37. {
  38. unsigned FRM0 : 1;
  39. unsigned FRM1 : 1;
  40. unsigned FRM2 : 1;
  41. unsigned FRM3 : 1;
  42. unsigned FRM4 : 1;
  43. unsigned FRM5 : 1;
  44. unsigned FRM6 : 1;
  45. unsigned FRM7 : 1;
  46. } __UFRMLbits_t;
  47. extern __at(0x0F66) volatile __UFRMLbits_t UFRMLbits;
  48. #define _FRM0 0x01
  49. #define _FRM1 0x02
  50. #define _FRM2 0x04
  51. #define _FRM3 0x08
  52. #define _FRM4 0x10
  53. #define _FRM5 0x20
  54. #define _FRM6 0x40
  55. #define _FRM7 0x80
  56. //==============================================================================
  57. //==============================================================================
  58. // UFRMH Bits
  59. extern __at(0x0F67) __sfr UFRMH;
  60. typedef struct
  61. {
  62. unsigned FRM8 : 1;
  63. unsigned FRM9 : 1;
  64. unsigned FRM10 : 1;
  65. unsigned : 1;
  66. unsigned : 1;
  67. unsigned : 1;
  68. unsigned : 1;
  69. unsigned : 1;
  70. } __UFRMHbits_t;
  71. extern __at(0x0F67) volatile __UFRMHbits_t UFRMHbits;
  72. #define _FRM8 0x01
  73. #define _FRM9 0x02
  74. #define _FRM10 0x04
  75. //==============================================================================
  76. //==============================================================================
  77. // UIR Bits
  78. extern __at(0x0F68) __sfr UIR;
  79. typedef struct
  80. {
  81. unsigned URSTIF : 1;
  82. unsigned UERRIF : 1;
  83. unsigned ACTVIF : 1;
  84. unsigned TRNIF : 1;
  85. unsigned IDLEIF : 1;
  86. unsigned STALLIF : 1;
  87. unsigned SOFIF : 1;
  88. unsigned : 1;
  89. } __UIRbits_t;
  90. extern __at(0x0F68) volatile __UIRbits_t UIRbits;
  91. #define _URSTIF 0x01
  92. #define _UERRIF 0x02
  93. #define _ACTVIF 0x04
  94. #define _TRNIF 0x08
  95. #define _IDLEIF 0x10
  96. #define _STALLIF 0x20
  97. #define _SOFIF 0x40
  98. //==============================================================================
  99. //==============================================================================
  100. // UIE Bits
  101. extern __at(0x0F69) __sfr UIE;
  102. typedef struct
  103. {
  104. unsigned URSTIE : 1;
  105. unsigned UERRIE : 1;
  106. unsigned ACTVIE : 1;
  107. unsigned TRNIE : 1;
  108. unsigned IDLEIE : 1;
  109. unsigned STALLIE : 1;
  110. unsigned SOFIE : 1;
  111. unsigned : 1;
  112. } __UIEbits_t;
  113. extern __at(0x0F69) volatile __UIEbits_t UIEbits;
  114. #define _URSTIE 0x01
  115. #define _UERRIE 0x02
  116. #define _ACTVIE 0x04
  117. #define _TRNIE 0x08
  118. #define _IDLEIE 0x10
  119. #define _STALLIE 0x20
  120. #define _SOFIE 0x40
  121. //==============================================================================
  122. //==============================================================================
  123. // UEIR Bits
  124. extern __at(0x0F6A) __sfr UEIR;
  125. typedef struct
  126. {
  127. unsigned PIDEF : 1;
  128. unsigned CRC5EF : 1;
  129. unsigned CRC16EF : 1;
  130. unsigned DFN8EF : 1;
  131. unsigned BTOEF : 1;
  132. unsigned : 1;
  133. unsigned : 1;
  134. unsigned BTSEF : 1;
  135. } __UEIRbits_t;
  136. extern __at(0x0F6A) volatile __UEIRbits_t UEIRbits;
  137. #define _PIDEF 0x01
  138. #define _CRC5EF 0x02
  139. #define _CRC16EF 0x04
  140. #define _DFN8EF 0x08
  141. #define _BTOEF 0x10
  142. #define _BTSEF 0x80
  143. //==============================================================================
  144. //==============================================================================
  145. // UEIE Bits
  146. extern __at(0x0F6B) __sfr UEIE;
  147. typedef struct
  148. {
  149. unsigned PIDEE : 1;
  150. unsigned CRC5EE : 1;
  151. unsigned CRC16EE : 1;
  152. unsigned DFN8EE : 1;
  153. unsigned BTOEE : 1;
  154. unsigned : 1;
  155. unsigned : 1;
  156. unsigned BTSEE : 1;
  157. } __UEIEbits_t;
  158. extern __at(0x0F6B) volatile __UEIEbits_t UEIEbits;
  159. #define _PIDEE 0x01
  160. #define _CRC5EE 0x02
  161. #define _CRC16EE 0x04
  162. #define _DFN8EE 0x08
  163. #define _BTOEE 0x10
  164. #define _BTSEE 0x80
  165. //==============================================================================
  166. //==============================================================================
  167. // USTAT Bits
  168. extern __at(0x0F6C) __sfr USTAT;
  169. typedef union
  170. {
  171. struct
  172. {
  173. unsigned : 1;
  174. unsigned PPBI : 1;
  175. unsigned DIR : 1;
  176. unsigned ENDP0 : 1;
  177. unsigned ENDP1 : 1;
  178. unsigned ENDP2 : 1;
  179. unsigned ENDP3 : 1;
  180. unsigned : 1;
  181. };
  182. struct
  183. {
  184. unsigned : 3;
  185. unsigned ENDP : 4;
  186. unsigned : 1;
  187. };
  188. } __USTATbits_t;
  189. extern __at(0x0F6C) volatile __USTATbits_t USTATbits;
  190. #define _PPBI 0x02
  191. #define _DIR 0x04
  192. #define _ENDP0 0x08
  193. #define _ENDP1 0x10
  194. #define _ENDP2 0x20
  195. #define _ENDP3 0x40
  196. //==============================================================================
  197. //==============================================================================
  198. // UCON Bits
  199. extern __at(0x0F6D) __sfr UCON;
  200. typedef struct
  201. {
  202. unsigned : 1;
  203. unsigned SUSPND : 1;
  204. unsigned RESUME : 1;
  205. unsigned USBEN : 1;
  206. unsigned PKTDIS : 1;
  207. unsigned SE0 : 1;
  208. unsigned PPBRST : 1;
  209. unsigned : 1;
  210. } __UCONbits_t;
  211. extern __at(0x0F6D) volatile __UCONbits_t UCONbits;
  212. #define _SUSPND 0x02
  213. #define _RESUME 0x04
  214. #define _USBEN 0x08
  215. #define _PKTDIS 0x10
  216. #define _SE0 0x20
  217. #define _PPBRST 0x40
  218. //==============================================================================
  219. //==============================================================================
  220. // UADDR Bits
  221. extern __at(0x0F6E) __sfr UADDR;
  222. typedef union
  223. {
  224. struct
  225. {
  226. unsigned ADDR0 : 1;
  227. unsigned ADDR1 : 1;
  228. unsigned ADDR2 : 1;
  229. unsigned ADDR3 : 1;
  230. unsigned ADDR4 : 1;
  231. unsigned ADDR5 : 1;
  232. unsigned ADDR6 : 1;
  233. unsigned : 1;
  234. };
  235. struct
  236. {
  237. unsigned ADDR : 7;
  238. unsigned : 1;
  239. };
  240. } __UADDRbits_t;
  241. extern __at(0x0F6E) volatile __UADDRbits_t UADDRbits;
  242. #define _ADDR0 0x01
  243. #define _ADDR1 0x02
  244. #define _ADDR2 0x04
  245. #define _ADDR3 0x08
  246. #define _ADDR4 0x10
  247. #define _ADDR5 0x20
  248. #define _ADDR6 0x40
  249. //==============================================================================
  250. //==============================================================================
  251. // UCFG Bits
  252. extern __at(0x0F6F) __sfr UCFG;
  253. typedef union
  254. {
  255. struct
  256. {
  257. unsigned PPB0 : 1;
  258. unsigned PPB1 : 1;
  259. unsigned FSEN : 1;
  260. unsigned UTRDIS : 1;
  261. unsigned UPUEN : 1;
  262. unsigned : 1;
  263. unsigned UOEMON : 1;
  264. unsigned UTEYE : 1;
  265. };
  266. struct
  267. {
  268. unsigned PPB : 2;
  269. unsigned : 6;
  270. };
  271. } __UCFGbits_t;
  272. extern __at(0x0F6F) volatile __UCFGbits_t UCFGbits;
  273. #define _PPB0 0x01
  274. #define _PPB1 0x02
  275. #define _FSEN 0x04
  276. #define _UTRDIS 0x08
  277. #define _UPUEN 0x10
  278. #define _UOEMON 0x40
  279. #define _UTEYE 0x80
  280. //==============================================================================
  281. //==============================================================================
  282. // UEP0 Bits
  283. extern __at(0x0F70) __sfr UEP0;
  284. typedef struct
  285. {
  286. unsigned EPSTALL : 1;
  287. unsigned EPINEN : 1;
  288. unsigned EPOUTEN : 1;
  289. unsigned EPCONDIS : 1;
  290. unsigned EPHSHK : 1;
  291. unsigned : 1;
  292. unsigned : 1;
  293. unsigned : 1;
  294. } __UEP0bits_t;
  295. extern __at(0x0F70) volatile __UEP0bits_t UEP0bits;
  296. #define _EPSTALL 0x01
  297. #define _EPINEN 0x02
  298. #define _EPOUTEN 0x04
  299. #define _EPCONDIS 0x08
  300. #define _EPHSHK 0x10
  301. //==============================================================================
  302. //==============================================================================
  303. // UEP1 Bits
  304. extern __at(0x0F71) __sfr UEP1;
  305. typedef struct
  306. {
  307. unsigned EPSTALL : 1;
  308. unsigned EPINEN : 1;
  309. unsigned EPOUTEN : 1;
  310. unsigned EPCONDIS : 1;
  311. unsigned EPHSHK : 1;
  312. unsigned : 1;
  313. unsigned : 1;
  314. unsigned : 1;
  315. } __UEP1bits_t;
  316. extern __at(0x0F71) volatile __UEP1bits_t UEP1bits;
  317. #define _UEP1_EPSTALL 0x01
  318. #define _UEP1_EPINEN 0x02
  319. #define _UEP1_EPOUTEN 0x04
  320. #define _UEP1_EPCONDIS 0x08
  321. #define _UEP1_EPHSHK 0x10
  322. //==============================================================================
  323. //==============================================================================
  324. // UEP2 Bits
  325. extern __at(0x0F72) __sfr UEP2;
  326. typedef struct
  327. {
  328. unsigned EPSTALL : 1;
  329. unsigned EPINEN : 1;
  330. unsigned EPOUTEN : 1;
  331. unsigned EPCONDIS : 1;
  332. unsigned EPHSHK : 1;
  333. unsigned : 1;
  334. unsigned : 1;
  335. unsigned : 1;
  336. } __UEP2bits_t;
  337. extern __at(0x0F72) volatile __UEP2bits_t UEP2bits;
  338. #define _UEP2_EPSTALL 0x01
  339. #define _UEP2_EPINEN 0x02
  340. #define _UEP2_EPOUTEN 0x04
  341. #define _UEP2_EPCONDIS 0x08
  342. #define _UEP2_EPHSHK 0x10
  343. //==============================================================================
  344. //==============================================================================
  345. // UEP3 Bits
  346. extern __at(0x0F73) __sfr UEP3;
  347. typedef struct
  348. {
  349. unsigned EPSTALL : 1;
  350. unsigned EPINEN : 1;
  351. unsigned EPOUTEN : 1;
  352. unsigned EPCONDIS : 1;
  353. unsigned EPHSHK : 1;
  354. unsigned : 1;
  355. unsigned : 1;
  356. unsigned : 1;
  357. } __UEP3bits_t;
  358. extern __at(0x0F73) volatile __UEP3bits_t UEP3bits;
  359. #define _UEP3_EPSTALL 0x01
  360. #define _UEP3_EPINEN 0x02
  361. #define _UEP3_EPOUTEN 0x04
  362. #define _UEP3_EPCONDIS 0x08
  363. #define _UEP3_EPHSHK 0x10
  364. //==============================================================================
  365. //==============================================================================
  366. // UEP4 Bits
  367. extern __at(0x0F74) __sfr UEP4;
  368. typedef struct
  369. {
  370. unsigned EPSTALL : 1;
  371. unsigned EPINEN : 1;
  372. unsigned EPOUTEN : 1;
  373. unsigned EPCONDIS : 1;
  374. unsigned EPHSHK : 1;
  375. unsigned : 1;
  376. unsigned : 1;
  377. unsigned : 1;
  378. } __UEP4bits_t;
  379. extern __at(0x0F74) volatile __UEP4bits_t UEP4bits;
  380. #define _UEP4_EPSTALL 0x01
  381. #define _UEP4_EPINEN 0x02
  382. #define _UEP4_EPOUTEN 0x04
  383. #define _UEP4_EPCONDIS 0x08
  384. #define _UEP4_EPHSHK 0x10
  385. //==============================================================================
  386. //==============================================================================
  387. // UEP5 Bits
  388. extern __at(0x0F75) __sfr UEP5;
  389. typedef struct
  390. {
  391. unsigned EPSTALL : 1;
  392. unsigned EPINEN : 1;
  393. unsigned EPOUTEN : 1;
  394. unsigned EPCONDIS : 1;
  395. unsigned EPHSHK : 1;
  396. unsigned : 1;
  397. unsigned : 1;
  398. unsigned : 1;
  399. } __UEP5bits_t;
  400. extern __at(0x0F75) volatile __UEP5bits_t UEP5bits;
  401. #define _UEP5_EPSTALL 0x01
  402. #define _UEP5_EPINEN 0x02
  403. #define _UEP5_EPOUTEN 0x04
  404. #define _UEP5_EPCONDIS 0x08
  405. #define _UEP5_EPHSHK 0x10
  406. //==============================================================================
  407. //==============================================================================
  408. // UEP6 Bits
  409. extern __at(0x0F76) __sfr UEP6;
  410. typedef struct
  411. {
  412. unsigned EPSTALL : 1;
  413. unsigned EPINEN : 1;
  414. unsigned EPOUTEN : 1;
  415. unsigned EPCONDIS : 1;
  416. unsigned EPHSHK : 1;
  417. unsigned : 1;
  418. unsigned : 1;
  419. unsigned : 1;
  420. } __UEP6bits_t;
  421. extern __at(0x0F76) volatile __UEP6bits_t UEP6bits;
  422. #define _UEP6_EPSTALL 0x01
  423. #define _UEP6_EPINEN 0x02
  424. #define _UEP6_EPOUTEN 0x04
  425. #define _UEP6_EPCONDIS 0x08
  426. #define _UEP6_EPHSHK 0x10
  427. //==============================================================================
  428. //==============================================================================
  429. // UEP7 Bits
  430. extern __at(0x0F77) __sfr UEP7;
  431. typedef struct
  432. {
  433. unsigned EPSTALL : 1;
  434. unsigned EPINEN : 1;
  435. unsigned EPOUTEN : 1;
  436. unsigned EPCONDIS : 1;
  437. unsigned EPHSHK : 1;
  438. unsigned : 1;
  439. unsigned : 1;
  440. unsigned : 1;
  441. } __UEP7bits_t;
  442. extern __at(0x0F77) volatile __UEP7bits_t UEP7bits;
  443. #define _UEP7_EPSTALL 0x01
  444. #define _UEP7_EPINEN 0x02
  445. #define _UEP7_EPOUTEN 0x04
  446. #define _UEP7_EPCONDIS 0x08
  447. #define _UEP7_EPHSHK 0x10
  448. //==============================================================================
  449. //==============================================================================
  450. // UEP8 Bits
  451. extern __at(0x0F78) __sfr UEP8;
  452. typedef struct
  453. {
  454. unsigned EPSTALL : 1;
  455. unsigned EPINEN : 1;
  456. unsigned EPOUTEN : 1;
  457. unsigned EPCONDIS : 1;
  458. unsigned EPHSHK : 1;
  459. unsigned : 1;
  460. unsigned : 1;
  461. unsigned : 1;
  462. } __UEP8bits_t;
  463. extern __at(0x0F78) volatile __UEP8bits_t UEP8bits;
  464. #define _UEP8_EPSTALL 0x01
  465. #define _UEP8_EPINEN 0x02
  466. #define _UEP8_EPOUTEN 0x04
  467. #define _UEP8_EPCONDIS 0x08
  468. #define _UEP8_EPHSHK 0x10
  469. //==============================================================================
  470. //==============================================================================
  471. // UEP9 Bits
  472. extern __at(0x0F79) __sfr UEP9;
  473. typedef struct
  474. {
  475. unsigned EPSTALL : 1;
  476. unsigned EPINEN : 1;
  477. unsigned EPOUTEN : 1;
  478. unsigned EPCONDIS : 1;
  479. unsigned EPHSHK : 1;
  480. unsigned : 1;
  481. unsigned : 1;
  482. unsigned : 1;
  483. } __UEP9bits_t;
  484. extern __at(0x0F79) volatile __UEP9bits_t UEP9bits;
  485. #define _UEP9_EPSTALL 0x01
  486. #define _UEP9_EPINEN 0x02
  487. #define _UEP9_EPOUTEN 0x04
  488. #define _UEP9_EPCONDIS 0x08
  489. #define _UEP9_EPHSHK 0x10
  490. //==============================================================================
  491. //==============================================================================
  492. // UEP10 Bits
  493. extern __at(0x0F7A) __sfr UEP10;
  494. typedef struct
  495. {
  496. unsigned EPSTALL : 1;
  497. unsigned EPINEN : 1;
  498. unsigned EPOUTEN : 1;
  499. unsigned EPCONDIS : 1;
  500. unsigned EPHSHK : 1;
  501. unsigned : 1;
  502. unsigned : 1;
  503. unsigned : 1;
  504. } __UEP10bits_t;
  505. extern __at(0x0F7A) volatile __UEP10bits_t UEP10bits;
  506. #define _UEP10_EPSTALL 0x01
  507. #define _UEP10_EPINEN 0x02
  508. #define _UEP10_EPOUTEN 0x04
  509. #define _UEP10_EPCONDIS 0x08
  510. #define _UEP10_EPHSHK 0x10
  511. //==============================================================================
  512. //==============================================================================
  513. // UEP11 Bits
  514. extern __at(0x0F7B) __sfr UEP11;
  515. typedef struct
  516. {
  517. unsigned EPSTALL : 1;
  518. unsigned EPINEN : 1;
  519. unsigned EPOUTEN : 1;
  520. unsigned EPCONDIS : 1;
  521. unsigned EPHSHK : 1;
  522. unsigned : 1;
  523. unsigned : 1;
  524. unsigned : 1;
  525. } __UEP11bits_t;
  526. extern __at(0x0F7B) volatile __UEP11bits_t UEP11bits;
  527. #define _UEP11_EPSTALL 0x01
  528. #define _UEP11_EPINEN 0x02
  529. #define _UEP11_EPOUTEN 0x04
  530. #define _UEP11_EPCONDIS 0x08
  531. #define _UEP11_EPHSHK 0x10
  532. //==============================================================================
  533. //==============================================================================
  534. // UEP12 Bits
  535. extern __at(0x0F7C) __sfr UEP12;
  536. typedef struct
  537. {
  538. unsigned EPSTALL : 1;
  539. unsigned EPINEN : 1;
  540. unsigned EPOUTEN : 1;
  541. unsigned EPCONDIS : 1;
  542. unsigned EPHSHK : 1;
  543. unsigned : 1;
  544. unsigned : 1;
  545. unsigned : 1;
  546. } __UEP12bits_t;
  547. extern __at(0x0F7C) volatile __UEP12bits_t UEP12bits;
  548. #define _UEP12_EPSTALL 0x01
  549. #define _UEP12_EPINEN 0x02
  550. #define _UEP12_EPOUTEN 0x04
  551. #define _UEP12_EPCONDIS 0x08
  552. #define _UEP12_EPHSHK 0x10
  553. //==============================================================================
  554. //==============================================================================
  555. // UEP13 Bits
  556. extern __at(0x0F7D) __sfr UEP13;
  557. typedef struct
  558. {
  559. unsigned EPSTALL : 1;
  560. unsigned EPINEN : 1;
  561. unsigned EPOUTEN : 1;
  562. unsigned EPCONDIS : 1;
  563. unsigned EPHSHK : 1;
  564. unsigned : 1;
  565. unsigned : 1;
  566. unsigned : 1;
  567. } __UEP13bits_t;
  568. extern __at(0x0F7D) volatile __UEP13bits_t UEP13bits;
  569. #define _UEP13_EPSTALL 0x01
  570. #define _UEP13_EPINEN 0x02
  571. #define _UEP13_EPOUTEN 0x04
  572. #define _UEP13_EPCONDIS 0x08
  573. #define _UEP13_EPHSHK 0x10
  574. //==============================================================================
  575. //==============================================================================
  576. // UEP14 Bits
  577. extern __at(0x0F7E) __sfr UEP14;
  578. typedef struct
  579. {
  580. unsigned EPSTALL : 1;
  581. unsigned EPINEN : 1;
  582. unsigned EPOUTEN : 1;
  583. unsigned EPCONDIS : 1;
  584. unsigned EPHSHK : 1;
  585. unsigned : 1;
  586. unsigned : 1;
  587. unsigned : 1;
  588. } __UEP14bits_t;
  589. extern __at(0x0F7E) volatile __UEP14bits_t UEP14bits;
  590. #define _UEP14_EPSTALL 0x01
  591. #define _UEP14_EPINEN 0x02
  592. #define _UEP14_EPOUTEN 0x04
  593. #define _UEP14_EPCONDIS 0x08
  594. #define _UEP14_EPHSHK 0x10
  595. //==============================================================================
  596. //==============================================================================
  597. // UEP15 Bits
  598. extern __at(0x0F7F) __sfr UEP15;
  599. typedef struct
  600. {
  601. unsigned EPSTALL : 1;
  602. unsigned EPINEN : 1;
  603. unsigned EPOUTEN : 1;
  604. unsigned EPCONDIS : 1;
  605. unsigned EPHSHK : 1;
  606. unsigned : 1;
  607. unsigned : 1;
  608. unsigned : 1;
  609. } __UEP15bits_t;
  610. extern __at(0x0F7F) volatile __UEP15bits_t UEP15bits;
  611. #define _UEP15_EPSTALL 0x01
  612. #define _UEP15_EPINEN 0x02
  613. #define _UEP15_EPOUTEN 0x04
  614. #define _UEP15_EPCONDIS 0x08
  615. #define _UEP15_EPHSHK 0x10
  616. //==============================================================================
  617. //==============================================================================
  618. // PORTA Bits
  619. extern __at(0x0F80) __sfr PORTA;
  620. typedef union
  621. {
  622. struct
  623. {
  624. unsigned RA0 : 1;
  625. unsigned RA1 : 1;
  626. unsigned RA2 : 1;
  627. unsigned RA3 : 1;
  628. unsigned RA4 : 1;
  629. unsigned RA5 : 1;
  630. unsigned RA6 : 1;
  631. unsigned : 1;
  632. };
  633. struct
  634. {
  635. unsigned AN0 : 1;
  636. unsigned AN1 : 1;
  637. unsigned AN2 : 1;
  638. unsigned AN3 : 1;
  639. unsigned T0CKI : 1;
  640. unsigned AN4 : 1;
  641. unsigned OSC2 : 1;
  642. unsigned : 1;
  643. };
  644. struct
  645. {
  646. unsigned : 1;
  647. unsigned : 1;
  648. unsigned VREFM : 1;
  649. unsigned VREFP : 1;
  650. unsigned : 1;
  651. unsigned LVDIN : 1;
  652. unsigned : 1;
  653. unsigned : 1;
  654. };
  655. struct
  656. {
  657. unsigned : 1;
  658. unsigned : 1;
  659. unsigned : 1;
  660. unsigned : 1;
  661. unsigned : 1;
  662. unsigned HLVDIN : 1;
  663. unsigned : 1;
  664. unsigned : 1;
  665. };
  666. struct
  667. {
  668. unsigned RA : 7;
  669. unsigned : 1;
  670. };
  671. } __PORTAbits_t;
  672. extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
  673. #define _PORTA_RA0 0x01
  674. #define _PORTA_AN0 0x01
  675. #define _PORTA_RA1 0x02
  676. #define _PORTA_AN1 0x02
  677. #define _PORTA_RA2 0x04
  678. #define _PORTA_AN2 0x04
  679. #define _PORTA_VREFM 0x04
  680. #define _PORTA_RA3 0x08
  681. #define _PORTA_AN3 0x08
  682. #define _PORTA_VREFP 0x08
  683. #define _PORTA_RA4 0x10
  684. #define _PORTA_T0CKI 0x10
  685. #define _PORTA_RA5 0x20
  686. #define _PORTA_AN4 0x20
  687. #define _PORTA_LVDIN 0x20
  688. #define _PORTA_HLVDIN 0x20
  689. #define _PORTA_RA6 0x40
  690. #define _PORTA_OSC2 0x40
  691. //==============================================================================
  692. //==============================================================================
  693. // PORTB Bits
  694. extern __at(0x0F81) __sfr PORTB;
  695. typedef union
  696. {
  697. struct
  698. {
  699. unsigned RB0 : 1;
  700. unsigned RB1 : 1;
  701. unsigned RB2 : 1;
  702. unsigned RB3 : 1;
  703. unsigned RB4 : 1;
  704. unsigned RB5 : 1;
  705. unsigned RB6 : 1;
  706. unsigned RB7 : 1;
  707. };
  708. struct
  709. {
  710. unsigned INT0 : 1;
  711. unsigned INT1 : 1;
  712. unsigned INT2 : 1;
  713. unsigned : 1;
  714. unsigned : 1;
  715. unsigned PGM : 1;
  716. unsigned PGC : 1;
  717. unsigned PGD : 1;
  718. };
  719. struct
  720. {
  721. unsigned INT : 3;
  722. unsigned : 5;
  723. };
  724. } __PORTBbits_t;
  725. extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
  726. #define _PORTB_RB0 0x01
  727. #define _PORTB_INT0 0x01
  728. #define _PORTB_RB1 0x02
  729. #define _PORTB_INT1 0x02
  730. #define _PORTB_RB2 0x04
  731. #define _PORTB_INT2 0x04
  732. #define _PORTB_RB3 0x08
  733. #define _PORTB_RB4 0x10
  734. #define _PORTB_RB5 0x20
  735. #define _PORTB_PGM 0x20
  736. #define _PORTB_RB6 0x40
  737. #define _PORTB_PGC 0x40
  738. #define _PORTB_RB7 0x80
  739. #define _PORTB_PGD 0x80
  740. //==============================================================================
  741. //==============================================================================
  742. // PORTC Bits
  743. extern __at(0x0F82) __sfr PORTC;
  744. typedef union
  745. {
  746. struct
  747. {
  748. unsigned RC0 : 1;
  749. unsigned RC1 : 1;
  750. unsigned RC2 : 1;
  751. unsigned : 1;
  752. unsigned RC4 : 1;
  753. unsigned RC5 : 1;
  754. unsigned RC6 : 1;
  755. unsigned RC7 : 1;
  756. };
  757. struct
  758. {
  759. unsigned T1OSO : 1;
  760. unsigned T1OSI : 1;
  761. unsigned CCP1 : 1;
  762. unsigned : 1;
  763. unsigned : 1;
  764. unsigned : 1;
  765. unsigned TX : 1;
  766. unsigned RX : 1;
  767. };
  768. struct
  769. {
  770. unsigned T13CKI : 1;
  771. unsigned : 1;
  772. unsigned P1A : 1;
  773. unsigned : 1;
  774. unsigned : 1;
  775. unsigned : 1;
  776. unsigned CK : 1;
  777. unsigned : 1;
  778. };
  779. } __PORTCbits_t;
  780. extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
  781. #define _PORTC_RC0 0x01
  782. #define _PORTC_T1OSO 0x01
  783. #define _PORTC_T13CKI 0x01
  784. #define _PORTC_RC1 0x02
  785. #define _PORTC_T1OSI 0x02
  786. #define _PORTC_RC2 0x04
  787. #define _PORTC_CCP1 0x04
  788. #define _PORTC_P1A 0x04
  789. #define _PORTC_RC4 0x10
  790. #define _PORTC_RC5 0x20
  791. #define _PORTC_RC6 0x40
  792. #define _PORTC_TX 0x40
  793. #define _PORTC_CK 0x40
  794. #define _PORTC_RC7 0x80
  795. #define _PORTC_RX 0x80
  796. //==============================================================================
  797. //==============================================================================
  798. // PORTE Bits
  799. extern __at(0x0F84) __sfr PORTE;
  800. typedef struct
  801. {
  802. unsigned : 1;
  803. unsigned : 1;
  804. unsigned : 1;
  805. unsigned RE3 : 1;
  806. unsigned : 1;
  807. unsigned : 1;
  808. unsigned : 1;
  809. unsigned : 1;
  810. } __PORTEbits_t;
  811. extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
  812. #define _RE3 0x08
  813. //==============================================================================
  814. //==============================================================================
  815. // LATA Bits
  816. extern __at(0x0F89) __sfr LATA;
  817. typedef union
  818. {
  819. struct
  820. {
  821. unsigned LATA0 : 1;
  822. unsigned LATA1 : 1;
  823. unsigned LATA2 : 1;
  824. unsigned LATA3 : 1;
  825. unsigned LATA4 : 1;
  826. unsigned LATA5 : 1;
  827. unsigned LATA6 : 1;
  828. unsigned : 1;
  829. };
  830. struct
  831. {
  832. unsigned LATA : 7;
  833. unsigned : 1;
  834. };
  835. } __LATAbits_t;
  836. extern __at(0x0F89) volatile __LATAbits_t LATAbits;
  837. #define _LATA0 0x01
  838. #define _LATA1 0x02
  839. #define _LATA2 0x04
  840. #define _LATA3 0x08
  841. #define _LATA4 0x10
  842. #define _LATA5 0x20
  843. #define _LATA6 0x40
  844. //==============================================================================
  845. //==============================================================================
  846. // LATB Bits
  847. extern __at(0x0F8A) __sfr LATB;
  848. typedef struct
  849. {
  850. unsigned LATB0 : 1;
  851. unsigned LATB1 : 1;
  852. unsigned LATB2 : 1;
  853. unsigned LATB3 : 1;
  854. unsigned LATB4 : 1;
  855. unsigned LATB5 : 1;
  856. unsigned LATB6 : 1;
  857. unsigned LATB7 : 1;
  858. } __LATBbits_t;
  859. extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
  860. #define _LATB0 0x01
  861. #define _LATB1 0x02
  862. #define _LATB2 0x04
  863. #define _LATB3 0x08
  864. #define _LATB4 0x10
  865. #define _LATB5 0x20
  866. #define _LATB6 0x40
  867. #define _LATB7 0x80
  868. //==============================================================================
  869. //==============================================================================
  870. // LATC Bits
  871. extern __at(0x0F8B) __sfr LATC;
  872. typedef struct
  873. {
  874. unsigned LATC0 : 1;
  875. unsigned LATC1 : 1;
  876. unsigned LATC2 : 1;
  877. unsigned : 1;
  878. unsigned : 1;
  879. unsigned : 1;
  880. unsigned LATC6 : 1;
  881. unsigned LATC7 : 1;
  882. } __LATCbits_t;
  883. extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
  884. #define _LATC0 0x01
  885. #define _LATC1 0x02
  886. #define _LATC2 0x04
  887. #define _LATC6 0x40
  888. #define _LATC7 0x80
  889. //==============================================================================
  890. //==============================================================================
  891. // DDRA Bits
  892. extern __at(0x0F92) __sfr DDRA;
  893. typedef union
  894. {
  895. struct
  896. {
  897. unsigned TRISA0 : 1;
  898. unsigned TRISA1 : 1;
  899. unsigned TRISA2 : 1;
  900. unsigned TRISA3 : 1;
  901. unsigned TRISA4 : 1;
  902. unsigned TRISA5 : 1;
  903. unsigned TRISA6 : 1;
  904. unsigned : 1;
  905. };
  906. struct
  907. {
  908. unsigned RA0 : 1;
  909. unsigned RA1 : 1;
  910. unsigned RA2 : 1;
  911. unsigned RA3 : 1;
  912. unsigned RA4 : 1;
  913. unsigned RA5 : 1;
  914. unsigned RA6 : 1;
  915. unsigned : 1;
  916. };
  917. struct
  918. {
  919. unsigned RA : 7;
  920. unsigned : 1;
  921. };
  922. struct
  923. {
  924. unsigned TRISA : 7;
  925. unsigned : 1;
  926. };
  927. } __DDRAbits_t;
  928. extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
  929. #define _TRISA0 0x01
  930. #define _RA0 0x01
  931. #define _TRISA1 0x02
  932. #define _RA1 0x02
  933. #define _TRISA2 0x04
  934. #define _RA2 0x04
  935. #define _TRISA3 0x08
  936. #define _RA3 0x08
  937. #define _TRISA4 0x10
  938. #define _RA4 0x10
  939. #define _TRISA5 0x20
  940. #define _RA5 0x20
  941. #define _TRISA6 0x40
  942. #define _RA6 0x40
  943. //==============================================================================
  944. //==============================================================================
  945. // TRISA Bits
  946. extern __at(0x0F92) __sfr TRISA;
  947. typedef union
  948. {
  949. struct
  950. {
  951. unsigned TRISA0 : 1;
  952. unsigned TRISA1 : 1;
  953. unsigned TRISA2 : 1;
  954. unsigned TRISA3 : 1;
  955. unsigned TRISA4 : 1;
  956. unsigned TRISA5 : 1;
  957. unsigned TRISA6 : 1;
  958. unsigned : 1;
  959. };
  960. struct
  961. {
  962. unsigned RA0 : 1;
  963. unsigned RA1 : 1;
  964. unsigned RA2 : 1;
  965. unsigned RA3 : 1;
  966. unsigned RA4 : 1;
  967. unsigned RA5 : 1;
  968. unsigned RA6 : 1;
  969. unsigned : 1;
  970. };
  971. struct
  972. {
  973. unsigned RA : 7;
  974. unsigned : 1;
  975. };
  976. struct
  977. {
  978. unsigned TRISA : 7;
  979. unsigned : 1;
  980. };
  981. } __TRISAbits_t;
  982. extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
  983. #define _TRISA_TRISA0 0x01
  984. #define _TRISA_RA0 0x01
  985. #define _TRISA_TRISA1 0x02
  986. #define _TRISA_RA1 0x02
  987. #define _TRISA_TRISA2 0x04
  988. #define _TRISA_RA2 0x04
  989. #define _TRISA_TRISA3 0x08
  990. #define _TRISA_RA3 0x08
  991. #define _TRISA_TRISA4 0x10
  992. #define _TRISA_RA4 0x10
  993. #define _TRISA_TRISA5 0x20
  994. #define _TRISA_RA5 0x20
  995. #define _TRISA_TRISA6 0x40
  996. #define _TRISA_RA6 0x40
  997. //==============================================================================
  998. //==============================================================================
  999. // DDRB Bits
  1000. extern __at(0x0F93) __sfr DDRB;
  1001. typedef union
  1002. {
  1003. struct
  1004. {
  1005. unsigned TRISB0 : 1;
  1006. unsigned TRISB1 : 1;
  1007. unsigned TRISB2 : 1;
  1008. unsigned TRISB3 : 1;
  1009. unsigned TRISB4 : 1;
  1010. unsigned TRISB5 : 1;
  1011. unsigned TRISB6 : 1;
  1012. unsigned TRISB7 : 1;
  1013. };
  1014. struct
  1015. {
  1016. unsigned RB0 : 1;
  1017. unsigned RB1 : 1;
  1018. unsigned RB2 : 1;
  1019. unsigned RB3 : 1;
  1020. unsigned RB4 : 1;
  1021. unsigned RB5 : 1;
  1022. unsigned RB6 : 1;
  1023. unsigned RB7 : 1;
  1024. };
  1025. } __DDRBbits_t;
  1026. extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
  1027. #define _TRISB0 0x01
  1028. #define _RB0 0x01
  1029. #define _TRISB1 0x02
  1030. #define _RB1 0x02
  1031. #define _TRISB2 0x04
  1032. #define _RB2 0x04
  1033. #define _TRISB3 0x08
  1034. #define _RB3 0x08
  1035. #define _TRISB4 0x10
  1036. #define _RB4 0x10
  1037. #define _TRISB5 0x20
  1038. #define _RB5 0x20
  1039. #define _TRISB6 0x40
  1040. #define _RB6 0x40
  1041. #define _TRISB7 0x80
  1042. #define _RB7 0x80
  1043. //==============================================================================
  1044. //==============================================================================
  1045. // TRISB Bits
  1046. extern __at(0x0F93) __sfr TRISB;
  1047. typedef union
  1048. {
  1049. struct
  1050. {
  1051. unsigned TRISB0 : 1;
  1052. unsigned TRISB1 : 1;
  1053. unsigned TRISB2 : 1;
  1054. unsigned TRISB3 : 1;
  1055. unsigned TRISB4 : 1;
  1056. unsigned TRISB5 : 1;
  1057. unsigned TRISB6 : 1;
  1058. unsigned TRISB7 : 1;
  1059. };
  1060. struct
  1061. {
  1062. unsigned RB0 : 1;
  1063. unsigned RB1 : 1;
  1064. unsigned RB2 : 1;
  1065. unsigned RB3 : 1;
  1066. unsigned RB4 : 1;
  1067. unsigned RB5 : 1;
  1068. unsigned RB6 : 1;
  1069. unsigned RB7 : 1;
  1070. };
  1071. } __TRISBbits_t;
  1072. extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
  1073. #define _TRISB_TRISB0 0x01
  1074. #define _TRISB_RB0 0x01
  1075. #define _TRISB_TRISB1 0x02
  1076. #define _TRISB_RB1 0x02
  1077. #define _TRISB_TRISB2 0x04
  1078. #define _TRISB_RB2 0x04
  1079. #define _TRISB_TRISB3 0x08
  1080. #define _TRISB_RB3 0x08
  1081. #define _TRISB_TRISB4 0x10
  1082. #define _TRISB_RB4 0x10
  1083. #define _TRISB_TRISB5 0x20
  1084. #define _TRISB_RB5 0x20
  1085. #define _TRISB_TRISB6 0x40
  1086. #define _TRISB_RB6 0x40
  1087. #define _TRISB_TRISB7 0x80
  1088. #define _TRISB_RB7 0x80
  1089. //==============================================================================
  1090. //==============================================================================
  1091. // DDRC Bits
  1092. extern __at(0x0F94) __sfr DDRC;
  1093. typedef union
  1094. {
  1095. struct
  1096. {
  1097. unsigned TRISC0 : 1;
  1098. unsigned TRISC1 : 1;
  1099. unsigned TRISC2 : 1;
  1100. unsigned : 1;
  1101. unsigned : 1;
  1102. unsigned : 1;
  1103. unsigned TRISC6 : 1;
  1104. unsigned TRISC7 : 1;
  1105. };
  1106. struct
  1107. {
  1108. unsigned RC0 : 1;
  1109. unsigned RC1 : 1;
  1110. unsigned RC2 : 1;
  1111. unsigned : 1;
  1112. unsigned : 1;
  1113. unsigned : 1;
  1114. unsigned RC6 : 1;
  1115. unsigned RC7 : 1;
  1116. };
  1117. } __DDRCbits_t;
  1118. extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
  1119. #define _TRISC0 0x01
  1120. #define _RC0 0x01
  1121. #define _TRISC1 0x02
  1122. #define _RC1 0x02
  1123. #define _TRISC2 0x04
  1124. #define _RC2 0x04
  1125. #define _TRISC6 0x40
  1126. #define _RC6 0x40
  1127. #define _TRISC7 0x80
  1128. #define _RC7 0x80
  1129. //==============================================================================
  1130. //==============================================================================
  1131. // TRISC Bits
  1132. extern __at(0x0F94) __sfr TRISC;
  1133. typedef union
  1134. {
  1135. struct
  1136. {
  1137. unsigned TRISC0 : 1;
  1138. unsigned TRISC1 : 1;
  1139. unsigned TRISC2 : 1;
  1140. unsigned : 1;
  1141. unsigned : 1;
  1142. unsigned : 1;
  1143. unsigned TRISC6 : 1;
  1144. unsigned TRISC7 : 1;
  1145. };
  1146. struct
  1147. {
  1148. unsigned RC0 : 1;
  1149. unsigned RC1 : 1;
  1150. unsigned RC2 : 1;
  1151. unsigned : 1;
  1152. unsigned : 1;
  1153. unsigned : 1;
  1154. unsigned RC6 : 1;
  1155. unsigned RC7 : 1;
  1156. };
  1157. } __TRISCbits_t;
  1158. extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
  1159. #define _TRISC_TRISC0 0x01
  1160. #define _TRISC_RC0 0x01
  1161. #define _TRISC_TRISC1 0x02
  1162. #define _TRISC_RC1 0x02
  1163. #define _TRISC_TRISC2 0x04
  1164. #define _TRISC_RC2 0x04
  1165. #define _TRISC_TRISC6 0x40
  1166. #define _TRISC_RC6 0x40
  1167. #define _TRISC_TRISC7 0x80
  1168. #define _TRISC_RC7 0x80
  1169. //==============================================================================
  1170. //==============================================================================
  1171. // OSCTUNE Bits
  1172. extern __at(0x0F9B) __sfr OSCTUNE;
  1173. typedef union
  1174. {
  1175. struct
  1176. {
  1177. unsigned TUN0 : 1;
  1178. unsigned TUN1 : 1;
  1179. unsigned TUN2 : 1;
  1180. unsigned TUN3 : 1;
  1181. unsigned TUN4 : 1;
  1182. unsigned : 1;
  1183. unsigned : 1;
  1184. unsigned INTSRC : 1;
  1185. };
  1186. struct
  1187. {
  1188. unsigned TUN : 5;
  1189. unsigned : 3;
  1190. };
  1191. } __OSCTUNEbits_t;
  1192. extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
  1193. #define _TUN0 0x01
  1194. #define _TUN1 0x02
  1195. #define _TUN2 0x04
  1196. #define _TUN3 0x08
  1197. #define _TUN4 0x10
  1198. #define _INTSRC 0x80
  1199. //==============================================================================
  1200. //==============================================================================
  1201. // PIE1 Bits
  1202. extern __at(0x0F9D) __sfr PIE1;
  1203. typedef struct
  1204. {
  1205. unsigned TMR1IE : 1;
  1206. unsigned TMR2IE : 1;
  1207. unsigned CCP1IE : 1;
  1208. unsigned SSPIE : 1;
  1209. unsigned TXIE : 1;
  1210. unsigned RCIE : 1;
  1211. unsigned ADIE : 1;
  1212. unsigned : 1;
  1213. } __PIE1bits_t;
  1214. extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
  1215. #define _TMR1IE 0x01
  1216. #define _TMR2IE 0x02
  1217. #define _CCP1IE 0x04
  1218. #define _SSPIE 0x08
  1219. #define _TXIE 0x10
  1220. #define _RCIE 0x20
  1221. #define _ADIE 0x40
  1222. //==============================================================================
  1223. //==============================================================================
  1224. // PIR1 Bits
  1225. extern __at(0x0F9E) __sfr PIR1;
  1226. typedef struct
  1227. {
  1228. unsigned TMR1IF : 1;
  1229. unsigned TMR2IF : 1;
  1230. unsigned CCP1IF : 1;
  1231. unsigned SSPIF : 1;
  1232. unsigned TXIF : 1;
  1233. unsigned RCIF : 1;
  1234. unsigned ADIF : 1;
  1235. unsigned : 1;
  1236. } __PIR1bits_t;
  1237. extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
  1238. #define _TMR1IF 0x01
  1239. #define _TMR2IF 0x02
  1240. #define _CCP1IF 0x04
  1241. #define _SSPIF 0x08
  1242. #define _TXIF 0x10
  1243. #define _RCIF 0x20
  1244. #define _ADIF 0x40
  1245. //==============================================================================
  1246. //==============================================================================
  1247. // IPR1 Bits
  1248. extern __at(0x0F9F) __sfr IPR1;
  1249. typedef struct
  1250. {
  1251. unsigned TMR1IP : 1;
  1252. unsigned TMR2IP : 1;
  1253. unsigned CCP1IP : 1;
  1254. unsigned SSPIP : 1;
  1255. unsigned TXIP : 1;
  1256. unsigned RCIP : 1;
  1257. unsigned ADIP : 1;
  1258. unsigned : 1;
  1259. } __IPR1bits_t;
  1260. extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
  1261. #define _TMR1IP 0x01
  1262. #define _TMR2IP 0x02
  1263. #define _CCP1IP 0x04
  1264. #define _SSPIP 0x08
  1265. #define _TXIP 0x10
  1266. #define _RCIP 0x20
  1267. #define _ADIP 0x40
  1268. //==============================================================================
  1269. //==============================================================================
  1270. // PIE2 Bits
  1271. extern __at(0x0FA0) __sfr PIE2;
  1272. typedef union
  1273. {
  1274. struct
  1275. {
  1276. unsigned CCP2IE : 1;
  1277. unsigned TMR3IE : 1;
  1278. unsigned HLVDIE : 1;
  1279. unsigned BCLIE : 1;
  1280. unsigned EEIE : 1;
  1281. unsigned USBIE : 1;
  1282. unsigned CMIE : 1;
  1283. unsigned OSCFIE : 1;
  1284. };
  1285. struct
  1286. {
  1287. unsigned : 1;
  1288. unsigned : 1;
  1289. unsigned LVDIE : 1;
  1290. unsigned : 1;
  1291. unsigned : 1;
  1292. unsigned : 1;
  1293. unsigned : 1;
  1294. unsigned : 1;
  1295. };
  1296. } __PIE2bits_t;
  1297. extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
  1298. #define _CCP2IE 0x01
  1299. #define _TMR3IE 0x02
  1300. #define _HLVDIE 0x04
  1301. #define _LVDIE 0x04
  1302. #define _BCLIE 0x08
  1303. #define _EEIE 0x10
  1304. #define _USBIE 0x20
  1305. #define _CMIE 0x40
  1306. #define _OSCFIE 0x80
  1307. //==============================================================================
  1308. //==============================================================================
  1309. // PIR2 Bits
  1310. extern __at(0x0FA1) __sfr PIR2;
  1311. typedef union
  1312. {
  1313. struct
  1314. {
  1315. unsigned CCP2IF : 1;
  1316. unsigned TMR3IF : 1;
  1317. unsigned HLVDIF : 1;
  1318. unsigned BCLIF : 1;
  1319. unsigned EEIF : 1;
  1320. unsigned USBIF : 1;
  1321. unsigned CMIF : 1;
  1322. unsigned OSCFIF : 1;
  1323. };
  1324. struct
  1325. {
  1326. unsigned : 1;
  1327. unsigned : 1;
  1328. unsigned LVDIF : 1;
  1329. unsigned : 1;
  1330. unsigned : 1;
  1331. unsigned : 1;
  1332. unsigned : 1;
  1333. unsigned : 1;
  1334. };
  1335. } __PIR2bits_t;
  1336. extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
  1337. #define _CCP2IF 0x01
  1338. #define _TMR3IF 0x02
  1339. #define _HLVDIF 0x04
  1340. #define _LVDIF 0x04
  1341. #define _BCLIF 0x08
  1342. #define _EEIF 0x10
  1343. #define _USBIF 0x20
  1344. #define _CMIF 0x40
  1345. #define _OSCFIF 0x80
  1346. //==============================================================================
  1347. //==============================================================================
  1348. // IPR2 Bits
  1349. extern __at(0x0FA2) __sfr IPR2;
  1350. typedef union
  1351. {
  1352. struct
  1353. {
  1354. unsigned CCP2IP : 1;
  1355. unsigned TMR3IP : 1;
  1356. unsigned HLVDIP : 1;
  1357. unsigned BCLIP : 1;
  1358. unsigned EEIP : 1;
  1359. unsigned USBIP : 1;
  1360. unsigned CMIP : 1;
  1361. unsigned OSCFIP : 1;
  1362. };
  1363. struct
  1364. {
  1365. unsigned : 1;
  1366. unsigned : 1;
  1367. unsigned LVDIP : 1;
  1368. unsigned : 1;
  1369. unsigned : 1;
  1370. unsigned : 1;
  1371. unsigned : 1;
  1372. unsigned : 1;
  1373. };
  1374. } __IPR2bits_t;
  1375. extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
  1376. #define _CCP2IP 0x01
  1377. #define _TMR3IP 0x02
  1378. #define _HLVDIP 0x04
  1379. #define _LVDIP 0x04
  1380. #define _BCLIP 0x08
  1381. #define _EEIP 0x10
  1382. #define _USBIP 0x20
  1383. #define _CMIP 0x40
  1384. #define _OSCFIP 0x80
  1385. //==============================================================================
  1386. //==============================================================================
  1387. // EECON1 Bits
  1388. extern __at(0x0FA6) __sfr EECON1;
  1389. typedef struct
  1390. {
  1391. unsigned RD : 1;
  1392. unsigned WR : 1;
  1393. unsigned WREN : 1;
  1394. unsigned WRERR : 1;
  1395. unsigned FREE : 1;
  1396. unsigned : 1;
  1397. unsigned CFGS : 1;
  1398. unsigned EEPGD : 1;
  1399. } __EECON1bits_t;
  1400. extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
  1401. #define _RD 0x01
  1402. #define _WR 0x02
  1403. #define _WREN 0x04
  1404. #define _WRERR 0x08
  1405. #define _FREE 0x10
  1406. #define _CFGS 0x40
  1407. #define _EEPGD 0x80
  1408. //==============================================================================
  1409. extern __at(0x0FA7) __sfr EECON2;
  1410. extern __at(0x0FA8) __sfr EEDATA;
  1411. extern __at(0x0FA9) __sfr EEADR;
  1412. //==============================================================================
  1413. // RCSTA Bits
  1414. extern __at(0x0FAB) __sfr RCSTA;
  1415. typedef union
  1416. {
  1417. struct
  1418. {
  1419. unsigned RX9D : 1;
  1420. unsigned OERR : 1;
  1421. unsigned FERR : 1;
  1422. unsigned ADDEN : 1;
  1423. unsigned CREN : 1;
  1424. unsigned SREN : 1;
  1425. unsigned RX9 : 1;
  1426. unsigned SPEN : 1;
  1427. };
  1428. struct
  1429. {
  1430. unsigned : 1;
  1431. unsigned : 1;
  1432. unsigned : 1;
  1433. unsigned ADEN : 1;
  1434. unsigned : 1;
  1435. unsigned : 1;
  1436. unsigned : 1;
  1437. unsigned : 1;
  1438. };
  1439. } __RCSTAbits_t;
  1440. extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
  1441. #define _RX9D 0x01
  1442. #define _OERR 0x02
  1443. #define _FERR 0x04
  1444. #define _ADDEN 0x08
  1445. #define _ADEN 0x08
  1446. #define _CREN 0x10
  1447. #define _SREN 0x20
  1448. #define _RX9 0x40
  1449. #define _SPEN 0x80
  1450. //==============================================================================
  1451. //==============================================================================
  1452. // TXSTA Bits
  1453. extern __at(0x0FAC) __sfr TXSTA;
  1454. typedef struct
  1455. {
  1456. unsigned TX9D : 1;
  1457. unsigned TRMT : 1;
  1458. unsigned BRGH : 1;
  1459. unsigned SENDB : 1;
  1460. unsigned SYNC : 1;
  1461. unsigned TXEN : 1;
  1462. unsigned TX9 : 1;
  1463. unsigned CSRC : 1;
  1464. } __TXSTAbits_t;
  1465. extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
  1466. #define _TX9D 0x01
  1467. #define _TRMT 0x02
  1468. #define _BRGH 0x04
  1469. #define _SENDB 0x08
  1470. #define _SYNC 0x10
  1471. #define _TXEN 0x20
  1472. #define _TX9 0x40
  1473. #define _CSRC 0x80
  1474. //==============================================================================
  1475. extern __at(0x0FAD) __sfr TXREG;
  1476. extern __at(0x0FAE) __sfr RCREG;
  1477. extern __at(0x0FAF) __sfr SPBRG;
  1478. extern __at(0x0FB0) __sfr SPBRGH;
  1479. //==============================================================================
  1480. // T3CON Bits
  1481. extern __at(0x0FB1) __sfr T3CON;
  1482. typedef union
  1483. {
  1484. struct
  1485. {
  1486. unsigned TMR3ON : 1;
  1487. unsigned TMR3CS : 1;
  1488. unsigned NOT_T3SYNC : 1;
  1489. unsigned T3CCP1 : 1;
  1490. unsigned T3CKPS0 : 1;
  1491. unsigned T3CKPS1 : 1;
  1492. unsigned T3CCP2 : 1;
  1493. unsigned RD16 : 1;
  1494. };
  1495. struct
  1496. {
  1497. unsigned : 1;
  1498. unsigned : 1;
  1499. unsigned T3SYNC : 1;
  1500. unsigned : 1;
  1501. unsigned : 1;
  1502. unsigned : 1;
  1503. unsigned : 1;
  1504. unsigned : 1;
  1505. };
  1506. struct
  1507. {
  1508. unsigned : 1;
  1509. unsigned : 1;
  1510. unsigned T3NSYNC : 1;
  1511. unsigned : 1;
  1512. unsigned : 1;
  1513. unsigned : 1;
  1514. unsigned : 1;
  1515. unsigned : 1;
  1516. };
  1517. struct
  1518. {
  1519. unsigned : 4;
  1520. unsigned T3CKPS : 2;
  1521. unsigned : 2;
  1522. };
  1523. } __T3CONbits_t;
  1524. extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
  1525. #define _T3CON_TMR3ON 0x01
  1526. #define _T3CON_TMR3CS 0x02
  1527. #define _T3CON_NOT_T3SYNC 0x04
  1528. #define _T3CON_T3SYNC 0x04
  1529. #define _T3CON_T3NSYNC 0x04
  1530. #define _T3CON_T3CCP1 0x08
  1531. #define _T3CON_T3CKPS0 0x10
  1532. #define _T3CON_T3CKPS1 0x20
  1533. #define _T3CON_T3CCP2 0x40
  1534. #define _T3CON_RD16 0x80
  1535. //==============================================================================
  1536. extern __at(0x0FB2) __sfr TMR3;
  1537. extern __at(0x0FB2) __sfr TMR3L;
  1538. extern __at(0x0FB3) __sfr TMR3H;
  1539. //==============================================================================
  1540. // CMCON Bits
  1541. extern __at(0x0FB4) __sfr CMCON;
  1542. typedef union
  1543. {
  1544. struct
  1545. {
  1546. unsigned CM0 : 1;
  1547. unsigned CM1 : 1;
  1548. unsigned CM2 : 1;
  1549. unsigned CIS : 1;
  1550. unsigned C1INV : 1;
  1551. unsigned C2INV : 1;
  1552. unsigned C1OUT : 1;
  1553. unsigned C2OUT : 1;
  1554. };
  1555. struct
  1556. {
  1557. unsigned CM : 3;
  1558. unsigned : 5;
  1559. };
  1560. } __CMCONbits_t;
  1561. extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
  1562. #define _CM0 0x01
  1563. #define _CM1 0x02
  1564. #define _CM2 0x04
  1565. #define _CIS 0x08
  1566. #define _C1INV 0x10
  1567. #define _C2INV 0x20
  1568. #define _C1OUT 0x40
  1569. #define _C2OUT 0x80
  1570. //==============================================================================
  1571. //==============================================================================
  1572. // CVRCON Bits
  1573. extern __at(0x0FB5) __sfr CVRCON;
  1574. typedef union
  1575. {
  1576. struct
  1577. {
  1578. unsigned CVR0 : 1;
  1579. unsigned CVR1 : 1;
  1580. unsigned CVR2 : 1;
  1581. unsigned CVR3 : 1;
  1582. unsigned CVRSS : 1;
  1583. unsigned CVRR : 1;
  1584. unsigned CVROE : 1;
  1585. unsigned CVREN : 1;
  1586. };
  1587. struct
  1588. {
  1589. unsigned : 1;
  1590. unsigned : 1;
  1591. unsigned : 1;
  1592. unsigned : 1;
  1593. unsigned CVREF : 1;
  1594. unsigned : 1;
  1595. unsigned : 1;
  1596. unsigned : 1;
  1597. };
  1598. struct
  1599. {
  1600. unsigned CVR : 4;
  1601. unsigned : 4;
  1602. };
  1603. } __CVRCONbits_t;
  1604. extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
  1605. #define _CVR0 0x01
  1606. #define _CVR1 0x02
  1607. #define _CVR2 0x04
  1608. #define _CVR3 0x08
  1609. #define _CVRSS 0x10
  1610. #define _CVREF 0x10
  1611. #define _CVRR 0x20
  1612. #define _CVROE 0x40
  1613. #define _CVREN 0x80
  1614. //==============================================================================
  1615. //==============================================================================
  1616. // CCP1AS Bits
  1617. extern __at(0x0FB6) __sfr CCP1AS;
  1618. typedef union
  1619. {
  1620. struct
  1621. {
  1622. unsigned : 1;
  1623. unsigned : 1;
  1624. unsigned PSSAC0 : 1;
  1625. unsigned PSSAC1 : 1;
  1626. unsigned ECCPAS0 : 1;
  1627. unsigned ECCPAS1 : 1;
  1628. unsigned ECCPAS2 : 1;
  1629. unsigned ECCPASE : 1;
  1630. };
  1631. struct
  1632. {
  1633. unsigned : 2;
  1634. unsigned PSSAC : 2;
  1635. unsigned : 4;
  1636. };
  1637. struct
  1638. {
  1639. unsigned : 4;
  1640. unsigned ECCPAS : 3;
  1641. unsigned : 1;
  1642. };
  1643. } __CCP1ASbits_t;
  1644. extern __at(0x0FB6) volatile __CCP1ASbits_t CCP1ASbits;
  1645. #define _PSSAC0 0x04
  1646. #define _PSSAC1 0x08
  1647. #define _ECCPAS0 0x10
  1648. #define _ECCPAS1 0x20
  1649. #define _ECCPAS2 0x40
  1650. #define _ECCPASE 0x80
  1651. //==============================================================================
  1652. //==============================================================================
  1653. // ECCP1AS Bits
  1654. extern __at(0x0FB6) __sfr ECCP1AS;
  1655. typedef union
  1656. {
  1657. struct
  1658. {
  1659. unsigned : 1;
  1660. unsigned : 1;
  1661. unsigned PSSAC0 : 1;
  1662. unsigned PSSAC1 : 1;
  1663. unsigned ECCPAS0 : 1;
  1664. unsigned ECCPAS1 : 1;
  1665. unsigned ECCPAS2 : 1;
  1666. unsigned ECCPASE : 1;
  1667. };
  1668. struct
  1669. {
  1670. unsigned : 2;
  1671. unsigned PSSAC : 2;
  1672. unsigned : 4;
  1673. };
  1674. struct
  1675. {
  1676. unsigned : 4;
  1677. unsigned ECCPAS : 3;
  1678. unsigned : 1;
  1679. };
  1680. } __ECCP1ASbits_t;
  1681. extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
  1682. #define _ECCP1AS_PSSAC0 0x04
  1683. #define _ECCP1AS_PSSAC1 0x08
  1684. #define _ECCP1AS_ECCPAS0 0x10
  1685. #define _ECCP1AS_ECCPAS1 0x20
  1686. #define _ECCP1AS_ECCPAS2 0x40
  1687. #define _ECCP1AS_ECCPASE 0x80
  1688. //==============================================================================
  1689. //==============================================================================
  1690. // CCP1DEL Bits
  1691. extern __at(0x0FB7) __sfr CCP1DEL;
  1692. typedef struct
  1693. {
  1694. unsigned : 1;
  1695. unsigned : 1;
  1696. unsigned : 1;
  1697. unsigned : 1;
  1698. unsigned : 1;
  1699. unsigned : 1;
  1700. unsigned : 1;
  1701. unsigned PRSEN : 1;
  1702. } __CCP1DELbits_t;
  1703. extern __at(0x0FB7) volatile __CCP1DELbits_t CCP1DELbits;
  1704. #define _PRSEN 0x80
  1705. //==============================================================================
  1706. //==============================================================================
  1707. // ECCP1DEL Bits
  1708. extern __at(0x0FB7) __sfr ECCP1DEL;
  1709. typedef struct
  1710. {
  1711. unsigned : 1;
  1712. unsigned : 1;
  1713. unsigned : 1;
  1714. unsigned : 1;
  1715. unsigned : 1;
  1716. unsigned : 1;
  1717. unsigned : 1;
  1718. unsigned PRSEN : 1;
  1719. } __ECCP1DELbits_t;
  1720. extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
  1721. #define _ECCP1DEL_PRSEN 0x80
  1722. //==============================================================================
  1723. //==============================================================================
  1724. // BAUDCON Bits
  1725. extern __at(0x0FB8) __sfr BAUDCON;
  1726. typedef union
  1727. {
  1728. struct
  1729. {
  1730. unsigned ABDEN : 1;
  1731. unsigned WUE : 1;
  1732. unsigned : 1;
  1733. unsigned BRG16 : 1;
  1734. unsigned TXCKP : 1;
  1735. unsigned RXDTP : 1;
  1736. unsigned RCIDL : 1;
  1737. unsigned ABDOVF : 1;
  1738. };
  1739. struct
  1740. {
  1741. unsigned : 1;
  1742. unsigned : 1;
  1743. unsigned : 1;
  1744. unsigned : 1;
  1745. unsigned SCKP : 1;
  1746. unsigned : 1;
  1747. unsigned RCMT : 1;
  1748. unsigned : 1;
  1749. };
  1750. } __BAUDCONbits_t;
  1751. extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
  1752. #define _ABDEN 0x01
  1753. #define _WUE 0x02
  1754. #define _BRG16 0x08
  1755. #define _TXCKP 0x10
  1756. #define _SCKP 0x10
  1757. #define _RXDTP 0x20
  1758. #define _RCIDL 0x40
  1759. #define _RCMT 0x40
  1760. #define _ABDOVF 0x80
  1761. //==============================================================================
  1762. //==============================================================================
  1763. // BAUDCTL Bits
  1764. extern __at(0x0FB8) __sfr BAUDCTL;
  1765. typedef union
  1766. {
  1767. struct
  1768. {
  1769. unsigned ABDEN : 1;
  1770. unsigned WUE : 1;
  1771. unsigned : 1;
  1772. unsigned BRG16 : 1;
  1773. unsigned TXCKP : 1;
  1774. unsigned RXDTP : 1;
  1775. unsigned RCIDL : 1;
  1776. unsigned ABDOVF : 1;
  1777. };
  1778. struct
  1779. {
  1780. unsigned : 1;
  1781. unsigned : 1;
  1782. unsigned : 1;
  1783. unsigned : 1;
  1784. unsigned SCKP : 1;
  1785. unsigned : 1;
  1786. unsigned RCMT : 1;
  1787. unsigned : 1;
  1788. };
  1789. } __BAUDCTLbits_t;
  1790. extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
  1791. #define _BAUDCTL_ABDEN 0x01
  1792. #define _BAUDCTL_WUE 0x02
  1793. #define _BAUDCTL_BRG16 0x08
  1794. #define _BAUDCTL_TXCKP 0x10
  1795. #define _BAUDCTL_SCKP 0x10
  1796. #define _BAUDCTL_RXDTP 0x20
  1797. #define _BAUDCTL_RCIDL 0x40
  1798. #define _BAUDCTL_RCMT 0x40
  1799. #define _BAUDCTL_ABDOVF 0x80
  1800. //==============================================================================
  1801. //==============================================================================
  1802. // CCP2CON Bits
  1803. extern __at(0x0FBA) __sfr CCP2CON;
  1804. typedef union
  1805. {
  1806. struct
  1807. {
  1808. unsigned CCP2M0 : 1;
  1809. unsigned CCP2M1 : 1;
  1810. unsigned CCP2M2 : 1;
  1811. unsigned CCP2M3 : 1;
  1812. unsigned DC2B0 : 1;
  1813. unsigned DC2B1 : 1;
  1814. unsigned : 1;
  1815. unsigned : 1;
  1816. };
  1817. struct
  1818. {
  1819. unsigned CCP2M : 4;
  1820. unsigned : 4;
  1821. };
  1822. struct
  1823. {
  1824. unsigned : 4;
  1825. unsigned DC2B : 2;
  1826. unsigned : 2;
  1827. };
  1828. } __CCP2CONbits_t;
  1829. extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
  1830. #define _CCP2M0 0x01
  1831. #define _CCP2M1 0x02
  1832. #define _CCP2M2 0x04
  1833. #define _CCP2M3 0x08
  1834. #define _DC2B0 0x10
  1835. #define _DC2B1 0x20
  1836. //==============================================================================
  1837. extern __at(0x0FBB) __sfr CCPR2;
  1838. extern __at(0x0FBB) __sfr CCPR2L;
  1839. extern __at(0x0FBC) __sfr CCPR2H;
  1840. //==============================================================================
  1841. // CCP1CON Bits
  1842. extern __at(0x0FBD) __sfr CCP1CON;
  1843. typedef union
  1844. {
  1845. struct
  1846. {
  1847. unsigned CCP1M0 : 1;
  1848. unsigned CCP1M1 : 1;
  1849. unsigned CCP1M2 : 1;
  1850. unsigned CCP1M3 : 1;
  1851. unsigned DC1B0 : 1;
  1852. unsigned DC1B1 : 1;
  1853. unsigned : 1;
  1854. unsigned : 1;
  1855. };
  1856. struct
  1857. {
  1858. unsigned CCP1M : 4;
  1859. unsigned : 4;
  1860. };
  1861. struct
  1862. {
  1863. unsigned : 4;
  1864. unsigned DC1B : 2;
  1865. unsigned : 2;
  1866. };
  1867. } __CCP1CONbits_t;
  1868. extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
  1869. #define _CCP1M0 0x01
  1870. #define _CCP1M1 0x02
  1871. #define _CCP1M2 0x04
  1872. #define _CCP1M3 0x08
  1873. #define _DC1B0 0x10
  1874. #define _DC1B1 0x20
  1875. //==============================================================================
  1876. extern __at(0x0FBE) __sfr CCPR1;
  1877. extern __at(0x0FBE) __sfr CCPR1L;
  1878. extern __at(0x0FBF) __sfr CCPR1H;
  1879. //==============================================================================
  1880. // ADCON2 Bits
  1881. extern __at(0x0FC0) __sfr ADCON2;
  1882. typedef union
  1883. {
  1884. struct
  1885. {
  1886. unsigned ADCS0 : 1;
  1887. unsigned ADCS1 : 1;
  1888. unsigned ADCS2 : 1;
  1889. unsigned ACQT0 : 1;
  1890. unsigned ACQT1 : 1;
  1891. unsigned ACQT2 : 1;
  1892. unsigned : 1;
  1893. unsigned ADFM : 1;
  1894. };
  1895. struct
  1896. {
  1897. unsigned ADCS : 3;
  1898. unsigned : 5;
  1899. };
  1900. struct
  1901. {
  1902. unsigned : 3;
  1903. unsigned ACQT : 3;
  1904. unsigned : 2;
  1905. };
  1906. } __ADCON2bits_t;
  1907. extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
  1908. #define _ADCS0 0x01
  1909. #define _ADCS1 0x02
  1910. #define _ADCS2 0x04
  1911. #define _ACQT0 0x08
  1912. #define _ACQT1 0x10
  1913. #define _ACQT2 0x20
  1914. #define _ADFM 0x80
  1915. //==============================================================================
  1916. //==============================================================================
  1917. // ADCON1 Bits
  1918. extern __at(0x0FC1) __sfr ADCON1;
  1919. typedef union
  1920. {
  1921. struct
  1922. {
  1923. unsigned PCFG0 : 1;
  1924. unsigned PCFG1 : 1;
  1925. unsigned PCFG2 : 1;
  1926. unsigned PCFG3 : 1;
  1927. unsigned VCFG0 : 1;
  1928. unsigned VCFG1 : 1;
  1929. unsigned : 1;
  1930. unsigned : 1;
  1931. };
  1932. struct
  1933. {
  1934. unsigned PCFG : 4;
  1935. unsigned : 4;
  1936. };
  1937. struct
  1938. {
  1939. unsigned : 4;
  1940. unsigned VCFG : 2;
  1941. unsigned : 2;
  1942. };
  1943. } __ADCON1bits_t;
  1944. extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
  1945. #define _PCFG0 0x01
  1946. #define _PCFG1 0x02
  1947. #define _PCFG2 0x04
  1948. #define _PCFG3 0x08
  1949. #define _VCFG0 0x10
  1950. #define _VCFG1 0x20
  1951. //==============================================================================
  1952. //==============================================================================
  1953. // ADCON0 Bits
  1954. extern __at(0x0FC2) __sfr ADCON0;
  1955. typedef union
  1956. {
  1957. struct
  1958. {
  1959. unsigned ADON : 1;
  1960. unsigned GO_NOT_DONE : 1;
  1961. unsigned CHS0 : 1;
  1962. unsigned CHS1 : 1;
  1963. unsigned CHS2 : 1;
  1964. unsigned CHS3 : 1;
  1965. unsigned : 1;
  1966. unsigned : 1;
  1967. };
  1968. struct
  1969. {
  1970. unsigned : 1;
  1971. unsigned GO_DONE : 1;
  1972. unsigned : 1;
  1973. unsigned : 1;
  1974. unsigned : 1;
  1975. unsigned : 1;
  1976. unsigned : 1;
  1977. unsigned : 1;
  1978. };
  1979. struct
  1980. {
  1981. unsigned : 1;
  1982. unsigned DONE : 1;
  1983. unsigned : 1;
  1984. unsigned : 1;
  1985. unsigned : 1;
  1986. unsigned : 1;
  1987. unsigned : 1;
  1988. unsigned : 1;
  1989. };
  1990. struct
  1991. {
  1992. unsigned : 1;
  1993. unsigned GO : 1;
  1994. unsigned : 1;
  1995. unsigned : 1;
  1996. unsigned : 1;
  1997. unsigned : 1;
  1998. unsigned : 1;
  1999. unsigned : 1;
  2000. };
  2001. struct
  2002. {
  2003. unsigned : 1;
  2004. unsigned NOT_DONE : 1;
  2005. unsigned : 1;
  2006. unsigned : 1;
  2007. unsigned : 1;
  2008. unsigned : 1;
  2009. unsigned : 1;
  2010. unsigned : 1;
  2011. };
  2012. struct
  2013. {
  2014. unsigned : 2;
  2015. unsigned CHS : 4;
  2016. unsigned : 2;
  2017. };
  2018. } __ADCON0bits_t;
  2019. extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
  2020. #define _ADON 0x01
  2021. #define _GO_NOT_DONE 0x02
  2022. #define _GO_DONE 0x02
  2023. #define _DONE 0x02
  2024. #define _GO 0x02
  2025. #define _NOT_DONE 0x02
  2026. #define _CHS0 0x04
  2027. #define _CHS1 0x08
  2028. #define _CHS2 0x10
  2029. #define _CHS3 0x20
  2030. //==============================================================================
  2031. extern __at(0x0FC3) __sfr ADRES;
  2032. extern __at(0x0FC3) __sfr ADRESL;
  2033. extern __at(0x0FC4) __sfr ADRESH;
  2034. //==============================================================================
  2035. // SSPCON2 Bits
  2036. extern __at(0x0FC5) __sfr SSPCON2;
  2037. typedef struct
  2038. {
  2039. unsigned SEN : 1;
  2040. unsigned RSEN : 1;
  2041. unsigned PEN : 1;
  2042. unsigned RCEN : 1;
  2043. unsigned ACKEN : 1;
  2044. unsigned ACKDT : 1;
  2045. unsigned ACKSTAT : 1;
  2046. unsigned GCEN : 1;
  2047. } __SSPCON2bits_t;
  2048. extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
  2049. #define _SEN 0x01
  2050. #define _RSEN 0x02
  2051. #define _PEN 0x04
  2052. #define _RCEN 0x08
  2053. #define _ACKEN 0x10
  2054. #define _ACKDT 0x20
  2055. #define _ACKSTAT 0x40
  2056. #define _GCEN 0x80
  2057. //==============================================================================
  2058. //==============================================================================
  2059. // SSPCON1 Bits
  2060. extern __at(0x0FC6) __sfr SSPCON1;
  2061. typedef union
  2062. {
  2063. struct
  2064. {
  2065. unsigned SSPM0 : 1;
  2066. unsigned SSPM1 : 1;
  2067. unsigned SSPM2 : 1;
  2068. unsigned SSPM3 : 1;
  2069. unsigned CKP : 1;
  2070. unsigned SSPEN : 1;
  2071. unsigned SSPOV : 1;
  2072. unsigned WCOL : 1;
  2073. };
  2074. struct
  2075. {
  2076. unsigned SSPM : 4;
  2077. unsigned : 4;
  2078. };
  2079. } __SSPCON1bits_t;
  2080. extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
  2081. #define _SSPM0 0x01
  2082. #define _SSPM1 0x02
  2083. #define _SSPM2 0x04
  2084. #define _SSPM3 0x08
  2085. #define _CKP 0x10
  2086. #define _SSPEN 0x20
  2087. #define _SSPOV 0x40
  2088. #define _WCOL 0x80
  2089. //==============================================================================
  2090. //==============================================================================
  2091. // SSPSTAT Bits
  2092. extern __at(0x0FC7) __sfr SSPSTAT;
  2093. typedef union
  2094. {
  2095. struct
  2096. {
  2097. unsigned BF : 1;
  2098. unsigned UA : 1;
  2099. unsigned R_NOT_W : 1;
  2100. unsigned S : 1;
  2101. unsigned P : 1;
  2102. unsigned D_NOT_A : 1;
  2103. unsigned CKE : 1;
  2104. unsigned SMP : 1;
  2105. };
  2106. struct
  2107. {
  2108. unsigned : 1;
  2109. unsigned : 1;
  2110. unsigned R_W : 1;
  2111. unsigned I2C_START : 1;
  2112. unsigned I2C_STOP : 1;
  2113. unsigned D_A : 1;
  2114. unsigned : 1;
  2115. unsigned : 1;
  2116. };
  2117. struct
  2118. {
  2119. unsigned : 1;
  2120. unsigned : 1;
  2121. unsigned I2C_READ : 1;
  2122. unsigned : 1;
  2123. unsigned : 1;
  2124. unsigned I2C_DAT : 1;
  2125. unsigned : 1;
  2126. unsigned : 1;
  2127. };
  2128. struct
  2129. {
  2130. unsigned : 1;
  2131. unsigned : 1;
  2132. unsigned NOT_W : 1;
  2133. unsigned : 1;
  2134. unsigned : 1;
  2135. unsigned NOT_A : 1;
  2136. unsigned : 1;
  2137. unsigned : 1;
  2138. };
  2139. struct
  2140. {
  2141. unsigned : 1;
  2142. unsigned : 1;
  2143. unsigned NOT_WRITE : 1;
  2144. unsigned : 1;
  2145. unsigned : 1;
  2146. unsigned NOT_ADDRESS : 1;
  2147. unsigned : 1;
  2148. unsigned : 1;
  2149. };
  2150. struct
  2151. {
  2152. unsigned : 1;
  2153. unsigned : 1;
  2154. unsigned READ_WRITE : 1;
  2155. unsigned : 1;
  2156. unsigned : 1;
  2157. unsigned DATA_ADDRESS : 1;
  2158. unsigned : 1;
  2159. unsigned : 1;
  2160. };
  2161. struct
  2162. {
  2163. unsigned : 1;
  2164. unsigned : 1;
  2165. unsigned R : 1;
  2166. unsigned : 1;
  2167. unsigned : 1;
  2168. unsigned D : 1;
  2169. unsigned : 1;
  2170. unsigned : 1;
  2171. };
  2172. } __SSPSTATbits_t;
  2173. extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
  2174. #define _BF 0x01
  2175. #define _UA 0x02
  2176. #define _R_NOT_W 0x04
  2177. #define _R_W 0x04
  2178. #define _I2C_READ 0x04
  2179. #define _NOT_W 0x04
  2180. #define _NOT_WRITE 0x04
  2181. #define _READ_WRITE 0x04
  2182. #define _R 0x04
  2183. #define _S 0x08
  2184. #define _I2C_START 0x08
  2185. #define _P 0x10
  2186. #define _I2C_STOP 0x10
  2187. #define _D_NOT_A 0x20
  2188. #define _D_A 0x20
  2189. #define _I2C_DAT 0x20
  2190. #define _NOT_A 0x20
  2191. #define _NOT_ADDRESS 0x20
  2192. #define _DATA_ADDRESS 0x20
  2193. #define _D 0x20
  2194. #define _CKE 0x40
  2195. #define _SMP 0x80
  2196. //==============================================================================
  2197. extern __at(0x0FC8) __sfr SSPADD;
  2198. extern __at(0x0FC9) __sfr SSPBUF;
  2199. //==============================================================================
  2200. // T2CON Bits
  2201. extern __at(0x0FCA) __sfr T2CON;
  2202. typedef union
  2203. {
  2204. struct
  2205. {
  2206. unsigned T2CKPS0 : 1;
  2207. unsigned T2CKPS1 : 1;
  2208. unsigned TMR2ON : 1;
  2209. unsigned T2OUTPS0 : 1;
  2210. unsigned T2OUTPS1 : 1;
  2211. unsigned T2OUTPS2 : 1;
  2212. unsigned T2OUTPS3 : 1;
  2213. unsigned : 1;
  2214. };
  2215. struct
  2216. {
  2217. unsigned : 1;
  2218. unsigned : 1;
  2219. unsigned : 1;
  2220. unsigned TOUTPS0 : 1;
  2221. unsigned TOUTPS1 : 1;
  2222. unsigned TOUTPS2 : 1;
  2223. unsigned TOUTPS3 : 1;
  2224. unsigned : 1;
  2225. };
  2226. struct
  2227. {
  2228. unsigned T2CKPS : 2;
  2229. unsigned : 6;
  2230. };
  2231. struct
  2232. {
  2233. unsigned : 3;
  2234. unsigned TOUTPS : 4;
  2235. unsigned : 1;
  2236. };
  2237. struct
  2238. {
  2239. unsigned : 3;
  2240. unsigned T2OUTPS : 4;
  2241. unsigned : 1;
  2242. };
  2243. } __T2CONbits_t;
  2244. extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
  2245. #define _T2CKPS0 0x01
  2246. #define _T2CKPS1 0x02
  2247. #define _TMR2ON 0x04
  2248. #define _T2OUTPS0 0x08
  2249. #define _TOUTPS0 0x08
  2250. #define _T2OUTPS1 0x10
  2251. #define _TOUTPS1 0x10
  2252. #define _T2OUTPS2 0x20
  2253. #define _TOUTPS2 0x20
  2254. #define _T2OUTPS3 0x40
  2255. #define _TOUTPS3 0x40
  2256. //==============================================================================
  2257. extern __at(0x0FCB) __sfr PR2;
  2258. extern __at(0x0FCC) __sfr TMR2;
  2259. //==============================================================================
  2260. // T1CON Bits
  2261. extern __at(0x0FCD) __sfr T1CON;
  2262. typedef union
  2263. {
  2264. struct
  2265. {
  2266. unsigned TMR1ON : 1;
  2267. unsigned TMR1CS : 1;
  2268. unsigned NOT_T1SYNC : 1;
  2269. unsigned T1OSCEN : 1;
  2270. unsigned T1CKPS0 : 1;
  2271. unsigned T1CKPS1 : 1;
  2272. unsigned T1RUN : 1;
  2273. unsigned RD16 : 1;
  2274. };
  2275. struct
  2276. {
  2277. unsigned : 1;
  2278. unsigned : 1;
  2279. unsigned T1SYNC : 1;
  2280. unsigned : 1;
  2281. unsigned : 1;
  2282. unsigned : 1;
  2283. unsigned : 1;
  2284. unsigned : 1;
  2285. };
  2286. struct
  2287. {
  2288. unsigned : 4;
  2289. unsigned T1CKPS : 2;
  2290. unsigned : 2;
  2291. };
  2292. } __T1CONbits_t;
  2293. extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
  2294. #define _TMR1ON 0x01
  2295. #define _TMR1CS 0x02
  2296. #define _NOT_T1SYNC 0x04
  2297. #define _T1SYNC 0x04
  2298. #define _T1OSCEN 0x08
  2299. #define _T1CKPS0 0x10
  2300. #define _T1CKPS1 0x20
  2301. #define _T1RUN 0x40
  2302. #define _RD16 0x80
  2303. //==============================================================================
  2304. extern __at(0x0FCE) __sfr TMR1;
  2305. extern __at(0x0FCE) __sfr TMR1L;
  2306. extern __at(0x0FCF) __sfr TMR1H;
  2307. //==============================================================================
  2308. // RCON Bits
  2309. extern __at(0x0FD0) __sfr RCON;
  2310. typedef union
  2311. {
  2312. struct
  2313. {
  2314. unsigned NOT_BOR : 1;
  2315. unsigned NOT_POR : 1;
  2316. unsigned NOT_PD : 1;
  2317. unsigned NOT_TO : 1;
  2318. unsigned NOT_RI : 1;
  2319. unsigned : 1;
  2320. unsigned SBOREN : 1;
  2321. unsigned IPEN : 1;
  2322. };
  2323. struct
  2324. {
  2325. unsigned BOR : 1;
  2326. unsigned POR : 1;
  2327. unsigned PD : 1;
  2328. unsigned TO : 1;
  2329. unsigned RI : 1;
  2330. unsigned : 1;
  2331. unsigned : 1;
  2332. unsigned NOT_IPEN : 1;
  2333. };
  2334. } __RCONbits_t;
  2335. extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
  2336. #define _NOT_BOR 0x01
  2337. #define _BOR 0x01
  2338. #define _NOT_POR 0x02
  2339. #define _POR 0x02
  2340. #define _NOT_PD 0x04
  2341. #define _PD 0x04
  2342. #define _NOT_TO 0x08
  2343. #define _TO 0x08
  2344. #define _NOT_RI 0x10
  2345. #define _RI 0x10
  2346. #define _SBOREN 0x40
  2347. #define _IPEN 0x80
  2348. #define _NOT_IPEN 0x80
  2349. //==============================================================================
  2350. //==============================================================================
  2351. // WDTCON Bits
  2352. extern __at(0x0FD1) __sfr WDTCON;
  2353. typedef union
  2354. {
  2355. struct
  2356. {
  2357. unsigned SWDTEN : 1;
  2358. unsigned : 1;
  2359. unsigned : 1;
  2360. unsigned : 1;
  2361. unsigned : 1;
  2362. unsigned : 1;
  2363. unsigned : 1;
  2364. unsigned : 1;
  2365. };
  2366. struct
  2367. {
  2368. unsigned SWDTE : 1;
  2369. unsigned : 1;
  2370. unsigned : 1;
  2371. unsigned : 1;
  2372. unsigned : 1;
  2373. unsigned : 1;
  2374. unsigned : 1;
  2375. unsigned : 1;
  2376. };
  2377. } __WDTCONbits_t;
  2378. extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
  2379. #define _SWDTEN 0x01
  2380. #define _SWDTE 0x01
  2381. //==============================================================================
  2382. //==============================================================================
  2383. // HLVDCON Bits
  2384. extern __at(0x0FD2) __sfr HLVDCON;
  2385. typedef union
  2386. {
  2387. struct
  2388. {
  2389. unsigned HLVDL0 : 1;
  2390. unsigned HLVDL1 : 1;
  2391. unsigned HLVDL2 : 1;
  2392. unsigned HLVDL3 : 1;
  2393. unsigned HLVDEN : 1;
  2394. unsigned IRVST : 1;
  2395. unsigned : 1;
  2396. unsigned VDIRMAG : 1;
  2397. };
  2398. struct
  2399. {
  2400. unsigned LVDL0 : 1;
  2401. unsigned LVDL1 : 1;
  2402. unsigned LVDL2 : 1;
  2403. unsigned LVDL3 : 1;
  2404. unsigned LVDEN : 1;
  2405. unsigned IVRST : 1;
  2406. unsigned : 1;
  2407. unsigned : 1;
  2408. };
  2409. struct
  2410. {
  2411. unsigned LVV0 : 1;
  2412. unsigned LVV1 : 1;
  2413. unsigned LVV2 : 1;
  2414. unsigned LVV3 : 1;
  2415. unsigned : 1;
  2416. unsigned BGST : 1;
  2417. unsigned : 1;
  2418. unsigned : 1;
  2419. };
  2420. struct
  2421. {
  2422. unsigned LVV : 4;
  2423. unsigned : 4;
  2424. };
  2425. struct
  2426. {
  2427. unsigned HLVDL : 4;
  2428. unsigned : 4;
  2429. };
  2430. struct
  2431. {
  2432. unsigned LVDL : 4;
  2433. unsigned : 4;
  2434. };
  2435. } __HLVDCONbits_t;
  2436. extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
  2437. #define _HLVDL0 0x01
  2438. #define _LVDL0 0x01
  2439. #define _LVV0 0x01
  2440. #define _HLVDL1 0x02
  2441. #define _LVDL1 0x02
  2442. #define _LVV1 0x02
  2443. #define _HLVDL2 0x04
  2444. #define _LVDL2 0x04
  2445. #define _LVV2 0x04
  2446. #define _HLVDL3 0x08
  2447. #define _LVDL3 0x08
  2448. #define _LVV3 0x08
  2449. #define _HLVDEN 0x10
  2450. #define _LVDEN 0x10
  2451. #define _IRVST 0x20
  2452. #define _IVRST 0x20
  2453. #define _BGST 0x20
  2454. #define _VDIRMAG 0x80
  2455. //==============================================================================
  2456. //==============================================================================
  2457. // LVDCON Bits
  2458. extern __at(0x0FD2) __sfr LVDCON;
  2459. typedef union
  2460. {
  2461. struct
  2462. {
  2463. unsigned HLVDL0 : 1;
  2464. unsigned HLVDL1 : 1;
  2465. unsigned HLVDL2 : 1;
  2466. unsigned HLVDL3 : 1;
  2467. unsigned HLVDEN : 1;
  2468. unsigned IRVST : 1;
  2469. unsigned : 1;
  2470. unsigned VDIRMAG : 1;
  2471. };
  2472. struct
  2473. {
  2474. unsigned LVDL0 : 1;
  2475. unsigned LVDL1 : 1;
  2476. unsigned LVDL2 : 1;
  2477. unsigned LVDL3 : 1;
  2478. unsigned LVDEN : 1;
  2479. unsigned IVRST : 1;
  2480. unsigned : 1;
  2481. unsigned : 1;
  2482. };
  2483. struct
  2484. {
  2485. unsigned LVV0 : 1;
  2486. unsigned LVV1 : 1;
  2487. unsigned LVV2 : 1;
  2488. unsigned LVV3 : 1;
  2489. unsigned : 1;
  2490. unsigned BGST : 1;
  2491. unsigned : 1;
  2492. unsigned : 1;
  2493. };
  2494. struct
  2495. {
  2496. unsigned LVV : 4;
  2497. unsigned : 4;
  2498. };
  2499. struct
  2500. {
  2501. unsigned HLVDL : 4;
  2502. unsigned : 4;
  2503. };
  2504. struct
  2505. {
  2506. unsigned LVDL : 4;
  2507. unsigned : 4;
  2508. };
  2509. } __LVDCONbits_t;
  2510. extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
  2511. #define _LVDCON_HLVDL0 0x01
  2512. #define _LVDCON_LVDL0 0x01
  2513. #define _LVDCON_LVV0 0x01
  2514. #define _LVDCON_HLVDL1 0x02
  2515. #define _LVDCON_LVDL1 0x02
  2516. #define _LVDCON_LVV1 0x02
  2517. #define _LVDCON_HLVDL2 0x04
  2518. #define _LVDCON_LVDL2 0x04
  2519. #define _LVDCON_LVV2 0x04
  2520. #define _LVDCON_HLVDL3 0x08
  2521. #define _LVDCON_LVDL3 0x08
  2522. #define _LVDCON_LVV3 0x08
  2523. #define _LVDCON_HLVDEN 0x10
  2524. #define _LVDCON_LVDEN 0x10
  2525. #define _LVDCON_IRVST 0x20
  2526. #define _LVDCON_IVRST 0x20
  2527. #define _LVDCON_BGST 0x20
  2528. #define _LVDCON_VDIRMAG 0x80
  2529. //==============================================================================
  2530. //==============================================================================
  2531. // OSCCON Bits
  2532. extern __at(0x0FD3) __sfr OSCCON;
  2533. typedef union
  2534. {
  2535. struct
  2536. {
  2537. unsigned SCS0 : 1;
  2538. unsigned SCS1 : 1;
  2539. unsigned IOFS : 1;
  2540. unsigned OSTS : 1;
  2541. unsigned IRCF0 : 1;
  2542. unsigned IRCF1 : 1;
  2543. unsigned IRCF2 : 1;
  2544. unsigned IDLEN : 1;
  2545. };
  2546. struct
  2547. {
  2548. unsigned : 1;
  2549. unsigned : 1;
  2550. unsigned FLTS : 1;
  2551. unsigned : 1;
  2552. unsigned : 1;
  2553. unsigned : 1;
  2554. unsigned : 1;
  2555. unsigned : 1;
  2556. };
  2557. struct
  2558. {
  2559. unsigned SCS : 2;
  2560. unsigned : 6;
  2561. };
  2562. struct
  2563. {
  2564. unsigned : 4;
  2565. unsigned IRCF : 3;
  2566. unsigned : 1;
  2567. };
  2568. } __OSCCONbits_t;
  2569. extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
  2570. #define _SCS0 0x01
  2571. #define _SCS1 0x02
  2572. #define _IOFS 0x04
  2573. #define _FLTS 0x04
  2574. #define _OSTS 0x08
  2575. #define _IRCF0 0x10
  2576. #define _IRCF1 0x20
  2577. #define _IRCF2 0x40
  2578. #define _IDLEN 0x80
  2579. //==============================================================================
  2580. //==============================================================================
  2581. // T0CON Bits
  2582. extern __at(0x0FD5) __sfr T0CON;
  2583. typedef union
  2584. {
  2585. struct
  2586. {
  2587. unsigned T0PS0 : 1;
  2588. unsigned T0PS1 : 1;
  2589. unsigned T0PS2 : 1;
  2590. unsigned PSA : 1;
  2591. unsigned T0SE : 1;
  2592. unsigned T0CS : 1;
  2593. unsigned T08BIT : 1;
  2594. unsigned TMR0ON : 1;
  2595. };
  2596. struct
  2597. {
  2598. unsigned T0PS : 3;
  2599. unsigned : 5;
  2600. };
  2601. } __T0CONbits_t;
  2602. extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
  2603. #define _T0PS0 0x01
  2604. #define _T0PS1 0x02
  2605. #define _T0PS2 0x04
  2606. #define _PSA 0x08
  2607. #define _T0SE 0x10
  2608. #define _T0CS 0x20
  2609. #define _T08BIT 0x40
  2610. #define _TMR0ON 0x80
  2611. //==============================================================================
  2612. extern __at(0x0FD6) __sfr TMR0;
  2613. extern __at(0x0FD6) __sfr TMR0L;
  2614. extern __at(0x0FD7) __sfr TMR0H;
  2615. //==============================================================================
  2616. // STATUS Bits
  2617. extern __at(0x0FD8) __sfr STATUS;
  2618. typedef struct
  2619. {
  2620. unsigned C : 1;
  2621. unsigned DC : 1;
  2622. unsigned Z : 1;
  2623. unsigned OV : 1;
  2624. unsigned N : 1;
  2625. unsigned : 1;
  2626. unsigned : 1;
  2627. unsigned : 1;
  2628. } __STATUSbits_t;
  2629. extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
  2630. #define _C 0x01
  2631. #define _DC 0x02
  2632. #define _Z 0x04
  2633. #define _OV 0x08
  2634. #define _N 0x10
  2635. //==============================================================================
  2636. extern __at(0x0FD9) __sfr FSR2L;
  2637. extern __at(0x0FDA) __sfr FSR2H;
  2638. extern __at(0x0FDB) __sfr PLUSW2;
  2639. extern __at(0x0FDC) __sfr PREINC2;
  2640. extern __at(0x0FDD) __sfr POSTDEC2;
  2641. extern __at(0x0FDE) __sfr POSTINC2;
  2642. extern __at(0x0FDF) __sfr INDF2;
  2643. extern __at(0x0FE0) __sfr BSR;
  2644. extern __at(0x0FE1) __sfr FSR1L;
  2645. extern __at(0x0FE2) __sfr FSR1H;
  2646. extern __at(0x0FE3) __sfr PLUSW1;
  2647. extern __at(0x0FE4) __sfr PREINC1;
  2648. extern __at(0x0FE5) __sfr POSTDEC1;
  2649. extern __at(0x0FE6) __sfr POSTINC1;
  2650. extern __at(0x0FE7) __sfr INDF1;
  2651. extern __at(0x0FE8) __sfr WREG;
  2652. extern __at(0x0FE9) __sfr FSR0L;
  2653. extern __at(0x0FEA) __sfr FSR0H;
  2654. extern __at(0x0FEB) __sfr PLUSW0;
  2655. extern __at(0x0FEC) __sfr PREINC0;
  2656. extern __at(0x0FED) __sfr POSTDEC0;
  2657. extern __at(0x0FEE) __sfr POSTINC0;
  2658. extern __at(0x0FEF) __sfr INDF0;
  2659. //==============================================================================
  2660. // INTCON3 Bits
  2661. extern __at(0x0FF0) __sfr INTCON3;
  2662. typedef union
  2663. {
  2664. struct
  2665. {
  2666. unsigned INT1IF : 1;
  2667. unsigned INT2IF : 1;
  2668. unsigned : 1;
  2669. unsigned INT1IE : 1;
  2670. unsigned INT2IE : 1;
  2671. unsigned : 1;
  2672. unsigned INT1IP : 1;
  2673. unsigned INT2IP : 1;
  2674. };
  2675. struct
  2676. {
  2677. unsigned INT1F : 1;
  2678. unsigned INT2F : 1;
  2679. unsigned : 1;
  2680. unsigned INT1E : 1;
  2681. unsigned INT2E : 1;
  2682. unsigned : 1;
  2683. unsigned INT1P : 1;
  2684. unsigned INT2P : 1;
  2685. };
  2686. } __INTCON3bits_t;
  2687. extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
  2688. #define _INT1IF 0x01
  2689. #define _INT1F 0x01
  2690. #define _INT2IF 0x02
  2691. #define _INT2F 0x02
  2692. #define _INT1IE 0x08
  2693. #define _INT1E 0x08
  2694. #define _INT2IE 0x10
  2695. #define _INT2E 0x10
  2696. #define _INT1IP 0x40
  2697. #define _INT1P 0x40
  2698. #define _INT2IP 0x80
  2699. #define _INT2P 0x80
  2700. //==============================================================================
  2701. //==============================================================================
  2702. // INTCON2 Bits
  2703. extern __at(0x0FF1) __sfr INTCON2;
  2704. typedef union
  2705. {
  2706. struct
  2707. {
  2708. unsigned RBIP : 1;
  2709. unsigned : 1;
  2710. unsigned TMR0IP : 1;
  2711. unsigned : 1;
  2712. unsigned INTEDG2 : 1;
  2713. unsigned INTEDG1 : 1;
  2714. unsigned INTEDG0 : 1;
  2715. unsigned NOT_RBPU : 1;
  2716. };
  2717. struct
  2718. {
  2719. unsigned : 1;
  2720. unsigned : 1;
  2721. unsigned T0IP : 1;
  2722. unsigned : 1;
  2723. unsigned : 1;
  2724. unsigned : 1;
  2725. unsigned : 1;
  2726. unsigned RBPU : 1;
  2727. };
  2728. } __INTCON2bits_t;
  2729. extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
  2730. #define _RBIP 0x01
  2731. #define _TMR0IP 0x04
  2732. #define _T0IP 0x04
  2733. #define _INTEDG2 0x10
  2734. #define _INTEDG1 0x20
  2735. #define _INTEDG0 0x40
  2736. #define _NOT_RBPU 0x80
  2737. #define _RBPU 0x80
  2738. //==============================================================================
  2739. //==============================================================================
  2740. // INTCON Bits
  2741. extern __at(0x0FF2) __sfr INTCON;
  2742. typedef union
  2743. {
  2744. struct
  2745. {
  2746. unsigned RBIF : 1;
  2747. unsigned INT0IF : 1;
  2748. unsigned TMR0IF : 1;
  2749. unsigned RBIE : 1;
  2750. unsigned INT0IE : 1;
  2751. unsigned TMR0IE : 1;
  2752. unsigned PEIE_GIEL : 1;
  2753. unsigned GIE_GIEH : 1;
  2754. };
  2755. struct
  2756. {
  2757. unsigned : 1;
  2758. unsigned INT0F : 1;
  2759. unsigned T0IF : 1;
  2760. unsigned : 1;
  2761. unsigned INT0E : 1;
  2762. unsigned T0IE : 1;
  2763. unsigned PEIE : 1;
  2764. unsigned GIE : 1;
  2765. };
  2766. struct
  2767. {
  2768. unsigned : 1;
  2769. unsigned : 1;
  2770. unsigned : 1;
  2771. unsigned : 1;
  2772. unsigned : 1;
  2773. unsigned : 1;
  2774. unsigned GIEL : 1;
  2775. unsigned GIEH : 1;
  2776. };
  2777. } __INTCONbits_t;
  2778. extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
  2779. #define _RBIF 0x01
  2780. #define _INT0IF 0x02
  2781. #define _INT0F 0x02
  2782. #define _TMR0IF 0x04
  2783. #define _T0IF 0x04
  2784. #define _RBIE 0x08
  2785. #define _INT0IE 0x10
  2786. #define _INT0E 0x10
  2787. #define _TMR0IE 0x20
  2788. #define _T0IE 0x20
  2789. #define _PEIE_GIEL 0x40
  2790. #define _PEIE 0x40
  2791. #define _GIEL 0x40
  2792. #define _GIE_GIEH 0x80
  2793. #define _GIE 0x80
  2794. #define _GIEH 0x80
  2795. //==============================================================================
  2796. extern __at(0x0FF3) __sfr PROD;
  2797. extern __at(0x0FF3) __sfr PRODL;
  2798. extern __at(0x0FF4) __sfr PRODH;
  2799. extern __at(0x0FF5) __sfr TABLAT;
  2800. extern __at(0x0FF6) __sfr TBLPTR;
  2801. extern __at(0x0FF6) __sfr TBLPTRL;
  2802. extern __at(0x0FF7) __sfr TBLPTRH;
  2803. extern __at(0x0FF8) __sfr TBLPTRU;
  2804. extern __at(0x0FF9) __sfr PC;
  2805. extern __at(0x0FF9) __sfr PCL;
  2806. extern __at(0x0FFA) __sfr PCLATH;
  2807. extern __at(0x0FFB) __sfr PCLATU;
  2808. //==============================================================================
  2809. // STKPTR Bits
  2810. extern __at(0x0FFC) __sfr STKPTR;
  2811. typedef union
  2812. {
  2813. struct
  2814. {
  2815. unsigned STKPTR0 : 1;
  2816. unsigned STKPTR1 : 1;
  2817. unsigned STKPTR2 : 1;
  2818. unsigned STKPTR3 : 1;
  2819. unsigned STKPTR4 : 1;
  2820. unsigned : 1;
  2821. unsigned STKUNF : 1;
  2822. unsigned STKFUL : 1;
  2823. };
  2824. struct
  2825. {
  2826. unsigned : 1;
  2827. unsigned : 1;
  2828. unsigned : 1;
  2829. unsigned : 1;
  2830. unsigned : 1;
  2831. unsigned : 1;
  2832. unsigned : 1;
  2833. unsigned STKOVF : 1;
  2834. };
  2835. struct
  2836. {
  2837. unsigned STKPTR : 5;
  2838. unsigned : 3;
  2839. };
  2840. } __STKPTRbits_t;
  2841. extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
  2842. #define _STKPTR0 0x01
  2843. #define _STKPTR1 0x02
  2844. #define _STKPTR2 0x04
  2845. #define _STKPTR3 0x08
  2846. #define _STKPTR4 0x10
  2847. #define _STKUNF 0x40
  2848. #define _STKFUL 0x80
  2849. #define _STKOVF 0x80
  2850. //==============================================================================
  2851. extern __at(0x0FFD) __sfr TOS;
  2852. extern __at(0x0FFD) __sfr TOSL;
  2853. extern __at(0x0FFE) __sfr TOSH;
  2854. extern __at(0x0FFF) __sfr TOSU;
  2855. //==============================================================================
  2856. //
  2857. // Configuration Bits
  2858. //
  2859. //==============================================================================
  2860. #define __CONFIG1L 0x300000
  2861. #define __CONFIG1H 0x300001
  2862. #define __CONFIG2L 0x300002
  2863. #define __CONFIG2H 0x300003
  2864. #define __CONFIG3H 0x300005
  2865. #define __CONFIG4L 0x300006
  2866. #define __CONFIG5L 0x300008
  2867. #define __CONFIG5H 0x300009
  2868. #define __CONFIG6L 0x30000A
  2869. #define __CONFIG6H 0x30000B
  2870. #define __CONFIG7L 0x30000C
  2871. #define __CONFIG7H 0x30000D
  2872. //----------------------------- CONFIG1L Options -------------------------------
  2873. #define _PLLDIV_1_1L 0xF8 // No prescale (4 MHz oscillator input drives PLL directly).
  2874. #define _PLLDIV_2_1L 0xF9 // Divide by 2 (8 MHz oscillator input).
  2875. #define _PLLDIV_3_1L 0xFA // Divide by 3 (12 MHz oscillator input).
  2876. #define _PLLDIV_4_1L 0xFB // Divide by 4 (16 MHz oscillator input).
  2877. #define _PLLDIV_5_1L 0xFC // Divide by 5 (20 MHz oscillator input).
  2878. #define _PLLDIV_6_1L 0xFD // Divide by 6 (24 MHz oscillator input).
  2879. #define _PLLDIV_10_1L 0xFE // Divide by 10 (40 MHz oscillator input).
  2880. #define _PLLDIV_12_1L 0xFF // Divide by 12 (48 MHz oscillator input).
  2881. #define _CPUDIV_OSC1_PLL2_1L 0xE7 // [Primary Oscillator Src: /1][96 MHz PLL Src: /2].
  2882. #define _CPUDIV_OSC2_PLL3_1L 0xEF // [Primary Oscillator Src: /2][96 MHz PLL Src: /3].
  2883. #define _CPUDIV_OSC3_PLL4_1L 0xF7 // [Primary Oscillator Src: /3][96 MHz PLL Src: /4].
  2884. #define _CPUDIV_OSC4_PLL6_1L 0xFF // [Primary Oscillator Src: /4][96 MHz PLL Src: /6].
  2885. #define _USBDIV_1_1L 0xDF // USB clock source comes directly from the primary oscillator block with no postscale.
  2886. #define _USBDIV_2_1L 0xFF // USB clock source comes from the 96 MHz PLL divided by 2.
  2887. //----------------------------- CONFIG1H Options -------------------------------
  2888. #define _FOSC_XT_XT_1H 0xF0 // XT oscillator (XT).
  2889. #define _FOSC_XTPLL_XT_1H 0xF2 // XT oscillator, PLL enabled (XTPLL).
  2890. #define _FOSC_ECIO_EC_1H 0xF4 // EC oscillator, port function on RA6 (ECIO).
  2891. #define _FOSC_EC_EC_1H 0xF5 // EC oscillator, CLKO function on RA6 (EC).
  2892. #define _FOSC_ECPLLIO_EC_1H 0xF6 // EC oscillator, PLL enabled, port function on RA6 (ECPIO).
  2893. #define _FOSC_ECPLL_EC_1H 0xF7 // EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL).
  2894. #define _FOSC_INTOSCIO_EC_1H 0xF8 // Internal oscillator, port function on RA6, EC used by USB (INTIO).
  2895. #define _FOSC_INTOSC_EC_1H 0xF9 // Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO).
  2896. #define _FOSC_INTOSC_XT_1H 0xFA // Internal oscillator, XT used by USB (INTXT).
  2897. #define _FOSC_INTOSC_HS_1H 0xFB // Internal oscillator, HS oscillator used by USB (INTHS).
  2898. #define _FOSC_HS_1H 0xFC // HS oscillator (HS).
  2899. #define _FOSC_HSPLL_HS_1H 0xFE // HS oscillator, PLL enabled (HSPLL).
  2900. #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
  2901. #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
  2902. #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
  2903. #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
  2904. //----------------------------- CONFIG2L Options -------------------------------
  2905. #define _PWRT_ON_2L 0xFE // PWRT enabled.
  2906. #define _PWRT_OFF_2L 0xFF // PWRT disabled.
  2907. #define _BOR_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
  2908. #define _BOR_SOFT_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
  2909. #define _BOR_ON_ACTIVE_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
  2910. #define _BOR_ON_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
  2911. #define _BORV_0_2L 0xE7 // Maximum setting.
  2912. #define _BORV_1_2L 0xEF
  2913. #define _BORV_2_2L 0xF7
  2914. #define _BORV_3_2L 0xFF // Minimum setting.
  2915. #define _VREGEN_OFF_2L 0xDF // USB voltage regulator disabled.
  2916. #define _VREGEN_ON_2L 0xFF // USB voltage regulator enabled.
  2917. //----------------------------- CONFIG2H Options -------------------------------
  2918. #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
  2919. #define _WDT_ON_2H 0xFF // WDT enabled.
  2920. #define _WDTPS_1_2H 0xE1 // 1:1.
  2921. #define _WDTPS_2_2H 0xE3 // 1:2.
  2922. #define _WDTPS_4_2H 0xE5 // 1:4.
  2923. #define _WDTPS_8_2H 0xE7 // 1:8.
  2924. #define _WDTPS_16_2H 0xE9 // 1:16.
  2925. #define _WDTPS_32_2H 0xEB // 1:32.
  2926. #define _WDTPS_64_2H 0xED // 1:64.
  2927. #define _WDTPS_128_2H 0xEF // 1:128.
  2928. #define _WDTPS_256_2H 0xF1 // 1:256.
  2929. #define _WDTPS_512_2H 0xF3 // 1:512.
  2930. #define _WDTPS_1024_2H 0xF5 // 1:1024.
  2931. #define _WDTPS_2048_2H 0xF7 // 1:2048.
  2932. #define _WDTPS_4096_2H 0xF9 // 1:4096.
  2933. #define _WDTPS_8192_2H 0xFB // 1:8192.
  2934. #define _WDTPS_16384_2H 0xFD // 1:16384.
  2935. #define _WDTPS_32768_2H 0xFF // 1:32768.
  2936. //----------------------------- CONFIG3H Options -------------------------------
  2937. #define _CCP2MX_OFF_3H 0xFE // CCP2 input/output is multiplexed with RB3.
  2938. #define _CCP2MX_ON_3H 0xFF // CCP2 input/output is multiplexed with RC1.
  2939. #define _PBADEN_OFF_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
  2940. #define _PBADEN_ON_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
  2941. #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
  2942. #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
  2943. #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR pin disabled.
  2944. #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
  2945. //----------------------------- CONFIG4L Options -------------------------------
  2946. #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
  2947. #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
  2948. #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
  2949. #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
  2950. #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
  2951. #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
  2952. #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
  2953. #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
  2954. //----------------------------- CONFIG5L Options -------------------------------
  2955. #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) is code-protected.
  2956. #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) is not code-protected.
  2957. #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) is code-protected.
  2958. #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) is not code-protected.
  2959. #define _CP2_ON_5L 0xFB // Block 2 (004000-005FFFh) is code-protected.
  2960. #define _CP2_OFF_5L 0xFF // Block 2 (004000-005FFFh) is not code-protected.
  2961. //----------------------------- CONFIG5H Options -------------------------------
  2962. #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) is code-protected.
  2963. #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) is not code-protected.
  2964. #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
  2965. #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
  2966. //----------------------------- CONFIG6L Options -------------------------------
  2967. #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) is write-protected.
  2968. #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) is not write-protected.
  2969. #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) is write-protected.
  2970. #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) is not write-protected.
  2971. #define _WRT2_ON_6L 0xFB // Block 2 (004000-005FFFh) is write-protected.
  2972. #define _WRT2_OFF_6L 0xFF // Block 2 (004000-005FFFh) is not write-protected.
  2973. //----------------------------- CONFIG6H Options -------------------------------
  2974. #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
  2975. #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
  2976. #define _WRTB_ON_6H 0xBF // Boot block (000000-0007FFh) is write-protected.
  2977. #define _WRTB_OFF_6H 0xFF // Boot block (000000-0007FFh) is not write-protected.
  2978. #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
  2979. #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
  2980. //----------------------------- CONFIG7L Options -------------------------------
  2981. #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) is protected from table reads executed in other blocks.
  2982. #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks.
  2983. #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) is protected from table reads executed in other blocks.
  2984. #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks.
  2985. #define _EBTR2_ON_7L 0xFB // Block 2 (004000-005FFFh) is protected from table reads executed in other blocks.
  2986. #define _EBTR2_OFF_7L 0xFF // Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks.
  2987. //----------------------------- CONFIG7H Options -------------------------------
  2988. #define _EBTRB_ON_7H 0xBF // Boot block (000000-0007FFh) is protected from table reads executed in other blocks.
  2989. #define _EBTRB_OFF_7H 0xFF // Boot block (000000-0007FFh) is not protected from table reads executed in other blocks.
  2990. //==============================================================================
  2991. #define __DEVID1 0x3FFFFE
  2992. #define __DEVID2 0x3FFFFF
  2993. #define __IDLOC0 0x200000
  2994. #define __IDLOC1 0x200001
  2995. #define __IDLOC2 0x200002
  2996. #define __IDLOC3 0x200003
  2997. #define __IDLOC4 0x200004
  2998. #define __IDLOC5 0x200005
  2999. #define __IDLOC6 0x200006
  3000. #define __IDLOC7 0x200007
  3001. #endif // #ifndef __PIC18F2455_H__