pic18f25k22.h 195 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139
  1. /*
  2. * This declarations of the PIC18F25K22 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:39 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 __PIC18F25K22_H__
  25. #define __PIC18F25K22_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. // RC1STA Bits
  3675. extern __at(0x0FAB) __sfr RC1STA;
  3676. typedef union
  3677. {
  3678. struct
  3679. {
  3680. unsigned RX9D : 1;
  3681. unsigned OERR : 1;
  3682. unsigned FERR : 1;
  3683. unsigned ADDEN : 1;
  3684. unsigned CREN : 1;
  3685. unsigned SREN : 1;
  3686. unsigned RX9 : 1;
  3687. unsigned SPEN : 1;
  3688. };
  3689. struct
  3690. {
  3691. unsigned RX9D1 : 1;
  3692. unsigned OERR1 : 1;
  3693. unsigned FERR1 : 1;
  3694. unsigned ADEN : 1;
  3695. unsigned CREN1 : 1;
  3696. unsigned SREN1 : 1;
  3697. unsigned RX91 : 1;
  3698. unsigned SPEN1 : 1;
  3699. };
  3700. struct
  3701. {
  3702. unsigned : 1;
  3703. unsigned : 1;
  3704. unsigned : 1;
  3705. unsigned ADDEN1 : 1;
  3706. unsigned : 1;
  3707. unsigned : 1;
  3708. unsigned : 1;
  3709. unsigned : 1;
  3710. };
  3711. } __RC1STAbits_t;
  3712. extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
  3713. #define _RX9D 0x01
  3714. #define _RX9D1 0x01
  3715. #define _OERR 0x02
  3716. #define _OERR1 0x02
  3717. #define _FERR 0x04
  3718. #define _FERR1 0x04
  3719. #define _ADDEN 0x08
  3720. #define _ADEN 0x08
  3721. #define _ADDEN1 0x08
  3722. #define _CREN 0x10
  3723. #define _CREN1 0x10
  3724. #define _SREN 0x20
  3725. #define _SREN1 0x20
  3726. #define _RX9 0x40
  3727. #define _RX91 0x40
  3728. #define _SPEN 0x80
  3729. #define _SPEN1 0x80
  3730. //==============================================================================
  3731. //==============================================================================
  3732. // RCSTA Bits
  3733. extern __at(0x0FAB) __sfr RCSTA;
  3734. typedef union
  3735. {
  3736. struct
  3737. {
  3738. unsigned RX9D : 1;
  3739. unsigned OERR : 1;
  3740. unsigned FERR : 1;
  3741. unsigned ADDEN : 1;
  3742. unsigned CREN : 1;
  3743. unsigned SREN : 1;
  3744. unsigned RX9 : 1;
  3745. unsigned SPEN : 1;
  3746. };
  3747. struct
  3748. {
  3749. unsigned RX9D1 : 1;
  3750. unsigned OERR1 : 1;
  3751. unsigned FERR1 : 1;
  3752. unsigned ADEN : 1;
  3753. unsigned CREN1 : 1;
  3754. unsigned SREN1 : 1;
  3755. unsigned RX91 : 1;
  3756. unsigned SPEN1 : 1;
  3757. };
  3758. struct
  3759. {
  3760. unsigned : 1;
  3761. unsigned : 1;
  3762. unsigned : 1;
  3763. unsigned ADDEN1 : 1;
  3764. unsigned : 1;
  3765. unsigned : 1;
  3766. unsigned : 1;
  3767. unsigned : 1;
  3768. };
  3769. } __RCSTAbits_t;
  3770. extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
  3771. #define _RCSTA_RX9D 0x01
  3772. #define _RCSTA_RX9D1 0x01
  3773. #define _RCSTA_OERR 0x02
  3774. #define _RCSTA_OERR1 0x02
  3775. #define _RCSTA_FERR 0x04
  3776. #define _RCSTA_FERR1 0x04
  3777. #define _RCSTA_ADDEN 0x08
  3778. #define _RCSTA_ADEN 0x08
  3779. #define _RCSTA_ADDEN1 0x08
  3780. #define _RCSTA_CREN 0x10
  3781. #define _RCSTA_CREN1 0x10
  3782. #define _RCSTA_SREN 0x20
  3783. #define _RCSTA_SREN1 0x20
  3784. #define _RCSTA_RX9 0x40
  3785. #define _RCSTA_RX91 0x40
  3786. #define _RCSTA_SPEN 0x80
  3787. #define _RCSTA_SPEN1 0x80
  3788. //==============================================================================
  3789. //==============================================================================
  3790. // RCSTA1 Bits
  3791. extern __at(0x0FAB) __sfr RCSTA1;
  3792. typedef union
  3793. {
  3794. struct
  3795. {
  3796. unsigned RX9D : 1;
  3797. unsigned OERR : 1;
  3798. unsigned FERR : 1;
  3799. unsigned ADDEN : 1;
  3800. unsigned CREN : 1;
  3801. unsigned SREN : 1;
  3802. unsigned RX9 : 1;
  3803. unsigned SPEN : 1;
  3804. };
  3805. struct
  3806. {
  3807. unsigned RX9D1 : 1;
  3808. unsigned OERR1 : 1;
  3809. unsigned FERR1 : 1;
  3810. unsigned ADEN : 1;
  3811. unsigned CREN1 : 1;
  3812. unsigned SREN1 : 1;
  3813. unsigned RX91 : 1;
  3814. unsigned SPEN1 : 1;
  3815. };
  3816. struct
  3817. {
  3818. unsigned : 1;
  3819. unsigned : 1;
  3820. unsigned : 1;
  3821. unsigned ADDEN1 : 1;
  3822. unsigned : 1;
  3823. unsigned : 1;
  3824. unsigned : 1;
  3825. unsigned : 1;
  3826. };
  3827. } __RCSTA1bits_t;
  3828. extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
  3829. #define _RCSTA1_RX9D 0x01
  3830. #define _RCSTA1_RX9D1 0x01
  3831. #define _RCSTA1_OERR 0x02
  3832. #define _RCSTA1_OERR1 0x02
  3833. #define _RCSTA1_FERR 0x04
  3834. #define _RCSTA1_FERR1 0x04
  3835. #define _RCSTA1_ADDEN 0x08
  3836. #define _RCSTA1_ADEN 0x08
  3837. #define _RCSTA1_ADDEN1 0x08
  3838. #define _RCSTA1_CREN 0x10
  3839. #define _RCSTA1_CREN1 0x10
  3840. #define _RCSTA1_SREN 0x20
  3841. #define _RCSTA1_SREN1 0x20
  3842. #define _RCSTA1_RX9 0x40
  3843. #define _RCSTA1_RX91 0x40
  3844. #define _RCSTA1_SPEN 0x80
  3845. #define _RCSTA1_SPEN1 0x80
  3846. //==============================================================================
  3847. //==============================================================================
  3848. // TX1STA Bits
  3849. extern __at(0x0FAC) __sfr TX1STA;
  3850. typedef union
  3851. {
  3852. struct
  3853. {
  3854. unsigned TX9D : 1;
  3855. unsigned TRMT : 1;
  3856. unsigned BRGH : 1;
  3857. unsigned SENDB : 1;
  3858. unsigned SYNC : 1;
  3859. unsigned TXEN : 1;
  3860. unsigned TX9 : 1;
  3861. unsigned CSRC : 1;
  3862. };
  3863. struct
  3864. {
  3865. unsigned TX9D1 : 1;
  3866. unsigned TRMT1 : 1;
  3867. unsigned BRGH1 : 1;
  3868. unsigned SENDB1 : 1;
  3869. unsigned SYNC1 : 1;
  3870. unsigned TXEN1 : 1;
  3871. unsigned TX91 : 1;
  3872. unsigned CSRC1 : 1;
  3873. };
  3874. } __TX1STAbits_t;
  3875. extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
  3876. #define _TX9D 0x01
  3877. #define _TX9D1 0x01
  3878. #define _TRMT 0x02
  3879. #define _TRMT1 0x02
  3880. #define _BRGH 0x04
  3881. #define _BRGH1 0x04
  3882. #define _SENDB 0x08
  3883. #define _SENDB1 0x08
  3884. #define _SYNC 0x10
  3885. #define _SYNC1 0x10
  3886. #define _TXEN 0x20
  3887. #define _TXEN1 0x20
  3888. #define _TX9 0x40
  3889. #define _TX91 0x40
  3890. #define _CSRC 0x80
  3891. #define _CSRC1 0x80
  3892. //==============================================================================
  3893. //==============================================================================
  3894. // TXSTA Bits
  3895. extern __at(0x0FAC) __sfr TXSTA;
  3896. typedef union
  3897. {
  3898. struct
  3899. {
  3900. unsigned TX9D : 1;
  3901. unsigned TRMT : 1;
  3902. unsigned BRGH : 1;
  3903. unsigned SENDB : 1;
  3904. unsigned SYNC : 1;
  3905. unsigned TXEN : 1;
  3906. unsigned TX9 : 1;
  3907. unsigned CSRC : 1;
  3908. };
  3909. struct
  3910. {
  3911. unsigned TX9D1 : 1;
  3912. unsigned TRMT1 : 1;
  3913. unsigned BRGH1 : 1;
  3914. unsigned SENDB1 : 1;
  3915. unsigned SYNC1 : 1;
  3916. unsigned TXEN1 : 1;
  3917. unsigned TX91 : 1;
  3918. unsigned CSRC1 : 1;
  3919. };
  3920. } __TXSTAbits_t;
  3921. extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
  3922. #define _TXSTA_TX9D 0x01
  3923. #define _TXSTA_TX9D1 0x01
  3924. #define _TXSTA_TRMT 0x02
  3925. #define _TXSTA_TRMT1 0x02
  3926. #define _TXSTA_BRGH 0x04
  3927. #define _TXSTA_BRGH1 0x04
  3928. #define _TXSTA_SENDB 0x08
  3929. #define _TXSTA_SENDB1 0x08
  3930. #define _TXSTA_SYNC 0x10
  3931. #define _TXSTA_SYNC1 0x10
  3932. #define _TXSTA_TXEN 0x20
  3933. #define _TXSTA_TXEN1 0x20
  3934. #define _TXSTA_TX9 0x40
  3935. #define _TXSTA_TX91 0x40
  3936. #define _TXSTA_CSRC 0x80
  3937. #define _TXSTA_CSRC1 0x80
  3938. //==============================================================================
  3939. //==============================================================================
  3940. // TXSTA1 Bits
  3941. extern __at(0x0FAC) __sfr TXSTA1;
  3942. typedef union
  3943. {
  3944. struct
  3945. {
  3946. unsigned TX9D : 1;
  3947. unsigned TRMT : 1;
  3948. unsigned BRGH : 1;
  3949. unsigned SENDB : 1;
  3950. unsigned SYNC : 1;
  3951. unsigned TXEN : 1;
  3952. unsigned TX9 : 1;
  3953. unsigned CSRC : 1;
  3954. };
  3955. struct
  3956. {
  3957. unsigned TX9D1 : 1;
  3958. unsigned TRMT1 : 1;
  3959. unsigned BRGH1 : 1;
  3960. unsigned SENDB1 : 1;
  3961. unsigned SYNC1 : 1;
  3962. unsigned TXEN1 : 1;
  3963. unsigned TX91 : 1;
  3964. unsigned CSRC1 : 1;
  3965. };
  3966. } __TXSTA1bits_t;
  3967. extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
  3968. #define _TXSTA1_TX9D 0x01
  3969. #define _TXSTA1_TX9D1 0x01
  3970. #define _TXSTA1_TRMT 0x02
  3971. #define _TXSTA1_TRMT1 0x02
  3972. #define _TXSTA1_BRGH 0x04
  3973. #define _TXSTA1_BRGH1 0x04
  3974. #define _TXSTA1_SENDB 0x08
  3975. #define _TXSTA1_SENDB1 0x08
  3976. #define _TXSTA1_SYNC 0x10
  3977. #define _TXSTA1_SYNC1 0x10
  3978. #define _TXSTA1_TXEN 0x20
  3979. #define _TXSTA1_TXEN1 0x20
  3980. #define _TXSTA1_TX9 0x40
  3981. #define _TXSTA1_TX91 0x40
  3982. #define _TXSTA1_CSRC 0x80
  3983. #define _TXSTA1_CSRC1 0x80
  3984. //==============================================================================
  3985. extern __at(0x0FAD) __sfr TX1REG;
  3986. extern __at(0x0FAD) __sfr TXREG;
  3987. extern __at(0x0FAD) __sfr TXREG1;
  3988. extern __at(0x0FAE) __sfr RC1REG;
  3989. extern __at(0x0FAE) __sfr RCREG;
  3990. extern __at(0x0FAE) __sfr RCREG1;
  3991. extern __at(0x0FAF) __sfr SP1BRG;
  3992. extern __at(0x0FAF) __sfr SPBRG;
  3993. extern __at(0x0FAF) __sfr SPBRG1;
  3994. extern __at(0x0FB0) __sfr SP1BRGH;
  3995. extern __at(0x0FB0) __sfr SPBRGH;
  3996. extern __at(0x0FB0) __sfr SPBRGH1;
  3997. //==============================================================================
  3998. // T3CON Bits
  3999. extern __at(0x0FB1) __sfr T3CON;
  4000. typedef union
  4001. {
  4002. struct
  4003. {
  4004. unsigned TMR3ON : 1;
  4005. unsigned T3RD16 : 1;
  4006. unsigned NOT_T3SYNC : 1;
  4007. unsigned T3SOSCEN : 1;
  4008. unsigned T3CKPS0 : 1;
  4009. unsigned T3CKPS1 : 1;
  4010. unsigned TMR3CS0 : 1;
  4011. unsigned TMR3CS1 : 1;
  4012. };
  4013. struct
  4014. {
  4015. unsigned : 1;
  4016. unsigned : 1;
  4017. unsigned : 1;
  4018. unsigned T3OSCEN : 1;
  4019. unsigned : 1;
  4020. unsigned : 1;
  4021. unsigned : 1;
  4022. unsigned : 1;
  4023. };
  4024. struct
  4025. {
  4026. unsigned : 4;
  4027. unsigned T3CKPS : 2;
  4028. unsigned : 2;
  4029. };
  4030. struct
  4031. {
  4032. unsigned : 6;
  4033. unsigned TMR3CS : 2;
  4034. };
  4035. } __T3CONbits_t;
  4036. extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
  4037. #define _TMR3ON 0x01
  4038. #define _T3RD16 0x02
  4039. #define _NOT_T3SYNC 0x04
  4040. #define _T3SOSCEN 0x08
  4041. #define _T3OSCEN 0x08
  4042. #define _T3CKPS0 0x10
  4043. #define _T3CKPS1 0x20
  4044. #define _TMR3CS0 0x40
  4045. #define _TMR3CS1 0x80
  4046. //==============================================================================
  4047. extern __at(0x0FB2) __sfr TMR3;
  4048. extern __at(0x0FB2) __sfr TMR3L;
  4049. extern __at(0x0FB3) __sfr TMR3H;
  4050. //==============================================================================
  4051. // T3GCON Bits
  4052. extern __at(0x0FB4) __sfr T3GCON;
  4053. typedef union
  4054. {
  4055. struct
  4056. {
  4057. unsigned T3GSS0 : 1;
  4058. unsigned T3GSS1 : 1;
  4059. unsigned T3GVAL : 1;
  4060. unsigned T3GGO_NOT_DONE : 1;
  4061. unsigned T3GSPM : 1;
  4062. unsigned T3GTM : 1;
  4063. unsigned T3GPOL : 1;
  4064. unsigned TMR3GE : 1;
  4065. };
  4066. struct
  4067. {
  4068. unsigned : 1;
  4069. unsigned : 1;
  4070. unsigned : 1;
  4071. unsigned T3G_DONE : 1;
  4072. unsigned : 1;
  4073. unsigned : 1;
  4074. unsigned : 1;
  4075. unsigned : 1;
  4076. };
  4077. struct
  4078. {
  4079. unsigned : 1;
  4080. unsigned : 1;
  4081. unsigned : 1;
  4082. unsigned T3GGO : 1;
  4083. unsigned : 1;
  4084. unsigned : 1;
  4085. unsigned : 1;
  4086. unsigned : 1;
  4087. };
  4088. struct
  4089. {
  4090. unsigned T3GSS : 2;
  4091. unsigned : 6;
  4092. };
  4093. } __T3GCONbits_t;
  4094. extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
  4095. #define _T3GSS0 0x01
  4096. #define _T3GSS1 0x02
  4097. #define _T3GVAL 0x04
  4098. #define _T3GGO_NOT_DONE 0x08
  4099. #define _T3G_DONE 0x08
  4100. #define _T3GGO 0x08
  4101. #define _T3GSPM 0x10
  4102. #define _T3GTM 0x20
  4103. #define _T3GPOL 0x40
  4104. #define _TMR3GE 0x80
  4105. //==============================================================================
  4106. //==============================================================================
  4107. // ECCP1AS Bits
  4108. extern __at(0x0FB6) __sfr ECCP1AS;
  4109. typedef union
  4110. {
  4111. struct
  4112. {
  4113. unsigned P1SSBD0 : 1;
  4114. unsigned P1SSBD1 : 1;
  4115. unsigned P1SSAC0 : 1;
  4116. unsigned P1SSAC1 : 1;
  4117. unsigned CCP1AS0 : 1;
  4118. unsigned CCP1AS1 : 1;
  4119. unsigned CCP1AS2 : 1;
  4120. unsigned CCP1ASE : 1;
  4121. };
  4122. struct
  4123. {
  4124. unsigned PSS1BD0 : 1;
  4125. unsigned PSS1BD1 : 1;
  4126. unsigned PSS1AC0 : 1;
  4127. unsigned PSS1AC1 : 1;
  4128. unsigned ECCPAS0 : 1;
  4129. unsigned ECCPAS1 : 1;
  4130. unsigned ECCPAS2 : 1;
  4131. unsigned ECCPASE : 1;
  4132. };
  4133. struct
  4134. {
  4135. unsigned PSSBD0 : 1;
  4136. unsigned PSSBD1 : 1;
  4137. unsigned PSSAC0 : 1;
  4138. unsigned PSSAC1 : 1;
  4139. unsigned : 1;
  4140. unsigned : 1;
  4141. unsigned : 1;
  4142. unsigned : 1;
  4143. };
  4144. struct
  4145. {
  4146. unsigned PSSBD : 2;
  4147. unsigned : 6;
  4148. };
  4149. struct
  4150. {
  4151. unsigned P1SSBD : 2;
  4152. unsigned : 6;
  4153. };
  4154. struct
  4155. {
  4156. unsigned PSS1BD : 2;
  4157. unsigned : 6;
  4158. };
  4159. struct
  4160. {
  4161. unsigned : 2;
  4162. unsigned PSS1AC : 2;
  4163. unsigned : 4;
  4164. };
  4165. struct
  4166. {
  4167. unsigned : 2;
  4168. unsigned P1SSAC : 2;
  4169. unsigned : 4;
  4170. };
  4171. struct
  4172. {
  4173. unsigned : 2;
  4174. unsigned PSSAC : 2;
  4175. unsigned : 4;
  4176. };
  4177. struct
  4178. {
  4179. unsigned : 4;
  4180. unsigned CCP1AS : 3;
  4181. unsigned : 1;
  4182. };
  4183. struct
  4184. {
  4185. unsigned : 4;
  4186. unsigned ECCPAS : 3;
  4187. unsigned : 1;
  4188. };
  4189. } __ECCP1ASbits_t;
  4190. extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
  4191. #define _P1SSBD0 0x01
  4192. #define _PSS1BD0 0x01
  4193. #define _PSSBD0 0x01
  4194. #define _P1SSBD1 0x02
  4195. #define _PSS1BD1 0x02
  4196. #define _PSSBD1 0x02
  4197. #define _P1SSAC0 0x04
  4198. #define _PSS1AC0 0x04
  4199. #define _PSSAC0 0x04
  4200. #define _P1SSAC1 0x08
  4201. #define _PSS1AC1 0x08
  4202. #define _PSSAC1 0x08
  4203. #define _CCP1AS0 0x10
  4204. #define _ECCPAS0 0x10
  4205. #define _CCP1AS1 0x20
  4206. #define _ECCPAS1 0x20
  4207. #define _CCP1AS2 0x40
  4208. #define _ECCPAS2 0x40
  4209. #define _CCP1ASE 0x80
  4210. #define _ECCPASE 0x80
  4211. //==============================================================================
  4212. //==============================================================================
  4213. // ECCPAS Bits
  4214. extern __at(0x0FB6) __sfr ECCPAS;
  4215. typedef union
  4216. {
  4217. struct
  4218. {
  4219. unsigned P1SSBD0 : 1;
  4220. unsigned P1SSBD1 : 1;
  4221. unsigned P1SSAC0 : 1;
  4222. unsigned P1SSAC1 : 1;
  4223. unsigned CCP1AS0 : 1;
  4224. unsigned CCP1AS1 : 1;
  4225. unsigned CCP1AS2 : 1;
  4226. unsigned CCP1ASE : 1;
  4227. };
  4228. struct
  4229. {
  4230. unsigned PSS1BD0 : 1;
  4231. unsigned PSS1BD1 : 1;
  4232. unsigned PSS1AC0 : 1;
  4233. unsigned PSS1AC1 : 1;
  4234. unsigned ECCPAS0 : 1;
  4235. unsigned ECCPAS1 : 1;
  4236. unsigned ECCPAS2 : 1;
  4237. unsigned ECCPASE : 1;
  4238. };
  4239. struct
  4240. {
  4241. unsigned PSSBD0 : 1;
  4242. unsigned PSSBD1 : 1;
  4243. unsigned PSSAC0 : 1;
  4244. unsigned PSSAC1 : 1;
  4245. unsigned : 1;
  4246. unsigned : 1;
  4247. unsigned : 1;
  4248. unsigned : 1;
  4249. };
  4250. struct
  4251. {
  4252. unsigned PSSBD : 2;
  4253. unsigned : 6;
  4254. };
  4255. struct
  4256. {
  4257. unsigned P1SSBD : 2;
  4258. unsigned : 6;
  4259. };
  4260. struct
  4261. {
  4262. unsigned PSS1BD : 2;
  4263. unsigned : 6;
  4264. };
  4265. struct
  4266. {
  4267. unsigned : 2;
  4268. unsigned PSS1AC : 2;
  4269. unsigned : 4;
  4270. };
  4271. struct
  4272. {
  4273. unsigned : 2;
  4274. unsigned P1SSAC : 2;
  4275. unsigned : 4;
  4276. };
  4277. struct
  4278. {
  4279. unsigned : 2;
  4280. unsigned PSSAC : 2;
  4281. unsigned : 4;
  4282. };
  4283. struct
  4284. {
  4285. unsigned : 4;
  4286. unsigned CCP1AS : 3;
  4287. unsigned : 1;
  4288. };
  4289. struct
  4290. {
  4291. unsigned : 4;
  4292. unsigned ECCPAS : 3;
  4293. unsigned : 1;
  4294. };
  4295. } __ECCPASbits_t;
  4296. extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
  4297. #define _ECCPAS_P1SSBD0 0x01
  4298. #define _ECCPAS_PSS1BD0 0x01
  4299. #define _ECCPAS_PSSBD0 0x01
  4300. #define _ECCPAS_P1SSBD1 0x02
  4301. #define _ECCPAS_PSS1BD1 0x02
  4302. #define _ECCPAS_PSSBD1 0x02
  4303. #define _ECCPAS_P1SSAC0 0x04
  4304. #define _ECCPAS_PSS1AC0 0x04
  4305. #define _ECCPAS_PSSAC0 0x04
  4306. #define _ECCPAS_P1SSAC1 0x08
  4307. #define _ECCPAS_PSS1AC1 0x08
  4308. #define _ECCPAS_PSSAC1 0x08
  4309. #define _ECCPAS_CCP1AS0 0x10
  4310. #define _ECCPAS_ECCPAS0 0x10
  4311. #define _ECCPAS_CCP1AS1 0x20
  4312. #define _ECCPAS_ECCPAS1 0x20
  4313. #define _ECCPAS_CCP1AS2 0x40
  4314. #define _ECCPAS_ECCPAS2 0x40
  4315. #define _ECCPAS_CCP1ASE 0x80
  4316. #define _ECCPAS_ECCPASE 0x80
  4317. //==============================================================================
  4318. //==============================================================================
  4319. // PWM1CON Bits
  4320. extern __at(0x0FB7) __sfr PWM1CON;
  4321. typedef union
  4322. {
  4323. struct
  4324. {
  4325. unsigned P1DC0 : 1;
  4326. unsigned P1DC1 : 1;
  4327. unsigned P1DC2 : 1;
  4328. unsigned P1DC3 : 1;
  4329. unsigned P1DC4 : 1;
  4330. unsigned P1DC5 : 1;
  4331. unsigned P1DC6 : 1;
  4332. unsigned P1RSEN : 1;
  4333. };
  4334. struct
  4335. {
  4336. unsigned PDC0 : 1;
  4337. unsigned PDC1 : 1;
  4338. unsigned PDC2 : 1;
  4339. unsigned PDC3 : 1;
  4340. unsigned PDC4 : 1;
  4341. unsigned PDC5 : 1;
  4342. unsigned PDC6 : 1;
  4343. unsigned PRSEN : 1;
  4344. };
  4345. struct
  4346. {
  4347. unsigned P1DC : 7;
  4348. unsigned : 1;
  4349. };
  4350. struct
  4351. {
  4352. unsigned PDC : 7;
  4353. unsigned : 1;
  4354. };
  4355. } __PWM1CONbits_t;
  4356. extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
  4357. #define _P1DC0 0x01
  4358. #define _PDC0 0x01
  4359. #define _P1DC1 0x02
  4360. #define _PDC1 0x02
  4361. #define _P1DC2 0x04
  4362. #define _PDC2 0x04
  4363. #define _P1DC3 0x08
  4364. #define _PDC3 0x08
  4365. #define _P1DC4 0x10
  4366. #define _PDC4 0x10
  4367. #define _P1DC5 0x20
  4368. #define _PDC5 0x20
  4369. #define _P1DC6 0x40
  4370. #define _PDC6 0x40
  4371. #define _P1RSEN 0x80
  4372. #define _PRSEN 0x80
  4373. //==============================================================================
  4374. //==============================================================================
  4375. // PWMCON Bits
  4376. extern __at(0x0FB7) __sfr PWMCON;
  4377. typedef union
  4378. {
  4379. struct
  4380. {
  4381. unsigned P1DC0 : 1;
  4382. unsigned P1DC1 : 1;
  4383. unsigned P1DC2 : 1;
  4384. unsigned P1DC3 : 1;
  4385. unsigned P1DC4 : 1;
  4386. unsigned P1DC5 : 1;
  4387. unsigned P1DC6 : 1;
  4388. unsigned P1RSEN : 1;
  4389. };
  4390. struct
  4391. {
  4392. unsigned PDC0 : 1;
  4393. unsigned PDC1 : 1;
  4394. unsigned PDC2 : 1;
  4395. unsigned PDC3 : 1;
  4396. unsigned PDC4 : 1;
  4397. unsigned PDC5 : 1;
  4398. unsigned PDC6 : 1;
  4399. unsigned PRSEN : 1;
  4400. };
  4401. struct
  4402. {
  4403. unsigned P1DC : 7;
  4404. unsigned : 1;
  4405. };
  4406. struct
  4407. {
  4408. unsigned PDC : 7;
  4409. unsigned : 1;
  4410. };
  4411. } __PWMCONbits_t;
  4412. extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
  4413. #define _PWMCON_P1DC0 0x01
  4414. #define _PWMCON_PDC0 0x01
  4415. #define _PWMCON_P1DC1 0x02
  4416. #define _PWMCON_PDC1 0x02
  4417. #define _PWMCON_P1DC2 0x04
  4418. #define _PWMCON_PDC2 0x04
  4419. #define _PWMCON_P1DC3 0x08
  4420. #define _PWMCON_PDC3 0x08
  4421. #define _PWMCON_P1DC4 0x10
  4422. #define _PWMCON_PDC4 0x10
  4423. #define _PWMCON_P1DC5 0x20
  4424. #define _PWMCON_PDC5 0x20
  4425. #define _PWMCON_P1DC6 0x40
  4426. #define _PWMCON_PDC6 0x40
  4427. #define _PWMCON_P1RSEN 0x80
  4428. #define _PWMCON_PRSEN 0x80
  4429. //==============================================================================
  4430. //==============================================================================
  4431. // BAUD1CON Bits
  4432. extern __at(0x0FB8) __sfr BAUD1CON;
  4433. typedef union
  4434. {
  4435. struct
  4436. {
  4437. unsigned ABDEN : 1;
  4438. unsigned WUE : 1;
  4439. unsigned : 1;
  4440. unsigned BRG16 : 1;
  4441. unsigned CKTXP : 1;
  4442. unsigned DTRXP : 1;
  4443. unsigned RCIDL : 1;
  4444. unsigned ABDOVF : 1;
  4445. };
  4446. struct
  4447. {
  4448. unsigned : 1;
  4449. unsigned : 1;
  4450. unsigned : 1;
  4451. unsigned : 1;
  4452. unsigned SCKP : 1;
  4453. unsigned : 1;
  4454. unsigned : 1;
  4455. unsigned : 1;
  4456. };
  4457. } __BAUD1CONbits_t;
  4458. extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
  4459. #define _ABDEN 0x01
  4460. #define _WUE 0x02
  4461. #define _BRG16 0x08
  4462. #define _CKTXP 0x10
  4463. #define _SCKP 0x10
  4464. #define _DTRXP 0x20
  4465. #define _RCIDL 0x40
  4466. #define _ABDOVF 0x80
  4467. //==============================================================================
  4468. //==============================================================================
  4469. // BAUDCON Bits
  4470. extern __at(0x0FB8) __sfr BAUDCON;
  4471. typedef union
  4472. {
  4473. struct
  4474. {
  4475. unsigned ABDEN : 1;
  4476. unsigned WUE : 1;
  4477. unsigned : 1;
  4478. unsigned BRG16 : 1;
  4479. unsigned CKTXP : 1;
  4480. unsigned DTRXP : 1;
  4481. unsigned RCIDL : 1;
  4482. unsigned ABDOVF : 1;
  4483. };
  4484. struct
  4485. {
  4486. unsigned : 1;
  4487. unsigned : 1;
  4488. unsigned : 1;
  4489. unsigned : 1;
  4490. unsigned SCKP : 1;
  4491. unsigned : 1;
  4492. unsigned : 1;
  4493. unsigned : 1;
  4494. };
  4495. } __BAUDCONbits_t;
  4496. extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
  4497. #define _BAUDCON_ABDEN 0x01
  4498. #define _BAUDCON_WUE 0x02
  4499. #define _BAUDCON_BRG16 0x08
  4500. #define _BAUDCON_CKTXP 0x10
  4501. #define _BAUDCON_SCKP 0x10
  4502. #define _BAUDCON_DTRXP 0x20
  4503. #define _BAUDCON_RCIDL 0x40
  4504. #define _BAUDCON_ABDOVF 0x80
  4505. //==============================================================================
  4506. //==============================================================================
  4507. // BAUDCON1 Bits
  4508. extern __at(0x0FB8) __sfr BAUDCON1;
  4509. typedef union
  4510. {
  4511. struct
  4512. {
  4513. unsigned ABDEN : 1;
  4514. unsigned WUE : 1;
  4515. unsigned : 1;
  4516. unsigned BRG16 : 1;
  4517. unsigned CKTXP : 1;
  4518. unsigned DTRXP : 1;
  4519. unsigned RCIDL : 1;
  4520. unsigned ABDOVF : 1;
  4521. };
  4522. struct
  4523. {
  4524. unsigned : 1;
  4525. unsigned : 1;
  4526. unsigned : 1;
  4527. unsigned : 1;
  4528. unsigned SCKP : 1;
  4529. unsigned : 1;
  4530. unsigned : 1;
  4531. unsigned : 1;
  4532. };
  4533. } __BAUDCON1bits_t;
  4534. extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
  4535. #define _BAUDCON1_ABDEN 0x01
  4536. #define _BAUDCON1_WUE 0x02
  4537. #define _BAUDCON1_BRG16 0x08
  4538. #define _BAUDCON1_CKTXP 0x10
  4539. #define _BAUDCON1_SCKP 0x10
  4540. #define _BAUDCON1_DTRXP 0x20
  4541. #define _BAUDCON1_RCIDL 0x40
  4542. #define _BAUDCON1_ABDOVF 0x80
  4543. //==============================================================================
  4544. //==============================================================================
  4545. // BAUDCTL Bits
  4546. extern __at(0x0FB8) __sfr BAUDCTL;
  4547. typedef union
  4548. {
  4549. struct
  4550. {
  4551. unsigned ABDEN : 1;
  4552. unsigned WUE : 1;
  4553. unsigned : 1;
  4554. unsigned BRG16 : 1;
  4555. unsigned CKTXP : 1;
  4556. unsigned DTRXP : 1;
  4557. unsigned RCIDL : 1;
  4558. unsigned ABDOVF : 1;
  4559. };
  4560. struct
  4561. {
  4562. unsigned : 1;
  4563. unsigned : 1;
  4564. unsigned : 1;
  4565. unsigned : 1;
  4566. unsigned SCKP : 1;
  4567. unsigned : 1;
  4568. unsigned : 1;
  4569. unsigned : 1;
  4570. };
  4571. } __BAUDCTLbits_t;
  4572. extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
  4573. #define _BAUDCTL_ABDEN 0x01
  4574. #define _BAUDCTL_WUE 0x02
  4575. #define _BAUDCTL_BRG16 0x08
  4576. #define _BAUDCTL_CKTXP 0x10
  4577. #define _BAUDCTL_SCKP 0x10
  4578. #define _BAUDCTL_DTRXP 0x20
  4579. #define _BAUDCTL_RCIDL 0x40
  4580. #define _BAUDCTL_ABDOVF 0x80
  4581. //==============================================================================
  4582. //==============================================================================
  4583. // PSTR1CON Bits
  4584. extern __at(0x0FB9) __sfr PSTR1CON;
  4585. typedef struct
  4586. {
  4587. unsigned STR1A : 1;
  4588. unsigned STR1B : 1;
  4589. unsigned STR1C : 1;
  4590. unsigned STR1D : 1;
  4591. unsigned STR1SYNC : 1;
  4592. unsigned : 1;
  4593. unsigned : 1;
  4594. unsigned : 1;
  4595. } __PSTR1CONbits_t;
  4596. extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
  4597. #define _STR1A 0x01
  4598. #define _STR1B 0x02
  4599. #define _STR1C 0x04
  4600. #define _STR1D 0x08
  4601. #define _STR1SYNC 0x10
  4602. //==============================================================================
  4603. //==============================================================================
  4604. // PSTRCON Bits
  4605. extern __at(0x0FB9) __sfr PSTRCON;
  4606. typedef struct
  4607. {
  4608. unsigned STR1A : 1;
  4609. unsigned STR1B : 1;
  4610. unsigned STR1C : 1;
  4611. unsigned STR1D : 1;
  4612. unsigned STR1SYNC : 1;
  4613. unsigned : 1;
  4614. unsigned : 1;
  4615. unsigned : 1;
  4616. } __PSTRCONbits_t;
  4617. extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
  4618. #define _PSTRCON_STR1A 0x01
  4619. #define _PSTRCON_STR1B 0x02
  4620. #define _PSTRCON_STR1C 0x04
  4621. #define _PSTRCON_STR1D 0x08
  4622. #define _PSTRCON_STR1SYNC 0x10
  4623. //==============================================================================
  4624. //==============================================================================
  4625. // T2CON Bits
  4626. extern __at(0x0FBA) __sfr T2CON;
  4627. typedef union
  4628. {
  4629. struct
  4630. {
  4631. unsigned T2CKPS0 : 1;
  4632. unsigned T2CKPS1 : 1;
  4633. unsigned TMR2ON : 1;
  4634. unsigned T2OUTPS0 : 1;
  4635. unsigned T2OUTPS1 : 1;
  4636. unsigned T2OUTPS2 : 1;
  4637. unsigned T2OUTPS3 : 1;
  4638. unsigned : 1;
  4639. };
  4640. struct
  4641. {
  4642. unsigned T2CKPS : 2;
  4643. unsigned : 6;
  4644. };
  4645. struct
  4646. {
  4647. unsigned : 3;
  4648. unsigned T2OUTPS : 4;
  4649. unsigned : 1;
  4650. };
  4651. } __T2CONbits_t;
  4652. extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
  4653. #define _T2CKPS0 0x01
  4654. #define _T2CKPS1 0x02
  4655. #define _TMR2ON 0x04
  4656. #define _T2OUTPS0 0x08
  4657. #define _T2OUTPS1 0x10
  4658. #define _T2OUTPS2 0x20
  4659. #define _T2OUTPS3 0x40
  4660. //==============================================================================
  4661. extern __at(0x0FBB) __sfr PR2;
  4662. extern __at(0x0FBC) __sfr TMR2;
  4663. //==============================================================================
  4664. // CCP1CON Bits
  4665. extern __at(0x0FBD) __sfr CCP1CON;
  4666. typedef union
  4667. {
  4668. struct
  4669. {
  4670. unsigned CCP1M0 : 1;
  4671. unsigned CCP1M1 : 1;
  4672. unsigned CCP1M2 : 1;
  4673. unsigned CCP1M3 : 1;
  4674. unsigned DC1B0 : 1;
  4675. unsigned DC1B1 : 1;
  4676. unsigned P1M0 : 1;
  4677. unsigned P1M1 : 1;
  4678. };
  4679. struct
  4680. {
  4681. unsigned CCP1M : 4;
  4682. unsigned : 4;
  4683. };
  4684. struct
  4685. {
  4686. unsigned : 4;
  4687. unsigned DC1B : 2;
  4688. unsigned : 2;
  4689. };
  4690. struct
  4691. {
  4692. unsigned : 6;
  4693. unsigned P1M : 2;
  4694. };
  4695. } __CCP1CONbits_t;
  4696. extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
  4697. #define _CCP1M0 0x01
  4698. #define _CCP1M1 0x02
  4699. #define _CCP1M2 0x04
  4700. #define _CCP1M3 0x08
  4701. #define _DC1B0 0x10
  4702. #define _DC1B1 0x20
  4703. #define _P1M0 0x40
  4704. #define _P1M1 0x80
  4705. //==============================================================================
  4706. extern __at(0x0FBE) __sfr CCPR1;
  4707. extern __at(0x0FBE) __sfr CCPR1L;
  4708. extern __at(0x0FBF) __sfr CCPR1H;
  4709. //==============================================================================
  4710. // ADCON2 Bits
  4711. extern __at(0x0FC0) __sfr ADCON2;
  4712. typedef union
  4713. {
  4714. struct
  4715. {
  4716. unsigned ADCS0 : 1;
  4717. unsigned ADCS1 : 1;
  4718. unsigned ADCS2 : 1;
  4719. unsigned ACQT0 : 1;
  4720. unsigned ACQT1 : 1;
  4721. unsigned ACQT2 : 1;
  4722. unsigned : 1;
  4723. unsigned ADFM : 1;
  4724. };
  4725. struct
  4726. {
  4727. unsigned ADCS : 3;
  4728. unsigned : 5;
  4729. };
  4730. struct
  4731. {
  4732. unsigned : 3;
  4733. unsigned ACQT : 3;
  4734. unsigned : 2;
  4735. };
  4736. } __ADCON2bits_t;
  4737. extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
  4738. #define _ADCS0 0x01
  4739. #define _ADCS1 0x02
  4740. #define _ADCS2 0x04
  4741. #define _ACQT0 0x08
  4742. #define _ACQT1 0x10
  4743. #define _ACQT2 0x20
  4744. #define _ADFM 0x80
  4745. //==============================================================================
  4746. //==============================================================================
  4747. // ADCON1 Bits
  4748. extern __at(0x0FC1) __sfr ADCON1;
  4749. typedef union
  4750. {
  4751. struct
  4752. {
  4753. unsigned NVCFG0 : 1;
  4754. unsigned NVCFG1 : 1;
  4755. unsigned PVCFG0 : 1;
  4756. unsigned PVCFG1 : 1;
  4757. unsigned : 1;
  4758. unsigned : 1;
  4759. unsigned : 1;
  4760. unsigned TRIGSEL : 1;
  4761. };
  4762. struct
  4763. {
  4764. unsigned NVCFG : 2;
  4765. unsigned : 6;
  4766. };
  4767. struct
  4768. {
  4769. unsigned : 2;
  4770. unsigned PVCFG : 2;
  4771. unsigned : 4;
  4772. };
  4773. } __ADCON1bits_t;
  4774. extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
  4775. #define _NVCFG0 0x01
  4776. #define _NVCFG1 0x02
  4777. #define _PVCFG0 0x04
  4778. #define _PVCFG1 0x08
  4779. #define _TRIGSEL 0x80
  4780. //==============================================================================
  4781. //==============================================================================
  4782. // ADCON0 Bits
  4783. extern __at(0x0FC2) __sfr ADCON0;
  4784. typedef union
  4785. {
  4786. struct
  4787. {
  4788. unsigned ADON : 1;
  4789. unsigned GO_NOT_DONE : 1;
  4790. unsigned CHS0 : 1;
  4791. unsigned CHS1 : 1;
  4792. unsigned CHS2 : 1;
  4793. unsigned CHS3 : 1;
  4794. unsigned CHS4 : 1;
  4795. unsigned : 1;
  4796. };
  4797. struct
  4798. {
  4799. unsigned : 1;
  4800. unsigned GO : 1;
  4801. unsigned : 1;
  4802. unsigned : 1;
  4803. unsigned : 1;
  4804. unsigned : 1;
  4805. unsigned : 1;
  4806. unsigned : 1;
  4807. };
  4808. struct
  4809. {
  4810. unsigned : 1;
  4811. unsigned DONE : 1;
  4812. unsigned : 1;
  4813. unsigned : 1;
  4814. unsigned : 1;
  4815. unsigned : 1;
  4816. unsigned : 1;
  4817. unsigned : 1;
  4818. };
  4819. struct
  4820. {
  4821. unsigned : 1;
  4822. unsigned NOT_DONE : 1;
  4823. unsigned : 1;
  4824. unsigned : 1;
  4825. unsigned : 1;
  4826. unsigned : 1;
  4827. unsigned : 1;
  4828. unsigned : 1;
  4829. };
  4830. struct
  4831. {
  4832. unsigned : 1;
  4833. unsigned GO_DONE : 1;
  4834. unsigned : 1;
  4835. unsigned : 1;
  4836. unsigned : 1;
  4837. unsigned : 1;
  4838. unsigned : 1;
  4839. unsigned : 1;
  4840. };
  4841. struct
  4842. {
  4843. unsigned : 2;
  4844. unsigned CHS : 5;
  4845. unsigned : 1;
  4846. };
  4847. } __ADCON0bits_t;
  4848. extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
  4849. #define _ADON 0x01
  4850. #define _GO_NOT_DONE 0x02
  4851. #define _GO 0x02
  4852. #define _DONE 0x02
  4853. #define _NOT_DONE 0x02
  4854. #define _GO_DONE 0x02
  4855. #define _CHS0 0x04
  4856. #define _CHS1 0x08
  4857. #define _CHS2 0x10
  4858. #define _CHS3 0x20
  4859. #define _CHS4 0x40
  4860. //==============================================================================
  4861. extern __at(0x0FC3) __sfr ADRES;
  4862. extern __at(0x0FC3) __sfr ADRESL;
  4863. extern __at(0x0FC4) __sfr ADRESH;
  4864. //==============================================================================
  4865. // SSP1CON2 Bits
  4866. extern __at(0x0FC5) __sfr SSP1CON2;
  4867. typedef struct
  4868. {
  4869. unsigned SEN : 1;
  4870. unsigned RSEN : 1;
  4871. unsigned PEN : 1;
  4872. unsigned RCEN : 1;
  4873. unsigned ACKEN : 1;
  4874. unsigned ACKDT : 1;
  4875. unsigned ACKSTAT : 1;
  4876. unsigned GCEN : 1;
  4877. } __SSP1CON2bits_t;
  4878. extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
  4879. #define _SEN 0x01
  4880. #define _RSEN 0x02
  4881. #define _PEN 0x04
  4882. #define _RCEN 0x08
  4883. #define _ACKEN 0x10
  4884. #define _ACKDT 0x20
  4885. #define _ACKSTAT 0x40
  4886. #define _GCEN 0x80
  4887. //==============================================================================
  4888. //==============================================================================
  4889. // SSPCON2 Bits
  4890. extern __at(0x0FC5) __sfr SSPCON2;
  4891. typedef struct
  4892. {
  4893. unsigned SEN : 1;
  4894. unsigned RSEN : 1;
  4895. unsigned PEN : 1;
  4896. unsigned RCEN : 1;
  4897. unsigned ACKEN : 1;
  4898. unsigned ACKDT : 1;
  4899. unsigned ACKSTAT : 1;
  4900. unsigned GCEN : 1;
  4901. } __SSPCON2bits_t;
  4902. extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
  4903. #define _SSPCON2_SEN 0x01
  4904. #define _SSPCON2_RSEN 0x02
  4905. #define _SSPCON2_PEN 0x04
  4906. #define _SSPCON2_RCEN 0x08
  4907. #define _SSPCON2_ACKEN 0x10
  4908. #define _SSPCON2_ACKDT 0x20
  4909. #define _SSPCON2_ACKSTAT 0x40
  4910. #define _SSPCON2_GCEN 0x80
  4911. //==============================================================================
  4912. //==============================================================================
  4913. // SSP1CON1 Bits
  4914. extern __at(0x0FC6) __sfr SSP1CON1;
  4915. typedef union
  4916. {
  4917. struct
  4918. {
  4919. unsigned SSPM0 : 1;
  4920. unsigned SSPM1 : 1;
  4921. unsigned SSPM2 : 1;
  4922. unsigned SSPM3 : 1;
  4923. unsigned CKP : 1;
  4924. unsigned SSPEN : 1;
  4925. unsigned SSPOV : 1;
  4926. unsigned WCOL : 1;
  4927. };
  4928. struct
  4929. {
  4930. unsigned SSPM : 4;
  4931. unsigned : 4;
  4932. };
  4933. } __SSP1CON1bits_t;
  4934. extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
  4935. #define _SSPM0 0x01
  4936. #define _SSPM1 0x02
  4937. #define _SSPM2 0x04
  4938. #define _SSPM3 0x08
  4939. #define _CKP 0x10
  4940. #define _SSPEN 0x20
  4941. #define _SSPOV 0x40
  4942. #define _WCOL 0x80
  4943. //==============================================================================
  4944. //==============================================================================
  4945. // SSPCON1 Bits
  4946. extern __at(0x0FC6) __sfr SSPCON1;
  4947. typedef union
  4948. {
  4949. struct
  4950. {
  4951. unsigned SSPM0 : 1;
  4952. unsigned SSPM1 : 1;
  4953. unsigned SSPM2 : 1;
  4954. unsigned SSPM3 : 1;
  4955. unsigned CKP : 1;
  4956. unsigned SSPEN : 1;
  4957. unsigned SSPOV : 1;
  4958. unsigned WCOL : 1;
  4959. };
  4960. struct
  4961. {
  4962. unsigned SSPM : 4;
  4963. unsigned : 4;
  4964. };
  4965. } __SSPCON1bits_t;
  4966. extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
  4967. #define _SSPCON1_SSPM0 0x01
  4968. #define _SSPCON1_SSPM1 0x02
  4969. #define _SSPCON1_SSPM2 0x04
  4970. #define _SSPCON1_SSPM3 0x08
  4971. #define _SSPCON1_CKP 0x10
  4972. #define _SSPCON1_SSPEN 0x20
  4973. #define _SSPCON1_SSPOV 0x40
  4974. #define _SSPCON1_WCOL 0x80
  4975. //==============================================================================
  4976. //==============================================================================
  4977. // SSP1STAT Bits
  4978. extern __at(0x0FC7) __sfr SSP1STAT;
  4979. typedef union
  4980. {
  4981. struct
  4982. {
  4983. unsigned BF : 1;
  4984. unsigned UA : 1;
  4985. unsigned R_NOT_W : 1;
  4986. unsigned S : 1;
  4987. unsigned P : 1;
  4988. unsigned D_NOT_A : 1;
  4989. unsigned CKE : 1;
  4990. unsigned SMP : 1;
  4991. };
  4992. struct
  4993. {
  4994. unsigned : 1;
  4995. unsigned : 1;
  4996. unsigned R : 1;
  4997. unsigned : 1;
  4998. unsigned : 1;
  4999. unsigned D : 1;
  5000. unsigned : 1;
  5001. unsigned : 1;
  5002. };
  5003. struct
  5004. {
  5005. unsigned : 1;
  5006. unsigned : 1;
  5007. unsigned NOT_W : 1;
  5008. unsigned : 1;
  5009. unsigned : 1;
  5010. unsigned NOT_A : 1;
  5011. unsigned : 1;
  5012. unsigned : 1;
  5013. };
  5014. struct
  5015. {
  5016. unsigned : 1;
  5017. unsigned : 1;
  5018. unsigned R_W : 1;
  5019. unsigned : 1;
  5020. unsigned : 1;
  5021. unsigned D_A : 1;
  5022. unsigned : 1;
  5023. unsigned : 1;
  5024. };
  5025. struct
  5026. {
  5027. unsigned : 1;
  5028. unsigned : 1;
  5029. unsigned NOT_WRITE : 1;
  5030. unsigned : 1;
  5031. unsigned : 1;
  5032. unsigned NOT_ADDRESS : 1;
  5033. unsigned : 1;
  5034. unsigned : 1;
  5035. };
  5036. } __SSP1STATbits_t;
  5037. extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
  5038. #define _BF 0x01
  5039. #define _UA 0x02
  5040. #define _R_NOT_W 0x04
  5041. #define _R 0x04
  5042. #define _NOT_W 0x04
  5043. #define _R_W 0x04
  5044. #define _NOT_WRITE 0x04
  5045. #define _S 0x08
  5046. #define _P 0x10
  5047. #define _D_NOT_A 0x20
  5048. #define _D 0x20
  5049. #define _NOT_A 0x20
  5050. #define _D_A 0x20
  5051. #define _NOT_ADDRESS 0x20
  5052. #define _CKE 0x40
  5053. #define _SMP 0x80
  5054. //==============================================================================
  5055. //==============================================================================
  5056. // SSPSTAT Bits
  5057. extern __at(0x0FC7) __sfr SSPSTAT;
  5058. typedef union
  5059. {
  5060. struct
  5061. {
  5062. unsigned BF : 1;
  5063. unsigned UA : 1;
  5064. unsigned R_NOT_W : 1;
  5065. unsigned S : 1;
  5066. unsigned P : 1;
  5067. unsigned D_NOT_A : 1;
  5068. unsigned CKE : 1;
  5069. unsigned SMP : 1;
  5070. };
  5071. struct
  5072. {
  5073. unsigned : 1;
  5074. unsigned : 1;
  5075. unsigned R : 1;
  5076. unsigned : 1;
  5077. unsigned : 1;
  5078. unsigned D : 1;
  5079. unsigned : 1;
  5080. unsigned : 1;
  5081. };
  5082. struct
  5083. {
  5084. unsigned : 1;
  5085. unsigned : 1;
  5086. unsigned NOT_W : 1;
  5087. unsigned : 1;
  5088. unsigned : 1;
  5089. unsigned NOT_A : 1;
  5090. unsigned : 1;
  5091. unsigned : 1;
  5092. };
  5093. struct
  5094. {
  5095. unsigned : 1;
  5096. unsigned : 1;
  5097. unsigned R_W : 1;
  5098. unsigned : 1;
  5099. unsigned : 1;
  5100. unsigned D_A : 1;
  5101. unsigned : 1;
  5102. unsigned : 1;
  5103. };
  5104. struct
  5105. {
  5106. unsigned : 1;
  5107. unsigned : 1;
  5108. unsigned NOT_WRITE : 1;
  5109. unsigned : 1;
  5110. unsigned : 1;
  5111. unsigned NOT_ADDRESS : 1;
  5112. unsigned : 1;
  5113. unsigned : 1;
  5114. };
  5115. } __SSPSTATbits_t;
  5116. extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
  5117. #define _SSPSTAT_BF 0x01
  5118. #define _SSPSTAT_UA 0x02
  5119. #define _SSPSTAT_R_NOT_W 0x04
  5120. #define _SSPSTAT_R 0x04
  5121. #define _SSPSTAT_NOT_W 0x04
  5122. #define _SSPSTAT_R_W 0x04
  5123. #define _SSPSTAT_NOT_WRITE 0x04
  5124. #define _SSPSTAT_S 0x08
  5125. #define _SSPSTAT_P 0x10
  5126. #define _SSPSTAT_D_NOT_A 0x20
  5127. #define _SSPSTAT_D 0x20
  5128. #define _SSPSTAT_NOT_A 0x20
  5129. #define _SSPSTAT_D_A 0x20
  5130. #define _SSPSTAT_NOT_ADDRESS 0x20
  5131. #define _SSPSTAT_CKE 0x40
  5132. #define _SSPSTAT_SMP 0x80
  5133. //==============================================================================
  5134. extern __at(0x0FC8) __sfr SSP1ADD;
  5135. extern __at(0x0FC8) __sfr SSPADD;
  5136. extern __at(0x0FC9) __sfr SSP1BUF;
  5137. extern __at(0x0FC9) __sfr SSPBUF;
  5138. //==============================================================================
  5139. // SSP1MSK Bits
  5140. extern __at(0x0FCA) __sfr SSP1MSK;
  5141. typedef struct
  5142. {
  5143. unsigned MSK0 : 1;
  5144. unsigned MSK1 : 1;
  5145. unsigned MSK2 : 1;
  5146. unsigned MSK3 : 1;
  5147. unsigned MSK4 : 1;
  5148. unsigned MSK5 : 1;
  5149. unsigned MSK6 : 1;
  5150. unsigned MSK7 : 1;
  5151. } __SSP1MSKbits_t;
  5152. extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
  5153. #define _MSK0 0x01
  5154. #define _MSK1 0x02
  5155. #define _MSK2 0x04
  5156. #define _MSK3 0x08
  5157. #define _MSK4 0x10
  5158. #define _MSK5 0x20
  5159. #define _MSK6 0x40
  5160. #define _MSK7 0x80
  5161. //==============================================================================
  5162. //==============================================================================
  5163. // SSPMSK Bits
  5164. extern __at(0x0FCA) __sfr SSPMSK;
  5165. typedef struct
  5166. {
  5167. unsigned MSK0 : 1;
  5168. unsigned MSK1 : 1;
  5169. unsigned MSK2 : 1;
  5170. unsigned MSK3 : 1;
  5171. unsigned MSK4 : 1;
  5172. unsigned MSK5 : 1;
  5173. unsigned MSK6 : 1;
  5174. unsigned MSK7 : 1;
  5175. } __SSPMSKbits_t;
  5176. extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
  5177. #define _SSPMSK_MSK0 0x01
  5178. #define _SSPMSK_MSK1 0x02
  5179. #define _SSPMSK_MSK2 0x04
  5180. #define _SSPMSK_MSK3 0x08
  5181. #define _SSPMSK_MSK4 0x10
  5182. #define _SSPMSK_MSK5 0x20
  5183. #define _SSPMSK_MSK6 0x40
  5184. #define _SSPMSK_MSK7 0x80
  5185. //==============================================================================
  5186. //==============================================================================
  5187. // SSP1CON3 Bits
  5188. extern __at(0x0FCB) __sfr SSP1CON3;
  5189. typedef struct
  5190. {
  5191. unsigned DHEN : 1;
  5192. unsigned AHEN : 1;
  5193. unsigned SBCDE : 1;
  5194. unsigned SDAHT : 1;
  5195. unsigned BOEN : 1;
  5196. unsigned SCIE : 1;
  5197. unsigned PCIE : 1;
  5198. unsigned ACKTIM : 1;
  5199. } __SSP1CON3bits_t;
  5200. extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
  5201. #define _DHEN 0x01
  5202. #define _AHEN 0x02
  5203. #define _SBCDE 0x04
  5204. #define _SDAHT 0x08
  5205. #define _BOEN 0x10
  5206. #define _SCIE 0x20
  5207. #define _PCIE 0x40
  5208. #define _ACKTIM 0x80
  5209. //==============================================================================
  5210. //==============================================================================
  5211. // SSPCON3 Bits
  5212. extern __at(0x0FCB) __sfr SSPCON3;
  5213. typedef struct
  5214. {
  5215. unsigned DHEN : 1;
  5216. unsigned AHEN : 1;
  5217. unsigned SBCDE : 1;
  5218. unsigned SDAHT : 1;
  5219. unsigned BOEN : 1;
  5220. unsigned SCIE : 1;
  5221. unsigned PCIE : 1;
  5222. unsigned ACKTIM : 1;
  5223. } __SSPCON3bits_t;
  5224. extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
  5225. #define _SSPCON3_DHEN 0x01
  5226. #define _SSPCON3_AHEN 0x02
  5227. #define _SSPCON3_SBCDE 0x04
  5228. #define _SSPCON3_SDAHT 0x08
  5229. #define _SSPCON3_BOEN 0x10
  5230. #define _SSPCON3_SCIE 0x20
  5231. #define _SSPCON3_PCIE 0x40
  5232. #define _SSPCON3_ACKTIM 0x80
  5233. //==============================================================================
  5234. //==============================================================================
  5235. // T1GCON Bits
  5236. extern __at(0x0FCC) __sfr T1GCON;
  5237. typedef union
  5238. {
  5239. struct
  5240. {
  5241. unsigned T1GSS0 : 1;
  5242. unsigned T1GSS1 : 1;
  5243. unsigned T1GVAL : 1;
  5244. unsigned T1GGO_NOT_DONE : 1;
  5245. unsigned T1GSPM : 1;
  5246. unsigned T1GTM : 1;
  5247. unsigned T1GPOL : 1;
  5248. unsigned TMR1GE : 1;
  5249. };
  5250. struct
  5251. {
  5252. unsigned : 1;
  5253. unsigned : 1;
  5254. unsigned : 1;
  5255. unsigned T1G_DONE : 1;
  5256. unsigned : 1;
  5257. unsigned : 1;
  5258. unsigned : 1;
  5259. unsigned : 1;
  5260. };
  5261. struct
  5262. {
  5263. unsigned : 1;
  5264. unsigned : 1;
  5265. unsigned : 1;
  5266. unsigned T1GGO : 1;
  5267. unsigned : 1;
  5268. unsigned : 1;
  5269. unsigned : 1;
  5270. unsigned : 1;
  5271. };
  5272. struct
  5273. {
  5274. unsigned T1GSS : 2;
  5275. unsigned : 6;
  5276. };
  5277. } __T1GCONbits_t;
  5278. extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
  5279. #define _T1GSS0 0x01
  5280. #define _T1GSS1 0x02
  5281. #define _T1GVAL 0x04
  5282. #define _T1GGO_NOT_DONE 0x08
  5283. #define _T1G_DONE 0x08
  5284. #define _T1GGO 0x08
  5285. #define _T1GSPM 0x10
  5286. #define _T1GTM 0x20
  5287. #define _T1GPOL 0x40
  5288. #define _TMR1GE 0x80
  5289. //==============================================================================
  5290. //==============================================================================
  5291. // T1CON Bits
  5292. extern __at(0x0FCD) __sfr T1CON;
  5293. typedef union
  5294. {
  5295. struct
  5296. {
  5297. unsigned TMR1ON : 1;
  5298. unsigned T1RD16 : 1;
  5299. unsigned NOT_T1SYNC : 1;
  5300. unsigned T1SOSCEN : 1;
  5301. unsigned T1CKPS0 : 1;
  5302. unsigned T1CKPS1 : 1;
  5303. unsigned TMR1CS0 : 1;
  5304. unsigned TMR1CS1 : 1;
  5305. };
  5306. struct
  5307. {
  5308. unsigned : 1;
  5309. unsigned RD16 : 1;
  5310. unsigned T1SYNC : 1;
  5311. unsigned T1OSCEN : 1;
  5312. unsigned : 1;
  5313. unsigned : 1;
  5314. unsigned : 1;
  5315. unsigned : 1;
  5316. };
  5317. struct
  5318. {
  5319. unsigned : 4;
  5320. unsigned T1CKPS : 2;
  5321. unsigned : 2;
  5322. };
  5323. struct
  5324. {
  5325. unsigned : 6;
  5326. unsigned TMR1CS : 2;
  5327. };
  5328. } __T1CONbits_t;
  5329. extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
  5330. #define _TMR1ON 0x01
  5331. #define _T1RD16 0x02
  5332. #define _RD16 0x02
  5333. #define _NOT_T1SYNC 0x04
  5334. #define _T1SYNC 0x04
  5335. #define _T1SOSCEN 0x08
  5336. #define _T1OSCEN 0x08
  5337. #define _T1CKPS0 0x10
  5338. #define _T1CKPS1 0x20
  5339. #define _TMR1CS0 0x40
  5340. #define _TMR1CS1 0x80
  5341. //==============================================================================
  5342. extern __at(0x0FCE) __sfr TMR1;
  5343. extern __at(0x0FCE) __sfr TMR1L;
  5344. extern __at(0x0FCF) __sfr TMR1H;
  5345. //==============================================================================
  5346. // RCON Bits
  5347. extern __at(0x0FD0) __sfr RCON;
  5348. typedef union
  5349. {
  5350. struct
  5351. {
  5352. unsigned NOT_BOR : 1;
  5353. unsigned NOT_POR : 1;
  5354. unsigned NOT_PD : 1;
  5355. unsigned NOT_TO : 1;
  5356. unsigned NOT_RI : 1;
  5357. unsigned : 1;
  5358. unsigned SBOREN : 1;
  5359. unsigned IPEN : 1;
  5360. };
  5361. struct
  5362. {
  5363. unsigned BOR : 1;
  5364. unsigned POR : 1;
  5365. unsigned PD : 1;
  5366. unsigned TO : 1;
  5367. unsigned RI : 1;
  5368. unsigned : 1;
  5369. unsigned : 1;
  5370. unsigned : 1;
  5371. };
  5372. } __RCONbits_t;
  5373. extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
  5374. #define _NOT_BOR 0x01
  5375. #define _BOR 0x01
  5376. #define _NOT_POR 0x02
  5377. #define _POR 0x02
  5378. #define _NOT_PD 0x04
  5379. #define _PD 0x04
  5380. #define _NOT_TO 0x08
  5381. #define _TO 0x08
  5382. #define _NOT_RI 0x10
  5383. #define _RI 0x10
  5384. #define _SBOREN 0x40
  5385. #define _IPEN 0x80
  5386. //==============================================================================
  5387. //==============================================================================
  5388. // WDTCON Bits
  5389. extern __at(0x0FD1) __sfr WDTCON;
  5390. typedef union
  5391. {
  5392. struct
  5393. {
  5394. unsigned SWDTEN : 1;
  5395. unsigned : 1;
  5396. unsigned : 1;
  5397. unsigned : 1;
  5398. unsigned : 1;
  5399. unsigned : 1;
  5400. unsigned : 1;
  5401. unsigned : 1;
  5402. };
  5403. struct
  5404. {
  5405. unsigned SWDTE : 1;
  5406. unsigned : 1;
  5407. unsigned : 1;
  5408. unsigned : 1;
  5409. unsigned : 1;
  5410. unsigned : 1;
  5411. unsigned : 1;
  5412. unsigned : 1;
  5413. };
  5414. } __WDTCONbits_t;
  5415. extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
  5416. #define _SWDTEN 0x01
  5417. #define _SWDTE 0x01
  5418. //==============================================================================
  5419. //==============================================================================
  5420. // OSCCON2 Bits
  5421. extern __at(0x0FD2) __sfr OSCCON2;
  5422. typedef struct
  5423. {
  5424. unsigned LFIOFS : 1;
  5425. unsigned MFIOFS : 1;
  5426. unsigned PRISD : 1;
  5427. unsigned SOSCGO : 1;
  5428. unsigned MFIOSEL : 1;
  5429. unsigned : 1;
  5430. unsigned SOSCRUN : 1;
  5431. unsigned PLLRDY : 1;
  5432. } __OSCCON2bits_t;
  5433. extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
  5434. #define _LFIOFS 0x01
  5435. #define _MFIOFS 0x02
  5436. #define _PRISD 0x04
  5437. #define _SOSCGO 0x08
  5438. #define _MFIOSEL 0x10
  5439. #define _SOSCRUN 0x40
  5440. #define _PLLRDY 0x80
  5441. //==============================================================================
  5442. //==============================================================================
  5443. // OSCCON Bits
  5444. extern __at(0x0FD3) __sfr OSCCON;
  5445. typedef union
  5446. {
  5447. struct
  5448. {
  5449. unsigned SCS0 : 1;
  5450. unsigned SCS1 : 1;
  5451. unsigned HFIOFS : 1;
  5452. unsigned OSTS : 1;
  5453. unsigned IRCF0 : 1;
  5454. unsigned IRCF1 : 1;
  5455. unsigned IRCF2 : 1;
  5456. unsigned IDLEN : 1;
  5457. };
  5458. struct
  5459. {
  5460. unsigned : 1;
  5461. unsigned : 1;
  5462. unsigned IOFS : 1;
  5463. unsigned : 1;
  5464. unsigned : 1;
  5465. unsigned : 1;
  5466. unsigned : 1;
  5467. unsigned : 1;
  5468. };
  5469. struct
  5470. {
  5471. unsigned SCS : 2;
  5472. unsigned : 6;
  5473. };
  5474. struct
  5475. {
  5476. unsigned : 4;
  5477. unsigned IRCF : 3;
  5478. unsigned : 1;
  5479. };
  5480. } __OSCCONbits_t;
  5481. extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
  5482. #define _SCS0 0x01
  5483. #define _SCS1 0x02
  5484. #define _HFIOFS 0x04
  5485. #define _IOFS 0x04
  5486. #define _OSTS 0x08
  5487. #define _IRCF0 0x10
  5488. #define _IRCF1 0x20
  5489. #define _IRCF2 0x40
  5490. #define _IDLEN 0x80
  5491. //==============================================================================
  5492. //==============================================================================
  5493. // T0CON Bits
  5494. extern __at(0x0FD5) __sfr T0CON;
  5495. typedef union
  5496. {
  5497. struct
  5498. {
  5499. unsigned T0PS0 : 1;
  5500. unsigned T0PS1 : 1;
  5501. unsigned T0PS2 : 1;
  5502. unsigned PSA : 1;
  5503. unsigned T0SE : 1;
  5504. unsigned T0CS : 1;
  5505. unsigned T08BIT : 1;
  5506. unsigned TMR0ON : 1;
  5507. };
  5508. struct
  5509. {
  5510. unsigned T0PS : 3;
  5511. unsigned : 5;
  5512. };
  5513. } __T0CONbits_t;
  5514. extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
  5515. #define _T0PS0 0x01
  5516. #define _T0PS1 0x02
  5517. #define _T0PS2 0x04
  5518. #define _PSA 0x08
  5519. #define _T0SE 0x10
  5520. #define _T0CS 0x20
  5521. #define _T08BIT 0x40
  5522. #define _TMR0ON 0x80
  5523. //==============================================================================
  5524. extern __at(0x0FD6) __sfr TMR0;
  5525. extern __at(0x0FD6) __sfr TMR0L;
  5526. extern __at(0x0FD7) __sfr TMR0H;
  5527. //==============================================================================
  5528. // STATUS Bits
  5529. extern __at(0x0FD8) __sfr STATUS;
  5530. typedef struct
  5531. {
  5532. unsigned C : 1;
  5533. unsigned DC : 1;
  5534. unsigned Z : 1;
  5535. unsigned OV : 1;
  5536. unsigned N : 1;
  5537. unsigned : 1;
  5538. unsigned : 1;
  5539. unsigned : 1;
  5540. } __STATUSbits_t;
  5541. extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
  5542. #define _C 0x01
  5543. #define _DC 0x02
  5544. #define _Z 0x04
  5545. #define _OV 0x08
  5546. #define _N 0x10
  5547. //==============================================================================
  5548. extern __at(0x0FD9) __sfr FSR2L;
  5549. extern __at(0x0FDA) __sfr FSR2H;
  5550. extern __at(0x0FDB) __sfr PLUSW2;
  5551. extern __at(0x0FDC) __sfr PREINC2;
  5552. extern __at(0x0FDD) __sfr POSTDEC2;
  5553. extern __at(0x0FDE) __sfr POSTINC2;
  5554. extern __at(0x0FDF) __sfr INDF2;
  5555. extern __at(0x0FE0) __sfr BSR;
  5556. extern __at(0x0FE1) __sfr FSR1L;
  5557. extern __at(0x0FE2) __sfr FSR1H;
  5558. extern __at(0x0FE3) __sfr PLUSW1;
  5559. extern __at(0x0FE4) __sfr PREINC1;
  5560. extern __at(0x0FE5) __sfr POSTDEC1;
  5561. extern __at(0x0FE6) __sfr POSTINC1;
  5562. extern __at(0x0FE7) __sfr INDF1;
  5563. extern __at(0x0FE8) __sfr WREG;
  5564. extern __at(0x0FE9) __sfr FSR0L;
  5565. extern __at(0x0FEA) __sfr FSR0H;
  5566. extern __at(0x0FEB) __sfr PLUSW0;
  5567. extern __at(0x0FEC) __sfr PREINC0;
  5568. extern __at(0x0FED) __sfr POSTDEC0;
  5569. extern __at(0x0FEE) __sfr POSTINC0;
  5570. extern __at(0x0FEF) __sfr INDF0;
  5571. //==============================================================================
  5572. // INTCON3 Bits
  5573. extern __at(0x0FF0) __sfr INTCON3;
  5574. typedef union
  5575. {
  5576. struct
  5577. {
  5578. unsigned INT1IF : 1;
  5579. unsigned INT2IF : 1;
  5580. unsigned : 1;
  5581. unsigned INT1IE : 1;
  5582. unsigned INT2IE : 1;
  5583. unsigned : 1;
  5584. unsigned INT1IP : 1;
  5585. unsigned INT2IP : 1;
  5586. };
  5587. struct
  5588. {
  5589. unsigned INT1F : 1;
  5590. unsigned INT2F : 1;
  5591. unsigned : 1;
  5592. unsigned INT1E : 1;
  5593. unsigned INT2E : 1;
  5594. unsigned : 1;
  5595. unsigned INT1P : 1;
  5596. unsigned INT2P : 1;
  5597. };
  5598. } __INTCON3bits_t;
  5599. extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
  5600. #define _INT1IF 0x01
  5601. #define _INT1F 0x01
  5602. #define _INT2IF 0x02
  5603. #define _INT2F 0x02
  5604. #define _INT1IE 0x08
  5605. #define _INT1E 0x08
  5606. #define _INT2IE 0x10
  5607. #define _INT2E 0x10
  5608. #define _INT1IP 0x40
  5609. #define _INT1P 0x40
  5610. #define _INT2IP 0x80
  5611. #define _INT2P 0x80
  5612. //==============================================================================
  5613. //==============================================================================
  5614. // INTCON2 Bits
  5615. extern __at(0x0FF1) __sfr INTCON2;
  5616. typedef union
  5617. {
  5618. struct
  5619. {
  5620. unsigned RBIP : 1;
  5621. unsigned : 1;
  5622. unsigned TMR0IP : 1;
  5623. unsigned : 1;
  5624. unsigned INTEDG2 : 1;
  5625. unsigned INTEDG1 : 1;
  5626. unsigned INTEDG0 : 1;
  5627. unsigned NOT_RBPU : 1;
  5628. };
  5629. struct
  5630. {
  5631. unsigned : 1;
  5632. unsigned : 1;
  5633. unsigned : 1;
  5634. unsigned : 1;
  5635. unsigned : 1;
  5636. unsigned : 1;
  5637. unsigned : 1;
  5638. unsigned RBPU : 1;
  5639. };
  5640. } __INTCON2bits_t;
  5641. extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
  5642. #define _RBIP 0x01
  5643. #define _TMR0IP 0x04
  5644. #define _INTEDG2 0x10
  5645. #define _INTEDG1 0x20
  5646. #define _INTEDG0 0x40
  5647. #define _NOT_RBPU 0x80
  5648. #define _RBPU 0x80
  5649. //==============================================================================
  5650. //==============================================================================
  5651. // INTCON Bits
  5652. extern __at(0x0FF2) __sfr INTCON;
  5653. typedef union
  5654. {
  5655. struct
  5656. {
  5657. unsigned RBIF : 1;
  5658. unsigned INT0IF : 1;
  5659. unsigned TMR0IF : 1;
  5660. unsigned RBIE : 1;
  5661. unsigned INT0IE : 1;
  5662. unsigned TMR0IE : 1;
  5663. unsigned PEIE_GIEL : 1;
  5664. unsigned GIE_GIEH : 1;
  5665. };
  5666. struct
  5667. {
  5668. unsigned : 1;
  5669. unsigned INT0F : 1;
  5670. unsigned T0IF : 1;
  5671. unsigned : 1;
  5672. unsigned INT0E : 1;
  5673. unsigned T0IE : 1;
  5674. unsigned PEIE : 1;
  5675. unsigned GIE : 1;
  5676. };
  5677. struct
  5678. {
  5679. unsigned : 1;
  5680. unsigned : 1;
  5681. unsigned : 1;
  5682. unsigned : 1;
  5683. unsigned : 1;
  5684. unsigned : 1;
  5685. unsigned GIEL : 1;
  5686. unsigned GIEH : 1;
  5687. };
  5688. } __INTCONbits_t;
  5689. extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
  5690. #define _RBIF 0x01
  5691. #define _INT0IF 0x02
  5692. #define _INT0F 0x02
  5693. #define _TMR0IF 0x04
  5694. #define _T0IF 0x04
  5695. #define _RBIE 0x08
  5696. #define _INT0IE 0x10
  5697. #define _INT0E 0x10
  5698. #define _TMR0IE 0x20
  5699. #define _T0IE 0x20
  5700. #define _PEIE_GIEL 0x40
  5701. #define _PEIE 0x40
  5702. #define _GIEL 0x40
  5703. #define _GIE_GIEH 0x80
  5704. #define _GIE 0x80
  5705. #define _GIEH 0x80
  5706. //==============================================================================
  5707. extern __at(0x0FF3) __sfr PROD;
  5708. extern __at(0x0FF3) __sfr PRODL;
  5709. extern __at(0x0FF4) __sfr PRODH;
  5710. extern __at(0x0FF5) __sfr TABLAT;
  5711. extern __at(0x0FF6) __sfr TBLPTR;
  5712. extern __at(0x0FF6) __sfr TBLPTRL;
  5713. extern __at(0x0FF7) __sfr TBLPTRH;
  5714. extern __at(0x0FF8) __sfr TBLPTRU;
  5715. extern __at(0x0FF9) __sfr PC;
  5716. extern __at(0x0FF9) __sfr PCL;
  5717. extern __at(0x0FFA) __sfr PCLATH;
  5718. extern __at(0x0FFB) __sfr PCLATU;
  5719. //==============================================================================
  5720. // STKPTR Bits
  5721. extern __at(0x0FFC) __sfr STKPTR;
  5722. typedef union
  5723. {
  5724. struct
  5725. {
  5726. unsigned STKPTR0 : 1;
  5727. unsigned STKPTR1 : 1;
  5728. unsigned STKPTR2 : 1;
  5729. unsigned STKPTR3 : 1;
  5730. unsigned STKPTR4 : 1;
  5731. unsigned : 1;
  5732. unsigned STKUNF : 1;
  5733. unsigned STKFUL : 1;
  5734. };
  5735. struct
  5736. {
  5737. unsigned SP0 : 1;
  5738. unsigned SP1 : 1;
  5739. unsigned SP2 : 1;
  5740. unsigned SP3 : 1;
  5741. unsigned SP4 : 1;
  5742. unsigned : 1;
  5743. unsigned : 1;
  5744. unsigned STKOVF : 1;
  5745. };
  5746. struct
  5747. {
  5748. unsigned STKPTR : 5;
  5749. unsigned : 3;
  5750. };
  5751. struct
  5752. {
  5753. unsigned SP : 5;
  5754. unsigned : 3;
  5755. };
  5756. } __STKPTRbits_t;
  5757. extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
  5758. #define _STKPTR0 0x01
  5759. #define _SP0 0x01
  5760. #define _STKPTR1 0x02
  5761. #define _SP1 0x02
  5762. #define _STKPTR2 0x04
  5763. #define _SP2 0x04
  5764. #define _STKPTR3 0x08
  5765. #define _SP3 0x08
  5766. #define _STKPTR4 0x10
  5767. #define _SP4 0x10
  5768. #define _STKUNF 0x40
  5769. #define _STKFUL 0x80
  5770. #define _STKOVF 0x80
  5771. //==============================================================================
  5772. extern __at(0x0FFD) __sfr TOS;
  5773. extern __at(0x0FFD) __sfr TOSL;
  5774. extern __at(0x0FFE) __sfr TOSH;
  5775. extern __at(0x0FFF) __sfr TOSU;
  5776. //==============================================================================
  5777. //
  5778. // Configuration Bits
  5779. //
  5780. //==============================================================================
  5781. #define __CONFIG1H 0x300001
  5782. #define __CONFIG2L 0x300002
  5783. #define __CONFIG2H 0x300003
  5784. #define __CONFIG3H 0x300005
  5785. #define __CONFIG4L 0x300006
  5786. #define __CONFIG5L 0x300008
  5787. #define __CONFIG5H 0x300009
  5788. #define __CONFIG6L 0x30000A
  5789. #define __CONFIG6H 0x30000B
  5790. #define __CONFIG7L 0x30000C
  5791. #define __CONFIG7H 0x30000D
  5792. //----------------------------- CONFIG1H Options -------------------------------
  5793. #define _FOSC_LP_1H 0xF0 // LP oscillator.
  5794. #define _FOSC_XT_1H 0xF1 // XT oscillator.
  5795. #define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz).
  5796. #define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz).
  5797. #define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
  5798. #define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz).
  5799. #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
  5800. #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator.
  5801. #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block.
  5802. #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2.
  5803. #define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
  5804. #define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz).
  5805. #define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
  5806. #define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz).
  5807. #define _PLLCFG_OFF_1H 0xEF // Oscillator used directly.
  5808. #define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4.
  5809. #define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software.
  5810. #define _PRICLKEN_ON_1H 0xFF // Primary clock enabled.
  5811. #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
  5812. #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
  5813. #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
  5814. #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
  5815. //----------------------------- CONFIG2L Options -------------------------------
  5816. #define _PWRTEN_ON_2L 0xFE // Power up timer enabled.
  5817. #define _PWRTEN_OFF_2L 0xFF // Power up timer disabled.
  5818. #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
  5819. #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
  5820. #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
  5821. #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
  5822. #define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal.
  5823. #define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal.
  5824. #define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal.
  5825. #define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal.
  5826. //----------------------------- CONFIG2H Options -------------------------------
  5827. #define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect.
  5828. #define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
  5829. #define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
  5830. #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
  5831. #define _WDTPS_1_2H 0xC3 // 1:1.
  5832. #define _WDTPS_2_2H 0xC7 // 1:2.
  5833. #define _WDTPS_4_2H 0xCB // 1:4.
  5834. #define _WDTPS_8_2H 0xCF // 1:8.
  5835. #define _WDTPS_16_2H 0xD3 // 1:16.
  5836. #define _WDTPS_32_2H 0xD7 // 1:32.
  5837. #define _WDTPS_64_2H 0xDB // 1:64.
  5838. #define _WDTPS_128_2H 0xDF // 1:128.
  5839. #define _WDTPS_256_2H 0xE3 // 1:256.
  5840. #define _WDTPS_512_2H 0xE7 // 1:512.
  5841. #define _WDTPS_1024_2H 0xEB // 1:1024.
  5842. #define _WDTPS_2048_2H 0xEF // 1:2048.
  5843. #define _WDTPS_4096_2H 0xF3 // 1:4096.
  5844. #define _WDTPS_8192_2H 0xF7 // 1:8192.
  5845. #define _WDTPS_16384_2H 0xFB // 1:16384.
  5846. #define _WDTPS_32768_2H 0xFF // 1:32768.
  5847. //----------------------------- CONFIG3H Options -------------------------------
  5848. #define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
  5849. #define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
  5850. #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
  5851. #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
  5852. #define _CCP3MX_PORTC6_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RC6.
  5853. #define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5.
  5854. #define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status.
  5855. #define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status.
  5856. #define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5.
  5857. #define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0.
  5858. #define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0.
  5859. #define _P2BMX_PORTB5_3H 0xFF // P2B is on RB5.
  5860. #define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled.
  5861. #define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled.
  5862. //----------------------------- CONFIG4L Options -------------------------------
  5863. #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
  5864. #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
  5865. #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
  5866. #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
  5867. #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
  5868. #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
  5869. #define _DEBUG_ON_4L 0x7F // Enabled.
  5870. #define _DEBUG_OFF_4L 0xFF // Disabled.
  5871. //----------------------------- CONFIG5L Options -------------------------------
  5872. #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) code-protected.
  5873. #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) not code-protected.
  5874. #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) code-protected.
  5875. #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) not code-protected.
  5876. #define _CP2_ON_5L 0xFB // Block 2 (004000-005FFFh) code-protected.
  5877. #define _CP2_OFF_5L 0xFF // Block 2 (004000-005FFFh) not code-protected.
  5878. #define _CP3_ON_5L 0xF7 // Block 3 (006000-007FFFh) code-protected.
  5879. #define _CP3_OFF_5L 0xFF // Block 3 (006000-007FFFh) not code-protected.
  5880. //----------------------------- CONFIG5H Options -------------------------------
  5881. #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) code-protected.
  5882. #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) not code-protected.
  5883. #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
  5884. #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
  5885. //----------------------------- CONFIG6L Options -------------------------------
  5886. #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) write-protected.
  5887. #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) not write-protected.
  5888. #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) write-protected.
  5889. #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) not write-protected.
  5890. #define _WRT2_ON_6L 0xFB // Block 2 (004000-005FFFh) write-protected.
  5891. #define _WRT2_OFF_6L 0xFF // Block 2 (004000-005FFFh) not write-protected.
  5892. #define _WRT3_ON_6L 0xF7 // Block 3 (006000-007FFFh) write-protected.
  5893. #define _WRT3_OFF_6L 0xFF // Block 3 (006000-007FFFh) not write-protected.
  5894. //----------------------------- CONFIG6H Options -------------------------------
  5895. #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
  5896. #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
  5897. #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
  5898. #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
  5899. #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
  5900. #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
  5901. //----------------------------- CONFIG7L Options -------------------------------
  5902. #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) protected from table reads executed in other blocks.
  5903. #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) not protected from table reads executed in other blocks.
  5904. #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) protected from table reads executed in other blocks.
  5905. #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) not protected from table reads executed in other blocks.
  5906. #define _EBTR2_ON_7L 0xFB // Block 2 (004000-005FFFh) protected from table reads executed in other blocks.
  5907. #define _EBTR2_OFF_7L 0xFF // Block 2 (004000-005FFFh) not protected from table reads executed in other blocks.
  5908. #define _EBTR3_ON_7L 0xF7 // Block 3 (006000-007FFFh) protected from table reads executed in other blocks.
  5909. #define _EBTR3_OFF_7L 0xFF // Block 3 (006000-007FFFh) not protected from table reads executed in other blocks.
  5910. //----------------------------- CONFIG7H Options -------------------------------
  5911. #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
  5912. #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
  5913. //==============================================================================
  5914. #define __DEVID1 0x3FFFFE
  5915. #define __DEVID2 0x3FFFFF
  5916. #define __IDLOC0 0x200000
  5917. #define __IDLOC1 0x200001
  5918. #define __IDLOC2 0x200002
  5919. #define __IDLOC3 0x200003
  5920. #define __IDLOC4 0x200004
  5921. #define __IDLOC5 0x200005
  5922. #define __IDLOC6 0x200006
  5923. #define __IDLOC7 0x200007
  5924. #endif // #ifndef __PIC18F25K22_H__