pic18f26k22.h 196 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164
  1. /*
  2. * This declarations of the PIC18F26K22 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:43 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 __PIC18F26K22_H__
  25. #define __PIC18F26K22_H__
  26. //==============================================================================
  27. //==============================================================================
  28. //
  29. // Register Definitions
  30. //
  31. //==============================================================================
  32. //==============================================================================
  33. // ANSELA Bits
  34. extern __at(0x0F38) __sfr ANSELA;
  35. typedef struct
  36. {
  37. unsigned ANSA0 : 1;
  38. unsigned ANSA1 : 1;
  39. unsigned ANSA2 : 1;
  40. unsigned ANSA3 : 1;
  41. unsigned : 1;
  42. unsigned ANSA5 : 1;
  43. unsigned : 1;
  44. unsigned : 1;
  45. } __ANSELAbits_t;
  46. extern __at(0x0F38) volatile __ANSELAbits_t ANSELAbits;
  47. #define _ANSA0 0x01
  48. #define _ANSA1 0x02
  49. #define _ANSA2 0x04
  50. #define _ANSA3 0x08
  51. #define _ANSA5 0x20
  52. //==============================================================================
  53. //==============================================================================
  54. // ANSELB Bits
  55. extern __at(0x0F39) __sfr ANSELB;
  56. typedef union
  57. {
  58. struct
  59. {
  60. unsigned ANSB0 : 1;
  61. unsigned ANSB1 : 1;
  62. unsigned ANSB2 : 1;
  63. unsigned ANSB3 : 1;
  64. unsigned ANSB4 : 1;
  65. unsigned ANSB5 : 1;
  66. unsigned : 1;
  67. unsigned : 1;
  68. };
  69. struct
  70. {
  71. unsigned ANSB : 6;
  72. unsigned : 2;
  73. };
  74. } __ANSELBbits_t;
  75. extern __at(0x0F39) volatile __ANSELBbits_t ANSELBbits;
  76. #define _ANSB0 0x01
  77. #define _ANSB1 0x02
  78. #define _ANSB2 0x04
  79. #define _ANSB3 0x08
  80. #define _ANSB4 0x10
  81. #define _ANSB5 0x20
  82. //==============================================================================
  83. //==============================================================================
  84. // ANSELC Bits
  85. extern __at(0x0F3A) __sfr ANSELC;
  86. typedef struct
  87. {
  88. unsigned : 1;
  89. unsigned : 1;
  90. unsigned ANSC2 : 1;
  91. unsigned ANSC3 : 1;
  92. unsigned ANSC4 : 1;
  93. unsigned ANSC5 : 1;
  94. unsigned ANSC6 : 1;
  95. unsigned ANSC7 : 1;
  96. } __ANSELCbits_t;
  97. extern __at(0x0F3A) volatile __ANSELCbits_t ANSELCbits;
  98. #define _ANSC2 0x04
  99. #define _ANSC3 0x08
  100. #define _ANSC4 0x10
  101. #define _ANSC5 0x20
  102. #define _ANSC6 0x40
  103. #define _ANSC7 0x80
  104. //==============================================================================
  105. //==============================================================================
  106. // PMD2 Bits
  107. extern __at(0x0F3D) __sfr PMD2;
  108. typedef struct
  109. {
  110. unsigned ADCMD : 1;
  111. unsigned CMP1MD : 1;
  112. unsigned CMP2MD : 1;
  113. unsigned CTMUMD : 1;
  114. unsigned : 1;
  115. unsigned : 1;
  116. unsigned : 1;
  117. unsigned : 1;
  118. } __PMD2bits_t;
  119. extern __at(0x0F3D) volatile __PMD2bits_t PMD2bits;
  120. #define _ADCMD 0x01
  121. #define _CMP1MD 0x02
  122. #define _CMP2MD 0x04
  123. #define _CTMUMD 0x08
  124. //==============================================================================
  125. //==============================================================================
  126. // PMD1 Bits
  127. extern __at(0x0F3E) __sfr PMD1;
  128. typedef struct
  129. {
  130. unsigned CCP1MD : 1;
  131. unsigned CCP2MD : 1;
  132. unsigned CCP3MD : 1;
  133. unsigned CCP4MD : 1;
  134. unsigned CCP5MD : 1;
  135. unsigned : 1;
  136. unsigned MSSP1MD : 1;
  137. unsigned MSSP2MD : 1;
  138. } __PMD1bits_t;
  139. extern __at(0x0F3E) volatile __PMD1bits_t PMD1bits;
  140. #define _CCP1MD 0x01
  141. #define _CCP2MD 0x02
  142. #define _CCP3MD 0x04
  143. #define _CCP4MD 0x08
  144. #define _CCP5MD 0x10
  145. #define _MSSP1MD 0x40
  146. #define _MSSP2MD 0x80
  147. //==============================================================================
  148. //==============================================================================
  149. // PMD0 Bits
  150. extern __at(0x0F3F) __sfr PMD0;
  151. typedef struct
  152. {
  153. unsigned TMR1MD : 1;
  154. unsigned TMR2MD : 1;
  155. unsigned TMR3MD : 1;
  156. unsigned TMR4MD : 1;
  157. unsigned TMR5MD : 1;
  158. unsigned TMR6MD : 1;
  159. unsigned UART1MD : 1;
  160. unsigned UART2MD : 1;
  161. } __PMD0bits_t;
  162. extern __at(0x0F3F) volatile __PMD0bits_t PMD0bits;
  163. #define _TMR1MD 0x01
  164. #define _TMR2MD 0x02
  165. #define _TMR3MD 0x04
  166. #define _TMR4MD 0x08
  167. #define _TMR5MD 0x10
  168. #define _TMR6MD 0x20
  169. #define _UART1MD 0x40
  170. #define _UART2MD 0x80
  171. //==============================================================================
  172. //==============================================================================
  173. // DACCON1 Bits
  174. extern __at(0x0F40) __sfr DACCON1;
  175. typedef union
  176. {
  177. struct
  178. {
  179. unsigned DACR0 : 1;
  180. unsigned DACR1 : 1;
  181. unsigned DACR2 : 1;
  182. unsigned DACR3 : 1;
  183. unsigned DACR4 : 1;
  184. unsigned : 1;
  185. unsigned : 1;
  186. unsigned : 1;
  187. };
  188. struct
  189. {
  190. unsigned DACR : 5;
  191. unsigned : 3;
  192. };
  193. } __DACCON1bits_t;
  194. extern __at(0x0F40) volatile __DACCON1bits_t DACCON1bits;
  195. #define _DACR0 0x01
  196. #define _DACR1 0x02
  197. #define _DACR2 0x04
  198. #define _DACR3 0x08
  199. #define _DACR4 0x10
  200. //==============================================================================
  201. //==============================================================================
  202. // VREFCON2 Bits
  203. extern __at(0x0F40) __sfr VREFCON2;
  204. typedef union
  205. {
  206. struct
  207. {
  208. unsigned DACR0 : 1;
  209. unsigned DACR1 : 1;
  210. unsigned DACR2 : 1;
  211. unsigned DACR3 : 1;
  212. unsigned DACR4 : 1;
  213. unsigned : 1;
  214. unsigned : 1;
  215. unsigned : 1;
  216. };
  217. struct
  218. {
  219. unsigned DACR : 5;
  220. unsigned : 3;
  221. };
  222. } __VREFCON2bits_t;
  223. extern __at(0x0F40) volatile __VREFCON2bits_t VREFCON2bits;
  224. #define _VREFCON2_DACR0 0x01
  225. #define _VREFCON2_DACR1 0x02
  226. #define _VREFCON2_DACR2 0x04
  227. #define _VREFCON2_DACR3 0x08
  228. #define _VREFCON2_DACR4 0x10
  229. //==============================================================================
  230. //==============================================================================
  231. // DACCON0 Bits
  232. extern __at(0x0F41) __sfr DACCON0;
  233. typedef union
  234. {
  235. struct
  236. {
  237. unsigned DACNSS : 1;
  238. unsigned : 1;
  239. unsigned DACPSS0 : 1;
  240. unsigned DACPSS1 : 1;
  241. unsigned : 1;
  242. unsigned DACOE : 1;
  243. unsigned DACLPS : 1;
  244. unsigned DACEN : 1;
  245. };
  246. struct
  247. {
  248. unsigned : 2;
  249. unsigned DACPSS : 2;
  250. unsigned : 4;
  251. };
  252. } __DACCON0bits_t;
  253. extern __at(0x0F41) volatile __DACCON0bits_t DACCON0bits;
  254. #define _DACNSS 0x01
  255. #define _DACPSS0 0x04
  256. #define _DACPSS1 0x08
  257. #define _DACOE 0x20
  258. #define _DACLPS 0x40
  259. #define _DACEN 0x80
  260. //==============================================================================
  261. //==============================================================================
  262. // VREFCON1 Bits
  263. extern __at(0x0F41) __sfr VREFCON1;
  264. typedef union
  265. {
  266. struct
  267. {
  268. unsigned DACNSS : 1;
  269. unsigned : 1;
  270. unsigned DACPSS0 : 1;
  271. unsigned DACPSS1 : 1;
  272. unsigned : 1;
  273. unsigned DACOE : 1;
  274. unsigned DACLPS : 1;
  275. unsigned DACEN : 1;
  276. };
  277. struct
  278. {
  279. unsigned : 2;
  280. unsigned DACPSS : 2;
  281. unsigned : 4;
  282. };
  283. } __VREFCON1bits_t;
  284. extern __at(0x0F41) volatile __VREFCON1bits_t VREFCON1bits;
  285. #define _VREFCON1_DACNSS 0x01
  286. #define _VREFCON1_DACPSS0 0x04
  287. #define _VREFCON1_DACPSS1 0x08
  288. #define _VREFCON1_DACOE 0x20
  289. #define _VREFCON1_DACLPS 0x40
  290. #define _VREFCON1_DACEN 0x80
  291. //==============================================================================
  292. //==============================================================================
  293. // FVRCON Bits
  294. extern __at(0x0F42) __sfr FVRCON;
  295. typedef union
  296. {
  297. struct
  298. {
  299. unsigned : 1;
  300. unsigned : 1;
  301. unsigned : 1;
  302. unsigned : 1;
  303. unsigned FVRS0 : 1;
  304. unsigned FVRS1 : 1;
  305. unsigned FVRST : 1;
  306. unsigned FVREN : 1;
  307. };
  308. struct
  309. {
  310. unsigned : 4;
  311. unsigned FVRS : 2;
  312. unsigned : 2;
  313. };
  314. } __FVRCONbits_t;
  315. extern __at(0x0F42) volatile __FVRCONbits_t FVRCONbits;
  316. #define _FVRS0 0x10
  317. #define _FVRS1 0x20
  318. #define _FVRST 0x40
  319. #define _FVREN 0x80
  320. //==============================================================================
  321. //==============================================================================
  322. // VREFCON0 Bits
  323. extern __at(0x0F42) __sfr VREFCON0;
  324. typedef union
  325. {
  326. struct
  327. {
  328. unsigned : 1;
  329. unsigned : 1;
  330. unsigned : 1;
  331. unsigned : 1;
  332. unsigned FVRS0 : 1;
  333. unsigned FVRS1 : 1;
  334. unsigned FVRST : 1;
  335. unsigned FVREN : 1;
  336. };
  337. struct
  338. {
  339. unsigned : 4;
  340. unsigned FVRS : 2;
  341. unsigned : 2;
  342. };
  343. } __VREFCON0bits_t;
  344. extern __at(0x0F42) volatile __VREFCON0bits_t VREFCON0bits;
  345. #define _VREFCON0_FVRS0 0x10
  346. #define _VREFCON0_FVRS1 0x20
  347. #define _VREFCON0_FVRST 0x40
  348. #define _VREFCON0_FVREN 0x80
  349. //==============================================================================
  350. //==============================================================================
  351. // CTMUICON Bits
  352. extern __at(0x0F43) __sfr CTMUICON;
  353. typedef union
  354. {
  355. struct
  356. {
  357. unsigned IRNG0 : 1;
  358. unsigned IRNG1 : 1;
  359. unsigned ITRIM0 : 1;
  360. unsigned ITRIM1 : 1;
  361. unsigned ITRIM2 : 1;
  362. unsigned ITRIM3 : 1;
  363. unsigned ITRIM4 : 1;
  364. unsigned ITRIM5 : 1;
  365. };
  366. struct
  367. {
  368. unsigned IRNG : 2;
  369. unsigned : 6;
  370. };
  371. struct
  372. {
  373. unsigned : 2;
  374. unsigned ITRIM : 6;
  375. };
  376. } __CTMUICONbits_t;
  377. extern __at(0x0F43) volatile __CTMUICONbits_t CTMUICONbits;
  378. #define _IRNG0 0x01
  379. #define _IRNG1 0x02
  380. #define _ITRIM0 0x04
  381. #define _ITRIM1 0x08
  382. #define _ITRIM2 0x10
  383. #define _ITRIM3 0x20
  384. #define _ITRIM4 0x40
  385. #define _ITRIM5 0x80
  386. //==============================================================================
  387. //==============================================================================
  388. // CTMUICONH Bits
  389. extern __at(0x0F43) __sfr CTMUICONH;
  390. typedef union
  391. {
  392. struct
  393. {
  394. unsigned IRNG0 : 1;
  395. unsigned IRNG1 : 1;
  396. unsigned ITRIM0 : 1;
  397. unsigned ITRIM1 : 1;
  398. unsigned ITRIM2 : 1;
  399. unsigned ITRIM3 : 1;
  400. unsigned ITRIM4 : 1;
  401. unsigned ITRIM5 : 1;
  402. };
  403. struct
  404. {
  405. unsigned IRNG : 2;
  406. unsigned : 6;
  407. };
  408. struct
  409. {
  410. unsigned : 2;
  411. unsigned ITRIM : 6;
  412. };
  413. } __CTMUICONHbits_t;
  414. extern __at(0x0F43) volatile __CTMUICONHbits_t CTMUICONHbits;
  415. #define _CTMUICONH_IRNG0 0x01
  416. #define _CTMUICONH_IRNG1 0x02
  417. #define _CTMUICONH_ITRIM0 0x04
  418. #define _CTMUICONH_ITRIM1 0x08
  419. #define _CTMUICONH_ITRIM2 0x10
  420. #define _CTMUICONH_ITRIM3 0x20
  421. #define _CTMUICONH_ITRIM4 0x40
  422. #define _CTMUICONH_ITRIM5 0x80
  423. //==============================================================================
  424. //==============================================================================
  425. // CTMUCON1 Bits
  426. extern __at(0x0F44) __sfr CTMUCON1;
  427. typedef union
  428. {
  429. struct
  430. {
  431. unsigned EDG1STAT : 1;
  432. unsigned EDG2STAT : 1;
  433. unsigned EDG1SEL0 : 1;
  434. unsigned EDG1SEL1 : 1;
  435. unsigned EDG1POL : 1;
  436. unsigned EDG2SEL0 : 1;
  437. unsigned EDG2SEL1 : 1;
  438. unsigned EDG2POL : 1;
  439. };
  440. struct
  441. {
  442. unsigned : 2;
  443. unsigned EDG1SEL : 2;
  444. unsigned : 4;
  445. };
  446. struct
  447. {
  448. unsigned : 5;
  449. unsigned EDG2SEL : 2;
  450. unsigned : 1;
  451. };
  452. } __CTMUCON1bits_t;
  453. extern __at(0x0F44) volatile __CTMUCON1bits_t CTMUCON1bits;
  454. #define _EDG1STAT 0x01
  455. #define _EDG2STAT 0x02
  456. #define _EDG1SEL0 0x04
  457. #define _EDG1SEL1 0x08
  458. #define _EDG1POL 0x10
  459. #define _EDG2SEL0 0x20
  460. #define _EDG2SEL1 0x40
  461. #define _EDG2POL 0x80
  462. //==============================================================================
  463. //==============================================================================
  464. // CTMUCONL Bits
  465. extern __at(0x0F44) __sfr CTMUCONL;
  466. typedef union
  467. {
  468. struct
  469. {
  470. unsigned EDG1STAT : 1;
  471. unsigned EDG2STAT : 1;
  472. unsigned EDG1SEL0 : 1;
  473. unsigned EDG1SEL1 : 1;
  474. unsigned EDG1POL : 1;
  475. unsigned EDG2SEL0 : 1;
  476. unsigned EDG2SEL1 : 1;
  477. unsigned EDG2POL : 1;
  478. };
  479. struct
  480. {
  481. unsigned : 2;
  482. unsigned EDG1SEL : 2;
  483. unsigned : 4;
  484. };
  485. struct
  486. {
  487. unsigned : 5;
  488. unsigned EDG2SEL : 2;
  489. unsigned : 1;
  490. };
  491. } __CTMUCONLbits_t;
  492. extern __at(0x0F44) volatile __CTMUCONLbits_t CTMUCONLbits;
  493. #define _CTMUCONL_EDG1STAT 0x01
  494. #define _CTMUCONL_EDG2STAT 0x02
  495. #define _CTMUCONL_EDG1SEL0 0x04
  496. #define _CTMUCONL_EDG1SEL1 0x08
  497. #define _CTMUCONL_EDG1POL 0x10
  498. #define _CTMUCONL_EDG2SEL0 0x20
  499. #define _CTMUCONL_EDG2SEL1 0x40
  500. #define _CTMUCONL_EDG2POL 0x80
  501. //==============================================================================
  502. //==============================================================================
  503. // CTMUCON0 Bits
  504. extern __at(0x0F45) __sfr CTMUCON0;
  505. typedef struct
  506. {
  507. unsigned CTTRIG : 1;
  508. unsigned IDISSEN : 1;
  509. unsigned EDGSEQEN : 1;
  510. unsigned EDGEN : 1;
  511. unsigned TGEN : 1;
  512. unsigned CTMUSIDL : 1;
  513. unsigned : 1;
  514. unsigned CTMUEN : 1;
  515. } __CTMUCON0bits_t;
  516. extern __at(0x0F45) volatile __CTMUCON0bits_t CTMUCON0bits;
  517. #define _CTTRIG 0x01
  518. #define _IDISSEN 0x02
  519. #define _EDGSEQEN 0x04
  520. #define _EDGEN 0x08
  521. #define _TGEN 0x10
  522. #define _CTMUSIDL 0x20
  523. #define _CTMUEN 0x80
  524. //==============================================================================
  525. //==============================================================================
  526. // CTMUCONH Bits
  527. extern __at(0x0F45) __sfr CTMUCONH;
  528. typedef struct
  529. {
  530. unsigned CTTRIG : 1;
  531. unsigned IDISSEN : 1;
  532. unsigned EDGSEQEN : 1;
  533. unsigned EDGEN : 1;
  534. unsigned TGEN : 1;
  535. unsigned CTMUSIDL : 1;
  536. unsigned : 1;
  537. unsigned CTMUEN : 1;
  538. } __CTMUCONHbits_t;
  539. extern __at(0x0F45) volatile __CTMUCONHbits_t CTMUCONHbits;
  540. #define _CTMUCONH_CTTRIG 0x01
  541. #define _CTMUCONH_IDISSEN 0x02
  542. #define _CTMUCONH_EDGSEQEN 0x04
  543. #define _CTMUCONH_EDGEN 0x08
  544. #define _CTMUCONH_TGEN 0x10
  545. #define _CTMUCONH_CTMUSIDL 0x20
  546. #define _CTMUCONH_CTMUEN 0x80
  547. //==============================================================================
  548. //==============================================================================
  549. // SRCON1 Bits
  550. extern __at(0x0F46) __sfr SRCON1;
  551. typedef struct
  552. {
  553. unsigned SRRC1E : 1;
  554. unsigned SRRC2E : 1;
  555. unsigned SRRCKE : 1;
  556. unsigned SRRPE : 1;
  557. unsigned SRSC1E : 1;
  558. unsigned SRSC2E : 1;
  559. unsigned SRSCKE : 1;
  560. unsigned SRSPE : 1;
  561. } __SRCON1bits_t;
  562. extern __at(0x0F46) volatile __SRCON1bits_t SRCON1bits;
  563. #define _SRRC1E 0x01
  564. #define _SRRC2E 0x02
  565. #define _SRRCKE 0x04
  566. #define _SRRPE 0x08
  567. #define _SRSC1E 0x10
  568. #define _SRSC2E 0x20
  569. #define _SRSCKE 0x40
  570. #define _SRSPE 0x80
  571. //==============================================================================
  572. //==============================================================================
  573. // SRCON0 Bits
  574. extern __at(0x0F47) __sfr SRCON0;
  575. typedef union
  576. {
  577. struct
  578. {
  579. unsigned SRPR : 1;
  580. unsigned SRPS : 1;
  581. unsigned SRNQEN : 1;
  582. unsigned SRQEN : 1;
  583. unsigned SRCLK0 : 1;
  584. unsigned SRCLK1 : 1;
  585. unsigned SRCLK2 : 1;
  586. unsigned SRLEN : 1;
  587. };
  588. struct
  589. {
  590. unsigned : 4;
  591. unsigned SRCLK : 3;
  592. unsigned : 1;
  593. };
  594. } __SRCON0bits_t;
  595. extern __at(0x0F47) volatile __SRCON0bits_t SRCON0bits;
  596. #define _SRPR 0x01
  597. #define _SRPS 0x02
  598. #define _SRNQEN 0x04
  599. #define _SRQEN 0x08
  600. #define _SRCLK0 0x10
  601. #define _SRCLK1 0x20
  602. #define _SRCLK2 0x40
  603. #define _SRLEN 0x80
  604. //==============================================================================
  605. //==============================================================================
  606. // CCPTMRS1 Bits
  607. extern __at(0x0F48) __sfr CCPTMRS1;
  608. typedef union
  609. {
  610. struct
  611. {
  612. unsigned C4TSEL0 : 1;
  613. unsigned C4TSEL1 : 1;
  614. unsigned C5TSEL0 : 1;
  615. unsigned C5TSEL1 : 1;
  616. unsigned : 1;
  617. unsigned : 1;
  618. unsigned : 1;
  619. unsigned : 1;
  620. };
  621. struct
  622. {
  623. unsigned C4TSEL : 2;
  624. unsigned : 6;
  625. };
  626. struct
  627. {
  628. unsigned : 2;
  629. unsigned C5TSEL : 2;
  630. unsigned : 4;
  631. };
  632. } __CCPTMRS1bits_t;
  633. extern __at(0x0F48) volatile __CCPTMRS1bits_t CCPTMRS1bits;
  634. #define _C4TSEL0 0x01
  635. #define _C4TSEL1 0x02
  636. #define _C5TSEL0 0x04
  637. #define _C5TSEL1 0x08
  638. //==============================================================================
  639. //==============================================================================
  640. // CCPTMRS0 Bits
  641. extern __at(0x0F49) __sfr CCPTMRS0;
  642. typedef union
  643. {
  644. struct
  645. {
  646. unsigned C1TSEL0 : 1;
  647. unsigned C1TSEL1 : 1;
  648. unsigned : 1;
  649. unsigned C2TSEL0 : 1;
  650. unsigned C2TSEL1 : 1;
  651. unsigned : 1;
  652. unsigned C3TSEL0 : 1;
  653. unsigned C3TSEL1 : 1;
  654. };
  655. struct
  656. {
  657. unsigned C1TSEL : 2;
  658. unsigned : 6;
  659. };
  660. struct
  661. {
  662. unsigned : 3;
  663. unsigned C2TSEL : 2;
  664. unsigned : 3;
  665. };
  666. struct
  667. {
  668. unsigned : 6;
  669. unsigned C3TSEL : 2;
  670. };
  671. } __CCPTMRS0bits_t;
  672. extern __at(0x0F49) volatile __CCPTMRS0bits_t CCPTMRS0bits;
  673. #define _C1TSEL0 0x01
  674. #define _C1TSEL1 0x02
  675. #define _C2TSEL0 0x08
  676. #define _C2TSEL1 0x10
  677. #define _C3TSEL0 0x40
  678. #define _C3TSEL1 0x80
  679. //==============================================================================
  680. //==============================================================================
  681. // T6CON Bits
  682. extern __at(0x0F4A) __sfr T6CON;
  683. typedef union
  684. {
  685. struct
  686. {
  687. unsigned T6CKPS0 : 1;
  688. unsigned T6CKPS1 : 1;
  689. unsigned TMR6ON : 1;
  690. unsigned T6OUTPS0 : 1;
  691. unsigned T6OUTPS1 : 1;
  692. unsigned T6OUTPS2 : 1;
  693. unsigned T6OUTPS3 : 1;
  694. unsigned : 1;
  695. };
  696. struct
  697. {
  698. unsigned T6CKPS : 2;
  699. unsigned : 6;
  700. };
  701. struct
  702. {
  703. unsigned : 3;
  704. unsigned T6OUTPS : 4;
  705. unsigned : 1;
  706. };
  707. } __T6CONbits_t;
  708. extern __at(0x0F4A) volatile __T6CONbits_t T6CONbits;
  709. #define _T6CKPS0 0x01
  710. #define _T6CKPS1 0x02
  711. #define _TMR6ON 0x04
  712. #define _T6OUTPS0 0x08
  713. #define _T6OUTPS1 0x10
  714. #define _T6OUTPS2 0x20
  715. #define _T6OUTPS3 0x40
  716. //==============================================================================
  717. extern __at(0x0F4B) __sfr PR6;
  718. extern __at(0x0F4C) __sfr TMR6;
  719. //==============================================================================
  720. // T5GCON Bits
  721. extern __at(0x0F4D) __sfr T5GCON;
  722. typedef union
  723. {
  724. struct
  725. {
  726. unsigned T5GSS0 : 1;
  727. unsigned T5GSS1 : 1;
  728. unsigned T5GVAL : 1;
  729. unsigned T5GGO_NOT_DONE : 1;
  730. unsigned T5GSPM : 1;
  731. unsigned T5GTM : 1;
  732. unsigned T5GPOL : 1;
  733. unsigned TMR5GE : 1;
  734. };
  735. struct
  736. {
  737. unsigned : 1;
  738. unsigned : 1;
  739. unsigned : 1;
  740. unsigned T5GGO : 1;
  741. unsigned : 1;
  742. unsigned : 1;
  743. unsigned : 1;
  744. unsigned : 1;
  745. };
  746. struct
  747. {
  748. unsigned : 1;
  749. unsigned : 1;
  750. unsigned : 1;
  751. unsigned T5G_DONE : 1;
  752. unsigned : 1;
  753. unsigned : 1;
  754. unsigned : 1;
  755. unsigned : 1;
  756. };
  757. struct
  758. {
  759. unsigned T5GSS : 2;
  760. unsigned : 6;
  761. };
  762. } __T5GCONbits_t;
  763. extern __at(0x0F4D) volatile __T5GCONbits_t T5GCONbits;
  764. #define _T5GSS0 0x01
  765. #define _T5GSS1 0x02
  766. #define _T5GVAL 0x04
  767. #define _T5GGO_NOT_DONE 0x08
  768. #define _T5GGO 0x08
  769. #define _T5G_DONE 0x08
  770. #define _T5GSPM 0x10
  771. #define _T5GTM 0x20
  772. #define _T5GPOL 0x40
  773. #define _TMR5GE 0x80
  774. //==============================================================================
  775. //==============================================================================
  776. // T5CON Bits
  777. extern __at(0x0F4E) __sfr T5CON;
  778. typedef union
  779. {
  780. struct
  781. {
  782. unsigned TMR5ON : 1;
  783. unsigned T5RD16 : 1;
  784. unsigned NOT_T5SYNC : 1;
  785. unsigned T5SOSCEN : 1;
  786. unsigned T5CKPS0 : 1;
  787. unsigned T5CKPS1 : 1;
  788. unsigned TMR5CS0 : 1;
  789. unsigned TMR5CS1 : 1;
  790. };
  791. struct
  792. {
  793. unsigned : 1;
  794. unsigned : 1;
  795. unsigned T5SYNC : 1;
  796. unsigned : 1;
  797. unsigned : 1;
  798. unsigned : 1;
  799. unsigned : 1;
  800. unsigned : 1;
  801. };
  802. struct
  803. {
  804. unsigned : 4;
  805. unsigned T5CKPS : 2;
  806. unsigned : 2;
  807. };
  808. struct
  809. {
  810. unsigned : 6;
  811. unsigned TMR5CS : 2;
  812. };
  813. } __T5CONbits_t;
  814. extern __at(0x0F4E) volatile __T5CONbits_t T5CONbits;
  815. #define _TMR5ON 0x01
  816. #define _T5RD16 0x02
  817. #define _NOT_T5SYNC 0x04
  818. #define _T5SYNC 0x04
  819. #define _T5SOSCEN 0x08
  820. #define _T5CKPS0 0x10
  821. #define _T5CKPS1 0x20
  822. #define _TMR5CS0 0x40
  823. #define _TMR5CS1 0x80
  824. //==============================================================================
  825. extern __at(0x0F4F) __sfr TMR5;
  826. extern __at(0x0F4F) __sfr TMR5L;
  827. extern __at(0x0F50) __sfr TMR5H;
  828. //==============================================================================
  829. // T4CON Bits
  830. extern __at(0x0F51) __sfr T4CON;
  831. typedef union
  832. {
  833. struct
  834. {
  835. unsigned T4CKPS0 : 1;
  836. unsigned T4CKPS1 : 1;
  837. unsigned TMR4ON : 1;
  838. unsigned T4OUTPS0 : 1;
  839. unsigned T4OUTPS1 : 1;
  840. unsigned T4OUTPS2 : 1;
  841. unsigned T4OUTPS3 : 1;
  842. unsigned : 1;
  843. };
  844. struct
  845. {
  846. unsigned T4CKPS : 2;
  847. unsigned : 6;
  848. };
  849. struct
  850. {
  851. unsigned : 3;
  852. unsigned T4OUTPS : 4;
  853. unsigned : 1;
  854. };
  855. } __T4CONbits_t;
  856. extern __at(0x0F51) volatile __T4CONbits_t T4CONbits;
  857. #define _T4CKPS0 0x01
  858. #define _T4CKPS1 0x02
  859. #define _TMR4ON 0x04
  860. #define _T4OUTPS0 0x08
  861. #define _T4OUTPS1 0x10
  862. #define _T4OUTPS2 0x20
  863. #define _T4OUTPS3 0x40
  864. //==============================================================================
  865. extern __at(0x0F52) __sfr PR4;
  866. extern __at(0x0F53) __sfr TMR4;
  867. //==============================================================================
  868. // CCP5CON Bits
  869. extern __at(0x0F54) __sfr CCP5CON;
  870. typedef union
  871. {
  872. struct
  873. {
  874. unsigned CCP5M0 : 1;
  875. unsigned CCP5M1 : 1;
  876. unsigned CCP5M2 : 1;
  877. unsigned CCP5M3 : 1;
  878. unsigned DC5B0 : 1;
  879. unsigned DC5B1 : 1;
  880. unsigned : 1;
  881. unsigned : 1;
  882. };
  883. struct
  884. {
  885. unsigned CCP5M : 4;
  886. unsigned : 4;
  887. };
  888. struct
  889. {
  890. unsigned : 4;
  891. unsigned DC5B : 2;
  892. unsigned : 2;
  893. };
  894. } __CCP5CONbits_t;
  895. extern __at(0x0F54) volatile __CCP5CONbits_t CCP5CONbits;
  896. #define _CCP5M0 0x01
  897. #define _CCP5M1 0x02
  898. #define _CCP5M2 0x04
  899. #define _CCP5M3 0x08
  900. #define _DC5B0 0x10
  901. #define _DC5B1 0x20
  902. //==============================================================================
  903. extern __at(0x0F55) __sfr CCPR5;
  904. extern __at(0x0F55) __sfr CCPR5L;
  905. extern __at(0x0F56) __sfr CCPR5H;
  906. //==============================================================================
  907. // CCP4CON Bits
  908. extern __at(0x0F57) __sfr CCP4CON;
  909. typedef union
  910. {
  911. struct
  912. {
  913. unsigned CCP4M0 : 1;
  914. unsigned CCP4M1 : 1;
  915. unsigned CCP4M2 : 1;
  916. unsigned CCP4M3 : 1;
  917. unsigned DC4B0 : 1;
  918. unsigned DC4B1 : 1;
  919. unsigned : 1;
  920. unsigned : 1;
  921. };
  922. struct
  923. {
  924. unsigned CCP4M : 4;
  925. unsigned : 4;
  926. };
  927. struct
  928. {
  929. unsigned : 4;
  930. unsigned DC4B : 2;
  931. unsigned : 2;
  932. };
  933. } __CCP4CONbits_t;
  934. extern __at(0x0F57) volatile __CCP4CONbits_t CCP4CONbits;
  935. #define _CCP4M0 0x01
  936. #define _CCP4M1 0x02
  937. #define _CCP4M2 0x04
  938. #define _CCP4M3 0x08
  939. #define _DC4B0 0x10
  940. #define _DC4B1 0x20
  941. //==============================================================================
  942. extern __at(0x0F58) __sfr CCPR4;
  943. extern __at(0x0F58) __sfr CCPR4L;
  944. extern __at(0x0F59) __sfr CCPR4H;
  945. //==============================================================================
  946. // PSTR3CON Bits
  947. extern __at(0x0F5A) __sfr PSTR3CON;
  948. typedef struct
  949. {
  950. unsigned STR3A : 1;
  951. unsigned STR3B : 1;
  952. unsigned STR3C : 1;
  953. unsigned STR3D : 1;
  954. unsigned STR3SYNC : 1;
  955. unsigned : 1;
  956. unsigned : 1;
  957. unsigned : 1;
  958. } __PSTR3CONbits_t;
  959. extern __at(0x0F5A) volatile __PSTR3CONbits_t PSTR3CONbits;
  960. #define _STR3A 0x01
  961. #define _STR3B 0x02
  962. #define _STR3C 0x04
  963. #define _STR3D 0x08
  964. #define _STR3SYNC 0x10
  965. //==============================================================================
  966. //==============================================================================
  967. // CCP3AS Bits
  968. extern __at(0x0F5B) __sfr CCP3AS;
  969. typedef union
  970. {
  971. struct
  972. {
  973. unsigned P3SSBD0 : 1;
  974. unsigned P3SSBD1 : 1;
  975. unsigned P3SSAC0 : 1;
  976. unsigned P3SSAC1 : 1;
  977. unsigned CCP3AS0 : 1;
  978. unsigned CCP3AS1 : 1;
  979. unsigned CCP3AS2 : 1;
  980. unsigned CCP3ASE : 1;
  981. };
  982. struct
  983. {
  984. unsigned PSS3BD0 : 1;
  985. unsigned PSS3BD1 : 1;
  986. unsigned PSS3AC0 : 1;
  987. unsigned PSS3AC1 : 1;
  988. unsigned : 1;
  989. unsigned : 1;
  990. unsigned : 1;
  991. unsigned : 1;
  992. };
  993. struct
  994. {
  995. unsigned PSS3BD : 2;
  996. unsigned : 6;
  997. };
  998. struct
  999. {
  1000. unsigned P3SSBD : 2;
  1001. unsigned : 6;
  1002. };
  1003. struct
  1004. {
  1005. unsigned : 2;
  1006. unsigned PSS3AC : 2;
  1007. unsigned : 4;
  1008. };
  1009. struct
  1010. {
  1011. unsigned : 2;
  1012. unsigned P3SSAC : 2;
  1013. unsigned : 4;
  1014. };
  1015. struct
  1016. {
  1017. unsigned : 4;
  1018. unsigned CCP3AS : 3;
  1019. unsigned : 1;
  1020. };
  1021. } __CCP3ASbits_t;
  1022. extern __at(0x0F5B) volatile __CCP3ASbits_t CCP3ASbits;
  1023. #define _P3SSBD0 0x01
  1024. #define _PSS3BD0 0x01
  1025. #define _P3SSBD1 0x02
  1026. #define _PSS3BD1 0x02
  1027. #define _P3SSAC0 0x04
  1028. #define _PSS3AC0 0x04
  1029. #define _P3SSAC1 0x08
  1030. #define _PSS3AC1 0x08
  1031. #define _CCP3AS0 0x10
  1032. #define _CCP3AS1 0x20
  1033. #define _CCP3AS2 0x40
  1034. #define _CCP3ASE 0x80
  1035. //==============================================================================
  1036. //==============================================================================
  1037. // ECCP3AS Bits
  1038. extern __at(0x0F5B) __sfr ECCP3AS;
  1039. typedef union
  1040. {
  1041. struct
  1042. {
  1043. unsigned P3SSBD0 : 1;
  1044. unsigned P3SSBD1 : 1;
  1045. unsigned P3SSAC0 : 1;
  1046. unsigned P3SSAC1 : 1;
  1047. unsigned CCP3AS0 : 1;
  1048. unsigned CCP3AS1 : 1;
  1049. unsigned CCP3AS2 : 1;
  1050. unsigned CCP3ASE : 1;
  1051. };
  1052. struct
  1053. {
  1054. unsigned PSS3BD0 : 1;
  1055. unsigned PSS3BD1 : 1;
  1056. unsigned PSS3AC0 : 1;
  1057. unsigned PSS3AC1 : 1;
  1058. unsigned : 1;
  1059. unsigned : 1;
  1060. unsigned : 1;
  1061. unsigned : 1;
  1062. };
  1063. struct
  1064. {
  1065. unsigned PSS3BD : 2;
  1066. unsigned : 6;
  1067. };
  1068. struct
  1069. {
  1070. unsigned P3SSBD : 2;
  1071. unsigned : 6;
  1072. };
  1073. struct
  1074. {
  1075. unsigned : 2;
  1076. unsigned PSS3AC : 2;
  1077. unsigned : 4;
  1078. };
  1079. struct
  1080. {
  1081. unsigned : 2;
  1082. unsigned P3SSAC : 2;
  1083. unsigned : 4;
  1084. };
  1085. struct
  1086. {
  1087. unsigned : 4;
  1088. unsigned CCP3AS : 3;
  1089. unsigned : 1;
  1090. };
  1091. } __ECCP3ASbits_t;
  1092. extern __at(0x0F5B) volatile __ECCP3ASbits_t ECCP3ASbits;
  1093. #define _ECCP3AS_P3SSBD0 0x01
  1094. #define _ECCP3AS_PSS3BD0 0x01
  1095. #define _ECCP3AS_P3SSBD1 0x02
  1096. #define _ECCP3AS_PSS3BD1 0x02
  1097. #define _ECCP3AS_P3SSAC0 0x04
  1098. #define _ECCP3AS_PSS3AC0 0x04
  1099. #define _ECCP3AS_P3SSAC1 0x08
  1100. #define _ECCP3AS_PSS3AC1 0x08
  1101. #define _ECCP3AS_CCP3AS0 0x10
  1102. #define _ECCP3AS_CCP3AS1 0x20
  1103. #define _ECCP3AS_CCP3AS2 0x40
  1104. #define _ECCP3AS_CCP3ASE 0x80
  1105. //==============================================================================
  1106. //==============================================================================
  1107. // PWM3CON Bits
  1108. extern __at(0x0F5C) __sfr PWM3CON;
  1109. typedef union
  1110. {
  1111. struct
  1112. {
  1113. unsigned P3DC0 : 1;
  1114. unsigned P3DC1 : 1;
  1115. unsigned P3DC2 : 1;
  1116. unsigned P3DC3 : 1;
  1117. unsigned P3DC4 : 1;
  1118. unsigned P3DC5 : 1;
  1119. unsigned P3DC6 : 1;
  1120. unsigned P3RSEN : 1;
  1121. };
  1122. struct
  1123. {
  1124. unsigned P3DC : 7;
  1125. unsigned : 1;
  1126. };
  1127. } __PWM3CONbits_t;
  1128. extern __at(0x0F5C) volatile __PWM3CONbits_t PWM3CONbits;
  1129. #define _P3DC0 0x01
  1130. #define _P3DC1 0x02
  1131. #define _P3DC2 0x04
  1132. #define _P3DC3 0x08
  1133. #define _P3DC4 0x10
  1134. #define _P3DC5 0x20
  1135. #define _P3DC6 0x40
  1136. #define _P3RSEN 0x80
  1137. //==============================================================================
  1138. //==============================================================================
  1139. // CCP3CON Bits
  1140. extern __at(0x0F5D) __sfr CCP3CON;
  1141. typedef union
  1142. {
  1143. struct
  1144. {
  1145. unsigned CCP3M0 : 1;
  1146. unsigned CCP3M1 : 1;
  1147. unsigned CCP3M2 : 1;
  1148. unsigned CCP3M3 : 1;
  1149. unsigned DC3B0 : 1;
  1150. unsigned DC3B1 : 1;
  1151. unsigned P3M0 : 1;
  1152. unsigned P3M1 : 1;
  1153. };
  1154. struct
  1155. {
  1156. unsigned CCP3M : 4;
  1157. unsigned : 4;
  1158. };
  1159. struct
  1160. {
  1161. unsigned : 4;
  1162. unsigned DC3B : 2;
  1163. unsigned : 2;
  1164. };
  1165. struct
  1166. {
  1167. unsigned : 6;
  1168. unsigned P3M : 2;
  1169. };
  1170. } __CCP3CONbits_t;
  1171. extern __at(0x0F5D) volatile __CCP3CONbits_t CCP3CONbits;
  1172. #define _CCP3M0 0x01
  1173. #define _CCP3M1 0x02
  1174. #define _CCP3M2 0x04
  1175. #define _CCP3M3 0x08
  1176. #define _DC3B0 0x10
  1177. #define _DC3B1 0x20
  1178. #define _P3M0 0x40
  1179. #define _P3M1 0x80
  1180. //==============================================================================
  1181. extern __at(0x0F5E) __sfr CCPR3;
  1182. extern __at(0x0F5E) __sfr CCPR3L;
  1183. extern __at(0x0F5F) __sfr CCPR3H;
  1184. //==============================================================================
  1185. // SLRCON Bits
  1186. extern __at(0x0F60) __sfr SLRCON;
  1187. typedef struct
  1188. {
  1189. unsigned SLRA : 1;
  1190. unsigned SLRB : 1;
  1191. unsigned SLRC : 1;
  1192. unsigned : 1;
  1193. unsigned : 1;
  1194. unsigned : 1;
  1195. unsigned : 1;
  1196. unsigned : 1;
  1197. } __SLRCONbits_t;
  1198. extern __at(0x0F60) volatile __SLRCONbits_t SLRCONbits;
  1199. #define _SLRA 0x01
  1200. #define _SLRB 0x02
  1201. #define _SLRC 0x04
  1202. //==============================================================================
  1203. //==============================================================================
  1204. // WPUB Bits
  1205. extern __at(0x0F61) __sfr WPUB;
  1206. typedef struct
  1207. {
  1208. unsigned WPUB0 : 1;
  1209. unsigned WPUB1 : 1;
  1210. unsigned WPUB2 : 1;
  1211. unsigned WPUB3 : 1;
  1212. unsigned WPUB4 : 1;
  1213. unsigned WPUB5 : 1;
  1214. unsigned WPUB6 : 1;
  1215. unsigned WPUB7 : 1;
  1216. } __WPUBbits_t;
  1217. extern __at(0x0F61) volatile __WPUBbits_t WPUBbits;
  1218. #define _WPUB0 0x01
  1219. #define _WPUB1 0x02
  1220. #define _WPUB2 0x04
  1221. #define _WPUB3 0x08
  1222. #define _WPUB4 0x10
  1223. #define _WPUB5 0x20
  1224. #define _WPUB6 0x40
  1225. #define _WPUB7 0x80
  1226. //==============================================================================
  1227. //==============================================================================
  1228. // IOCB Bits
  1229. extern __at(0x0F62) __sfr IOCB;
  1230. typedef struct
  1231. {
  1232. unsigned : 1;
  1233. unsigned : 1;
  1234. unsigned : 1;
  1235. unsigned : 1;
  1236. unsigned IOCB4 : 1;
  1237. unsigned IOCB5 : 1;
  1238. unsigned IOCB6 : 1;
  1239. unsigned IOCB7 : 1;
  1240. } __IOCBbits_t;
  1241. extern __at(0x0F62) volatile __IOCBbits_t IOCBbits;
  1242. #define _IOCB4 0x10
  1243. #define _IOCB5 0x20
  1244. #define _IOCB6 0x40
  1245. #define _IOCB7 0x80
  1246. //==============================================================================
  1247. //==============================================================================
  1248. // PSTR2CON Bits
  1249. extern __at(0x0F63) __sfr PSTR2CON;
  1250. typedef struct
  1251. {
  1252. unsigned STR2A : 1;
  1253. unsigned STR2B : 1;
  1254. unsigned STR2C : 1;
  1255. unsigned STR2D : 1;
  1256. unsigned STR2SYNC : 1;
  1257. unsigned : 1;
  1258. unsigned : 1;
  1259. unsigned : 1;
  1260. } __PSTR2CONbits_t;
  1261. extern __at(0x0F63) volatile __PSTR2CONbits_t PSTR2CONbits;
  1262. #define _STR2A 0x01
  1263. #define _STR2B 0x02
  1264. #define _STR2C 0x04
  1265. #define _STR2D 0x08
  1266. #define _STR2SYNC 0x10
  1267. //==============================================================================
  1268. //==============================================================================
  1269. // CCP2AS Bits
  1270. extern __at(0x0F64) __sfr CCP2AS;
  1271. typedef union
  1272. {
  1273. struct
  1274. {
  1275. unsigned P2SSBD0 : 1;
  1276. unsigned P2SSBD1 : 1;
  1277. unsigned P2SSAC0 : 1;
  1278. unsigned P2SSAC1 : 1;
  1279. unsigned CCP2AS0 : 1;
  1280. unsigned CCP2AS1 : 1;
  1281. unsigned CCP2AS2 : 1;
  1282. unsigned CCP2ASE : 1;
  1283. };
  1284. struct
  1285. {
  1286. unsigned PSS2BD0 : 1;
  1287. unsigned PSS2BD1 : 1;
  1288. unsigned PSS2AC0 : 1;
  1289. unsigned PSS2AC1 : 1;
  1290. unsigned : 1;
  1291. unsigned : 1;
  1292. unsigned : 1;
  1293. unsigned : 1;
  1294. };
  1295. struct
  1296. {
  1297. unsigned PSS2BD : 2;
  1298. unsigned : 6;
  1299. };
  1300. struct
  1301. {
  1302. unsigned P2SSBD : 2;
  1303. unsigned : 6;
  1304. };
  1305. struct
  1306. {
  1307. unsigned : 2;
  1308. unsigned P2SSAC : 2;
  1309. unsigned : 4;
  1310. };
  1311. struct
  1312. {
  1313. unsigned : 2;
  1314. unsigned PSS2AC : 2;
  1315. unsigned : 4;
  1316. };
  1317. struct
  1318. {
  1319. unsigned : 4;
  1320. unsigned CCP2AS : 3;
  1321. unsigned : 1;
  1322. };
  1323. } __CCP2ASbits_t;
  1324. extern __at(0x0F64) volatile __CCP2ASbits_t CCP2ASbits;
  1325. #define _P2SSBD0 0x01
  1326. #define _PSS2BD0 0x01
  1327. #define _P2SSBD1 0x02
  1328. #define _PSS2BD1 0x02
  1329. #define _P2SSAC0 0x04
  1330. #define _PSS2AC0 0x04
  1331. #define _P2SSAC1 0x08
  1332. #define _PSS2AC1 0x08
  1333. #define _CCP2AS0 0x10
  1334. #define _CCP2AS1 0x20
  1335. #define _CCP2AS2 0x40
  1336. #define _CCP2ASE 0x80
  1337. //==============================================================================
  1338. //==============================================================================
  1339. // ECCP2AS Bits
  1340. extern __at(0x0F64) __sfr ECCP2AS;
  1341. typedef union
  1342. {
  1343. struct
  1344. {
  1345. unsigned P2SSBD0 : 1;
  1346. unsigned P2SSBD1 : 1;
  1347. unsigned P2SSAC0 : 1;
  1348. unsigned P2SSAC1 : 1;
  1349. unsigned CCP2AS0 : 1;
  1350. unsigned CCP2AS1 : 1;
  1351. unsigned CCP2AS2 : 1;
  1352. unsigned CCP2ASE : 1;
  1353. };
  1354. struct
  1355. {
  1356. unsigned PSS2BD0 : 1;
  1357. unsigned PSS2BD1 : 1;
  1358. unsigned PSS2AC0 : 1;
  1359. unsigned PSS2AC1 : 1;
  1360. unsigned : 1;
  1361. unsigned : 1;
  1362. unsigned : 1;
  1363. unsigned : 1;
  1364. };
  1365. struct
  1366. {
  1367. unsigned PSS2BD : 2;
  1368. unsigned : 6;
  1369. };
  1370. struct
  1371. {
  1372. unsigned P2SSBD : 2;
  1373. unsigned : 6;
  1374. };
  1375. struct
  1376. {
  1377. unsigned : 2;
  1378. unsigned P2SSAC : 2;
  1379. unsigned : 4;
  1380. };
  1381. struct
  1382. {
  1383. unsigned : 2;
  1384. unsigned PSS2AC : 2;
  1385. unsigned : 4;
  1386. };
  1387. struct
  1388. {
  1389. unsigned : 4;
  1390. unsigned CCP2AS : 3;
  1391. unsigned : 1;
  1392. };
  1393. } __ECCP2ASbits_t;
  1394. extern __at(0x0F64) volatile __ECCP2ASbits_t ECCP2ASbits;
  1395. #define _ECCP2AS_P2SSBD0 0x01
  1396. #define _ECCP2AS_PSS2BD0 0x01
  1397. #define _ECCP2AS_P2SSBD1 0x02
  1398. #define _ECCP2AS_PSS2BD1 0x02
  1399. #define _ECCP2AS_P2SSAC0 0x04
  1400. #define _ECCP2AS_PSS2AC0 0x04
  1401. #define _ECCP2AS_P2SSAC1 0x08
  1402. #define _ECCP2AS_PSS2AC1 0x08
  1403. #define _ECCP2AS_CCP2AS0 0x10
  1404. #define _ECCP2AS_CCP2AS1 0x20
  1405. #define _ECCP2AS_CCP2AS2 0x40
  1406. #define _ECCP2AS_CCP2ASE 0x80
  1407. //==============================================================================
  1408. //==============================================================================
  1409. // PWM2CON Bits
  1410. extern __at(0x0F65) __sfr PWM2CON;
  1411. typedef union
  1412. {
  1413. struct
  1414. {
  1415. unsigned P2DC0 : 1;
  1416. unsigned P2DC1 : 1;
  1417. unsigned P2DC2 : 1;
  1418. unsigned P2DC3 : 1;
  1419. unsigned P2DC4 : 1;
  1420. unsigned P2DC5 : 1;
  1421. unsigned P2DC6 : 1;
  1422. unsigned P2RSEN : 1;
  1423. };
  1424. struct
  1425. {
  1426. unsigned P2DC : 7;
  1427. unsigned : 1;
  1428. };
  1429. } __PWM2CONbits_t;
  1430. extern __at(0x0F65) volatile __PWM2CONbits_t PWM2CONbits;
  1431. #define _P2DC0 0x01
  1432. #define _P2DC1 0x02
  1433. #define _P2DC2 0x04
  1434. #define _P2DC3 0x08
  1435. #define _P2DC4 0x10
  1436. #define _P2DC5 0x20
  1437. #define _P2DC6 0x40
  1438. #define _P2RSEN 0x80
  1439. //==============================================================================
  1440. //==============================================================================
  1441. // CCP2CON Bits
  1442. extern __at(0x0F66) __sfr CCP2CON;
  1443. typedef union
  1444. {
  1445. struct
  1446. {
  1447. unsigned CCP2M0 : 1;
  1448. unsigned CCP2M1 : 1;
  1449. unsigned CCP2M2 : 1;
  1450. unsigned CCP2M3 : 1;
  1451. unsigned DC2B0 : 1;
  1452. unsigned DC2B1 : 1;
  1453. unsigned P2M0 : 1;
  1454. unsigned P2M1 : 1;
  1455. };
  1456. struct
  1457. {
  1458. unsigned CCP2M : 4;
  1459. unsigned : 4;
  1460. };
  1461. struct
  1462. {
  1463. unsigned : 4;
  1464. unsigned DC2B : 2;
  1465. unsigned : 2;
  1466. };
  1467. struct
  1468. {
  1469. unsigned : 6;
  1470. unsigned P2M : 2;
  1471. };
  1472. } __CCP2CONbits_t;
  1473. extern __at(0x0F66) volatile __CCP2CONbits_t CCP2CONbits;
  1474. #define _CCP2M0 0x01
  1475. #define _CCP2M1 0x02
  1476. #define _CCP2M2 0x04
  1477. #define _CCP2M3 0x08
  1478. #define _DC2B0 0x10
  1479. #define _DC2B1 0x20
  1480. #define _P2M0 0x40
  1481. #define _P2M1 0x80
  1482. //==============================================================================
  1483. extern __at(0x0F67) __sfr CCPR2;
  1484. extern __at(0x0F67) __sfr CCPR2L;
  1485. extern __at(0x0F68) __sfr CCPR2H;
  1486. //==============================================================================
  1487. // SSP2CON3 Bits
  1488. extern __at(0x0F69) __sfr SSP2CON3;
  1489. typedef struct
  1490. {
  1491. unsigned DHEN : 1;
  1492. unsigned AHEN : 1;
  1493. unsigned SBCDE : 1;
  1494. unsigned SDAHT : 1;
  1495. unsigned BOEN : 1;
  1496. unsigned SCIE : 1;
  1497. unsigned PCIE : 1;
  1498. unsigned ACKTIM : 1;
  1499. } __SSP2CON3bits_t;
  1500. extern __at(0x0F69) volatile __SSP2CON3bits_t SSP2CON3bits;
  1501. #define _SSP2CON3_DHEN 0x01
  1502. #define _SSP2CON3_AHEN 0x02
  1503. #define _SSP2CON3_SBCDE 0x04
  1504. #define _SSP2CON3_SDAHT 0x08
  1505. #define _SSP2CON3_BOEN 0x10
  1506. #define _SSP2CON3_SCIE 0x20
  1507. #define _SSP2CON3_PCIE 0x40
  1508. #define _SSP2CON3_ACKTIM 0x80
  1509. //==============================================================================
  1510. //==============================================================================
  1511. // SSP2MSK Bits
  1512. extern __at(0x0F6A) __sfr SSP2MSK;
  1513. typedef struct
  1514. {
  1515. unsigned MSK0 : 1;
  1516. unsigned MSK1 : 1;
  1517. unsigned MSK2 : 1;
  1518. unsigned MSK3 : 1;
  1519. unsigned MSK4 : 1;
  1520. unsigned MSK5 : 1;
  1521. unsigned MSK6 : 1;
  1522. unsigned MSK7 : 1;
  1523. } __SSP2MSKbits_t;
  1524. extern __at(0x0F6A) volatile __SSP2MSKbits_t SSP2MSKbits;
  1525. #define _SSP2MSK_MSK0 0x01
  1526. #define _SSP2MSK_MSK1 0x02
  1527. #define _SSP2MSK_MSK2 0x04
  1528. #define _SSP2MSK_MSK3 0x08
  1529. #define _SSP2MSK_MSK4 0x10
  1530. #define _SSP2MSK_MSK5 0x20
  1531. #define _SSP2MSK_MSK6 0x40
  1532. #define _SSP2MSK_MSK7 0x80
  1533. //==============================================================================
  1534. //==============================================================================
  1535. // SSP2CON2 Bits
  1536. extern __at(0x0F6B) __sfr SSP2CON2;
  1537. typedef struct
  1538. {
  1539. unsigned SEN : 1;
  1540. unsigned RSEN : 1;
  1541. unsigned PEN : 1;
  1542. unsigned RCEN : 1;
  1543. unsigned ACKEN : 1;
  1544. unsigned ACKDT : 1;
  1545. unsigned ACKSTAT : 1;
  1546. unsigned GCEN : 1;
  1547. } __SSP2CON2bits_t;
  1548. extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
  1549. #define _SSP2CON2_SEN 0x01
  1550. #define _SSP2CON2_RSEN 0x02
  1551. #define _SSP2CON2_PEN 0x04
  1552. #define _SSP2CON2_RCEN 0x08
  1553. #define _SSP2CON2_ACKEN 0x10
  1554. #define _SSP2CON2_ACKDT 0x20
  1555. #define _SSP2CON2_ACKSTAT 0x40
  1556. #define _SSP2CON2_GCEN 0x80
  1557. //==============================================================================
  1558. //==============================================================================
  1559. // SSP2CON1 Bits
  1560. extern __at(0x0F6C) __sfr SSP2CON1;
  1561. typedef union
  1562. {
  1563. struct
  1564. {
  1565. unsigned SSPM0 : 1;
  1566. unsigned SSPM1 : 1;
  1567. unsigned SSPM2 : 1;
  1568. unsigned SSPM3 : 1;
  1569. unsigned CKP : 1;
  1570. unsigned SSPEN : 1;
  1571. unsigned SSPOV : 1;
  1572. unsigned WCOL : 1;
  1573. };
  1574. struct
  1575. {
  1576. unsigned SSPM : 4;
  1577. unsigned : 4;
  1578. };
  1579. } __SSP2CON1bits_t;
  1580. extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
  1581. #define _SSP2CON1_SSPM0 0x01
  1582. #define _SSP2CON1_SSPM1 0x02
  1583. #define _SSP2CON1_SSPM2 0x04
  1584. #define _SSP2CON1_SSPM3 0x08
  1585. #define _SSP2CON1_CKP 0x10
  1586. #define _SSP2CON1_SSPEN 0x20
  1587. #define _SSP2CON1_SSPOV 0x40
  1588. #define _SSP2CON1_WCOL 0x80
  1589. //==============================================================================
  1590. //==============================================================================
  1591. // SSP2STAT Bits
  1592. extern __at(0x0F6D) __sfr SSP2STAT;
  1593. typedef union
  1594. {
  1595. struct
  1596. {
  1597. unsigned BF : 1;
  1598. unsigned UA : 1;
  1599. unsigned R_NOT_W : 1;
  1600. unsigned S : 1;
  1601. unsigned P : 1;
  1602. unsigned D_NOT_A : 1;
  1603. unsigned CKE : 1;
  1604. unsigned SMP : 1;
  1605. };
  1606. struct
  1607. {
  1608. unsigned : 1;
  1609. unsigned : 1;
  1610. unsigned R : 1;
  1611. unsigned : 1;
  1612. unsigned : 1;
  1613. unsigned D : 1;
  1614. unsigned : 1;
  1615. unsigned : 1;
  1616. };
  1617. struct
  1618. {
  1619. unsigned : 1;
  1620. unsigned : 1;
  1621. unsigned NOT_W : 1;
  1622. unsigned : 1;
  1623. unsigned : 1;
  1624. unsigned NOT_A : 1;
  1625. unsigned : 1;
  1626. unsigned : 1;
  1627. };
  1628. struct
  1629. {
  1630. unsigned : 1;
  1631. unsigned : 1;
  1632. unsigned R_W : 1;
  1633. unsigned : 1;
  1634. unsigned : 1;
  1635. unsigned D_A : 1;
  1636. unsigned : 1;
  1637. unsigned : 1;
  1638. };
  1639. struct
  1640. {
  1641. unsigned : 1;
  1642. unsigned : 1;
  1643. unsigned NOT_WRITE : 1;
  1644. unsigned : 1;
  1645. unsigned : 1;
  1646. unsigned NOT_ADDRESS : 1;
  1647. unsigned : 1;
  1648. unsigned : 1;
  1649. };
  1650. } __SSP2STATbits_t;
  1651. extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
  1652. #define _SSP2STAT_BF 0x01
  1653. #define _SSP2STAT_UA 0x02
  1654. #define _SSP2STAT_R_NOT_W 0x04
  1655. #define _SSP2STAT_R 0x04
  1656. #define _SSP2STAT_NOT_W 0x04
  1657. #define _SSP2STAT_R_W 0x04
  1658. #define _SSP2STAT_NOT_WRITE 0x04
  1659. #define _SSP2STAT_S 0x08
  1660. #define _SSP2STAT_P 0x10
  1661. #define _SSP2STAT_D_NOT_A 0x20
  1662. #define _SSP2STAT_D 0x20
  1663. #define _SSP2STAT_NOT_A 0x20
  1664. #define _SSP2STAT_D_A 0x20
  1665. #define _SSP2STAT_NOT_ADDRESS 0x20
  1666. #define _SSP2STAT_CKE 0x40
  1667. #define _SSP2STAT_SMP 0x80
  1668. //==============================================================================
  1669. extern __at(0x0F6E) __sfr SSP2ADD;
  1670. extern __at(0x0F6F) __sfr SSP2BUF;
  1671. //==============================================================================
  1672. // BAUD2CON Bits
  1673. extern __at(0x0F70) __sfr BAUD2CON;
  1674. typedef union
  1675. {
  1676. struct
  1677. {
  1678. unsigned ABDEN : 1;
  1679. unsigned WUE : 1;
  1680. unsigned : 1;
  1681. unsigned BRG16 : 1;
  1682. unsigned CKTXP : 1;
  1683. unsigned DTRXP : 1;
  1684. unsigned RCIDL : 1;
  1685. unsigned ABDOVF : 1;
  1686. };
  1687. struct
  1688. {
  1689. unsigned : 1;
  1690. unsigned : 1;
  1691. unsigned : 1;
  1692. unsigned : 1;
  1693. unsigned SCKP : 1;
  1694. unsigned : 1;
  1695. unsigned : 1;
  1696. unsigned : 1;
  1697. };
  1698. } __BAUD2CONbits_t;
  1699. extern __at(0x0F70) volatile __BAUD2CONbits_t BAUD2CONbits;
  1700. #define _BAUD2CON_ABDEN 0x01
  1701. #define _BAUD2CON_WUE 0x02
  1702. #define _BAUD2CON_BRG16 0x08
  1703. #define _BAUD2CON_CKTXP 0x10
  1704. #define _BAUD2CON_SCKP 0x10
  1705. #define _BAUD2CON_DTRXP 0x20
  1706. #define _BAUD2CON_RCIDL 0x40
  1707. #define _BAUD2CON_ABDOVF 0x80
  1708. //==============================================================================
  1709. //==============================================================================
  1710. // BAUDCON2 Bits
  1711. extern __at(0x0F70) __sfr BAUDCON2;
  1712. typedef union
  1713. {
  1714. struct
  1715. {
  1716. unsigned ABDEN : 1;
  1717. unsigned WUE : 1;
  1718. unsigned : 1;
  1719. unsigned BRG16 : 1;
  1720. unsigned CKTXP : 1;
  1721. unsigned DTRXP : 1;
  1722. unsigned RCIDL : 1;
  1723. unsigned ABDOVF : 1;
  1724. };
  1725. struct
  1726. {
  1727. unsigned : 1;
  1728. unsigned : 1;
  1729. unsigned : 1;
  1730. unsigned : 1;
  1731. unsigned SCKP : 1;
  1732. unsigned : 1;
  1733. unsigned : 1;
  1734. unsigned : 1;
  1735. };
  1736. } __BAUDCON2bits_t;
  1737. extern __at(0x0F70) volatile __BAUDCON2bits_t BAUDCON2bits;
  1738. #define _BAUDCON2_ABDEN 0x01
  1739. #define _BAUDCON2_WUE 0x02
  1740. #define _BAUDCON2_BRG16 0x08
  1741. #define _BAUDCON2_CKTXP 0x10
  1742. #define _BAUDCON2_SCKP 0x10
  1743. #define _BAUDCON2_DTRXP 0x20
  1744. #define _BAUDCON2_RCIDL 0x40
  1745. #define _BAUDCON2_ABDOVF 0x80
  1746. //==============================================================================
  1747. //==============================================================================
  1748. // RC2STA Bits
  1749. extern __at(0x0F71) __sfr RC2STA;
  1750. typedef union
  1751. {
  1752. struct
  1753. {
  1754. unsigned RX9D : 1;
  1755. unsigned OERR : 1;
  1756. unsigned FERR : 1;
  1757. unsigned ADDEN : 1;
  1758. unsigned CREN : 1;
  1759. unsigned SREN : 1;
  1760. unsigned RX9 : 1;
  1761. unsigned SPEN : 1;
  1762. };
  1763. struct
  1764. {
  1765. unsigned RX9D2 : 1;
  1766. unsigned OERR2 : 1;
  1767. unsigned FERR2 : 1;
  1768. unsigned ADEN : 1;
  1769. unsigned CREN2 : 1;
  1770. unsigned SREN2 : 1;
  1771. unsigned RX92 : 1;
  1772. unsigned SPEN2 : 1;
  1773. };
  1774. struct
  1775. {
  1776. unsigned : 1;
  1777. unsigned : 1;
  1778. unsigned : 1;
  1779. unsigned ADDEN2 : 1;
  1780. unsigned : 1;
  1781. unsigned : 1;
  1782. unsigned : 1;
  1783. unsigned : 1;
  1784. };
  1785. } __RC2STAbits_t;
  1786. extern __at(0x0F71) volatile __RC2STAbits_t RC2STAbits;
  1787. #define _RC2STA_RX9D 0x01
  1788. #define _RC2STA_RX9D2 0x01
  1789. #define _RC2STA_OERR 0x02
  1790. #define _RC2STA_OERR2 0x02
  1791. #define _RC2STA_FERR 0x04
  1792. #define _RC2STA_FERR2 0x04
  1793. #define _RC2STA_ADDEN 0x08
  1794. #define _RC2STA_ADEN 0x08
  1795. #define _RC2STA_ADDEN2 0x08
  1796. #define _RC2STA_CREN 0x10
  1797. #define _RC2STA_CREN2 0x10
  1798. #define _RC2STA_SREN 0x20
  1799. #define _RC2STA_SREN2 0x20
  1800. #define _RC2STA_RX9 0x40
  1801. #define _RC2STA_RX92 0x40
  1802. #define _RC2STA_SPEN 0x80
  1803. #define _RC2STA_SPEN2 0x80
  1804. //==============================================================================
  1805. //==============================================================================
  1806. // RCSTA2 Bits
  1807. extern __at(0x0F71) __sfr RCSTA2;
  1808. typedef union
  1809. {
  1810. struct
  1811. {
  1812. unsigned RX9D : 1;
  1813. unsigned OERR : 1;
  1814. unsigned FERR : 1;
  1815. unsigned ADDEN : 1;
  1816. unsigned CREN : 1;
  1817. unsigned SREN : 1;
  1818. unsigned RX9 : 1;
  1819. unsigned SPEN : 1;
  1820. };
  1821. struct
  1822. {
  1823. unsigned RX9D2 : 1;
  1824. unsigned OERR2 : 1;
  1825. unsigned FERR2 : 1;
  1826. unsigned ADEN : 1;
  1827. unsigned CREN2 : 1;
  1828. unsigned SREN2 : 1;
  1829. unsigned RX92 : 1;
  1830. unsigned SPEN2 : 1;
  1831. };
  1832. struct
  1833. {
  1834. unsigned : 1;
  1835. unsigned : 1;
  1836. unsigned : 1;
  1837. unsigned ADDEN2 : 1;
  1838. unsigned : 1;
  1839. unsigned : 1;
  1840. unsigned : 1;
  1841. unsigned : 1;
  1842. };
  1843. } __RCSTA2bits_t;
  1844. extern __at(0x0F71) volatile __RCSTA2bits_t RCSTA2bits;
  1845. #define _RCSTA2_RX9D 0x01
  1846. #define _RCSTA2_RX9D2 0x01
  1847. #define _RCSTA2_OERR 0x02
  1848. #define _RCSTA2_OERR2 0x02
  1849. #define _RCSTA2_FERR 0x04
  1850. #define _RCSTA2_FERR2 0x04
  1851. #define _RCSTA2_ADDEN 0x08
  1852. #define _RCSTA2_ADEN 0x08
  1853. #define _RCSTA2_ADDEN2 0x08
  1854. #define _RCSTA2_CREN 0x10
  1855. #define _RCSTA2_CREN2 0x10
  1856. #define _RCSTA2_SREN 0x20
  1857. #define _RCSTA2_SREN2 0x20
  1858. #define _RCSTA2_RX9 0x40
  1859. #define _RCSTA2_RX92 0x40
  1860. #define _RCSTA2_SPEN 0x80
  1861. #define _RCSTA2_SPEN2 0x80
  1862. //==============================================================================
  1863. //==============================================================================
  1864. // TX2STA Bits
  1865. extern __at(0x0F72) __sfr TX2STA;
  1866. typedef union
  1867. {
  1868. struct
  1869. {
  1870. unsigned TX9D : 1;
  1871. unsigned TRMT : 1;
  1872. unsigned BRGH : 1;
  1873. unsigned SENDB : 1;
  1874. unsigned SYNC : 1;
  1875. unsigned TXEN : 1;
  1876. unsigned TX9 : 1;
  1877. unsigned CSRC : 1;
  1878. };
  1879. struct
  1880. {
  1881. unsigned TX9D2 : 1;
  1882. unsigned TRMT2 : 1;
  1883. unsigned BRGH2 : 1;
  1884. unsigned SENDB2 : 1;
  1885. unsigned SYNC2 : 1;
  1886. unsigned TXEN2 : 1;
  1887. unsigned TX92 : 1;
  1888. unsigned CSRC2 : 1;
  1889. };
  1890. } __TX2STAbits_t;
  1891. extern __at(0x0F72) volatile __TX2STAbits_t TX2STAbits;
  1892. #define _TX2STA_TX9D 0x01
  1893. #define _TX2STA_TX9D2 0x01
  1894. #define _TX2STA_TRMT 0x02
  1895. #define _TX2STA_TRMT2 0x02
  1896. #define _TX2STA_BRGH 0x04
  1897. #define _TX2STA_BRGH2 0x04
  1898. #define _TX2STA_SENDB 0x08
  1899. #define _TX2STA_SENDB2 0x08
  1900. #define _TX2STA_SYNC 0x10
  1901. #define _TX2STA_SYNC2 0x10
  1902. #define _TX2STA_TXEN 0x20
  1903. #define _TX2STA_TXEN2 0x20
  1904. #define _TX2STA_TX9 0x40
  1905. #define _TX2STA_TX92 0x40
  1906. #define _TX2STA_CSRC 0x80
  1907. #define _TX2STA_CSRC2 0x80
  1908. //==============================================================================
  1909. //==============================================================================
  1910. // TXSTA2 Bits
  1911. extern __at(0x0F72) __sfr TXSTA2;
  1912. typedef union
  1913. {
  1914. struct
  1915. {
  1916. unsigned TX9D : 1;
  1917. unsigned TRMT : 1;
  1918. unsigned BRGH : 1;
  1919. unsigned SENDB : 1;
  1920. unsigned SYNC : 1;
  1921. unsigned TXEN : 1;
  1922. unsigned TX9 : 1;
  1923. unsigned CSRC : 1;
  1924. };
  1925. struct
  1926. {
  1927. unsigned TX9D2 : 1;
  1928. unsigned TRMT2 : 1;
  1929. unsigned BRGH2 : 1;
  1930. unsigned SENDB2 : 1;
  1931. unsigned SYNC2 : 1;
  1932. unsigned TXEN2 : 1;
  1933. unsigned TX92 : 1;
  1934. unsigned CSRC2 : 1;
  1935. };
  1936. } __TXSTA2bits_t;
  1937. extern __at(0x0F72) volatile __TXSTA2bits_t TXSTA2bits;
  1938. #define _TXSTA2_TX9D 0x01
  1939. #define _TXSTA2_TX9D2 0x01
  1940. #define _TXSTA2_TRMT 0x02
  1941. #define _TXSTA2_TRMT2 0x02
  1942. #define _TXSTA2_BRGH 0x04
  1943. #define _TXSTA2_BRGH2 0x04
  1944. #define _TXSTA2_SENDB 0x08
  1945. #define _TXSTA2_SENDB2 0x08
  1946. #define _TXSTA2_SYNC 0x10
  1947. #define _TXSTA2_SYNC2 0x10
  1948. #define _TXSTA2_TXEN 0x20
  1949. #define _TXSTA2_TXEN2 0x20
  1950. #define _TXSTA2_TX9 0x40
  1951. #define _TXSTA2_TX92 0x40
  1952. #define _TXSTA2_CSRC 0x80
  1953. #define _TXSTA2_CSRC2 0x80
  1954. //==============================================================================
  1955. extern __at(0x0F73) __sfr TX2REG;
  1956. extern __at(0x0F73) __sfr TXREG2;
  1957. extern __at(0x0F74) __sfr RC2REG;
  1958. extern __at(0x0F74) __sfr RCREG2;
  1959. extern __at(0x0F75) __sfr SP2BRG;
  1960. extern __at(0x0F75) __sfr SPBRG2;
  1961. extern __at(0x0F76) __sfr SP2BRGH;
  1962. extern __at(0x0F76) __sfr SPBRGH2;
  1963. //==============================================================================
  1964. // CM12CON Bits
  1965. extern __at(0x0F77) __sfr CM12CON;
  1966. typedef struct
  1967. {
  1968. unsigned C2SYNC : 1;
  1969. unsigned C1SYNC : 1;
  1970. unsigned C2HYS : 1;
  1971. unsigned C1HYS : 1;
  1972. unsigned C2RSEL : 1;
  1973. unsigned C1RSEL : 1;
  1974. unsigned MC2OUT : 1;
  1975. unsigned MC1OUT : 1;
  1976. } __CM12CONbits_t;
  1977. extern __at(0x0F77) volatile __CM12CONbits_t CM12CONbits;
  1978. #define _CM12CON_C2SYNC 0x01
  1979. #define _CM12CON_C1SYNC 0x02
  1980. #define _CM12CON_C2HYS 0x04
  1981. #define _CM12CON_C1HYS 0x08
  1982. #define _CM12CON_C2RSEL 0x10
  1983. #define _CM12CON_C1RSEL 0x20
  1984. #define _CM12CON_MC2OUT 0x40
  1985. #define _CM12CON_MC1OUT 0x80
  1986. //==============================================================================
  1987. //==============================================================================
  1988. // CM2CON1 Bits
  1989. extern __at(0x0F77) __sfr CM2CON1;
  1990. typedef struct
  1991. {
  1992. unsigned C2SYNC : 1;
  1993. unsigned C1SYNC : 1;
  1994. unsigned C2HYS : 1;
  1995. unsigned C1HYS : 1;
  1996. unsigned C2RSEL : 1;
  1997. unsigned C1RSEL : 1;
  1998. unsigned MC2OUT : 1;
  1999. unsigned MC1OUT : 1;
  2000. } __CM2CON1bits_t;
  2001. extern __at(0x0F77) volatile __CM2CON1bits_t CM2CON1bits;
  2002. #define _C2SYNC 0x01
  2003. #define _C1SYNC 0x02
  2004. #define _C2HYS 0x04
  2005. #define _C1HYS 0x08
  2006. #define _C2RSEL 0x10
  2007. #define _C1RSEL 0x20
  2008. #define _MC2OUT 0x40
  2009. #define _MC1OUT 0x80
  2010. //==============================================================================
  2011. //==============================================================================
  2012. // CM2CON Bits
  2013. extern __at(0x0F78) __sfr CM2CON;
  2014. typedef union
  2015. {
  2016. struct
  2017. {
  2018. unsigned C2CH0 : 1;
  2019. unsigned C2CH1 : 1;
  2020. unsigned C2R : 1;
  2021. unsigned C2SP : 1;
  2022. unsigned C2POL : 1;
  2023. unsigned C2OE : 1;
  2024. unsigned C2OUT : 1;
  2025. unsigned C2ON : 1;
  2026. };
  2027. struct
  2028. {
  2029. unsigned C2CH : 2;
  2030. unsigned : 6;
  2031. };
  2032. } __CM2CONbits_t;
  2033. extern __at(0x0F78) volatile __CM2CONbits_t CM2CONbits;
  2034. #define _C2CH0 0x01
  2035. #define _C2CH1 0x02
  2036. #define _C2R 0x04
  2037. #define _C2SP 0x08
  2038. #define _C2POL 0x10
  2039. #define _C2OE 0x20
  2040. #define _C2OUT 0x40
  2041. #define _C2ON 0x80
  2042. //==============================================================================
  2043. //==============================================================================
  2044. // CM2CON0 Bits
  2045. extern __at(0x0F78) __sfr CM2CON0;
  2046. typedef union
  2047. {
  2048. struct
  2049. {
  2050. unsigned C2CH0 : 1;
  2051. unsigned C2CH1 : 1;
  2052. unsigned C2R : 1;
  2053. unsigned C2SP : 1;
  2054. unsigned C2POL : 1;
  2055. unsigned C2OE : 1;
  2056. unsigned C2OUT : 1;
  2057. unsigned C2ON : 1;
  2058. };
  2059. struct
  2060. {
  2061. unsigned C2CH : 2;
  2062. unsigned : 6;
  2063. };
  2064. } __CM2CON0bits_t;
  2065. extern __at(0x0F78) volatile __CM2CON0bits_t CM2CON0bits;
  2066. #define _CM2CON0_C2CH0 0x01
  2067. #define _CM2CON0_C2CH1 0x02
  2068. #define _CM2CON0_C2R 0x04
  2069. #define _CM2CON0_C2SP 0x08
  2070. #define _CM2CON0_C2POL 0x10
  2071. #define _CM2CON0_C2OE 0x20
  2072. #define _CM2CON0_C2OUT 0x40
  2073. #define _CM2CON0_C2ON 0x80
  2074. //==============================================================================
  2075. //==============================================================================
  2076. // CM1CON Bits
  2077. extern __at(0x0F79) __sfr CM1CON;
  2078. typedef union
  2079. {
  2080. struct
  2081. {
  2082. unsigned C1CH0 : 1;
  2083. unsigned C1CH1 : 1;
  2084. unsigned C1R : 1;
  2085. unsigned C1SP : 1;
  2086. unsigned C1POL : 1;
  2087. unsigned C1OE : 1;
  2088. unsigned C1OUT : 1;
  2089. unsigned C1ON : 1;
  2090. };
  2091. struct
  2092. {
  2093. unsigned C1CH : 2;
  2094. unsigned : 6;
  2095. };
  2096. } __CM1CONbits_t;
  2097. extern __at(0x0F79) volatile __CM1CONbits_t CM1CONbits;
  2098. #define _C1CH0 0x01
  2099. #define _C1CH1 0x02
  2100. #define _C1R 0x04
  2101. #define _C1SP 0x08
  2102. #define _C1POL 0x10
  2103. #define _C1OE 0x20
  2104. #define _C1OUT 0x40
  2105. #define _C1ON 0x80
  2106. //==============================================================================
  2107. //==============================================================================
  2108. // CM1CON0 Bits
  2109. extern __at(0x0F79) __sfr CM1CON0;
  2110. typedef union
  2111. {
  2112. struct
  2113. {
  2114. unsigned C1CH0 : 1;
  2115. unsigned C1CH1 : 1;
  2116. unsigned C1R : 1;
  2117. unsigned C1SP : 1;
  2118. unsigned C1POL : 1;
  2119. unsigned C1OE : 1;
  2120. unsigned C1OUT : 1;
  2121. unsigned C1ON : 1;
  2122. };
  2123. struct
  2124. {
  2125. unsigned C1CH : 2;
  2126. unsigned : 6;
  2127. };
  2128. } __CM1CON0bits_t;
  2129. extern __at(0x0F79) volatile __CM1CON0bits_t CM1CON0bits;
  2130. #define _CM1CON0_C1CH0 0x01
  2131. #define _CM1CON0_C1CH1 0x02
  2132. #define _CM1CON0_C1R 0x04
  2133. #define _CM1CON0_C1SP 0x08
  2134. #define _CM1CON0_C1POL 0x10
  2135. #define _CM1CON0_C1OE 0x20
  2136. #define _CM1CON0_C1OUT 0x40
  2137. #define _CM1CON0_C1ON 0x80
  2138. //==============================================================================
  2139. //==============================================================================
  2140. // PIE4 Bits
  2141. extern __at(0x0F7A) __sfr PIE4;
  2142. typedef struct
  2143. {
  2144. unsigned CCP3IE : 1;
  2145. unsigned CCP4IE : 1;
  2146. unsigned CCP5IE : 1;
  2147. unsigned : 1;
  2148. unsigned : 1;
  2149. unsigned : 1;
  2150. unsigned : 1;
  2151. unsigned : 1;
  2152. } __PIE4bits_t;
  2153. extern __at(0x0F7A) volatile __PIE4bits_t PIE4bits;
  2154. #define _CCP3IE 0x01
  2155. #define _CCP4IE 0x02
  2156. #define _CCP5IE 0x04
  2157. //==============================================================================
  2158. //==============================================================================
  2159. // PIR4 Bits
  2160. extern __at(0x0F7B) __sfr PIR4;
  2161. typedef struct
  2162. {
  2163. unsigned CCP3IF : 1;
  2164. unsigned CCP4IF : 1;
  2165. unsigned CCP5IF : 1;
  2166. unsigned : 1;
  2167. unsigned : 1;
  2168. unsigned : 1;
  2169. unsigned : 1;
  2170. unsigned : 1;
  2171. } __PIR4bits_t;
  2172. extern __at(0x0F7B) volatile __PIR4bits_t PIR4bits;
  2173. #define _CCP3IF 0x01
  2174. #define _CCP4IF 0x02
  2175. #define _CCP5IF 0x04
  2176. //==============================================================================
  2177. //==============================================================================
  2178. // IPR4 Bits
  2179. extern __at(0x0F7C) __sfr IPR4;
  2180. typedef struct
  2181. {
  2182. unsigned CCP3IP : 1;
  2183. unsigned CCP4IP : 1;
  2184. unsigned CCP5IP : 1;
  2185. unsigned : 1;
  2186. unsigned : 1;
  2187. unsigned : 1;
  2188. unsigned : 1;
  2189. unsigned : 1;
  2190. } __IPR4bits_t;
  2191. extern __at(0x0F7C) volatile __IPR4bits_t IPR4bits;
  2192. #define _CCP3IP 0x01
  2193. #define _CCP4IP 0x02
  2194. #define _CCP5IP 0x04
  2195. //==============================================================================
  2196. //==============================================================================
  2197. // PIE5 Bits
  2198. extern __at(0x0F7D) __sfr PIE5;
  2199. typedef struct
  2200. {
  2201. unsigned TMR4IE : 1;
  2202. unsigned TMR5IE : 1;
  2203. unsigned TMR6IE : 1;
  2204. unsigned : 1;
  2205. unsigned : 1;
  2206. unsigned : 1;
  2207. unsigned : 1;
  2208. unsigned : 1;
  2209. } __PIE5bits_t;
  2210. extern __at(0x0F7D) volatile __PIE5bits_t PIE5bits;
  2211. #define _TMR4IE 0x01
  2212. #define _TMR5IE 0x02
  2213. #define _TMR6IE 0x04
  2214. //==============================================================================
  2215. //==============================================================================
  2216. // PIR5 Bits
  2217. extern __at(0x0F7E) __sfr PIR5;
  2218. typedef struct
  2219. {
  2220. unsigned TMR4IF : 1;
  2221. unsigned TMR5IF : 1;
  2222. unsigned TMR6IF : 1;
  2223. unsigned : 1;
  2224. unsigned : 1;
  2225. unsigned : 1;
  2226. unsigned : 1;
  2227. unsigned : 1;
  2228. } __PIR5bits_t;
  2229. extern __at(0x0F7E) volatile __PIR5bits_t PIR5bits;
  2230. #define _TMR4IF 0x01
  2231. #define _TMR5IF 0x02
  2232. #define _TMR6IF 0x04
  2233. //==============================================================================
  2234. //==============================================================================
  2235. // IPR5 Bits
  2236. extern __at(0x0F7F) __sfr IPR5;
  2237. typedef struct
  2238. {
  2239. unsigned TMR4IP : 1;
  2240. unsigned TMR5IP : 1;
  2241. unsigned TMR6IP : 1;
  2242. unsigned : 1;
  2243. unsigned : 1;
  2244. unsigned : 1;
  2245. unsigned : 1;
  2246. unsigned : 1;
  2247. } __IPR5bits_t;
  2248. extern __at(0x0F7F) volatile __IPR5bits_t IPR5bits;
  2249. #define _TMR4IP 0x01
  2250. #define _TMR5IP 0x02
  2251. #define _TMR6IP 0x04
  2252. //==============================================================================
  2253. //==============================================================================
  2254. // PORTA Bits
  2255. extern __at(0x0F80) __sfr PORTA;
  2256. typedef union
  2257. {
  2258. struct
  2259. {
  2260. unsigned RA0 : 1;
  2261. unsigned RA1 : 1;
  2262. unsigned RA2 : 1;
  2263. unsigned RA3 : 1;
  2264. unsigned RA4 : 1;
  2265. unsigned RA5 : 1;
  2266. unsigned RA6 : 1;
  2267. unsigned RA7 : 1;
  2268. };
  2269. struct
  2270. {
  2271. unsigned AN0 : 1;
  2272. unsigned AN1 : 1;
  2273. unsigned AN2 : 1;
  2274. unsigned AN3 : 1;
  2275. unsigned C1OUT : 1;
  2276. unsigned AN4 : 1;
  2277. unsigned : 1;
  2278. unsigned : 1;
  2279. };
  2280. struct
  2281. {
  2282. unsigned C12IN0M : 1;
  2283. unsigned C12IN1M : 1;
  2284. unsigned C2INP : 1;
  2285. unsigned C1INP : 1;
  2286. unsigned T0CKI : 1;
  2287. unsigned C2OUT : 1;
  2288. unsigned : 1;
  2289. unsigned : 1;
  2290. };
  2291. struct
  2292. {
  2293. unsigned C12IN0N : 1;
  2294. unsigned C12IN1N : 1;
  2295. unsigned VREFM : 1;
  2296. unsigned VREFP : 1;
  2297. unsigned SRQ : 1;
  2298. unsigned SS : 1;
  2299. unsigned : 1;
  2300. unsigned : 1;
  2301. };
  2302. struct
  2303. {
  2304. unsigned : 1;
  2305. unsigned : 1;
  2306. unsigned VREFN : 1;
  2307. unsigned : 1;
  2308. unsigned CCP5 : 1;
  2309. unsigned NOT_SS : 1;
  2310. unsigned : 1;
  2311. unsigned : 1;
  2312. };
  2313. struct
  2314. {
  2315. unsigned : 1;
  2316. unsigned : 1;
  2317. unsigned CVREF : 1;
  2318. unsigned : 1;
  2319. unsigned : 1;
  2320. unsigned LVDIN : 1;
  2321. unsigned : 1;
  2322. unsigned : 1;
  2323. };
  2324. struct
  2325. {
  2326. unsigned : 1;
  2327. unsigned : 1;
  2328. unsigned DACOUT : 1;
  2329. unsigned : 1;
  2330. unsigned : 1;
  2331. unsigned HLVDIN : 1;
  2332. unsigned : 1;
  2333. unsigned : 1;
  2334. };
  2335. struct
  2336. {
  2337. unsigned : 1;
  2338. unsigned : 1;
  2339. unsigned : 1;
  2340. unsigned : 1;
  2341. unsigned : 1;
  2342. unsigned SS1 : 1;
  2343. unsigned : 1;
  2344. unsigned : 1;
  2345. };
  2346. struct
  2347. {
  2348. unsigned : 1;
  2349. unsigned : 1;
  2350. unsigned : 1;
  2351. unsigned : 1;
  2352. unsigned : 1;
  2353. unsigned NOT_SS1 : 1;
  2354. unsigned : 1;
  2355. unsigned : 1;
  2356. };
  2357. struct
  2358. {
  2359. unsigned : 1;
  2360. unsigned : 1;
  2361. unsigned : 1;
  2362. unsigned : 1;
  2363. unsigned : 1;
  2364. unsigned SRNQ : 1;
  2365. unsigned : 1;
  2366. unsigned : 1;
  2367. };
  2368. } __PORTAbits_t;
  2369. extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
  2370. #define _PORTA_RA0 0x01
  2371. #define _PORTA_AN0 0x01
  2372. #define _PORTA_C12IN0M 0x01
  2373. #define _PORTA_C12IN0N 0x01
  2374. #define _PORTA_RA1 0x02
  2375. #define _PORTA_AN1 0x02
  2376. #define _PORTA_C12IN1M 0x02
  2377. #define _PORTA_C12IN1N 0x02
  2378. #define _PORTA_RA2 0x04
  2379. #define _PORTA_AN2 0x04
  2380. #define _PORTA_C2INP 0x04
  2381. #define _PORTA_VREFM 0x04
  2382. #define _PORTA_VREFN 0x04
  2383. #define _PORTA_CVREF 0x04
  2384. #define _PORTA_DACOUT 0x04
  2385. #define _PORTA_RA3 0x08
  2386. #define _PORTA_AN3 0x08
  2387. #define _PORTA_C1INP 0x08
  2388. #define _PORTA_VREFP 0x08
  2389. #define _PORTA_RA4 0x10
  2390. #define _PORTA_C1OUT 0x10
  2391. #define _PORTA_T0CKI 0x10
  2392. #define _PORTA_SRQ 0x10
  2393. #define _PORTA_CCP5 0x10
  2394. #define _PORTA_RA5 0x20
  2395. #define _PORTA_AN4 0x20
  2396. #define _PORTA_C2OUT 0x20
  2397. #define _PORTA_SS 0x20
  2398. #define _PORTA_NOT_SS 0x20
  2399. #define _PORTA_LVDIN 0x20
  2400. #define _PORTA_HLVDIN 0x20
  2401. #define _PORTA_SS1 0x20
  2402. #define _PORTA_NOT_SS1 0x20
  2403. #define _PORTA_SRNQ 0x20
  2404. #define _PORTA_RA6 0x40
  2405. #define _PORTA_RA7 0x80
  2406. //==============================================================================
  2407. //==============================================================================
  2408. // PORTB Bits
  2409. extern __at(0x0F81) __sfr PORTB;
  2410. typedef union
  2411. {
  2412. struct
  2413. {
  2414. unsigned RB0 : 1;
  2415. unsigned RB1 : 1;
  2416. unsigned RB2 : 1;
  2417. unsigned RB3 : 1;
  2418. unsigned RB4 : 1;
  2419. unsigned RB5 : 1;
  2420. unsigned RB6 : 1;
  2421. unsigned RB7 : 1;
  2422. };
  2423. struct
  2424. {
  2425. unsigned INT0 : 1;
  2426. unsigned INT1 : 1;
  2427. unsigned INT2 : 1;
  2428. unsigned CCP2 : 1;
  2429. unsigned KBI0 : 1;
  2430. unsigned KBI1 : 1;
  2431. unsigned KBI2 : 1;
  2432. unsigned KBI3 : 1;
  2433. };
  2434. struct
  2435. {
  2436. unsigned AN12 : 1;
  2437. unsigned AN10 : 1;
  2438. unsigned AN8 : 1;
  2439. unsigned AN9 : 1;
  2440. unsigned AN11 : 1;
  2441. unsigned AN13 : 1;
  2442. unsigned TX2 : 1;
  2443. unsigned RX2 : 1;
  2444. };
  2445. struct
  2446. {
  2447. unsigned FLT0 : 1;
  2448. unsigned C12IN3M : 1;
  2449. unsigned P1B : 1;
  2450. unsigned C12IN2M : 1;
  2451. unsigned T5G : 1;
  2452. unsigned T1G : 1;
  2453. unsigned CK2 : 1;
  2454. unsigned DT2 : 1;
  2455. };
  2456. struct
  2457. {
  2458. unsigned SRI : 1;
  2459. unsigned C12IN3N : 1;
  2460. unsigned CTED1 : 1;
  2461. unsigned C12IN2N : 1;
  2462. unsigned P1D : 1;
  2463. unsigned CCP3 : 1;
  2464. unsigned PGC : 1;
  2465. unsigned PGD : 1;
  2466. };
  2467. struct
  2468. {
  2469. unsigned CCP4 : 1;
  2470. unsigned P1C : 1;
  2471. unsigned SDA2 : 1;
  2472. unsigned CTED2 : 1;
  2473. unsigned : 1;
  2474. unsigned T3CKI : 1;
  2475. unsigned : 1;
  2476. unsigned : 1;
  2477. };
  2478. struct
  2479. {
  2480. unsigned SS2 : 1;
  2481. unsigned SCL2 : 1;
  2482. unsigned SDI2 : 1;
  2483. unsigned P2A : 1;
  2484. unsigned : 1;
  2485. unsigned P3A : 1;
  2486. unsigned : 1;
  2487. unsigned : 1;
  2488. };
  2489. struct
  2490. {
  2491. unsigned NOT_SS2 : 1;
  2492. unsigned SCK2 : 1;
  2493. unsigned : 1;
  2494. unsigned SDO2 : 1;
  2495. unsigned : 1;
  2496. unsigned P2B : 1;
  2497. unsigned : 1;
  2498. unsigned : 1;
  2499. };
  2500. struct
  2501. {
  2502. unsigned INT : 3;
  2503. unsigned : 5;
  2504. };
  2505. struct
  2506. {
  2507. unsigned : 4;
  2508. unsigned KBI : 4;
  2509. };
  2510. } __PORTBbits_t;
  2511. extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
  2512. #define _PORTB_RB0 0x01
  2513. #define _PORTB_INT0 0x01
  2514. #define _PORTB_AN12 0x01
  2515. #define _PORTB_FLT0 0x01
  2516. #define _PORTB_SRI 0x01
  2517. #define _PORTB_CCP4 0x01
  2518. #define _PORTB_SS2 0x01
  2519. #define _PORTB_NOT_SS2 0x01
  2520. #define _PORTB_RB1 0x02
  2521. #define _PORTB_INT1 0x02
  2522. #define _PORTB_AN10 0x02
  2523. #define _PORTB_C12IN3M 0x02
  2524. #define _PORTB_C12IN3N 0x02
  2525. #define _PORTB_P1C 0x02
  2526. #define _PORTB_SCL2 0x02
  2527. #define _PORTB_SCK2 0x02
  2528. #define _PORTB_RB2 0x04
  2529. #define _PORTB_INT2 0x04
  2530. #define _PORTB_AN8 0x04
  2531. #define _PORTB_P1B 0x04
  2532. #define _PORTB_CTED1 0x04
  2533. #define _PORTB_SDA2 0x04
  2534. #define _PORTB_SDI2 0x04
  2535. #define _PORTB_RB3 0x08
  2536. #define _PORTB_CCP2 0x08
  2537. #define _PORTB_AN9 0x08
  2538. #define _PORTB_C12IN2M 0x08
  2539. #define _PORTB_C12IN2N 0x08
  2540. #define _PORTB_CTED2 0x08
  2541. #define _PORTB_P2A 0x08
  2542. #define _PORTB_SDO2 0x08
  2543. #define _PORTB_RB4 0x10
  2544. #define _PORTB_KBI0 0x10
  2545. #define _PORTB_AN11 0x10
  2546. #define _PORTB_T5G 0x10
  2547. #define _PORTB_P1D 0x10
  2548. #define _PORTB_RB5 0x20
  2549. #define _PORTB_KBI1 0x20
  2550. #define _PORTB_AN13 0x20
  2551. #define _PORTB_T1G 0x20
  2552. #define _PORTB_CCP3 0x20
  2553. #define _PORTB_T3CKI 0x20
  2554. #define _PORTB_P3A 0x20
  2555. #define _PORTB_P2B 0x20
  2556. #define _PORTB_RB6 0x40
  2557. #define _PORTB_KBI2 0x40
  2558. #define _PORTB_TX2 0x40
  2559. #define _PORTB_CK2 0x40
  2560. #define _PORTB_PGC 0x40
  2561. #define _PORTB_RB7 0x80
  2562. #define _PORTB_KBI3 0x80
  2563. #define _PORTB_RX2 0x80
  2564. #define _PORTB_DT2 0x80
  2565. #define _PORTB_PGD 0x80
  2566. //==============================================================================
  2567. //==============================================================================
  2568. // PORTC Bits
  2569. extern __at(0x0F82) __sfr PORTC;
  2570. typedef union
  2571. {
  2572. struct
  2573. {
  2574. unsigned RC0 : 1;
  2575. unsigned RC1 : 1;
  2576. unsigned RC2 : 1;
  2577. unsigned RC3 : 1;
  2578. unsigned RC4 : 1;
  2579. unsigned RC5 : 1;
  2580. unsigned RC6 : 1;
  2581. unsigned RC7 : 1;
  2582. };
  2583. struct
  2584. {
  2585. unsigned T1OSO : 1;
  2586. unsigned T1OSI : 1;
  2587. unsigned T5CKI : 1;
  2588. unsigned SCK : 1;
  2589. unsigned SDI : 1;
  2590. unsigned SDO : 1;
  2591. unsigned TX : 1;
  2592. unsigned RX : 1;
  2593. };
  2594. struct
  2595. {
  2596. unsigned P2B : 1;
  2597. unsigned P2A : 1;
  2598. unsigned P1A : 1;
  2599. unsigned SCL : 1;
  2600. unsigned SDA : 1;
  2601. unsigned SDO1 : 1;
  2602. unsigned CK : 1;
  2603. unsigned RX1 : 1;
  2604. };
  2605. struct
  2606. {
  2607. unsigned T1CKI : 1;
  2608. unsigned CCP2 : 1;
  2609. unsigned CCP1 : 1;
  2610. unsigned SCK1 : 1;
  2611. unsigned SDI1 : 1;
  2612. unsigned AN17 : 1;
  2613. unsigned TX1 : 1;
  2614. unsigned DT1 : 1;
  2615. };
  2616. struct
  2617. {
  2618. unsigned T3CKI : 1;
  2619. unsigned : 1;
  2620. unsigned CTPLS : 1;
  2621. unsigned SCL1 : 1;
  2622. unsigned SDA1 : 1;
  2623. unsigned : 1;
  2624. unsigned CK1 : 1;
  2625. unsigned AN19 : 1;
  2626. };
  2627. struct
  2628. {
  2629. unsigned T3G : 1;
  2630. unsigned : 1;
  2631. unsigned AN14 : 1;
  2632. unsigned AN15 : 1;
  2633. unsigned AN16 : 1;
  2634. unsigned : 1;
  2635. unsigned AN18 : 1;
  2636. unsigned P3B : 1;
  2637. };
  2638. struct
  2639. {
  2640. unsigned : 1;
  2641. unsigned : 1;
  2642. unsigned : 1;
  2643. unsigned : 1;
  2644. unsigned : 1;
  2645. unsigned : 1;
  2646. unsigned CCP3 : 1;
  2647. unsigned : 1;
  2648. };
  2649. struct
  2650. {
  2651. unsigned : 1;
  2652. unsigned : 1;
  2653. unsigned : 1;
  2654. unsigned : 1;
  2655. unsigned : 1;
  2656. unsigned : 1;
  2657. unsigned P3A : 1;
  2658. unsigned : 1;
  2659. };
  2660. } __PORTCbits_t;
  2661. extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
  2662. #define _PORTC_RC0 0x01
  2663. #define _PORTC_T1OSO 0x01
  2664. #define _PORTC_P2B 0x01
  2665. #define _PORTC_T1CKI 0x01
  2666. #define _PORTC_T3CKI 0x01
  2667. #define _PORTC_T3G 0x01
  2668. #define _PORTC_RC1 0x02
  2669. #define _PORTC_T1OSI 0x02
  2670. #define _PORTC_P2A 0x02
  2671. #define _PORTC_CCP2 0x02
  2672. #define _PORTC_RC2 0x04
  2673. #define _PORTC_T5CKI 0x04
  2674. #define _PORTC_P1A 0x04
  2675. #define _PORTC_CCP1 0x04
  2676. #define _PORTC_CTPLS 0x04
  2677. #define _PORTC_AN14 0x04
  2678. #define _PORTC_RC3 0x08
  2679. #define _PORTC_SCK 0x08
  2680. #define _PORTC_SCL 0x08
  2681. #define _PORTC_SCK1 0x08
  2682. #define _PORTC_SCL1 0x08
  2683. #define _PORTC_AN15 0x08
  2684. #define _PORTC_RC4 0x10
  2685. #define _PORTC_SDI 0x10
  2686. #define _PORTC_SDA 0x10
  2687. #define _PORTC_SDI1 0x10
  2688. #define _PORTC_SDA1 0x10
  2689. #define _PORTC_AN16 0x10
  2690. #define _PORTC_RC5 0x20
  2691. #define _PORTC_SDO 0x20
  2692. #define _PORTC_SDO1 0x20
  2693. #define _PORTC_AN17 0x20
  2694. #define _PORTC_RC6 0x40
  2695. #define _PORTC_TX 0x40
  2696. #define _PORTC_CK 0x40
  2697. #define _PORTC_TX1 0x40
  2698. #define _PORTC_CK1 0x40
  2699. #define _PORTC_AN18 0x40
  2700. #define _PORTC_CCP3 0x40
  2701. #define _PORTC_P3A 0x40
  2702. #define _PORTC_RC7 0x80
  2703. #define _PORTC_RX 0x80
  2704. #define _PORTC_RX1 0x80
  2705. #define _PORTC_DT1 0x80
  2706. #define _PORTC_AN19 0x80
  2707. #define _PORTC_P3B 0x80
  2708. //==============================================================================
  2709. //==============================================================================
  2710. // PORTE Bits
  2711. extern __at(0x0F84) __sfr PORTE;
  2712. typedef union
  2713. {
  2714. struct
  2715. {
  2716. unsigned : 1;
  2717. unsigned : 1;
  2718. unsigned : 1;
  2719. unsigned RE3 : 1;
  2720. unsigned : 1;
  2721. unsigned : 1;
  2722. unsigned : 1;
  2723. unsigned : 1;
  2724. };
  2725. struct
  2726. {
  2727. unsigned : 1;
  2728. unsigned : 1;
  2729. unsigned : 1;
  2730. unsigned MCLR : 1;
  2731. unsigned : 1;
  2732. unsigned : 1;
  2733. unsigned : 1;
  2734. unsigned : 1;
  2735. };
  2736. struct
  2737. {
  2738. unsigned : 1;
  2739. unsigned : 1;
  2740. unsigned : 1;
  2741. unsigned NOT_MCLR : 1;
  2742. unsigned : 1;
  2743. unsigned : 1;
  2744. unsigned : 1;
  2745. unsigned : 1;
  2746. };
  2747. struct
  2748. {
  2749. unsigned : 1;
  2750. unsigned : 1;
  2751. unsigned : 1;
  2752. unsigned VPP : 1;
  2753. unsigned : 1;
  2754. unsigned : 1;
  2755. unsigned : 1;
  2756. unsigned : 1;
  2757. };
  2758. } __PORTEbits_t;
  2759. extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
  2760. #define _RE3 0x08
  2761. #define _MCLR 0x08
  2762. #define _NOT_MCLR 0x08
  2763. #define _VPP 0x08
  2764. //==============================================================================
  2765. //==============================================================================
  2766. // LATA Bits
  2767. extern __at(0x0F89) __sfr LATA;
  2768. typedef struct
  2769. {
  2770. unsigned LATA0 : 1;
  2771. unsigned LATA1 : 1;
  2772. unsigned LATA2 : 1;
  2773. unsigned LATA3 : 1;
  2774. unsigned LATA4 : 1;
  2775. unsigned LATA5 : 1;
  2776. unsigned LATA6 : 1;
  2777. unsigned LATA7 : 1;
  2778. } __LATAbits_t;
  2779. extern __at(0x0F89) volatile __LATAbits_t LATAbits;
  2780. #define _LATA0 0x01
  2781. #define _LATA1 0x02
  2782. #define _LATA2 0x04
  2783. #define _LATA3 0x08
  2784. #define _LATA4 0x10
  2785. #define _LATA5 0x20
  2786. #define _LATA6 0x40
  2787. #define _LATA7 0x80
  2788. //==============================================================================
  2789. //==============================================================================
  2790. // LATB Bits
  2791. extern __at(0x0F8A) __sfr LATB;
  2792. typedef struct
  2793. {
  2794. unsigned LATB0 : 1;
  2795. unsigned LATB1 : 1;
  2796. unsigned LATB2 : 1;
  2797. unsigned LATB3 : 1;
  2798. unsigned LATB4 : 1;
  2799. unsigned LATB5 : 1;
  2800. unsigned LATB6 : 1;
  2801. unsigned LATB7 : 1;
  2802. } __LATBbits_t;
  2803. extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
  2804. #define _LATB0 0x01
  2805. #define _LATB1 0x02
  2806. #define _LATB2 0x04
  2807. #define _LATB3 0x08
  2808. #define _LATB4 0x10
  2809. #define _LATB5 0x20
  2810. #define _LATB6 0x40
  2811. #define _LATB7 0x80
  2812. //==============================================================================
  2813. //==============================================================================
  2814. // LATC Bits
  2815. extern __at(0x0F8B) __sfr LATC;
  2816. typedef struct
  2817. {
  2818. unsigned LATC0 : 1;
  2819. unsigned LATC1 : 1;
  2820. unsigned LATC2 : 1;
  2821. unsigned LATC3 : 1;
  2822. unsigned LATC4 : 1;
  2823. unsigned LATC5 : 1;
  2824. unsigned LATC6 : 1;
  2825. unsigned LATC7 : 1;
  2826. } __LATCbits_t;
  2827. extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
  2828. #define _LATC0 0x01
  2829. #define _LATC1 0x02
  2830. #define _LATC2 0x04
  2831. #define _LATC3 0x08
  2832. #define _LATC4 0x10
  2833. #define _LATC5 0x20
  2834. #define _LATC6 0x40
  2835. #define _LATC7 0x80
  2836. //==============================================================================
  2837. //==============================================================================
  2838. // DDRA Bits
  2839. extern __at(0x0F92) __sfr DDRA;
  2840. typedef union
  2841. {
  2842. struct
  2843. {
  2844. unsigned TRISA0 : 1;
  2845. unsigned TRISA1 : 1;
  2846. unsigned TRISA2 : 1;
  2847. unsigned TRISA3 : 1;
  2848. unsigned TRISA4 : 1;
  2849. unsigned TRISA5 : 1;
  2850. unsigned TRISA6 : 1;
  2851. unsigned TRISA7 : 1;
  2852. };
  2853. struct
  2854. {
  2855. unsigned RA0 : 1;
  2856. unsigned RA1 : 1;
  2857. unsigned RA2 : 1;
  2858. unsigned RA3 : 1;
  2859. unsigned RA4 : 1;
  2860. unsigned RA5 : 1;
  2861. unsigned RA6 : 1;
  2862. unsigned RA7 : 1;
  2863. };
  2864. } __DDRAbits_t;
  2865. extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
  2866. #define _TRISA0 0x01
  2867. #define _RA0 0x01
  2868. #define _TRISA1 0x02
  2869. #define _RA1 0x02
  2870. #define _TRISA2 0x04
  2871. #define _RA2 0x04
  2872. #define _TRISA3 0x08
  2873. #define _RA3 0x08
  2874. #define _TRISA4 0x10
  2875. #define _RA4 0x10
  2876. #define _TRISA5 0x20
  2877. #define _RA5 0x20
  2878. #define _TRISA6 0x40
  2879. #define _RA6 0x40
  2880. #define _TRISA7 0x80
  2881. #define _RA7 0x80
  2882. //==============================================================================
  2883. //==============================================================================
  2884. // TRISA Bits
  2885. extern __at(0x0F92) __sfr TRISA;
  2886. typedef union
  2887. {
  2888. struct
  2889. {
  2890. unsigned TRISA0 : 1;
  2891. unsigned TRISA1 : 1;
  2892. unsigned TRISA2 : 1;
  2893. unsigned TRISA3 : 1;
  2894. unsigned TRISA4 : 1;
  2895. unsigned TRISA5 : 1;
  2896. unsigned TRISA6 : 1;
  2897. unsigned TRISA7 : 1;
  2898. };
  2899. struct
  2900. {
  2901. unsigned RA0 : 1;
  2902. unsigned RA1 : 1;
  2903. unsigned RA2 : 1;
  2904. unsigned RA3 : 1;
  2905. unsigned RA4 : 1;
  2906. unsigned RA5 : 1;
  2907. unsigned RA6 : 1;
  2908. unsigned RA7 : 1;
  2909. };
  2910. } __TRISAbits_t;
  2911. extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
  2912. #define _TRISA_TRISA0 0x01
  2913. #define _TRISA_RA0 0x01
  2914. #define _TRISA_TRISA1 0x02
  2915. #define _TRISA_RA1 0x02
  2916. #define _TRISA_TRISA2 0x04
  2917. #define _TRISA_RA2 0x04
  2918. #define _TRISA_TRISA3 0x08
  2919. #define _TRISA_RA3 0x08
  2920. #define _TRISA_TRISA4 0x10
  2921. #define _TRISA_RA4 0x10
  2922. #define _TRISA_TRISA5 0x20
  2923. #define _TRISA_RA5 0x20
  2924. #define _TRISA_TRISA6 0x40
  2925. #define _TRISA_RA6 0x40
  2926. #define _TRISA_TRISA7 0x80
  2927. #define _TRISA_RA7 0x80
  2928. //==============================================================================
  2929. //==============================================================================
  2930. // DDRB Bits
  2931. extern __at(0x0F93) __sfr DDRB;
  2932. typedef union
  2933. {
  2934. struct
  2935. {
  2936. unsigned TRISB0 : 1;
  2937. unsigned TRISB1 : 1;
  2938. unsigned TRISB2 : 1;
  2939. unsigned TRISB3 : 1;
  2940. unsigned TRISB4 : 1;
  2941. unsigned TRISB5 : 1;
  2942. unsigned TRISB6 : 1;
  2943. unsigned TRISB7 : 1;
  2944. };
  2945. struct
  2946. {
  2947. unsigned RB0 : 1;
  2948. unsigned RB1 : 1;
  2949. unsigned RB2 : 1;
  2950. unsigned RB3 : 1;
  2951. unsigned RB4 : 1;
  2952. unsigned RB5 : 1;
  2953. unsigned RB6 : 1;
  2954. unsigned RB7 : 1;
  2955. };
  2956. } __DDRBbits_t;
  2957. extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
  2958. #define _TRISB0 0x01
  2959. #define _RB0 0x01
  2960. #define _TRISB1 0x02
  2961. #define _RB1 0x02
  2962. #define _TRISB2 0x04
  2963. #define _RB2 0x04
  2964. #define _TRISB3 0x08
  2965. #define _RB3 0x08
  2966. #define _TRISB4 0x10
  2967. #define _RB4 0x10
  2968. #define _TRISB5 0x20
  2969. #define _RB5 0x20
  2970. #define _TRISB6 0x40
  2971. #define _RB6 0x40
  2972. #define _TRISB7 0x80
  2973. #define _RB7 0x80
  2974. //==============================================================================
  2975. //==============================================================================
  2976. // TRISB Bits
  2977. extern __at(0x0F93) __sfr TRISB;
  2978. typedef union
  2979. {
  2980. struct
  2981. {
  2982. unsigned TRISB0 : 1;
  2983. unsigned TRISB1 : 1;
  2984. unsigned TRISB2 : 1;
  2985. unsigned TRISB3 : 1;
  2986. unsigned TRISB4 : 1;
  2987. unsigned TRISB5 : 1;
  2988. unsigned TRISB6 : 1;
  2989. unsigned TRISB7 : 1;
  2990. };
  2991. struct
  2992. {
  2993. unsigned RB0 : 1;
  2994. unsigned RB1 : 1;
  2995. unsigned RB2 : 1;
  2996. unsigned RB3 : 1;
  2997. unsigned RB4 : 1;
  2998. unsigned RB5 : 1;
  2999. unsigned RB6 : 1;
  3000. unsigned RB7 : 1;
  3001. };
  3002. } __TRISBbits_t;
  3003. extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
  3004. #define _TRISB_TRISB0 0x01
  3005. #define _TRISB_RB0 0x01
  3006. #define _TRISB_TRISB1 0x02
  3007. #define _TRISB_RB1 0x02
  3008. #define _TRISB_TRISB2 0x04
  3009. #define _TRISB_RB2 0x04
  3010. #define _TRISB_TRISB3 0x08
  3011. #define _TRISB_RB3 0x08
  3012. #define _TRISB_TRISB4 0x10
  3013. #define _TRISB_RB4 0x10
  3014. #define _TRISB_TRISB5 0x20
  3015. #define _TRISB_RB5 0x20
  3016. #define _TRISB_TRISB6 0x40
  3017. #define _TRISB_RB6 0x40
  3018. #define _TRISB_TRISB7 0x80
  3019. #define _TRISB_RB7 0x80
  3020. //==============================================================================
  3021. //==============================================================================
  3022. // DDRC Bits
  3023. extern __at(0x0F94) __sfr DDRC;
  3024. typedef union
  3025. {
  3026. struct
  3027. {
  3028. unsigned TRISC0 : 1;
  3029. unsigned TRISC1 : 1;
  3030. unsigned TRISC2 : 1;
  3031. unsigned TRISC3 : 1;
  3032. unsigned TRISC4 : 1;
  3033. unsigned TRISC5 : 1;
  3034. unsigned TRISC6 : 1;
  3035. unsigned TRISC7 : 1;
  3036. };
  3037. struct
  3038. {
  3039. unsigned RC0 : 1;
  3040. unsigned RC1 : 1;
  3041. unsigned RC2 : 1;
  3042. unsigned RC3 : 1;
  3043. unsigned RC4 : 1;
  3044. unsigned RC5 : 1;
  3045. unsigned RC6 : 1;
  3046. unsigned RC7 : 1;
  3047. };
  3048. } __DDRCbits_t;
  3049. extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
  3050. #define _TRISC0 0x01
  3051. #define _RC0 0x01
  3052. #define _TRISC1 0x02
  3053. #define _RC1 0x02
  3054. #define _TRISC2 0x04
  3055. #define _RC2 0x04
  3056. #define _TRISC3 0x08
  3057. #define _RC3 0x08
  3058. #define _TRISC4 0x10
  3059. #define _RC4 0x10
  3060. #define _TRISC5 0x20
  3061. #define _RC5 0x20
  3062. #define _TRISC6 0x40
  3063. #define _RC6 0x40
  3064. #define _TRISC7 0x80
  3065. #define _RC7 0x80
  3066. //==============================================================================
  3067. //==============================================================================
  3068. // TRISC Bits
  3069. extern __at(0x0F94) __sfr TRISC;
  3070. typedef union
  3071. {
  3072. struct
  3073. {
  3074. unsigned TRISC0 : 1;
  3075. unsigned TRISC1 : 1;
  3076. unsigned TRISC2 : 1;
  3077. unsigned TRISC3 : 1;
  3078. unsigned TRISC4 : 1;
  3079. unsigned TRISC5 : 1;
  3080. unsigned TRISC6 : 1;
  3081. unsigned TRISC7 : 1;
  3082. };
  3083. struct
  3084. {
  3085. unsigned RC0 : 1;
  3086. unsigned RC1 : 1;
  3087. unsigned RC2 : 1;
  3088. unsigned RC3 : 1;
  3089. unsigned RC4 : 1;
  3090. unsigned RC5 : 1;
  3091. unsigned RC6 : 1;
  3092. unsigned RC7 : 1;
  3093. };
  3094. } __TRISCbits_t;
  3095. extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
  3096. #define _TRISC_TRISC0 0x01
  3097. #define _TRISC_RC0 0x01
  3098. #define _TRISC_TRISC1 0x02
  3099. #define _TRISC_RC1 0x02
  3100. #define _TRISC_TRISC2 0x04
  3101. #define _TRISC_RC2 0x04
  3102. #define _TRISC_TRISC3 0x08
  3103. #define _TRISC_RC3 0x08
  3104. #define _TRISC_TRISC4 0x10
  3105. #define _TRISC_RC4 0x10
  3106. #define _TRISC_TRISC5 0x20
  3107. #define _TRISC_RC5 0x20
  3108. #define _TRISC_TRISC6 0x40
  3109. #define _TRISC_RC6 0x40
  3110. #define _TRISC_TRISC7 0x80
  3111. #define _TRISC_RC7 0x80
  3112. //==============================================================================
  3113. //==============================================================================
  3114. // TRISE Bits
  3115. extern __at(0x0F96) __sfr TRISE;
  3116. typedef struct
  3117. {
  3118. unsigned : 1;
  3119. unsigned : 1;
  3120. unsigned : 1;
  3121. unsigned : 1;
  3122. unsigned : 1;
  3123. unsigned : 1;
  3124. unsigned : 1;
  3125. unsigned WPUE3 : 1;
  3126. } __TRISEbits_t;
  3127. extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
  3128. #define _WPUE3 0x80
  3129. //==============================================================================
  3130. //==============================================================================
  3131. // OSCTUNE Bits
  3132. extern __at(0x0F9B) __sfr OSCTUNE;
  3133. typedef union
  3134. {
  3135. struct
  3136. {
  3137. unsigned TUN0 : 1;
  3138. unsigned TUN1 : 1;
  3139. unsigned TUN2 : 1;
  3140. unsigned TUN3 : 1;
  3141. unsigned TUN4 : 1;
  3142. unsigned TUN5 : 1;
  3143. unsigned PLLEN : 1;
  3144. unsigned INTSRC : 1;
  3145. };
  3146. struct
  3147. {
  3148. unsigned TUN : 6;
  3149. unsigned : 2;
  3150. };
  3151. } __OSCTUNEbits_t;
  3152. extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
  3153. #define _TUN0 0x01
  3154. #define _TUN1 0x02
  3155. #define _TUN2 0x04
  3156. #define _TUN3 0x08
  3157. #define _TUN4 0x10
  3158. #define _TUN5 0x20
  3159. #define _PLLEN 0x40
  3160. #define _INTSRC 0x80
  3161. //==============================================================================
  3162. //==============================================================================
  3163. // HLVDCON Bits
  3164. extern __at(0x0F9C) __sfr HLVDCON;
  3165. typedef union
  3166. {
  3167. struct
  3168. {
  3169. unsigned HLVDL0 : 1;
  3170. unsigned HLVDL1 : 1;
  3171. unsigned HLVDL2 : 1;
  3172. unsigned HLVDL3 : 1;
  3173. unsigned HLVDEN : 1;
  3174. unsigned IRVST : 1;
  3175. unsigned BGVST : 1;
  3176. unsigned VDIRMAG : 1;
  3177. };
  3178. struct
  3179. {
  3180. unsigned LVDL0 : 1;
  3181. unsigned LVDL1 : 1;
  3182. unsigned LVDL2 : 1;
  3183. unsigned LVDL3 : 1;
  3184. unsigned LVDEN : 1;
  3185. unsigned IVRST : 1;
  3186. unsigned : 1;
  3187. unsigned : 1;
  3188. };
  3189. struct
  3190. {
  3191. unsigned LVV0 : 1;
  3192. unsigned LVV1 : 1;
  3193. unsigned LVV2 : 1;
  3194. unsigned LVV3 : 1;
  3195. unsigned : 1;
  3196. unsigned BGST : 1;
  3197. unsigned : 1;
  3198. unsigned : 1;
  3199. };
  3200. struct
  3201. {
  3202. unsigned LVV : 4;
  3203. unsigned : 4;
  3204. };
  3205. struct
  3206. {
  3207. unsigned HLVDL : 4;
  3208. unsigned : 4;
  3209. };
  3210. struct
  3211. {
  3212. unsigned LVDL : 4;
  3213. unsigned : 4;
  3214. };
  3215. } __HLVDCONbits_t;
  3216. extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
  3217. #define _HLVDL0 0x01
  3218. #define _LVDL0 0x01
  3219. #define _LVV0 0x01
  3220. #define _HLVDL1 0x02
  3221. #define _LVDL1 0x02
  3222. #define _LVV1 0x02
  3223. #define _HLVDL2 0x04
  3224. #define _LVDL2 0x04
  3225. #define _LVV2 0x04
  3226. #define _HLVDL3 0x08
  3227. #define _LVDL3 0x08
  3228. #define _LVV3 0x08
  3229. #define _HLVDEN 0x10
  3230. #define _LVDEN 0x10
  3231. #define _IRVST 0x20
  3232. #define _IVRST 0x20
  3233. #define _BGST 0x20
  3234. #define _BGVST 0x40
  3235. #define _VDIRMAG 0x80
  3236. //==============================================================================
  3237. //==============================================================================
  3238. // LVDCON Bits
  3239. extern __at(0x0F9C) __sfr LVDCON;
  3240. typedef union
  3241. {
  3242. struct
  3243. {
  3244. unsigned HLVDL0 : 1;
  3245. unsigned HLVDL1 : 1;
  3246. unsigned HLVDL2 : 1;
  3247. unsigned HLVDL3 : 1;
  3248. unsigned HLVDEN : 1;
  3249. unsigned IRVST : 1;
  3250. unsigned BGVST : 1;
  3251. unsigned VDIRMAG : 1;
  3252. };
  3253. struct
  3254. {
  3255. unsigned LVDL0 : 1;
  3256. unsigned LVDL1 : 1;
  3257. unsigned LVDL2 : 1;
  3258. unsigned LVDL3 : 1;
  3259. unsigned LVDEN : 1;
  3260. unsigned IVRST : 1;
  3261. unsigned : 1;
  3262. unsigned : 1;
  3263. };
  3264. struct
  3265. {
  3266. unsigned LVV0 : 1;
  3267. unsigned LVV1 : 1;
  3268. unsigned LVV2 : 1;
  3269. unsigned LVV3 : 1;
  3270. unsigned : 1;
  3271. unsigned BGST : 1;
  3272. unsigned : 1;
  3273. unsigned : 1;
  3274. };
  3275. struct
  3276. {
  3277. unsigned LVV : 4;
  3278. unsigned : 4;
  3279. };
  3280. struct
  3281. {
  3282. unsigned HLVDL : 4;
  3283. unsigned : 4;
  3284. };
  3285. struct
  3286. {
  3287. unsigned LVDL : 4;
  3288. unsigned : 4;
  3289. };
  3290. } __LVDCONbits_t;
  3291. extern __at(0x0F9C) volatile __LVDCONbits_t LVDCONbits;
  3292. #define _LVDCON_HLVDL0 0x01
  3293. #define _LVDCON_LVDL0 0x01
  3294. #define _LVDCON_LVV0 0x01
  3295. #define _LVDCON_HLVDL1 0x02
  3296. #define _LVDCON_LVDL1 0x02
  3297. #define _LVDCON_LVV1 0x02
  3298. #define _LVDCON_HLVDL2 0x04
  3299. #define _LVDCON_LVDL2 0x04
  3300. #define _LVDCON_LVV2 0x04
  3301. #define _LVDCON_HLVDL3 0x08
  3302. #define _LVDCON_LVDL3 0x08
  3303. #define _LVDCON_LVV3 0x08
  3304. #define _LVDCON_HLVDEN 0x10
  3305. #define _LVDCON_LVDEN 0x10
  3306. #define _LVDCON_IRVST 0x20
  3307. #define _LVDCON_IVRST 0x20
  3308. #define _LVDCON_BGST 0x20
  3309. #define _LVDCON_BGVST 0x40
  3310. #define _LVDCON_VDIRMAG 0x80
  3311. //==============================================================================
  3312. //==============================================================================
  3313. // PIE1 Bits
  3314. extern __at(0x0F9D) __sfr PIE1;
  3315. typedef union
  3316. {
  3317. struct
  3318. {
  3319. unsigned TMR1IE : 1;
  3320. unsigned TMR2IE : 1;
  3321. unsigned CCP1IE : 1;
  3322. unsigned SSP1IE : 1;
  3323. unsigned TX1IE : 1;
  3324. unsigned RC1IE : 1;
  3325. unsigned ADIE : 1;
  3326. unsigned : 1;
  3327. };
  3328. struct
  3329. {
  3330. unsigned : 1;
  3331. unsigned : 1;
  3332. unsigned : 1;
  3333. unsigned SSPIE : 1;
  3334. unsigned TXIE : 1;
  3335. unsigned RCIE : 1;
  3336. unsigned : 1;
  3337. unsigned : 1;
  3338. };
  3339. } __PIE1bits_t;
  3340. extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
  3341. #define _TMR1IE 0x01
  3342. #define _TMR2IE 0x02
  3343. #define _CCP1IE 0x04
  3344. #define _SSP1IE 0x08
  3345. #define _SSPIE 0x08
  3346. #define _TX1IE 0x10
  3347. #define _TXIE 0x10
  3348. #define _RC1IE 0x20
  3349. #define _RCIE 0x20
  3350. #define _ADIE 0x40
  3351. //==============================================================================
  3352. //==============================================================================
  3353. // PIR1 Bits
  3354. extern __at(0x0F9E) __sfr PIR1;
  3355. typedef union
  3356. {
  3357. struct
  3358. {
  3359. unsigned TMR1IF : 1;
  3360. unsigned TMR2IF : 1;
  3361. unsigned CCP1IF : 1;
  3362. unsigned SSP1IF : 1;
  3363. unsigned TX1IF : 1;
  3364. unsigned RC1IF : 1;
  3365. unsigned ADIF : 1;
  3366. unsigned : 1;
  3367. };
  3368. struct
  3369. {
  3370. unsigned : 1;
  3371. unsigned : 1;
  3372. unsigned : 1;
  3373. unsigned SSPIF : 1;
  3374. unsigned TXIF : 1;
  3375. unsigned RCIF : 1;
  3376. unsigned : 1;
  3377. unsigned : 1;
  3378. };
  3379. } __PIR1bits_t;
  3380. extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
  3381. #define _TMR1IF 0x01
  3382. #define _TMR2IF 0x02
  3383. #define _CCP1IF 0x04
  3384. #define _SSP1IF 0x08
  3385. #define _SSPIF 0x08
  3386. #define _TX1IF 0x10
  3387. #define _TXIF 0x10
  3388. #define _RC1IF 0x20
  3389. #define _RCIF 0x20
  3390. #define _ADIF 0x40
  3391. //==============================================================================
  3392. //==============================================================================
  3393. // IPR1 Bits
  3394. extern __at(0x0F9F) __sfr IPR1;
  3395. typedef union
  3396. {
  3397. struct
  3398. {
  3399. unsigned TMR1IP : 1;
  3400. unsigned TMR2IP : 1;
  3401. unsigned CCP1IP : 1;
  3402. unsigned SSP1IP : 1;
  3403. unsigned TX1IP : 1;
  3404. unsigned RC1IP : 1;
  3405. unsigned ADIP : 1;
  3406. unsigned : 1;
  3407. };
  3408. struct
  3409. {
  3410. unsigned : 1;
  3411. unsigned : 1;
  3412. unsigned : 1;
  3413. unsigned SSPIP : 1;
  3414. unsigned TXIP : 1;
  3415. unsigned RCIP : 1;
  3416. unsigned : 1;
  3417. unsigned : 1;
  3418. };
  3419. } __IPR1bits_t;
  3420. extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
  3421. #define _TMR1IP 0x01
  3422. #define _TMR2IP 0x02
  3423. #define _CCP1IP 0x04
  3424. #define _SSP1IP 0x08
  3425. #define _SSPIP 0x08
  3426. #define _TX1IP 0x10
  3427. #define _TXIP 0x10
  3428. #define _RC1IP 0x20
  3429. #define _RCIP 0x20
  3430. #define _ADIP 0x40
  3431. //==============================================================================
  3432. //==============================================================================
  3433. // PIE2 Bits
  3434. extern __at(0x0FA0) __sfr PIE2;
  3435. typedef union
  3436. {
  3437. struct
  3438. {
  3439. unsigned CCP2IE : 1;
  3440. unsigned TMR3IE : 1;
  3441. unsigned HLVDIE : 1;
  3442. unsigned BCL1IE : 1;
  3443. unsigned EEIE : 1;
  3444. unsigned C2IE : 1;
  3445. unsigned C1IE : 1;
  3446. unsigned OSCFIE : 1;
  3447. };
  3448. struct
  3449. {
  3450. unsigned : 1;
  3451. unsigned : 1;
  3452. unsigned LVDIE : 1;
  3453. unsigned BCLIE : 1;
  3454. unsigned : 1;
  3455. unsigned : 1;
  3456. unsigned : 1;
  3457. unsigned : 1;
  3458. };
  3459. } __PIE2bits_t;
  3460. extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
  3461. #define _CCP2IE 0x01
  3462. #define _TMR3IE 0x02
  3463. #define _HLVDIE 0x04
  3464. #define _LVDIE 0x04
  3465. #define _BCL1IE 0x08
  3466. #define _BCLIE 0x08
  3467. #define _EEIE 0x10
  3468. #define _C2IE 0x20
  3469. #define _C1IE 0x40
  3470. #define _OSCFIE 0x80
  3471. //==============================================================================
  3472. //==============================================================================
  3473. // PIR2 Bits
  3474. extern __at(0x0FA1) __sfr PIR2;
  3475. typedef union
  3476. {
  3477. struct
  3478. {
  3479. unsigned CCP2IF : 1;
  3480. unsigned TMR3IF : 1;
  3481. unsigned HLVDIF : 1;
  3482. unsigned BCL1IF : 1;
  3483. unsigned EEIF : 1;
  3484. unsigned C2IF : 1;
  3485. unsigned C1IF : 1;
  3486. unsigned OSCFIF : 1;
  3487. };
  3488. struct
  3489. {
  3490. unsigned : 1;
  3491. unsigned : 1;
  3492. unsigned LVDIF : 1;
  3493. unsigned BCLIF : 1;
  3494. unsigned : 1;
  3495. unsigned : 1;
  3496. unsigned : 1;
  3497. unsigned : 1;
  3498. };
  3499. } __PIR2bits_t;
  3500. extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
  3501. #define _CCP2IF 0x01
  3502. #define _TMR3IF 0x02
  3503. #define _HLVDIF 0x04
  3504. #define _LVDIF 0x04
  3505. #define _BCL1IF 0x08
  3506. #define _BCLIF 0x08
  3507. #define _EEIF 0x10
  3508. #define _C2IF 0x20
  3509. #define _C1IF 0x40
  3510. #define _OSCFIF 0x80
  3511. //==============================================================================
  3512. //==============================================================================
  3513. // IPR2 Bits
  3514. extern __at(0x0FA2) __sfr IPR2;
  3515. typedef union
  3516. {
  3517. struct
  3518. {
  3519. unsigned CCP2IP : 1;
  3520. unsigned TMR3IP : 1;
  3521. unsigned HLVDIP : 1;
  3522. unsigned BCL1IP : 1;
  3523. unsigned EEIP : 1;
  3524. unsigned C2IP : 1;
  3525. unsigned C1IP : 1;
  3526. unsigned OSCFIP : 1;
  3527. };
  3528. struct
  3529. {
  3530. unsigned : 1;
  3531. unsigned : 1;
  3532. unsigned LVDIP : 1;
  3533. unsigned BCLIP : 1;
  3534. unsigned : 1;
  3535. unsigned : 1;
  3536. unsigned : 1;
  3537. unsigned : 1;
  3538. };
  3539. } __IPR2bits_t;
  3540. extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
  3541. #define _CCP2IP 0x01
  3542. #define _TMR3IP 0x02
  3543. #define _HLVDIP 0x04
  3544. #define _LVDIP 0x04
  3545. #define _BCL1IP 0x08
  3546. #define _BCLIP 0x08
  3547. #define _EEIP 0x10
  3548. #define _C2IP 0x20
  3549. #define _C1IP 0x40
  3550. #define _OSCFIP 0x80
  3551. //==============================================================================
  3552. //==============================================================================
  3553. // PIE3 Bits
  3554. extern __at(0x0FA3) __sfr PIE3;
  3555. typedef struct
  3556. {
  3557. unsigned TMR1GIE : 1;
  3558. unsigned TMR3GIE : 1;
  3559. unsigned TMR5GIE : 1;
  3560. unsigned CTMUIE : 1;
  3561. unsigned TX2IE : 1;
  3562. unsigned RC2IE : 1;
  3563. unsigned BCL2IE : 1;
  3564. unsigned SSP2IE : 1;
  3565. } __PIE3bits_t;
  3566. extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
  3567. #define _TMR1GIE 0x01
  3568. #define _TMR3GIE 0x02
  3569. #define _TMR5GIE 0x04
  3570. #define _CTMUIE 0x08
  3571. #define _TX2IE 0x10
  3572. #define _RC2IE 0x20
  3573. #define _BCL2IE 0x40
  3574. #define _SSP2IE 0x80
  3575. //==============================================================================
  3576. //==============================================================================
  3577. // PIR3 Bits
  3578. extern __at(0x0FA4) __sfr PIR3;
  3579. typedef struct
  3580. {
  3581. unsigned TMR1GIF : 1;
  3582. unsigned TMR3GIF : 1;
  3583. unsigned TMR5GIF : 1;
  3584. unsigned CTMUIF : 1;
  3585. unsigned TX2IF : 1;
  3586. unsigned RC2IF : 1;
  3587. unsigned BCL2IF : 1;
  3588. unsigned SSP2IF : 1;
  3589. } __PIR3bits_t;
  3590. extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
  3591. #define _TMR1GIF 0x01
  3592. #define _TMR3GIF 0x02
  3593. #define _TMR5GIF 0x04
  3594. #define _CTMUIF 0x08
  3595. #define _TX2IF 0x10
  3596. #define _RC2IF 0x20
  3597. #define _BCL2IF 0x40
  3598. #define _SSP2IF 0x80
  3599. //==============================================================================
  3600. //==============================================================================
  3601. // IPR3 Bits
  3602. extern __at(0x0FA5) __sfr IPR3;
  3603. typedef struct
  3604. {
  3605. unsigned TMR1GIP : 1;
  3606. unsigned TMR3GIP : 1;
  3607. unsigned TMR5GIP : 1;
  3608. unsigned CTMUIP : 1;
  3609. unsigned TX2IP : 1;
  3610. unsigned RC2IP : 1;
  3611. unsigned BCL2IP : 1;
  3612. unsigned SSP2IP : 1;
  3613. } __IPR3bits_t;
  3614. extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
  3615. #define _TMR1GIP 0x01
  3616. #define _TMR3GIP 0x02
  3617. #define _TMR5GIP 0x04
  3618. #define _CTMUIP 0x08
  3619. #define _TX2IP 0x10
  3620. #define _RC2IP 0x20
  3621. #define _BCL2IP 0x40
  3622. #define _SSP2IP 0x80
  3623. //==============================================================================
  3624. //==============================================================================
  3625. // EECON1 Bits
  3626. extern __at(0x0FA6) __sfr EECON1;
  3627. typedef struct
  3628. {
  3629. unsigned RD : 1;
  3630. unsigned WR : 1;
  3631. unsigned WREN : 1;
  3632. unsigned WRERR : 1;
  3633. unsigned FREE : 1;
  3634. unsigned : 1;
  3635. unsigned CFGS : 1;
  3636. unsigned EEPGD : 1;
  3637. } __EECON1bits_t;
  3638. extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
  3639. #define _RD 0x01
  3640. #define _WR 0x02
  3641. #define _WREN 0x04
  3642. #define _WRERR 0x08
  3643. #define _FREE 0x10
  3644. #define _CFGS 0x40
  3645. #define _EEPGD 0x80
  3646. //==============================================================================
  3647. extern __at(0x0FA7) __sfr EECON2;
  3648. extern __at(0x0FA8) __sfr EEDATA;
  3649. //==============================================================================
  3650. // EEADR Bits
  3651. extern __at(0x0FA9) __sfr EEADR;
  3652. typedef struct
  3653. {
  3654. unsigned EEADR0 : 1;
  3655. unsigned EEADR1 : 1;
  3656. unsigned EEADR2 : 1;
  3657. unsigned EEADR3 : 1;
  3658. unsigned EEADR4 : 1;
  3659. unsigned EEADR5 : 1;
  3660. unsigned EEADR6 : 1;
  3661. unsigned EEADR7 : 1;
  3662. } __EEADRbits_t;
  3663. extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
  3664. #define _EEADR0 0x01
  3665. #define _EEADR1 0x02
  3666. #define _EEADR2 0x04
  3667. #define _EEADR3 0x08
  3668. #define _EEADR4 0x10
  3669. #define _EEADR5 0x20
  3670. #define _EEADR6 0x40
  3671. #define _EEADR7 0x80
  3672. //==============================================================================
  3673. //==============================================================================
  3674. // EEADRH Bits
  3675. extern __at(0x0FAA) __sfr EEADRH;
  3676. typedef struct
  3677. {
  3678. unsigned EEADR8 : 1;
  3679. unsigned EEADR9 : 1;
  3680. unsigned : 1;
  3681. unsigned : 1;
  3682. unsigned : 1;
  3683. unsigned : 1;
  3684. unsigned : 1;
  3685. unsigned : 1;
  3686. } __EEADRHbits_t;
  3687. extern __at(0x0FAA) volatile __EEADRHbits_t EEADRHbits;
  3688. #define _EEADR8 0x01
  3689. #define _EEADR9 0x02
  3690. //==============================================================================
  3691. //==============================================================================
  3692. // RC1STA Bits
  3693. extern __at(0x0FAB) __sfr RC1STA;
  3694. typedef union
  3695. {
  3696. struct
  3697. {
  3698. unsigned RX9D : 1;
  3699. unsigned OERR : 1;
  3700. unsigned FERR : 1;
  3701. unsigned ADDEN : 1;
  3702. unsigned CREN : 1;
  3703. unsigned SREN : 1;
  3704. unsigned RX9 : 1;
  3705. unsigned SPEN : 1;
  3706. };
  3707. struct
  3708. {
  3709. unsigned RX9D1 : 1;
  3710. unsigned OERR1 : 1;
  3711. unsigned FERR1 : 1;
  3712. unsigned ADEN : 1;
  3713. unsigned CREN1 : 1;
  3714. unsigned SREN1 : 1;
  3715. unsigned RX91 : 1;
  3716. unsigned SPEN1 : 1;
  3717. };
  3718. struct
  3719. {
  3720. unsigned : 1;
  3721. unsigned : 1;
  3722. unsigned : 1;
  3723. unsigned ADDEN1 : 1;
  3724. unsigned : 1;
  3725. unsigned : 1;
  3726. unsigned : 1;
  3727. unsigned : 1;
  3728. };
  3729. } __RC1STAbits_t;
  3730. extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
  3731. #define _RX9D 0x01
  3732. #define _RX9D1 0x01
  3733. #define _OERR 0x02
  3734. #define _OERR1 0x02
  3735. #define _FERR 0x04
  3736. #define _FERR1 0x04
  3737. #define _ADDEN 0x08
  3738. #define _ADEN 0x08
  3739. #define _ADDEN1 0x08
  3740. #define _CREN 0x10
  3741. #define _CREN1 0x10
  3742. #define _SREN 0x20
  3743. #define _SREN1 0x20
  3744. #define _RX9 0x40
  3745. #define _RX91 0x40
  3746. #define _SPEN 0x80
  3747. #define _SPEN1 0x80
  3748. //==============================================================================
  3749. //==============================================================================
  3750. // RCSTA Bits
  3751. extern __at(0x0FAB) __sfr RCSTA;
  3752. typedef union
  3753. {
  3754. struct
  3755. {
  3756. unsigned RX9D : 1;
  3757. unsigned OERR : 1;
  3758. unsigned FERR : 1;
  3759. unsigned ADDEN : 1;
  3760. unsigned CREN : 1;
  3761. unsigned SREN : 1;
  3762. unsigned RX9 : 1;
  3763. unsigned SPEN : 1;
  3764. };
  3765. struct
  3766. {
  3767. unsigned RX9D1 : 1;
  3768. unsigned OERR1 : 1;
  3769. unsigned FERR1 : 1;
  3770. unsigned ADEN : 1;
  3771. unsigned CREN1 : 1;
  3772. unsigned SREN1 : 1;
  3773. unsigned RX91 : 1;
  3774. unsigned SPEN1 : 1;
  3775. };
  3776. struct
  3777. {
  3778. unsigned : 1;
  3779. unsigned : 1;
  3780. unsigned : 1;
  3781. unsigned ADDEN1 : 1;
  3782. unsigned : 1;
  3783. unsigned : 1;
  3784. unsigned : 1;
  3785. unsigned : 1;
  3786. };
  3787. } __RCSTAbits_t;
  3788. extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
  3789. #define _RCSTA_RX9D 0x01
  3790. #define _RCSTA_RX9D1 0x01
  3791. #define _RCSTA_OERR 0x02
  3792. #define _RCSTA_OERR1 0x02
  3793. #define _RCSTA_FERR 0x04
  3794. #define _RCSTA_FERR1 0x04
  3795. #define _RCSTA_ADDEN 0x08
  3796. #define _RCSTA_ADEN 0x08
  3797. #define _RCSTA_ADDEN1 0x08
  3798. #define _RCSTA_CREN 0x10
  3799. #define _RCSTA_CREN1 0x10
  3800. #define _RCSTA_SREN 0x20
  3801. #define _RCSTA_SREN1 0x20
  3802. #define _RCSTA_RX9 0x40
  3803. #define _RCSTA_RX91 0x40
  3804. #define _RCSTA_SPEN 0x80
  3805. #define _RCSTA_SPEN1 0x80
  3806. //==============================================================================
  3807. //==============================================================================
  3808. // RCSTA1 Bits
  3809. extern __at(0x0FAB) __sfr RCSTA1;
  3810. typedef union
  3811. {
  3812. struct
  3813. {
  3814. unsigned RX9D : 1;
  3815. unsigned OERR : 1;
  3816. unsigned FERR : 1;
  3817. unsigned ADDEN : 1;
  3818. unsigned CREN : 1;
  3819. unsigned SREN : 1;
  3820. unsigned RX9 : 1;
  3821. unsigned SPEN : 1;
  3822. };
  3823. struct
  3824. {
  3825. unsigned RX9D1 : 1;
  3826. unsigned OERR1 : 1;
  3827. unsigned FERR1 : 1;
  3828. unsigned ADEN : 1;
  3829. unsigned CREN1 : 1;
  3830. unsigned SREN1 : 1;
  3831. unsigned RX91 : 1;
  3832. unsigned SPEN1 : 1;
  3833. };
  3834. struct
  3835. {
  3836. unsigned : 1;
  3837. unsigned : 1;
  3838. unsigned : 1;
  3839. unsigned ADDEN1 : 1;
  3840. unsigned : 1;
  3841. unsigned : 1;
  3842. unsigned : 1;
  3843. unsigned : 1;
  3844. };
  3845. } __RCSTA1bits_t;
  3846. extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
  3847. #define _RCSTA1_RX9D 0x01
  3848. #define _RCSTA1_RX9D1 0x01
  3849. #define _RCSTA1_OERR 0x02
  3850. #define _RCSTA1_OERR1 0x02
  3851. #define _RCSTA1_FERR 0x04
  3852. #define _RCSTA1_FERR1 0x04
  3853. #define _RCSTA1_ADDEN 0x08
  3854. #define _RCSTA1_ADEN 0x08
  3855. #define _RCSTA1_ADDEN1 0x08
  3856. #define _RCSTA1_CREN 0x10
  3857. #define _RCSTA1_CREN1 0x10
  3858. #define _RCSTA1_SREN 0x20
  3859. #define _RCSTA1_SREN1 0x20
  3860. #define _RCSTA1_RX9 0x40
  3861. #define _RCSTA1_RX91 0x40
  3862. #define _RCSTA1_SPEN 0x80
  3863. #define _RCSTA1_SPEN1 0x80
  3864. //==============================================================================
  3865. //==============================================================================
  3866. // TX1STA Bits
  3867. extern __at(0x0FAC) __sfr TX1STA;
  3868. typedef union
  3869. {
  3870. struct
  3871. {
  3872. unsigned TX9D : 1;
  3873. unsigned TRMT : 1;
  3874. unsigned BRGH : 1;
  3875. unsigned SENDB : 1;
  3876. unsigned SYNC : 1;
  3877. unsigned TXEN : 1;
  3878. unsigned TX9 : 1;
  3879. unsigned CSRC : 1;
  3880. };
  3881. struct
  3882. {
  3883. unsigned TX9D1 : 1;
  3884. unsigned TRMT1 : 1;
  3885. unsigned BRGH1 : 1;
  3886. unsigned SENDB1 : 1;
  3887. unsigned SYNC1 : 1;
  3888. unsigned TXEN1 : 1;
  3889. unsigned TX91 : 1;
  3890. unsigned CSRC1 : 1;
  3891. };
  3892. } __TX1STAbits_t;
  3893. extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
  3894. #define _TX9D 0x01
  3895. #define _TX9D1 0x01
  3896. #define _TRMT 0x02
  3897. #define _TRMT1 0x02
  3898. #define _BRGH 0x04
  3899. #define _BRGH1 0x04
  3900. #define _SENDB 0x08
  3901. #define _SENDB1 0x08
  3902. #define _SYNC 0x10
  3903. #define _SYNC1 0x10
  3904. #define _TXEN 0x20
  3905. #define _TXEN1 0x20
  3906. #define _TX9 0x40
  3907. #define _TX91 0x40
  3908. #define _CSRC 0x80
  3909. #define _CSRC1 0x80
  3910. //==============================================================================
  3911. //==============================================================================
  3912. // TXSTA Bits
  3913. extern __at(0x0FAC) __sfr TXSTA;
  3914. typedef union
  3915. {
  3916. struct
  3917. {
  3918. unsigned TX9D : 1;
  3919. unsigned TRMT : 1;
  3920. unsigned BRGH : 1;
  3921. unsigned SENDB : 1;
  3922. unsigned SYNC : 1;
  3923. unsigned TXEN : 1;
  3924. unsigned TX9 : 1;
  3925. unsigned CSRC : 1;
  3926. };
  3927. struct
  3928. {
  3929. unsigned TX9D1 : 1;
  3930. unsigned TRMT1 : 1;
  3931. unsigned BRGH1 : 1;
  3932. unsigned SENDB1 : 1;
  3933. unsigned SYNC1 : 1;
  3934. unsigned TXEN1 : 1;
  3935. unsigned TX91 : 1;
  3936. unsigned CSRC1 : 1;
  3937. };
  3938. } __TXSTAbits_t;
  3939. extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
  3940. #define _TXSTA_TX9D 0x01
  3941. #define _TXSTA_TX9D1 0x01
  3942. #define _TXSTA_TRMT 0x02
  3943. #define _TXSTA_TRMT1 0x02
  3944. #define _TXSTA_BRGH 0x04
  3945. #define _TXSTA_BRGH1 0x04
  3946. #define _TXSTA_SENDB 0x08
  3947. #define _TXSTA_SENDB1 0x08
  3948. #define _TXSTA_SYNC 0x10
  3949. #define _TXSTA_SYNC1 0x10
  3950. #define _TXSTA_TXEN 0x20
  3951. #define _TXSTA_TXEN1 0x20
  3952. #define _TXSTA_TX9 0x40
  3953. #define _TXSTA_TX91 0x40
  3954. #define _TXSTA_CSRC 0x80
  3955. #define _TXSTA_CSRC1 0x80
  3956. //==============================================================================
  3957. //==============================================================================
  3958. // TXSTA1 Bits
  3959. extern __at(0x0FAC) __sfr TXSTA1;
  3960. typedef union
  3961. {
  3962. struct
  3963. {
  3964. unsigned TX9D : 1;
  3965. unsigned TRMT : 1;
  3966. unsigned BRGH : 1;
  3967. unsigned SENDB : 1;
  3968. unsigned SYNC : 1;
  3969. unsigned TXEN : 1;
  3970. unsigned TX9 : 1;
  3971. unsigned CSRC : 1;
  3972. };
  3973. struct
  3974. {
  3975. unsigned TX9D1 : 1;
  3976. unsigned TRMT1 : 1;
  3977. unsigned BRGH1 : 1;
  3978. unsigned SENDB1 : 1;
  3979. unsigned SYNC1 : 1;
  3980. unsigned TXEN1 : 1;
  3981. unsigned TX91 : 1;
  3982. unsigned CSRC1 : 1;
  3983. };
  3984. } __TXSTA1bits_t;
  3985. extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
  3986. #define _TXSTA1_TX9D 0x01
  3987. #define _TXSTA1_TX9D1 0x01
  3988. #define _TXSTA1_TRMT 0x02
  3989. #define _TXSTA1_TRMT1 0x02
  3990. #define _TXSTA1_BRGH 0x04
  3991. #define _TXSTA1_BRGH1 0x04
  3992. #define _TXSTA1_SENDB 0x08
  3993. #define _TXSTA1_SENDB1 0x08
  3994. #define _TXSTA1_SYNC 0x10
  3995. #define _TXSTA1_SYNC1 0x10
  3996. #define _TXSTA1_TXEN 0x20
  3997. #define _TXSTA1_TXEN1 0x20
  3998. #define _TXSTA1_TX9 0x40
  3999. #define _TXSTA1_TX91 0x40
  4000. #define _TXSTA1_CSRC 0x80
  4001. #define _TXSTA1_CSRC1 0x80
  4002. //==============================================================================
  4003. extern __at(0x0FAD) __sfr TX1REG;
  4004. extern __at(0x0FAD) __sfr TXREG;
  4005. extern __at(0x0FAD) __sfr TXREG1;
  4006. extern __at(0x0FAE) __sfr RC1REG;
  4007. extern __at(0x0FAE) __sfr RCREG;
  4008. extern __at(0x0FAE) __sfr RCREG1;
  4009. extern __at(0x0FAF) __sfr SP1BRG;
  4010. extern __at(0x0FAF) __sfr SPBRG;
  4011. extern __at(0x0FAF) __sfr SPBRG1;
  4012. extern __at(0x0FB0) __sfr SP1BRGH;
  4013. extern __at(0x0FB0) __sfr SPBRGH;
  4014. extern __at(0x0FB0) __sfr SPBRGH1;
  4015. //==============================================================================
  4016. // T3CON Bits
  4017. extern __at(0x0FB1) __sfr T3CON;
  4018. typedef union
  4019. {
  4020. struct
  4021. {
  4022. unsigned TMR3ON : 1;
  4023. unsigned T3RD16 : 1;
  4024. unsigned NOT_T3SYNC : 1;
  4025. unsigned T3SOSCEN : 1;
  4026. unsigned T3CKPS0 : 1;
  4027. unsigned T3CKPS1 : 1;
  4028. unsigned TMR3CS0 : 1;
  4029. unsigned TMR3CS1 : 1;
  4030. };
  4031. struct
  4032. {
  4033. unsigned : 1;
  4034. unsigned : 1;
  4035. unsigned : 1;
  4036. unsigned T3OSCEN : 1;
  4037. unsigned : 1;
  4038. unsigned : 1;
  4039. unsigned : 1;
  4040. unsigned : 1;
  4041. };
  4042. struct
  4043. {
  4044. unsigned : 4;
  4045. unsigned T3CKPS : 2;
  4046. unsigned : 2;
  4047. };
  4048. struct
  4049. {
  4050. unsigned : 6;
  4051. unsigned TMR3CS : 2;
  4052. };
  4053. } __T3CONbits_t;
  4054. extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
  4055. #define _TMR3ON 0x01
  4056. #define _T3RD16 0x02
  4057. #define _NOT_T3SYNC 0x04
  4058. #define _T3SOSCEN 0x08
  4059. #define _T3OSCEN 0x08
  4060. #define _T3CKPS0 0x10
  4061. #define _T3CKPS1 0x20
  4062. #define _TMR3CS0 0x40
  4063. #define _TMR3CS1 0x80
  4064. //==============================================================================
  4065. extern __at(0x0FB2) __sfr TMR3;
  4066. extern __at(0x0FB2) __sfr TMR3L;
  4067. extern __at(0x0FB3) __sfr TMR3H;
  4068. //==============================================================================
  4069. // T3GCON Bits
  4070. extern __at(0x0FB4) __sfr T3GCON;
  4071. typedef union
  4072. {
  4073. struct
  4074. {
  4075. unsigned T3GSS0 : 1;
  4076. unsigned T3GSS1 : 1;
  4077. unsigned T3GVAL : 1;
  4078. unsigned T3GGO_NOT_DONE : 1;
  4079. unsigned T3GSPM : 1;
  4080. unsigned T3GTM : 1;
  4081. unsigned T3GPOL : 1;
  4082. unsigned TMR3GE : 1;
  4083. };
  4084. struct
  4085. {
  4086. unsigned : 1;
  4087. unsigned : 1;
  4088. unsigned : 1;
  4089. unsigned T3G_DONE : 1;
  4090. unsigned : 1;
  4091. unsigned : 1;
  4092. unsigned : 1;
  4093. unsigned : 1;
  4094. };
  4095. struct
  4096. {
  4097. unsigned : 1;
  4098. unsigned : 1;
  4099. unsigned : 1;
  4100. unsigned T3GGO : 1;
  4101. unsigned : 1;
  4102. unsigned : 1;
  4103. unsigned : 1;
  4104. unsigned : 1;
  4105. };
  4106. struct
  4107. {
  4108. unsigned T3GSS : 2;
  4109. unsigned : 6;
  4110. };
  4111. } __T3GCONbits_t;
  4112. extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
  4113. #define _T3GSS0 0x01
  4114. #define _T3GSS1 0x02
  4115. #define _T3GVAL 0x04
  4116. #define _T3GGO_NOT_DONE 0x08
  4117. #define _T3G_DONE 0x08
  4118. #define _T3GGO 0x08
  4119. #define _T3GSPM 0x10
  4120. #define _T3GTM 0x20
  4121. #define _T3GPOL 0x40
  4122. #define _TMR3GE 0x80
  4123. //==============================================================================
  4124. //==============================================================================
  4125. // ECCP1AS Bits
  4126. extern __at(0x0FB6) __sfr ECCP1AS;
  4127. typedef union
  4128. {
  4129. struct
  4130. {
  4131. unsigned P1SSBD0 : 1;
  4132. unsigned P1SSBD1 : 1;
  4133. unsigned P1SSAC0 : 1;
  4134. unsigned P1SSAC1 : 1;
  4135. unsigned CCP1AS0 : 1;
  4136. unsigned CCP1AS1 : 1;
  4137. unsigned CCP1AS2 : 1;
  4138. unsigned CCP1ASE : 1;
  4139. };
  4140. struct
  4141. {
  4142. unsigned PSS1BD0 : 1;
  4143. unsigned PSS1BD1 : 1;
  4144. unsigned PSS1AC0 : 1;
  4145. unsigned PSS1AC1 : 1;
  4146. unsigned ECCPAS0 : 1;
  4147. unsigned ECCPAS1 : 1;
  4148. unsigned ECCPAS2 : 1;
  4149. unsigned ECCPASE : 1;
  4150. };
  4151. struct
  4152. {
  4153. unsigned PSSBD0 : 1;
  4154. unsigned PSSBD1 : 1;
  4155. unsigned PSSAC0 : 1;
  4156. unsigned PSSAC1 : 1;
  4157. unsigned : 1;
  4158. unsigned : 1;
  4159. unsigned : 1;
  4160. unsigned : 1;
  4161. };
  4162. struct
  4163. {
  4164. unsigned PSSBD : 2;
  4165. unsigned : 6;
  4166. };
  4167. struct
  4168. {
  4169. unsigned P1SSBD : 2;
  4170. unsigned : 6;
  4171. };
  4172. struct
  4173. {
  4174. unsigned PSS1BD : 2;
  4175. unsigned : 6;
  4176. };
  4177. struct
  4178. {
  4179. unsigned : 2;
  4180. unsigned PSS1AC : 2;
  4181. unsigned : 4;
  4182. };
  4183. struct
  4184. {
  4185. unsigned : 2;
  4186. unsigned P1SSAC : 2;
  4187. unsigned : 4;
  4188. };
  4189. struct
  4190. {
  4191. unsigned : 2;
  4192. unsigned PSSAC : 2;
  4193. unsigned : 4;
  4194. };
  4195. struct
  4196. {
  4197. unsigned : 4;
  4198. unsigned CCP1AS : 3;
  4199. unsigned : 1;
  4200. };
  4201. struct
  4202. {
  4203. unsigned : 4;
  4204. unsigned ECCPAS : 3;
  4205. unsigned : 1;
  4206. };
  4207. } __ECCP1ASbits_t;
  4208. extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
  4209. #define _P1SSBD0 0x01
  4210. #define _PSS1BD0 0x01
  4211. #define _PSSBD0 0x01
  4212. #define _P1SSBD1 0x02
  4213. #define _PSS1BD1 0x02
  4214. #define _PSSBD1 0x02
  4215. #define _P1SSAC0 0x04
  4216. #define _PSS1AC0 0x04
  4217. #define _PSSAC0 0x04
  4218. #define _P1SSAC1 0x08
  4219. #define _PSS1AC1 0x08
  4220. #define _PSSAC1 0x08
  4221. #define _CCP1AS0 0x10
  4222. #define _ECCPAS0 0x10
  4223. #define _CCP1AS1 0x20
  4224. #define _ECCPAS1 0x20
  4225. #define _CCP1AS2 0x40
  4226. #define _ECCPAS2 0x40
  4227. #define _CCP1ASE 0x80
  4228. #define _ECCPASE 0x80
  4229. //==============================================================================
  4230. //==============================================================================
  4231. // ECCPAS Bits
  4232. extern __at(0x0FB6) __sfr ECCPAS;
  4233. typedef union
  4234. {
  4235. struct
  4236. {
  4237. unsigned P1SSBD0 : 1;
  4238. unsigned P1SSBD1 : 1;
  4239. unsigned P1SSAC0 : 1;
  4240. unsigned P1SSAC1 : 1;
  4241. unsigned CCP1AS0 : 1;
  4242. unsigned CCP1AS1 : 1;
  4243. unsigned CCP1AS2 : 1;
  4244. unsigned CCP1ASE : 1;
  4245. };
  4246. struct
  4247. {
  4248. unsigned PSS1BD0 : 1;
  4249. unsigned PSS1BD1 : 1;
  4250. unsigned PSS1AC0 : 1;
  4251. unsigned PSS1AC1 : 1;
  4252. unsigned ECCPAS0 : 1;
  4253. unsigned ECCPAS1 : 1;
  4254. unsigned ECCPAS2 : 1;
  4255. unsigned ECCPASE : 1;
  4256. };
  4257. struct
  4258. {
  4259. unsigned PSSBD0 : 1;
  4260. unsigned PSSBD1 : 1;
  4261. unsigned PSSAC0 : 1;
  4262. unsigned PSSAC1 : 1;
  4263. unsigned : 1;
  4264. unsigned : 1;
  4265. unsigned : 1;
  4266. unsigned : 1;
  4267. };
  4268. struct
  4269. {
  4270. unsigned PSSBD : 2;
  4271. unsigned : 6;
  4272. };
  4273. struct
  4274. {
  4275. unsigned P1SSBD : 2;
  4276. unsigned : 6;
  4277. };
  4278. struct
  4279. {
  4280. unsigned PSS1BD : 2;
  4281. unsigned : 6;
  4282. };
  4283. struct
  4284. {
  4285. unsigned : 2;
  4286. unsigned PSS1AC : 2;
  4287. unsigned : 4;
  4288. };
  4289. struct
  4290. {
  4291. unsigned : 2;
  4292. unsigned P1SSAC : 2;
  4293. unsigned : 4;
  4294. };
  4295. struct
  4296. {
  4297. unsigned : 2;
  4298. unsigned PSSAC : 2;
  4299. unsigned : 4;
  4300. };
  4301. struct
  4302. {
  4303. unsigned : 4;
  4304. unsigned CCP1AS : 3;
  4305. unsigned : 1;
  4306. };
  4307. struct
  4308. {
  4309. unsigned : 4;
  4310. unsigned ECCPAS : 3;
  4311. unsigned : 1;
  4312. };
  4313. } __ECCPASbits_t;
  4314. extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
  4315. #define _ECCPAS_P1SSBD0 0x01
  4316. #define _ECCPAS_PSS1BD0 0x01
  4317. #define _ECCPAS_PSSBD0 0x01
  4318. #define _ECCPAS_P1SSBD1 0x02
  4319. #define _ECCPAS_PSS1BD1 0x02
  4320. #define _ECCPAS_PSSBD1 0x02
  4321. #define _ECCPAS_P1SSAC0 0x04
  4322. #define _ECCPAS_PSS1AC0 0x04
  4323. #define _ECCPAS_PSSAC0 0x04
  4324. #define _ECCPAS_P1SSAC1 0x08
  4325. #define _ECCPAS_PSS1AC1 0x08
  4326. #define _ECCPAS_PSSAC1 0x08
  4327. #define _ECCPAS_CCP1AS0 0x10
  4328. #define _ECCPAS_ECCPAS0 0x10
  4329. #define _ECCPAS_CCP1AS1 0x20
  4330. #define _ECCPAS_ECCPAS1 0x20
  4331. #define _ECCPAS_CCP1AS2 0x40
  4332. #define _ECCPAS_ECCPAS2 0x40
  4333. #define _ECCPAS_CCP1ASE 0x80
  4334. #define _ECCPAS_ECCPASE 0x80
  4335. //==============================================================================
  4336. //==============================================================================
  4337. // PWM1CON Bits
  4338. extern __at(0x0FB7) __sfr PWM1CON;
  4339. typedef union
  4340. {
  4341. struct
  4342. {
  4343. unsigned P1DC0 : 1;
  4344. unsigned P1DC1 : 1;
  4345. unsigned P1DC2 : 1;
  4346. unsigned P1DC3 : 1;
  4347. unsigned P1DC4 : 1;
  4348. unsigned P1DC5 : 1;
  4349. unsigned P1DC6 : 1;
  4350. unsigned P1RSEN : 1;
  4351. };
  4352. struct
  4353. {
  4354. unsigned PDC0 : 1;
  4355. unsigned PDC1 : 1;
  4356. unsigned PDC2 : 1;
  4357. unsigned PDC3 : 1;
  4358. unsigned PDC4 : 1;
  4359. unsigned PDC5 : 1;
  4360. unsigned PDC6 : 1;
  4361. unsigned PRSEN : 1;
  4362. };
  4363. struct
  4364. {
  4365. unsigned P1DC : 7;
  4366. unsigned : 1;
  4367. };
  4368. struct
  4369. {
  4370. unsigned PDC : 7;
  4371. unsigned : 1;
  4372. };
  4373. } __PWM1CONbits_t;
  4374. extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
  4375. #define _P1DC0 0x01
  4376. #define _PDC0 0x01
  4377. #define _P1DC1 0x02
  4378. #define _PDC1 0x02
  4379. #define _P1DC2 0x04
  4380. #define _PDC2 0x04
  4381. #define _P1DC3 0x08
  4382. #define _PDC3 0x08
  4383. #define _P1DC4 0x10
  4384. #define _PDC4 0x10
  4385. #define _P1DC5 0x20
  4386. #define _PDC5 0x20
  4387. #define _P1DC6 0x40
  4388. #define _PDC6 0x40
  4389. #define _P1RSEN 0x80
  4390. #define _PRSEN 0x80
  4391. //==============================================================================
  4392. //==============================================================================
  4393. // PWMCON Bits
  4394. extern __at(0x0FB7) __sfr PWMCON;
  4395. typedef union
  4396. {
  4397. struct
  4398. {
  4399. unsigned P1DC0 : 1;
  4400. unsigned P1DC1 : 1;
  4401. unsigned P1DC2 : 1;
  4402. unsigned P1DC3 : 1;
  4403. unsigned P1DC4 : 1;
  4404. unsigned P1DC5 : 1;
  4405. unsigned P1DC6 : 1;
  4406. unsigned P1RSEN : 1;
  4407. };
  4408. struct
  4409. {
  4410. unsigned PDC0 : 1;
  4411. unsigned PDC1 : 1;
  4412. unsigned PDC2 : 1;
  4413. unsigned PDC3 : 1;
  4414. unsigned PDC4 : 1;
  4415. unsigned PDC5 : 1;
  4416. unsigned PDC6 : 1;
  4417. unsigned PRSEN : 1;
  4418. };
  4419. struct
  4420. {
  4421. unsigned P1DC : 7;
  4422. unsigned : 1;
  4423. };
  4424. struct
  4425. {
  4426. unsigned PDC : 7;
  4427. unsigned : 1;
  4428. };
  4429. } __PWMCONbits_t;
  4430. extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
  4431. #define _PWMCON_P1DC0 0x01
  4432. #define _PWMCON_PDC0 0x01
  4433. #define _PWMCON_P1DC1 0x02
  4434. #define _PWMCON_PDC1 0x02
  4435. #define _PWMCON_P1DC2 0x04
  4436. #define _PWMCON_PDC2 0x04
  4437. #define _PWMCON_P1DC3 0x08
  4438. #define _PWMCON_PDC3 0x08
  4439. #define _PWMCON_P1DC4 0x10
  4440. #define _PWMCON_PDC4 0x10
  4441. #define _PWMCON_P1DC5 0x20
  4442. #define _PWMCON_PDC5 0x20
  4443. #define _PWMCON_P1DC6 0x40
  4444. #define _PWMCON_PDC6 0x40
  4445. #define _PWMCON_P1RSEN 0x80
  4446. #define _PWMCON_PRSEN 0x80
  4447. //==============================================================================
  4448. //==============================================================================
  4449. // BAUD1CON Bits
  4450. extern __at(0x0FB8) __sfr BAUD1CON;
  4451. typedef union
  4452. {
  4453. struct
  4454. {
  4455. unsigned ABDEN : 1;
  4456. unsigned WUE : 1;
  4457. unsigned : 1;
  4458. unsigned BRG16 : 1;
  4459. unsigned CKTXP : 1;
  4460. unsigned DTRXP : 1;
  4461. unsigned RCIDL : 1;
  4462. unsigned ABDOVF : 1;
  4463. };
  4464. struct
  4465. {
  4466. unsigned : 1;
  4467. unsigned : 1;
  4468. unsigned : 1;
  4469. unsigned : 1;
  4470. unsigned SCKP : 1;
  4471. unsigned : 1;
  4472. unsigned : 1;
  4473. unsigned : 1;
  4474. };
  4475. } __BAUD1CONbits_t;
  4476. extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
  4477. #define _ABDEN 0x01
  4478. #define _WUE 0x02
  4479. #define _BRG16 0x08
  4480. #define _CKTXP 0x10
  4481. #define _SCKP 0x10
  4482. #define _DTRXP 0x20
  4483. #define _RCIDL 0x40
  4484. #define _ABDOVF 0x80
  4485. //==============================================================================
  4486. //==============================================================================
  4487. // BAUDCON Bits
  4488. extern __at(0x0FB8) __sfr BAUDCON;
  4489. typedef union
  4490. {
  4491. struct
  4492. {
  4493. unsigned ABDEN : 1;
  4494. unsigned WUE : 1;
  4495. unsigned : 1;
  4496. unsigned BRG16 : 1;
  4497. unsigned CKTXP : 1;
  4498. unsigned DTRXP : 1;
  4499. unsigned RCIDL : 1;
  4500. unsigned ABDOVF : 1;
  4501. };
  4502. struct
  4503. {
  4504. unsigned : 1;
  4505. unsigned : 1;
  4506. unsigned : 1;
  4507. unsigned : 1;
  4508. unsigned SCKP : 1;
  4509. unsigned : 1;
  4510. unsigned : 1;
  4511. unsigned : 1;
  4512. };
  4513. } __BAUDCONbits_t;
  4514. extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
  4515. #define _BAUDCON_ABDEN 0x01
  4516. #define _BAUDCON_WUE 0x02
  4517. #define _BAUDCON_BRG16 0x08
  4518. #define _BAUDCON_CKTXP 0x10
  4519. #define _BAUDCON_SCKP 0x10
  4520. #define _BAUDCON_DTRXP 0x20
  4521. #define _BAUDCON_RCIDL 0x40
  4522. #define _BAUDCON_ABDOVF 0x80
  4523. //==============================================================================
  4524. //==============================================================================
  4525. // BAUDCON1 Bits
  4526. extern __at(0x0FB8) __sfr BAUDCON1;
  4527. typedef union
  4528. {
  4529. struct
  4530. {
  4531. unsigned ABDEN : 1;
  4532. unsigned WUE : 1;
  4533. unsigned : 1;
  4534. unsigned BRG16 : 1;
  4535. unsigned CKTXP : 1;
  4536. unsigned DTRXP : 1;
  4537. unsigned RCIDL : 1;
  4538. unsigned ABDOVF : 1;
  4539. };
  4540. struct
  4541. {
  4542. unsigned : 1;
  4543. unsigned : 1;
  4544. unsigned : 1;
  4545. unsigned : 1;
  4546. unsigned SCKP : 1;
  4547. unsigned : 1;
  4548. unsigned : 1;
  4549. unsigned : 1;
  4550. };
  4551. } __BAUDCON1bits_t;
  4552. extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
  4553. #define _BAUDCON1_ABDEN 0x01
  4554. #define _BAUDCON1_WUE 0x02
  4555. #define _BAUDCON1_BRG16 0x08
  4556. #define _BAUDCON1_CKTXP 0x10
  4557. #define _BAUDCON1_SCKP 0x10
  4558. #define _BAUDCON1_DTRXP 0x20
  4559. #define _BAUDCON1_RCIDL 0x40
  4560. #define _BAUDCON1_ABDOVF 0x80
  4561. //==============================================================================
  4562. //==============================================================================
  4563. // BAUDCTL Bits
  4564. extern __at(0x0FB8) __sfr BAUDCTL;
  4565. typedef union
  4566. {
  4567. struct
  4568. {
  4569. unsigned ABDEN : 1;
  4570. unsigned WUE : 1;
  4571. unsigned : 1;
  4572. unsigned BRG16 : 1;
  4573. unsigned CKTXP : 1;
  4574. unsigned DTRXP : 1;
  4575. unsigned RCIDL : 1;
  4576. unsigned ABDOVF : 1;
  4577. };
  4578. struct
  4579. {
  4580. unsigned : 1;
  4581. unsigned : 1;
  4582. unsigned : 1;
  4583. unsigned : 1;
  4584. unsigned SCKP : 1;
  4585. unsigned : 1;
  4586. unsigned : 1;
  4587. unsigned : 1;
  4588. };
  4589. } __BAUDCTLbits_t;
  4590. extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
  4591. #define _BAUDCTL_ABDEN 0x01
  4592. #define _BAUDCTL_WUE 0x02
  4593. #define _BAUDCTL_BRG16 0x08
  4594. #define _BAUDCTL_CKTXP 0x10
  4595. #define _BAUDCTL_SCKP 0x10
  4596. #define _BAUDCTL_DTRXP 0x20
  4597. #define _BAUDCTL_RCIDL 0x40
  4598. #define _BAUDCTL_ABDOVF 0x80
  4599. //==============================================================================
  4600. //==============================================================================
  4601. // PSTR1CON Bits
  4602. extern __at(0x0FB9) __sfr PSTR1CON;
  4603. typedef struct
  4604. {
  4605. unsigned STR1A : 1;
  4606. unsigned STR1B : 1;
  4607. unsigned STR1C : 1;
  4608. unsigned STR1D : 1;
  4609. unsigned STR1SYNC : 1;
  4610. unsigned : 1;
  4611. unsigned : 1;
  4612. unsigned : 1;
  4613. } __PSTR1CONbits_t;
  4614. extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
  4615. #define _STR1A 0x01
  4616. #define _STR1B 0x02
  4617. #define _STR1C 0x04
  4618. #define _STR1D 0x08
  4619. #define _STR1SYNC 0x10
  4620. //==============================================================================
  4621. //==============================================================================
  4622. // PSTRCON Bits
  4623. extern __at(0x0FB9) __sfr PSTRCON;
  4624. typedef struct
  4625. {
  4626. unsigned STR1A : 1;
  4627. unsigned STR1B : 1;
  4628. unsigned STR1C : 1;
  4629. unsigned STR1D : 1;
  4630. unsigned STR1SYNC : 1;
  4631. unsigned : 1;
  4632. unsigned : 1;
  4633. unsigned : 1;
  4634. } __PSTRCONbits_t;
  4635. extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
  4636. #define _PSTRCON_STR1A 0x01
  4637. #define _PSTRCON_STR1B 0x02
  4638. #define _PSTRCON_STR1C 0x04
  4639. #define _PSTRCON_STR1D 0x08
  4640. #define _PSTRCON_STR1SYNC 0x10
  4641. //==============================================================================
  4642. //==============================================================================
  4643. // T2CON Bits
  4644. extern __at(0x0FBA) __sfr T2CON;
  4645. typedef union
  4646. {
  4647. struct
  4648. {
  4649. unsigned T2CKPS0 : 1;
  4650. unsigned T2CKPS1 : 1;
  4651. unsigned TMR2ON : 1;
  4652. unsigned T2OUTPS0 : 1;
  4653. unsigned T2OUTPS1 : 1;
  4654. unsigned T2OUTPS2 : 1;
  4655. unsigned T2OUTPS3 : 1;
  4656. unsigned : 1;
  4657. };
  4658. struct
  4659. {
  4660. unsigned T2CKPS : 2;
  4661. unsigned : 6;
  4662. };
  4663. struct
  4664. {
  4665. unsigned : 3;
  4666. unsigned T2OUTPS : 4;
  4667. unsigned : 1;
  4668. };
  4669. } __T2CONbits_t;
  4670. extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
  4671. #define _T2CKPS0 0x01
  4672. #define _T2CKPS1 0x02
  4673. #define _TMR2ON 0x04
  4674. #define _T2OUTPS0 0x08
  4675. #define _T2OUTPS1 0x10
  4676. #define _T2OUTPS2 0x20
  4677. #define _T2OUTPS3 0x40
  4678. //==============================================================================
  4679. extern __at(0x0FBB) __sfr PR2;
  4680. extern __at(0x0FBC) __sfr TMR2;
  4681. //==============================================================================
  4682. // CCP1CON Bits
  4683. extern __at(0x0FBD) __sfr CCP1CON;
  4684. typedef union
  4685. {
  4686. struct
  4687. {
  4688. unsigned CCP1M0 : 1;
  4689. unsigned CCP1M1 : 1;
  4690. unsigned CCP1M2 : 1;
  4691. unsigned CCP1M3 : 1;
  4692. unsigned DC1B0 : 1;
  4693. unsigned DC1B1 : 1;
  4694. unsigned P1M0 : 1;
  4695. unsigned P1M1 : 1;
  4696. };
  4697. struct
  4698. {
  4699. unsigned CCP1M : 4;
  4700. unsigned : 4;
  4701. };
  4702. struct
  4703. {
  4704. unsigned : 4;
  4705. unsigned DC1B : 2;
  4706. unsigned : 2;
  4707. };
  4708. struct
  4709. {
  4710. unsigned : 6;
  4711. unsigned P1M : 2;
  4712. };
  4713. } __CCP1CONbits_t;
  4714. extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
  4715. #define _CCP1M0 0x01
  4716. #define _CCP1M1 0x02
  4717. #define _CCP1M2 0x04
  4718. #define _CCP1M3 0x08
  4719. #define _DC1B0 0x10
  4720. #define _DC1B1 0x20
  4721. #define _P1M0 0x40
  4722. #define _P1M1 0x80
  4723. //==============================================================================
  4724. extern __at(0x0FBE) __sfr CCPR1;
  4725. extern __at(0x0FBE) __sfr CCPR1L;
  4726. extern __at(0x0FBF) __sfr CCPR1H;
  4727. //==============================================================================
  4728. // ADCON2 Bits
  4729. extern __at(0x0FC0) __sfr ADCON2;
  4730. typedef union
  4731. {
  4732. struct
  4733. {
  4734. unsigned ADCS0 : 1;
  4735. unsigned ADCS1 : 1;
  4736. unsigned ADCS2 : 1;
  4737. unsigned ACQT0 : 1;
  4738. unsigned ACQT1 : 1;
  4739. unsigned ACQT2 : 1;
  4740. unsigned : 1;
  4741. unsigned ADFM : 1;
  4742. };
  4743. struct
  4744. {
  4745. unsigned ADCS : 3;
  4746. unsigned : 5;
  4747. };
  4748. struct
  4749. {
  4750. unsigned : 3;
  4751. unsigned ACQT : 3;
  4752. unsigned : 2;
  4753. };
  4754. } __ADCON2bits_t;
  4755. extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
  4756. #define _ADCS0 0x01
  4757. #define _ADCS1 0x02
  4758. #define _ADCS2 0x04
  4759. #define _ACQT0 0x08
  4760. #define _ACQT1 0x10
  4761. #define _ACQT2 0x20
  4762. #define _ADFM 0x80
  4763. //==============================================================================
  4764. //==============================================================================
  4765. // ADCON1 Bits
  4766. extern __at(0x0FC1) __sfr ADCON1;
  4767. typedef union
  4768. {
  4769. struct
  4770. {
  4771. unsigned NVCFG0 : 1;
  4772. unsigned NVCFG1 : 1;
  4773. unsigned PVCFG0 : 1;
  4774. unsigned PVCFG1 : 1;
  4775. unsigned : 1;
  4776. unsigned : 1;
  4777. unsigned : 1;
  4778. unsigned TRIGSEL : 1;
  4779. };
  4780. struct
  4781. {
  4782. unsigned NVCFG : 2;
  4783. unsigned : 6;
  4784. };
  4785. struct
  4786. {
  4787. unsigned : 2;
  4788. unsigned PVCFG : 2;
  4789. unsigned : 4;
  4790. };
  4791. } __ADCON1bits_t;
  4792. extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
  4793. #define _NVCFG0 0x01
  4794. #define _NVCFG1 0x02
  4795. #define _PVCFG0 0x04
  4796. #define _PVCFG1 0x08
  4797. #define _TRIGSEL 0x80
  4798. //==============================================================================
  4799. //==============================================================================
  4800. // ADCON0 Bits
  4801. extern __at(0x0FC2) __sfr ADCON0;
  4802. typedef union
  4803. {
  4804. struct
  4805. {
  4806. unsigned ADON : 1;
  4807. unsigned GO_NOT_DONE : 1;
  4808. unsigned CHS0 : 1;
  4809. unsigned CHS1 : 1;
  4810. unsigned CHS2 : 1;
  4811. unsigned CHS3 : 1;
  4812. unsigned CHS4 : 1;
  4813. unsigned : 1;
  4814. };
  4815. struct
  4816. {
  4817. unsigned : 1;
  4818. unsigned GO : 1;
  4819. unsigned : 1;
  4820. unsigned : 1;
  4821. unsigned : 1;
  4822. unsigned : 1;
  4823. unsigned : 1;
  4824. unsigned : 1;
  4825. };
  4826. struct
  4827. {
  4828. unsigned : 1;
  4829. unsigned DONE : 1;
  4830. unsigned : 1;
  4831. unsigned : 1;
  4832. unsigned : 1;
  4833. unsigned : 1;
  4834. unsigned : 1;
  4835. unsigned : 1;
  4836. };
  4837. struct
  4838. {
  4839. unsigned : 1;
  4840. unsigned NOT_DONE : 1;
  4841. unsigned : 1;
  4842. unsigned : 1;
  4843. unsigned : 1;
  4844. unsigned : 1;
  4845. unsigned : 1;
  4846. unsigned : 1;
  4847. };
  4848. struct
  4849. {
  4850. unsigned : 1;
  4851. unsigned GO_DONE : 1;
  4852. unsigned : 1;
  4853. unsigned : 1;
  4854. unsigned : 1;
  4855. unsigned : 1;
  4856. unsigned : 1;
  4857. unsigned : 1;
  4858. };
  4859. struct
  4860. {
  4861. unsigned : 2;
  4862. unsigned CHS : 5;
  4863. unsigned : 1;
  4864. };
  4865. } __ADCON0bits_t;
  4866. extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
  4867. #define _ADON 0x01
  4868. #define _GO_NOT_DONE 0x02
  4869. #define _GO 0x02
  4870. #define _DONE 0x02
  4871. #define _NOT_DONE 0x02
  4872. #define _GO_DONE 0x02
  4873. #define _CHS0 0x04
  4874. #define _CHS1 0x08
  4875. #define _CHS2 0x10
  4876. #define _CHS3 0x20
  4877. #define _CHS4 0x40
  4878. //==============================================================================
  4879. extern __at(0x0FC3) __sfr ADRES;
  4880. extern __at(0x0FC3) __sfr ADRESL;
  4881. extern __at(0x0FC4) __sfr ADRESH;
  4882. //==============================================================================
  4883. // SSP1CON2 Bits
  4884. extern __at(0x0FC5) __sfr SSP1CON2;
  4885. typedef struct
  4886. {
  4887. unsigned SEN : 1;
  4888. unsigned RSEN : 1;
  4889. unsigned PEN : 1;
  4890. unsigned RCEN : 1;
  4891. unsigned ACKEN : 1;
  4892. unsigned ACKDT : 1;
  4893. unsigned ACKSTAT : 1;
  4894. unsigned GCEN : 1;
  4895. } __SSP1CON2bits_t;
  4896. extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
  4897. #define _SEN 0x01
  4898. #define _RSEN 0x02
  4899. #define _PEN 0x04
  4900. #define _RCEN 0x08
  4901. #define _ACKEN 0x10
  4902. #define _ACKDT 0x20
  4903. #define _ACKSTAT 0x40
  4904. #define _GCEN 0x80
  4905. //==============================================================================
  4906. //==============================================================================
  4907. // SSPCON2 Bits
  4908. extern __at(0x0FC5) __sfr SSPCON2;
  4909. typedef struct
  4910. {
  4911. unsigned SEN : 1;
  4912. unsigned RSEN : 1;
  4913. unsigned PEN : 1;
  4914. unsigned RCEN : 1;
  4915. unsigned ACKEN : 1;
  4916. unsigned ACKDT : 1;
  4917. unsigned ACKSTAT : 1;
  4918. unsigned GCEN : 1;
  4919. } __SSPCON2bits_t;
  4920. extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
  4921. #define _SSPCON2_SEN 0x01
  4922. #define _SSPCON2_RSEN 0x02
  4923. #define _SSPCON2_PEN 0x04
  4924. #define _SSPCON2_RCEN 0x08
  4925. #define _SSPCON2_ACKEN 0x10
  4926. #define _SSPCON2_ACKDT 0x20
  4927. #define _SSPCON2_ACKSTAT 0x40
  4928. #define _SSPCON2_GCEN 0x80
  4929. //==============================================================================
  4930. //==============================================================================
  4931. // SSP1CON1 Bits
  4932. extern __at(0x0FC6) __sfr SSP1CON1;
  4933. typedef union
  4934. {
  4935. struct
  4936. {
  4937. unsigned SSPM0 : 1;
  4938. unsigned SSPM1 : 1;
  4939. unsigned SSPM2 : 1;
  4940. unsigned SSPM3 : 1;
  4941. unsigned CKP : 1;
  4942. unsigned SSPEN : 1;
  4943. unsigned SSPOV : 1;
  4944. unsigned WCOL : 1;
  4945. };
  4946. struct
  4947. {
  4948. unsigned SSPM : 4;
  4949. unsigned : 4;
  4950. };
  4951. } __SSP1CON1bits_t;
  4952. extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
  4953. #define _SSPM0 0x01
  4954. #define _SSPM1 0x02
  4955. #define _SSPM2 0x04
  4956. #define _SSPM3 0x08
  4957. #define _CKP 0x10
  4958. #define _SSPEN 0x20
  4959. #define _SSPOV 0x40
  4960. #define _WCOL 0x80
  4961. //==============================================================================
  4962. //==============================================================================
  4963. // SSPCON1 Bits
  4964. extern __at(0x0FC6) __sfr SSPCON1;
  4965. typedef union
  4966. {
  4967. struct
  4968. {
  4969. unsigned SSPM0 : 1;
  4970. unsigned SSPM1 : 1;
  4971. unsigned SSPM2 : 1;
  4972. unsigned SSPM3 : 1;
  4973. unsigned CKP : 1;
  4974. unsigned SSPEN : 1;
  4975. unsigned SSPOV : 1;
  4976. unsigned WCOL : 1;
  4977. };
  4978. struct
  4979. {
  4980. unsigned SSPM : 4;
  4981. unsigned : 4;
  4982. };
  4983. } __SSPCON1bits_t;
  4984. extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
  4985. #define _SSPCON1_SSPM0 0x01
  4986. #define _SSPCON1_SSPM1 0x02
  4987. #define _SSPCON1_SSPM2 0x04
  4988. #define _SSPCON1_SSPM3 0x08
  4989. #define _SSPCON1_CKP 0x10
  4990. #define _SSPCON1_SSPEN 0x20
  4991. #define _SSPCON1_SSPOV 0x40
  4992. #define _SSPCON1_WCOL 0x80
  4993. //==============================================================================
  4994. //==============================================================================
  4995. // SSP1STAT Bits
  4996. extern __at(0x0FC7) __sfr SSP1STAT;
  4997. typedef union
  4998. {
  4999. struct
  5000. {
  5001. unsigned BF : 1;
  5002. unsigned UA : 1;
  5003. unsigned R_NOT_W : 1;
  5004. unsigned S : 1;
  5005. unsigned P : 1;
  5006. unsigned D_NOT_A : 1;
  5007. unsigned CKE : 1;
  5008. unsigned SMP : 1;
  5009. };
  5010. struct
  5011. {
  5012. unsigned : 1;
  5013. unsigned : 1;
  5014. unsigned R : 1;
  5015. unsigned : 1;
  5016. unsigned : 1;
  5017. unsigned D : 1;
  5018. unsigned : 1;
  5019. unsigned : 1;
  5020. };
  5021. struct
  5022. {
  5023. unsigned : 1;
  5024. unsigned : 1;
  5025. unsigned NOT_W : 1;
  5026. unsigned : 1;
  5027. unsigned : 1;
  5028. unsigned NOT_A : 1;
  5029. unsigned : 1;
  5030. unsigned : 1;
  5031. };
  5032. struct
  5033. {
  5034. unsigned : 1;
  5035. unsigned : 1;
  5036. unsigned R_W : 1;
  5037. unsigned : 1;
  5038. unsigned : 1;
  5039. unsigned D_A : 1;
  5040. unsigned : 1;
  5041. unsigned : 1;
  5042. };
  5043. struct
  5044. {
  5045. unsigned : 1;
  5046. unsigned : 1;
  5047. unsigned NOT_WRITE : 1;
  5048. unsigned : 1;
  5049. unsigned : 1;
  5050. unsigned NOT_ADDRESS : 1;
  5051. unsigned : 1;
  5052. unsigned : 1;
  5053. };
  5054. } __SSP1STATbits_t;
  5055. extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
  5056. #define _BF 0x01
  5057. #define _UA 0x02
  5058. #define _R_NOT_W 0x04
  5059. #define _R 0x04
  5060. #define _NOT_W 0x04
  5061. #define _R_W 0x04
  5062. #define _NOT_WRITE 0x04
  5063. #define _S 0x08
  5064. #define _P 0x10
  5065. #define _D_NOT_A 0x20
  5066. #define _D 0x20
  5067. #define _NOT_A 0x20
  5068. #define _D_A 0x20
  5069. #define _NOT_ADDRESS 0x20
  5070. #define _CKE 0x40
  5071. #define _SMP 0x80
  5072. //==============================================================================
  5073. //==============================================================================
  5074. // SSPSTAT Bits
  5075. extern __at(0x0FC7) __sfr SSPSTAT;
  5076. typedef union
  5077. {
  5078. struct
  5079. {
  5080. unsigned BF : 1;
  5081. unsigned UA : 1;
  5082. unsigned R_NOT_W : 1;
  5083. unsigned S : 1;
  5084. unsigned P : 1;
  5085. unsigned D_NOT_A : 1;
  5086. unsigned CKE : 1;
  5087. unsigned SMP : 1;
  5088. };
  5089. struct
  5090. {
  5091. unsigned : 1;
  5092. unsigned : 1;
  5093. unsigned R : 1;
  5094. unsigned : 1;
  5095. unsigned : 1;
  5096. unsigned D : 1;
  5097. unsigned : 1;
  5098. unsigned : 1;
  5099. };
  5100. struct
  5101. {
  5102. unsigned : 1;
  5103. unsigned : 1;
  5104. unsigned NOT_W : 1;
  5105. unsigned : 1;
  5106. unsigned : 1;
  5107. unsigned NOT_A : 1;
  5108. unsigned : 1;
  5109. unsigned : 1;
  5110. };
  5111. struct
  5112. {
  5113. unsigned : 1;
  5114. unsigned : 1;
  5115. unsigned R_W : 1;
  5116. unsigned : 1;
  5117. unsigned : 1;
  5118. unsigned D_A : 1;
  5119. unsigned : 1;
  5120. unsigned : 1;
  5121. };
  5122. struct
  5123. {
  5124. unsigned : 1;
  5125. unsigned : 1;
  5126. unsigned NOT_WRITE : 1;
  5127. unsigned : 1;
  5128. unsigned : 1;
  5129. unsigned NOT_ADDRESS : 1;
  5130. unsigned : 1;
  5131. unsigned : 1;
  5132. };
  5133. } __SSPSTATbits_t;
  5134. extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
  5135. #define _SSPSTAT_BF 0x01
  5136. #define _SSPSTAT_UA 0x02
  5137. #define _SSPSTAT_R_NOT_W 0x04
  5138. #define _SSPSTAT_R 0x04
  5139. #define _SSPSTAT_NOT_W 0x04
  5140. #define _SSPSTAT_R_W 0x04
  5141. #define _SSPSTAT_NOT_WRITE 0x04
  5142. #define _SSPSTAT_S 0x08
  5143. #define _SSPSTAT_P 0x10
  5144. #define _SSPSTAT_D_NOT_A 0x20
  5145. #define _SSPSTAT_D 0x20
  5146. #define _SSPSTAT_NOT_A 0x20
  5147. #define _SSPSTAT_D_A 0x20
  5148. #define _SSPSTAT_NOT_ADDRESS 0x20
  5149. #define _SSPSTAT_CKE 0x40
  5150. #define _SSPSTAT_SMP 0x80
  5151. //==============================================================================
  5152. extern __at(0x0FC8) __sfr SSP1ADD;
  5153. extern __at(0x0FC8) __sfr SSPADD;
  5154. extern __at(0x0FC9) __sfr SSP1BUF;
  5155. extern __at(0x0FC9) __sfr SSPBUF;
  5156. //==============================================================================
  5157. // SSP1MSK Bits
  5158. extern __at(0x0FCA) __sfr SSP1MSK;
  5159. typedef struct
  5160. {
  5161. unsigned MSK0 : 1;
  5162. unsigned MSK1 : 1;
  5163. unsigned MSK2 : 1;
  5164. unsigned MSK3 : 1;
  5165. unsigned MSK4 : 1;
  5166. unsigned MSK5 : 1;
  5167. unsigned MSK6 : 1;
  5168. unsigned MSK7 : 1;
  5169. } __SSP1MSKbits_t;
  5170. extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
  5171. #define _MSK0 0x01
  5172. #define _MSK1 0x02
  5173. #define _MSK2 0x04
  5174. #define _MSK3 0x08
  5175. #define _MSK4 0x10
  5176. #define _MSK5 0x20
  5177. #define _MSK6 0x40
  5178. #define _MSK7 0x80
  5179. //==============================================================================
  5180. //==============================================================================
  5181. // SSPMSK Bits
  5182. extern __at(0x0FCA) __sfr SSPMSK;
  5183. typedef struct
  5184. {
  5185. unsigned MSK0 : 1;
  5186. unsigned MSK1 : 1;
  5187. unsigned MSK2 : 1;
  5188. unsigned MSK3 : 1;
  5189. unsigned MSK4 : 1;
  5190. unsigned MSK5 : 1;
  5191. unsigned MSK6 : 1;
  5192. unsigned MSK7 : 1;
  5193. } __SSPMSKbits_t;
  5194. extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
  5195. #define _SSPMSK_MSK0 0x01
  5196. #define _SSPMSK_MSK1 0x02
  5197. #define _SSPMSK_MSK2 0x04
  5198. #define _SSPMSK_MSK3 0x08
  5199. #define _SSPMSK_MSK4 0x10
  5200. #define _SSPMSK_MSK5 0x20
  5201. #define _SSPMSK_MSK6 0x40
  5202. #define _SSPMSK_MSK7 0x80
  5203. //==============================================================================
  5204. //==============================================================================
  5205. // SSP1CON3 Bits
  5206. extern __at(0x0FCB) __sfr SSP1CON3;
  5207. typedef struct
  5208. {
  5209. unsigned DHEN : 1;
  5210. unsigned AHEN : 1;
  5211. unsigned SBCDE : 1;
  5212. unsigned SDAHT : 1;
  5213. unsigned BOEN : 1;
  5214. unsigned SCIE : 1;
  5215. unsigned PCIE : 1;
  5216. unsigned ACKTIM : 1;
  5217. } __SSP1CON3bits_t;
  5218. extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
  5219. #define _DHEN 0x01
  5220. #define _AHEN 0x02
  5221. #define _SBCDE 0x04
  5222. #define _SDAHT 0x08
  5223. #define _BOEN 0x10
  5224. #define _SCIE 0x20
  5225. #define _PCIE 0x40
  5226. #define _ACKTIM 0x80
  5227. //==============================================================================
  5228. //==============================================================================
  5229. // SSPCON3 Bits
  5230. extern __at(0x0FCB) __sfr SSPCON3;
  5231. typedef struct
  5232. {
  5233. unsigned DHEN : 1;
  5234. unsigned AHEN : 1;
  5235. unsigned SBCDE : 1;
  5236. unsigned SDAHT : 1;
  5237. unsigned BOEN : 1;
  5238. unsigned SCIE : 1;
  5239. unsigned PCIE : 1;
  5240. unsigned ACKTIM : 1;
  5241. } __SSPCON3bits_t;
  5242. extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
  5243. #define _SSPCON3_DHEN 0x01
  5244. #define _SSPCON3_AHEN 0x02
  5245. #define _SSPCON3_SBCDE 0x04
  5246. #define _SSPCON3_SDAHT 0x08
  5247. #define _SSPCON3_BOEN 0x10
  5248. #define _SSPCON3_SCIE 0x20
  5249. #define _SSPCON3_PCIE 0x40
  5250. #define _SSPCON3_ACKTIM 0x80
  5251. //==============================================================================
  5252. //==============================================================================
  5253. // T1GCON Bits
  5254. extern __at(0x0FCC) __sfr T1GCON;
  5255. typedef union
  5256. {
  5257. struct
  5258. {
  5259. unsigned T1GSS0 : 1;
  5260. unsigned T1GSS1 : 1;
  5261. unsigned T1GVAL : 1;
  5262. unsigned T1GGO_NOT_DONE : 1;
  5263. unsigned T1GSPM : 1;
  5264. unsigned T1GTM : 1;
  5265. unsigned T1GPOL : 1;
  5266. unsigned TMR1GE : 1;
  5267. };
  5268. struct
  5269. {
  5270. unsigned : 1;
  5271. unsigned : 1;
  5272. unsigned : 1;
  5273. unsigned T1G_DONE : 1;
  5274. unsigned : 1;
  5275. unsigned : 1;
  5276. unsigned : 1;
  5277. unsigned : 1;
  5278. };
  5279. struct
  5280. {
  5281. unsigned : 1;
  5282. unsigned : 1;
  5283. unsigned : 1;
  5284. unsigned T1GGO : 1;
  5285. unsigned : 1;
  5286. unsigned : 1;
  5287. unsigned : 1;
  5288. unsigned : 1;
  5289. };
  5290. struct
  5291. {
  5292. unsigned T1GSS : 2;
  5293. unsigned : 6;
  5294. };
  5295. } __T1GCONbits_t;
  5296. extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
  5297. #define _T1GSS0 0x01
  5298. #define _T1GSS1 0x02
  5299. #define _T1GVAL 0x04
  5300. #define _T1GGO_NOT_DONE 0x08
  5301. #define _T1G_DONE 0x08
  5302. #define _T1GGO 0x08
  5303. #define _T1GSPM 0x10
  5304. #define _T1GTM 0x20
  5305. #define _T1GPOL 0x40
  5306. #define _TMR1GE 0x80
  5307. //==============================================================================
  5308. //==============================================================================
  5309. // T1CON Bits
  5310. extern __at(0x0FCD) __sfr T1CON;
  5311. typedef union
  5312. {
  5313. struct
  5314. {
  5315. unsigned TMR1ON : 1;
  5316. unsigned T1RD16 : 1;
  5317. unsigned NOT_T1SYNC : 1;
  5318. unsigned T1SOSCEN : 1;
  5319. unsigned T1CKPS0 : 1;
  5320. unsigned T1CKPS1 : 1;
  5321. unsigned TMR1CS0 : 1;
  5322. unsigned TMR1CS1 : 1;
  5323. };
  5324. struct
  5325. {
  5326. unsigned : 1;
  5327. unsigned RD16 : 1;
  5328. unsigned T1SYNC : 1;
  5329. unsigned T1OSCEN : 1;
  5330. unsigned : 1;
  5331. unsigned : 1;
  5332. unsigned : 1;
  5333. unsigned : 1;
  5334. };
  5335. struct
  5336. {
  5337. unsigned : 4;
  5338. unsigned T1CKPS : 2;
  5339. unsigned : 2;
  5340. };
  5341. struct
  5342. {
  5343. unsigned : 6;
  5344. unsigned TMR1CS : 2;
  5345. };
  5346. } __T1CONbits_t;
  5347. extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
  5348. #define _TMR1ON 0x01
  5349. #define _T1RD16 0x02
  5350. #define _RD16 0x02
  5351. #define _NOT_T1SYNC 0x04
  5352. #define _T1SYNC 0x04
  5353. #define _T1SOSCEN 0x08
  5354. #define _T1OSCEN 0x08
  5355. #define _T1CKPS0 0x10
  5356. #define _T1CKPS1 0x20
  5357. #define _TMR1CS0 0x40
  5358. #define _TMR1CS1 0x80
  5359. //==============================================================================
  5360. extern __at(0x0FCE) __sfr TMR1;
  5361. extern __at(0x0FCE) __sfr TMR1L;
  5362. extern __at(0x0FCF) __sfr TMR1H;
  5363. //==============================================================================
  5364. // RCON Bits
  5365. extern __at(0x0FD0) __sfr RCON;
  5366. typedef union
  5367. {
  5368. struct
  5369. {
  5370. unsigned NOT_BOR : 1;
  5371. unsigned NOT_POR : 1;
  5372. unsigned NOT_PD : 1;
  5373. unsigned NOT_TO : 1;
  5374. unsigned NOT_RI : 1;
  5375. unsigned : 1;
  5376. unsigned SBOREN : 1;
  5377. unsigned IPEN : 1;
  5378. };
  5379. struct
  5380. {
  5381. unsigned BOR : 1;
  5382. unsigned POR : 1;
  5383. unsigned PD : 1;
  5384. unsigned TO : 1;
  5385. unsigned RI : 1;
  5386. unsigned : 1;
  5387. unsigned : 1;
  5388. unsigned : 1;
  5389. };
  5390. } __RCONbits_t;
  5391. extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
  5392. #define _NOT_BOR 0x01
  5393. #define _BOR 0x01
  5394. #define _NOT_POR 0x02
  5395. #define _POR 0x02
  5396. #define _NOT_PD 0x04
  5397. #define _PD 0x04
  5398. #define _NOT_TO 0x08
  5399. #define _TO 0x08
  5400. #define _NOT_RI 0x10
  5401. #define _RI 0x10
  5402. #define _SBOREN 0x40
  5403. #define _IPEN 0x80
  5404. //==============================================================================
  5405. //==============================================================================
  5406. // WDTCON Bits
  5407. extern __at(0x0FD1) __sfr WDTCON;
  5408. typedef union
  5409. {
  5410. struct
  5411. {
  5412. unsigned SWDTEN : 1;
  5413. unsigned : 1;
  5414. unsigned : 1;
  5415. unsigned : 1;
  5416. unsigned : 1;
  5417. unsigned : 1;
  5418. unsigned : 1;
  5419. unsigned : 1;
  5420. };
  5421. struct
  5422. {
  5423. unsigned SWDTE : 1;
  5424. unsigned : 1;
  5425. unsigned : 1;
  5426. unsigned : 1;
  5427. unsigned : 1;
  5428. unsigned : 1;
  5429. unsigned : 1;
  5430. unsigned : 1;
  5431. };
  5432. } __WDTCONbits_t;
  5433. extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
  5434. #define _SWDTEN 0x01
  5435. #define _SWDTE 0x01
  5436. //==============================================================================
  5437. //==============================================================================
  5438. // OSCCON2 Bits
  5439. extern __at(0x0FD2) __sfr OSCCON2;
  5440. typedef struct
  5441. {
  5442. unsigned LFIOFS : 1;
  5443. unsigned MFIOFS : 1;
  5444. unsigned PRISD : 1;
  5445. unsigned SOSCGO : 1;
  5446. unsigned MFIOSEL : 1;
  5447. unsigned : 1;
  5448. unsigned SOSCRUN : 1;
  5449. unsigned PLLRDY : 1;
  5450. } __OSCCON2bits_t;
  5451. extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
  5452. #define _LFIOFS 0x01
  5453. #define _MFIOFS 0x02
  5454. #define _PRISD 0x04
  5455. #define _SOSCGO 0x08
  5456. #define _MFIOSEL 0x10
  5457. #define _SOSCRUN 0x40
  5458. #define _PLLRDY 0x80
  5459. //==============================================================================
  5460. //==============================================================================
  5461. // OSCCON Bits
  5462. extern __at(0x0FD3) __sfr OSCCON;
  5463. typedef union
  5464. {
  5465. struct
  5466. {
  5467. unsigned SCS0 : 1;
  5468. unsigned SCS1 : 1;
  5469. unsigned HFIOFS : 1;
  5470. unsigned OSTS : 1;
  5471. unsigned IRCF0 : 1;
  5472. unsigned IRCF1 : 1;
  5473. unsigned IRCF2 : 1;
  5474. unsigned IDLEN : 1;
  5475. };
  5476. struct
  5477. {
  5478. unsigned : 1;
  5479. unsigned : 1;
  5480. unsigned IOFS : 1;
  5481. unsigned : 1;
  5482. unsigned : 1;
  5483. unsigned : 1;
  5484. unsigned : 1;
  5485. unsigned : 1;
  5486. };
  5487. struct
  5488. {
  5489. unsigned SCS : 2;
  5490. unsigned : 6;
  5491. };
  5492. struct
  5493. {
  5494. unsigned : 4;
  5495. unsigned IRCF : 3;
  5496. unsigned : 1;
  5497. };
  5498. } __OSCCONbits_t;
  5499. extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
  5500. #define _SCS0 0x01
  5501. #define _SCS1 0x02
  5502. #define _HFIOFS 0x04
  5503. #define _IOFS 0x04
  5504. #define _OSTS 0x08
  5505. #define _IRCF0 0x10
  5506. #define _IRCF1 0x20
  5507. #define _IRCF2 0x40
  5508. #define _IDLEN 0x80
  5509. //==============================================================================
  5510. //==============================================================================
  5511. // T0CON Bits
  5512. extern __at(0x0FD5) __sfr T0CON;
  5513. typedef union
  5514. {
  5515. struct
  5516. {
  5517. unsigned T0PS0 : 1;
  5518. unsigned T0PS1 : 1;
  5519. unsigned T0PS2 : 1;
  5520. unsigned PSA : 1;
  5521. unsigned T0SE : 1;
  5522. unsigned T0CS : 1;
  5523. unsigned T08BIT : 1;
  5524. unsigned TMR0ON : 1;
  5525. };
  5526. struct
  5527. {
  5528. unsigned T0PS : 3;
  5529. unsigned : 5;
  5530. };
  5531. } __T0CONbits_t;
  5532. extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
  5533. #define _T0PS0 0x01
  5534. #define _T0PS1 0x02
  5535. #define _T0PS2 0x04
  5536. #define _PSA 0x08
  5537. #define _T0SE 0x10
  5538. #define _T0CS 0x20
  5539. #define _T08BIT 0x40
  5540. #define _TMR0ON 0x80
  5541. //==============================================================================
  5542. extern __at(0x0FD6) __sfr TMR0;
  5543. extern __at(0x0FD6) __sfr TMR0L;
  5544. extern __at(0x0FD7) __sfr TMR0H;
  5545. //==============================================================================
  5546. // STATUS Bits
  5547. extern __at(0x0FD8) __sfr STATUS;
  5548. typedef struct
  5549. {
  5550. unsigned C : 1;
  5551. unsigned DC : 1;
  5552. unsigned Z : 1;
  5553. unsigned OV : 1;
  5554. unsigned N : 1;
  5555. unsigned : 1;
  5556. unsigned : 1;
  5557. unsigned : 1;
  5558. } __STATUSbits_t;
  5559. extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
  5560. #define _C 0x01
  5561. #define _DC 0x02
  5562. #define _Z 0x04
  5563. #define _OV 0x08
  5564. #define _N 0x10
  5565. //==============================================================================
  5566. extern __at(0x0FD9) __sfr FSR2L;
  5567. extern __at(0x0FDA) __sfr FSR2H;
  5568. extern __at(0x0FDB) __sfr PLUSW2;
  5569. extern __at(0x0FDC) __sfr PREINC2;
  5570. extern __at(0x0FDD) __sfr POSTDEC2;
  5571. extern __at(0x0FDE) __sfr POSTINC2;
  5572. extern __at(0x0FDF) __sfr INDF2;
  5573. extern __at(0x0FE0) __sfr BSR;
  5574. extern __at(0x0FE1) __sfr FSR1L;
  5575. extern __at(0x0FE2) __sfr FSR1H;
  5576. extern __at(0x0FE3) __sfr PLUSW1;
  5577. extern __at(0x0FE4) __sfr PREINC1;
  5578. extern __at(0x0FE5) __sfr POSTDEC1;
  5579. extern __at(0x0FE6) __sfr POSTINC1;
  5580. extern __at(0x0FE7) __sfr INDF1;
  5581. extern __at(0x0FE8) __sfr WREG;
  5582. extern __at(0x0FE9) __sfr FSR0L;
  5583. extern __at(0x0FEA) __sfr FSR0H;
  5584. extern __at(0x0FEB) __sfr PLUSW0;
  5585. extern __at(0x0FEC) __sfr PREINC0;
  5586. extern __at(0x0FED) __sfr POSTDEC0;
  5587. extern __at(0x0FEE) __sfr POSTINC0;
  5588. extern __at(0x0FEF) __sfr INDF0;
  5589. //==============================================================================
  5590. // INTCON3 Bits
  5591. extern __at(0x0FF0) __sfr INTCON3;
  5592. typedef union
  5593. {
  5594. struct
  5595. {
  5596. unsigned INT1IF : 1;
  5597. unsigned INT2IF : 1;
  5598. unsigned : 1;
  5599. unsigned INT1IE : 1;
  5600. unsigned INT2IE : 1;
  5601. unsigned : 1;
  5602. unsigned INT1IP : 1;
  5603. unsigned INT2IP : 1;
  5604. };
  5605. struct
  5606. {
  5607. unsigned INT1F : 1;
  5608. unsigned INT2F : 1;
  5609. unsigned : 1;
  5610. unsigned INT1E : 1;
  5611. unsigned INT2E : 1;
  5612. unsigned : 1;
  5613. unsigned INT1P : 1;
  5614. unsigned INT2P : 1;
  5615. };
  5616. } __INTCON3bits_t;
  5617. extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
  5618. #define _INT1IF 0x01
  5619. #define _INT1F 0x01
  5620. #define _INT2IF 0x02
  5621. #define _INT2F 0x02
  5622. #define _INT1IE 0x08
  5623. #define _INT1E 0x08
  5624. #define _INT2IE 0x10
  5625. #define _INT2E 0x10
  5626. #define _INT1IP 0x40
  5627. #define _INT1P 0x40
  5628. #define _INT2IP 0x80
  5629. #define _INT2P 0x80
  5630. //==============================================================================
  5631. //==============================================================================
  5632. // INTCON2 Bits
  5633. extern __at(0x0FF1) __sfr INTCON2;
  5634. typedef union
  5635. {
  5636. struct
  5637. {
  5638. unsigned RBIP : 1;
  5639. unsigned : 1;
  5640. unsigned TMR0IP : 1;
  5641. unsigned : 1;
  5642. unsigned INTEDG2 : 1;
  5643. unsigned INTEDG1 : 1;
  5644. unsigned INTEDG0 : 1;
  5645. unsigned NOT_RBPU : 1;
  5646. };
  5647. struct
  5648. {
  5649. unsigned : 1;
  5650. unsigned : 1;
  5651. unsigned : 1;
  5652. unsigned : 1;
  5653. unsigned : 1;
  5654. unsigned : 1;
  5655. unsigned : 1;
  5656. unsigned RBPU : 1;
  5657. };
  5658. } __INTCON2bits_t;
  5659. extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
  5660. #define _RBIP 0x01
  5661. #define _TMR0IP 0x04
  5662. #define _INTEDG2 0x10
  5663. #define _INTEDG1 0x20
  5664. #define _INTEDG0 0x40
  5665. #define _NOT_RBPU 0x80
  5666. #define _RBPU 0x80
  5667. //==============================================================================
  5668. //==============================================================================
  5669. // INTCON Bits
  5670. extern __at(0x0FF2) __sfr INTCON;
  5671. typedef union
  5672. {
  5673. struct
  5674. {
  5675. unsigned RBIF : 1;
  5676. unsigned INT0IF : 1;
  5677. unsigned TMR0IF : 1;
  5678. unsigned RBIE : 1;
  5679. unsigned INT0IE : 1;
  5680. unsigned TMR0IE : 1;
  5681. unsigned PEIE_GIEL : 1;
  5682. unsigned GIE_GIEH : 1;
  5683. };
  5684. struct
  5685. {
  5686. unsigned : 1;
  5687. unsigned INT0F : 1;
  5688. unsigned T0IF : 1;
  5689. unsigned : 1;
  5690. unsigned INT0E : 1;
  5691. unsigned T0IE : 1;
  5692. unsigned PEIE : 1;
  5693. unsigned GIE : 1;
  5694. };
  5695. struct
  5696. {
  5697. unsigned : 1;
  5698. unsigned : 1;
  5699. unsigned : 1;
  5700. unsigned : 1;
  5701. unsigned : 1;
  5702. unsigned : 1;
  5703. unsigned GIEL : 1;
  5704. unsigned GIEH : 1;
  5705. };
  5706. } __INTCONbits_t;
  5707. extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
  5708. #define _RBIF 0x01
  5709. #define _INT0IF 0x02
  5710. #define _INT0F 0x02
  5711. #define _TMR0IF 0x04
  5712. #define _T0IF 0x04
  5713. #define _RBIE 0x08
  5714. #define _INT0IE 0x10
  5715. #define _INT0E 0x10
  5716. #define _TMR0IE 0x20
  5717. #define _T0IE 0x20
  5718. #define _PEIE_GIEL 0x40
  5719. #define _PEIE 0x40
  5720. #define _GIEL 0x40
  5721. #define _GIE_GIEH 0x80
  5722. #define _GIE 0x80
  5723. #define _GIEH 0x80
  5724. //==============================================================================
  5725. extern __at(0x0FF3) __sfr PROD;
  5726. extern __at(0x0FF3) __sfr PRODL;
  5727. extern __at(0x0FF4) __sfr PRODH;
  5728. extern __at(0x0FF5) __sfr TABLAT;
  5729. extern __at(0x0FF6) __sfr TBLPTR;
  5730. extern __at(0x0FF6) __sfr TBLPTRL;
  5731. extern __at(0x0FF7) __sfr TBLPTRH;
  5732. extern __at(0x0FF8) __sfr TBLPTRU;
  5733. extern __at(0x0FF9) __sfr PC;
  5734. extern __at(0x0FF9) __sfr PCL;
  5735. extern __at(0x0FFA) __sfr PCLATH;
  5736. extern __at(0x0FFB) __sfr PCLATU;
  5737. //==============================================================================
  5738. // STKPTR Bits
  5739. extern __at(0x0FFC) __sfr STKPTR;
  5740. typedef union
  5741. {
  5742. struct
  5743. {
  5744. unsigned STKPTR0 : 1;
  5745. unsigned STKPTR1 : 1;
  5746. unsigned STKPTR2 : 1;
  5747. unsigned STKPTR3 : 1;
  5748. unsigned STKPTR4 : 1;
  5749. unsigned : 1;
  5750. unsigned STKUNF : 1;
  5751. unsigned STKFUL : 1;
  5752. };
  5753. struct
  5754. {
  5755. unsigned SP0 : 1;
  5756. unsigned SP1 : 1;
  5757. unsigned SP2 : 1;
  5758. unsigned SP3 : 1;
  5759. unsigned SP4 : 1;
  5760. unsigned : 1;
  5761. unsigned : 1;
  5762. unsigned STKOVF : 1;
  5763. };
  5764. struct
  5765. {
  5766. unsigned STKPTR : 5;
  5767. unsigned : 3;
  5768. };
  5769. struct
  5770. {
  5771. unsigned SP : 5;
  5772. unsigned : 3;
  5773. };
  5774. } __STKPTRbits_t;
  5775. extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
  5776. #define _STKPTR0 0x01
  5777. #define _SP0 0x01
  5778. #define _STKPTR1 0x02
  5779. #define _SP1 0x02
  5780. #define _STKPTR2 0x04
  5781. #define _SP2 0x04
  5782. #define _STKPTR3 0x08
  5783. #define _SP3 0x08
  5784. #define _STKPTR4 0x10
  5785. #define _SP4 0x10
  5786. #define _STKUNF 0x40
  5787. #define _STKFUL 0x80
  5788. #define _STKOVF 0x80
  5789. //==============================================================================
  5790. extern __at(0x0FFD) __sfr TOS;
  5791. extern __at(0x0FFD) __sfr TOSL;
  5792. extern __at(0x0FFE) __sfr TOSH;
  5793. extern __at(0x0FFF) __sfr TOSU;
  5794. //==============================================================================
  5795. //
  5796. // Configuration Bits
  5797. //
  5798. //==============================================================================
  5799. #define __CONFIG1H 0x300001
  5800. #define __CONFIG2L 0x300002
  5801. #define __CONFIG2H 0x300003
  5802. #define __CONFIG3H 0x300005
  5803. #define __CONFIG4L 0x300006
  5804. #define __CONFIG5L 0x300008
  5805. #define __CONFIG5H 0x300009
  5806. #define __CONFIG6L 0x30000A
  5807. #define __CONFIG6H 0x30000B
  5808. #define __CONFIG7L 0x30000C
  5809. #define __CONFIG7H 0x30000D
  5810. //----------------------------- CONFIG1H Options -------------------------------
  5811. #define _FOSC_LP_1H 0xF0 // LP oscillator.
  5812. #define _FOSC_XT_1H 0xF1 // XT oscillator.
  5813. #define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz).
  5814. #define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz).
  5815. #define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
  5816. #define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz).
  5817. #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
  5818. #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator.
  5819. #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block.
  5820. #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2.
  5821. #define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
  5822. #define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz).
  5823. #define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
  5824. #define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz).
  5825. #define _PLLCFG_OFF_1H 0xEF // Oscillator used directly.
  5826. #define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4.
  5827. #define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software.
  5828. #define _PRICLKEN_ON_1H 0xFF // Primary clock enabled.
  5829. #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
  5830. #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
  5831. #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
  5832. #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
  5833. //----------------------------- CONFIG2L Options -------------------------------
  5834. #define _PWRTEN_ON_2L 0xFE // Power up timer enabled.
  5835. #define _PWRTEN_OFF_2L 0xFF // Power up timer disabled.
  5836. #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
  5837. #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
  5838. #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
  5839. #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
  5840. #define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal.
  5841. #define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal.
  5842. #define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal.
  5843. #define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal.
  5844. //----------------------------- CONFIG2H Options -------------------------------
  5845. #define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect.
  5846. #define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
  5847. #define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
  5848. #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
  5849. #define _WDTPS_1_2H 0xC3 // 1:1.
  5850. #define _WDTPS_2_2H 0xC7 // 1:2.
  5851. #define _WDTPS_4_2H 0xCB // 1:4.
  5852. #define _WDTPS_8_2H 0xCF // 1:8.
  5853. #define _WDTPS_16_2H 0xD3 // 1:16.
  5854. #define _WDTPS_32_2H 0xD7 // 1:32.
  5855. #define _WDTPS_64_2H 0xDB // 1:64.
  5856. #define _WDTPS_128_2H 0xDF // 1:128.
  5857. #define _WDTPS_256_2H 0xE3 // 1:256.
  5858. #define _WDTPS_512_2H 0xE7 // 1:512.
  5859. #define _WDTPS_1024_2H 0xEB // 1:1024.
  5860. #define _WDTPS_2048_2H 0xEF // 1:2048.
  5861. #define _WDTPS_4096_2H 0xF3 // 1:4096.
  5862. #define _WDTPS_8192_2H 0xF7 // 1:8192.
  5863. #define _WDTPS_16384_2H 0xFB // 1:16384.
  5864. #define _WDTPS_32768_2H 0xFF // 1:32768.
  5865. //----------------------------- CONFIG3H Options -------------------------------
  5866. #define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
  5867. #define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
  5868. #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
  5869. #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
  5870. #define _CCP3MX_PORTC6_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RC6.
  5871. #define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5.
  5872. #define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status.
  5873. #define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status.
  5874. #define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5.
  5875. #define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0.
  5876. #define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0.
  5877. #define _P2BMX_PORTB5_3H 0xFF // P2B is on RB5.
  5878. #define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled.
  5879. #define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled.
  5880. //----------------------------- CONFIG4L Options -------------------------------
  5881. #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
  5882. #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
  5883. #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
  5884. #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
  5885. #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
  5886. #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
  5887. #define _DEBUG_ON_4L 0x7F // Enabled.
  5888. #define _DEBUG_OFF_4L 0xFF // Disabled.
  5889. //----------------------------- CONFIG5L Options -------------------------------
  5890. #define _CP0_ON_5L 0xFE // Block 0 (000800-003FFFh) code-protected.
  5891. #define _CP0_OFF_5L 0xFF // Block 0 (000800-003FFFh) not code-protected.
  5892. #define _CP1_ON_5L 0xFD // Block 1 (004000-007FFFh) code-protected.
  5893. #define _CP1_OFF_5L 0xFF // Block 1 (004000-007FFFh) not code-protected.
  5894. #define _CP2_ON_5L 0xFB // Block 2 (008000-00BFFFh) code-protected.
  5895. #define _CP2_OFF_5L 0xFF // Block 2 (008000-00BFFFh) not code-protected.
  5896. #define _CP3_ON_5L 0xF7 // Block 3 (00C000-00FFFFh) code-protected.
  5897. #define _CP3_OFF_5L 0xFF // Block 3 (00C000-00FFFFh) not code-protected.
  5898. //----------------------------- CONFIG5H Options -------------------------------
  5899. #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) code-protected.
  5900. #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) not code-protected.
  5901. #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
  5902. #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
  5903. //----------------------------- CONFIG6L Options -------------------------------
  5904. #define _WRT0_ON_6L 0xFE // Block 0 (000800-003FFFh) write-protected.
  5905. #define _WRT0_OFF_6L 0xFF // Block 0 (000800-003FFFh) not write-protected.
  5906. #define _WRT1_ON_6L 0xFD // Block 1 (004000-007FFFh) write-protected.
  5907. #define _WRT1_OFF_6L 0xFF // Block 1 (004000-007FFFh) not write-protected.
  5908. #define _WRT2_ON_6L 0xFB // Block 2 (008000-00BFFFh) write-protected.
  5909. #define _WRT2_OFF_6L 0xFF // Block 2 (008000-00BFFFh) not write-protected.
  5910. #define _WRT3_ON_6L 0xF7 // Block 3 (00C000-00FFFFh) write-protected.
  5911. #define _WRT3_OFF_6L 0xFF // Block 3 (00C000-00FFFFh) not write-protected.
  5912. //----------------------------- CONFIG6H Options -------------------------------
  5913. #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
  5914. #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
  5915. #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
  5916. #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
  5917. #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
  5918. #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
  5919. //----------------------------- CONFIG7L Options -------------------------------
  5920. #define _EBTR0_ON_7L 0xFE // Block 0 (000800-003FFFh) protected from table reads executed in other blocks.
  5921. #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-003FFFh) not protected from table reads executed in other blocks.
  5922. #define _EBTR1_ON_7L 0xFD // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
  5923. #define _EBTR1_OFF_7L 0xFF // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
  5924. #define _EBTR2_ON_7L 0xFB // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
  5925. #define _EBTR2_OFF_7L 0xFF // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
  5926. #define _EBTR3_ON_7L 0xF7 // Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks.
  5927. #define _EBTR3_OFF_7L 0xFF // Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks.
  5928. //----------------------------- CONFIG7H Options -------------------------------
  5929. #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
  5930. #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
  5931. //==============================================================================
  5932. #define __DEVID1 0x3FFFFE
  5933. #define __DEVID2 0x3FFFFF
  5934. #define __IDLOC0 0x200000
  5935. #define __IDLOC1 0x200001
  5936. #define __IDLOC2 0x200002
  5937. #define __IDLOC3 0x200003
  5938. #define __IDLOC4 0x200004
  5939. #define __IDLOC5 0x200005
  5940. #define __IDLOC6 0x200006
  5941. #define __IDLOC7 0x200007
  5942. #endif // #ifndef __PIC18F26K22_H__