1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682 |
- /*
- * This declarations of the PIC18F2550 MCU.
- *
- * This file is part of the GNU PIC library for SDCC, originally
- * created by Molnar Karoly <molnarkaroly@users.sf.net> 2012.
- *
- * This file is generated automatically by the cinc2h.pl, 2012-11-01 17:30:36 UTC.
- *
- * SDCC is licensed under the GNU Public license (GPL) v2. Note that
- * this license covers the code to the compiler and other executables,
- * but explicitly does not cover any code or objects generated by sdcc.
- *
- * For pic device libraries and header files which are derived from
- * Microchip header (.inc) and linker script (.lkr) files Microchip
- * requires that "The header files should state that they are only to be
- * used with authentic Microchip devices" which makes them incompatible
- * with the GPL. Pic device libraries and header files are located at
- * non-free/lib and non-free/include directories respectively.
- * Sdcc should be run with the --use-non-free command line option in
- * order to include non-free header files and libraries.
- *
- * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
- */
- #ifndef __PIC18F2550_H__
- #define __PIC18F2550_H__
- //==============================================================================
- //==============================================================================
- //
- // Register Definitions
- //
- //==============================================================================
- extern __at(0x0F66) __sfr UFRM;
- //==============================================================================
- // UFRML Bits
- extern __at(0x0F66) __sfr UFRML;
- typedef struct
- {
- unsigned FRM0 : 1;
- unsigned FRM1 : 1;
- unsigned FRM2 : 1;
- unsigned FRM3 : 1;
- unsigned FRM4 : 1;
- unsigned FRM5 : 1;
- unsigned FRM6 : 1;
- unsigned FRM7 : 1;
- } __UFRMLbits_t;
- extern __at(0x0F66) volatile __UFRMLbits_t UFRMLbits;
- #define _FRM0 0x01
- #define _FRM1 0x02
- #define _FRM2 0x04
- #define _FRM3 0x08
- #define _FRM4 0x10
- #define _FRM5 0x20
- #define _FRM6 0x40
- #define _FRM7 0x80
- //==============================================================================
- //==============================================================================
- // UFRMH Bits
- extern __at(0x0F67) __sfr UFRMH;
- typedef struct
- {
- unsigned FRM8 : 1;
- unsigned FRM9 : 1;
- unsigned FRM10 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UFRMHbits_t;
- extern __at(0x0F67) volatile __UFRMHbits_t UFRMHbits;
- #define _FRM8 0x01
- #define _FRM9 0x02
- #define _FRM10 0x04
- //==============================================================================
- //==============================================================================
- // UIR Bits
- extern __at(0x0F68) __sfr UIR;
- typedef struct
- {
- unsigned URSTIF : 1;
- unsigned UERRIF : 1;
- unsigned ACTVIF : 1;
- unsigned TRNIF : 1;
- unsigned IDLEIF : 1;
- unsigned STALLIF : 1;
- unsigned SOFIF : 1;
- unsigned : 1;
- } __UIRbits_t;
- extern __at(0x0F68) volatile __UIRbits_t UIRbits;
- #define _URSTIF 0x01
- #define _UERRIF 0x02
- #define _ACTVIF 0x04
- #define _TRNIF 0x08
- #define _IDLEIF 0x10
- #define _STALLIF 0x20
- #define _SOFIF 0x40
- //==============================================================================
- //==============================================================================
- // UIE Bits
- extern __at(0x0F69) __sfr UIE;
- typedef struct
- {
- unsigned URSTIE : 1;
- unsigned UERRIE : 1;
- unsigned ACTVIE : 1;
- unsigned TRNIE : 1;
- unsigned IDLEIE : 1;
- unsigned STALLIE : 1;
- unsigned SOFIE : 1;
- unsigned : 1;
- } __UIEbits_t;
- extern __at(0x0F69) volatile __UIEbits_t UIEbits;
- #define _URSTIE 0x01
- #define _UERRIE 0x02
- #define _ACTVIE 0x04
- #define _TRNIE 0x08
- #define _IDLEIE 0x10
- #define _STALLIE 0x20
- #define _SOFIE 0x40
- //==============================================================================
- //==============================================================================
- // UEIR Bits
- extern __at(0x0F6A) __sfr UEIR;
- typedef struct
- {
- unsigned PIDEF : 1;
- unsigned CRC5EF : 1;
- unsigned CRC16EF : 1;
- unsigned DFN8EF : 1;
- unsigned BTOEF : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned BTSEF : 1;
- } __UEIRbits_t;
- extern __at(0x0F6A) volatile __UEIRbits_t UEIRbits;
- #define _PIDEF 0x01
- #define _CRC5EF 0x02
- #define _CRC16EF 0x04
- #define _DFN8EF 0x08
- #define _BTOEF 0x10
- #define _BTSEF 0x80
- //==============================================================================
- //==============================================================================
- // UEIE Bits
- extern __at(0x0F6B) __sfr UEIE;
- typedef struct
- {
- unsigned PIDEE : 1;
- unsigned CRC5EE : 1;
- unsigned CRC16EE : 1;
- unsigned DFN8EE : 1;
- unsigned BTOEE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned BTSEE : 1;
- } __UEIEbits_t;
- extern __at(0x0F6B) volatile __UEIEbits_t UEIEbits;
- #define _PIDEE 0x01
- #define _CRC5EE 0x02
- #define _CRC16EE 0x04
- #define _DFN8EE 0x08
- #define _BTOEE 0x10
- #define _BTSEE 0x80
- //==============================================================================
- //==============================================================================
- // USTAT Bits
- extern __at(0x0F6C) __sfr USTAT;
- typedef union
- {
- struct
- {
- unsigned : 1;
- unsigned PPBI : 1;
- unsigned DIR : 1;
- unsigned ENDP0 : 1;
- unsigned ENDP1 : 1;
- unsigned ENDP2 : 1;
- unsigned ENDP3 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 3;
- unsigned ENDP : 4;
- unsigned : 1;
- };
- } __USTATbits_t;
- extern __at(0x0F6C) volatile __USTATbits_t USTATbits;
- #define _PPBI 0x02
- #define _DIR 0x04
- #define _ENDP0 0x08
- #define _ENDP1 0x10
- #define _ENDP2 0x20
- #define _ENDP3 0x40
- //==============================================================================
- //==============================================================================
- // UCON Bits
- extern __at(0x0F6D) __sfr UCON;
- typedef struct
- {
- unsigned : 1;
- unsigned SUSPND : 1;
- unsigned RESUME : 1;
- unsigned USBEN : 1;
- unsigned PKTDIS : 1;
- unsigned SE0 : 1;
- unsigned PPBRST : 1;
- unsigned : 1;
- } __UCONbits_t;
- extern __at(0x0F6D) volatile __UCONbits_t UCONbits;
- #define _SUSPND 0x02
- #define _RESUME 0x04
- #define _USBEN 0x08
- #define _PKTDIS 0x10
- #define _SE0 0x20
- #define _PPBRST 0x40
- //==============================================================================
- //==============================================================================
- // UADDR Bits
- extern __at(0x0F6E) __sfr UADDR;
- typedef union
- {
- struct
- {
- unsigned ADDR0 : 1;
- unsigned ADDR1 : 1;
- unsigned ADDR2 : 1;
- unsigned ADDR3 : 1;
- unsigned ADDR4 : 1;
- unsigned ADDR5 : 1;
- unsigned ADDR6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned ADDR : 7;
- unsigned : 1;
- };
- } __UADDRbits_t;
- extern __at(0x0F6E) volatile __UADDRbits_t UADDRbits;
- #define _ADDR0 0x01
- #define _ADDR1 0x02
- #define _ADDR2 0x04
- #define _ADDR3 0x08
- #define _ADDR4 0x10
- #define _ADDR5 0x20
- #define _ADDR6 0x40
- //==============================================================================
- //==============================================================================
- // UCFG Bits
- extern __at(0x0F6F) __sfr UCFG;
- typedef union
- {
- struct
- {
- unsigned PPB0 : 1;
- unsigned PPB1 : 1;
- unsigned FSEN : 1;
- unsigned UTRDIS : 1;
- unsigned UPUEN : 1;
- unsigned : 1;
- unsigned UOEMON : 1;
- unsigned UTEYE : 1;
- };
- struct
- {
- unsigned PPB : 2;
- unsigned : 6;
- };
- } __UCFGbits_t;
- extern __at(0x0F6F) volatile __UCFGbits_t UCFGbits;
- #define _PPB0 0x01
- #define _PPB1 0x02
- #define _FSEN 0x04
- #define _UTRDIS 0x08
- #define _UPUEN 0x10
- #define _UOEMON 0x40
- #define _UTEYE 0x80
- //==============================================================================
- //==============================================================================
- // UEP0 Bits
- extern __at(0x0F70) __sfr UEP0;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP0bits_t;
- extern __at(0x0F70) volatile __UEP0bits_t UEP0bits;
- #define _EPSTALL 0x01
- #define _EPINEN 0x02
- #define _EPOUTEN 0x04
- #define _EPCONDIS 0x08
- #define _EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP1 Bits
- extern __at(0x0F71) __sfr UEP1;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP1bits_t;
- extern __at(0x0F71) volatile __UEP1bits_t UEP1bits;
- #define _UEP1_EPSTALL 0x01
- #define _UEP1_EPINEN 0x02
- #define _UEP1_EPOUTEN 0x04
- #define _UEP1_EPCONDIS 0x08
- #define _UEP1_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP2 Bits
- extern __at(0x0F72) __sfr UEP2;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP2bits_t;
- extern __at(0x0F72) volatile __UEP2bits_t UEP2bits;
- #define _UEP2_EPSTALL 0x01
- #define _UEP2_EPINEN 0x02
- #define _UEP2_EPOUTEN 0x04
- #define _UEP2_EPCONDIS 0x08
- #define _UEP2_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP3 Bits
- extern __at(0x0F73) __sfr UEP3;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP3bits_t;
- extern __at(0x0F73) volatile __UEP3bits_t UEP3bits;
- #define _UEP3_EPSTALL 0x01
- #define _UEP3_EPINEN 0x02
- #define _UEP3_EPOUTEN 0x04
- #define _UEP3_EPCONDIS 0x08
- #define _UEP3_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP4 Bits
- extern __at(0x0F74) __sfr UEP4;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP4bits_t;
- extern __at(0x0F74) volatile __UEP4bits_t UEP4bits;
- #define _UEP4_EPSTALL 0x01
- #define _UEP4_EPINEN 0x02
- #define _UEP4_EPOUTEN 0x04
- #define _UEP4_EPCONDIS 0x08
- #define _UEP4_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP5 Bits
- extern __at(0x0F75) __sfr UEP5;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP5bits_t;
- extern __at(0x0F75) volatile __UEP5bits_t UEP5bits;
- #define _UEP5_EPSTALL 0x01
- #define _UEP5_EPINEN 0x02
- #define _UEP5_EPOUTEN 0x04
- #define _UEP5_EPCONDIS 0x08
- #define _UEP5_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP6 Bits
- extern __at(0x0F76) __sfr UEP6;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP6bits_t;
- extern __at(0x0F76) volatile __UEP6bits_t UEP6bits;
- #define _UEP6_EPSTALL 0x01
- #define _UEP6_EPINEN 0x02
- #define _UEP6_EPOUTEN 0x04
- #define _UEP6_EPCONDIS 0x08
- #define _UEP6_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP7 Bits
- extern __at(0x0F77) __sfr UEP7;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP7bits_t;
- extern __at(0x0F77) volatile __UEP7bits_t UEP7bits;
- #define _UEP7_EPSTALL 0x01
- #define _UEP7_EPINEN 0x02
- #define _UEP7_EPOUTEN 0x04
- #define _UEP7_EPCONDIS 0x08
- #define _UEP7_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP8 Bits
- extern __at(0x0F78) __sfr UEP8;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP8bits_t;
- extern __at(0x0F78) volatile __UEP8bits_t UEP8bits;
- #define _UEP8_EPSTALL 0x01
- #define _UEP8_EPINEN 0x02
- #define _UEP8_EPOUTEN 0x04
- #define _UEP8_EPCONDIS 0x08
- #define _UEP8_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP9 Bits
- extern __at(0x0F79) __sfr UEP9;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP9bits_t;
- extern __at(0x0F79) volatile __UEP9bits_t UEP9bits;
- #define _UEP9_EPSTALL 0x01
- #define _UEP9_EPINEN 0x02
- #define _UEP9_EPOUTEN 0x04
- #define _UEP9_EPCONDIS 0x08
- #define _UEP9_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP10 Bits
- extern __at(0x0F7A) __sfr UEP10;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP10bits_t;
- extern __at(0x0F7A) volatile __UEP10bits_t UEP10bits;
- #define _UEP10_EPSTALL 0x01
- #define _UEP10_EPINEN 0x02
- #define _UEP10_EPOUTEN 0x04
- #define _UEP10_EPCONDIS 0x08
- #define _UEP10_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP11 Bits
- extern __at(0x0F7B) __sfr UEP11;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP11bits_t;
- extern __at(0x0F7B) volatile __UEP11bits_t UEP11bits;
- #define _UEP11_EPSTALL 0x01
- #define _UEP11_EPINEN 0x02
- #define _UEP11_EPOUTEN 0x04
- #define _UEP11_EPCONDIS 0x08
- #define _UEP11_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP12 Bits
- extern __at(0x0F7C) __sfr UEP12;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP12bits_t;
- extern __at(0x0F7C) volatile __UEP12bits_t UEP12bits;
- #define _UEP12_EPSTALL 0x01
- #define _UEP12_EPINEN 0x02
- #define _UEP12_EPOUTEN 0x04
- #define _UEP12_EPCONDIS 0x08
- #define _UEP12_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP13 Bits
- extern __at(0x0F7D) __sfr UEP13;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP13bits_t;
- extern __at(0x0F7D) volatile __UEP13bits_t UEP13bits;
- #define _UEP13_EPSTALL 0x01
- #define _UEP13_EPINEN 0x02
- #define _UEP13_EPOUTEN 0x04
- #define _UEP13_EPCONDIS 0x08
- #define _UEP13_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP14 Bits
- extern __at(0x0F7E) __sfr UEP14;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP14bits_t;
- extern __at(0x0F7E) volatile __UEP14bits_t UEP14bits;
- #define _UEP14_EPSTALL 0x01
- #define _UEP14_EPINEN 0x02
- #define _UEP14_EPOUTEN 0x04
- #define _UEP14_EPCONDIS 0x08
- #define _UEP14_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // UEP15 Bits
- extern __at(0x0F7F) __sfr UEP15;
- typedef struct
- {
- unsigned EPSTALL : 1;
- unsigned EPINEN : 1;
- unsigned EPOUTEN : 1;
- unsigned EPCONDIS : 1;
- unsigned EPHSHK : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __UEP15bits_t;
- extern __at(0x0F7F) volatile __UEP15bits_t UEP15bits;
- #define _UEP15_EPSTALL 0x01
- #define _UEP15_EPINEN 0x02
- #define _UEP15_EPOUTEN 0x04
- #define _UEP15_EPCONDIS 0x08
- #define _UEP15_EPHSHK 0x10
- //==============================================================================
- //==============================================================================
- // PORTA Bits
- extern __at(0x0F80) __sfr PORTA;
- typedef union
- {
- struct
- {
- unsigned RA0 : 1;
- unsigned RA1 : 1;
- unsigned RA2 : 1;
- unsigned RA3 : 1;
- unsigned RA4 : 1;
- unsigned RA5 : 1;
- unsigned RA6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned AN0 : 1;
- unsigned AN1 : 1;
- unsigned AN2 : 1;
- unsigned AN3 : 1;
- unsigned T0CKI : 1;
- unsigned AN4 : 1;
- unsigned OSC2 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned VREFM : 1;
- unsigned VREFP : 1;
- unsigned : 1;
- unsigned LVDIN : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned HLVDIN : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned RA : 7;
- unsigned : 1;
- };
- } __PORTAbits_t;
- extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
- #define _PORTA_RA0 0x01
- #define _PORTA_AN0 0x01
- #define _PORTA_RA1 0x02
- #define _PORTA_AN1 0x02
- #define _PORTA_RA2 0x04
- #define _PORTA_AN2 0x04
- #define _PORTA_VREFM 0x04
- #define _PORTA_RA3 0x08
- #define _PORTA_AN3 0x08
- #define _PORTA_VREFP 0x08
- #define _PORTA_RA4 0x10
- #define _PORTA_T0CKI 0x10
- #define _PORTA_RA5 0x20
- #define _PORTA_AN4 0x20
- #define _PORTA_LVDIN 0x20
- #define _PORTA_HLVDIN 0x20
- #define _PORTA_RA6 0x40
- #define _PORTA_OSC2 0x40
- //==============================================================================
- //==============================================================================
- // PORTB Bits
- extern __at(0x0F81) __sfr PORTB;
- typedef union
- {
- struct
- {
- unsigned RB0 : 1;
- unsigned RB1 : 1;
- unsigned RB2 : 1;
- unsigned RB3 : 1;
- unsigned RB4 : 1;
- unsigned RB5 : 1;
- unsigned RB6 : 1;
- unsigned RB7 : 1;
- };
- struct
- {
- unsigned INT0 : 1;
- unsigned INT1 : 1;
- unsigned INT2 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned PGM : 1;
- unsigned PGC : 1;
- unsigned PGD : 1;
- };
- struct
- {
- unsigned INT : 3;
- unsigned : 5;
- };
- } __PORTBbits_t;
- extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
- #define _PORTB_RB0 0x01
- #define _PORTB_INT0 0x01
- #define _PORTB_RB1 0x02
- #define _PORTB_INT1 0x02
- #define _PORTB_RB2 0x04
- #define _PORTB_INT2 0x04
- #define _PORTB_RB3 0x08
- #define _PORTB_RB4 0x10
- #define _PORTB_RB5 0x20
- #define _PORTB_PGM 0x20
- #define _PORTB_RB6 0x40
- #define _PORTB_PGC 0x40
- #define _PORTB_RB7 0x80
- #define _PORTB_PGD 0x80
- //==============================================================================
- //==============================================================================
- // PORTC Bits
- extern __at(0x0F82) __sfr PORTC;
- typedef union
- {
- struct
- {
- unsigned RC0 : 1;
- unsigned RC1 : 1;
- unsigned RC2 : 1;
- unsigned : 1;
- unsigned RC4 : 1;
- unsigned RC5 : 1;
- unsigned RC6 : 1;
- unsigned RC7 : 1;
- };
- struct
- {
- unsigned T1OSO : 1;
- unsigned T1OSI : 1;
- unsigned CCP1 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned TX : 1;
- unsigned RX : 1;
- };
- struct
- {
- unsigned T13CKI : 1;
- unsigned : 1;
- unsigned P1A : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned CK : 1;
- unsigned : 1;
- };
- } __PORTCbits_t;
- extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
- #define _PORTC_RC0 0x01
- #define _PORTC_T1OSO 0x01
- #define _PORTC_T13CKI 0x01
- #define _PORTC_RC1 0x02
- #define _PORTC_T1OSI 0x02
- #define _PORTC_RC2 0x04
- #define _PORTC_CCP1 0x04
- #define _PORTC_P1A 0x04
- #define _PORTC_RC4 0x10
- #define _PORTC_RC5 0x20
- #define _PORTC_RC6 0x40
- #define _PORTC_TX 0x40
- #define _PORTC_CK 0x40
- #define _PORTC_RC7 0x80
- #define _PORTC_RX 0x80
- //==============================================================================
- //==============================================================================
- // PORTE Bits
- extern __at(0x0F84) __sfr PORTE;
- typedef struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned RE3 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __PORTEbits_t;
- extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
- #define _RE3 0x08
- //==============================================================================
- //==============================================================================
- // LATA Bits
- extern __at(0x0F89) __sfr LATA;
- typedef union
- {
- struct
- {
- unsigned LATA0 : 1;
- unsigned LATA1 : 1;
- unsigned LATA2 : 1;
- unsigned LATA3 : 1;
- unsigned LATA4 : 1;
- unsigned LATA5 : 1;
- unsigned LATA6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned LATA : 7;
- unsigned : 1;
- };
- } __LATAbits_t;
- extern __at(0x0F89) volatile __LATAbits_t LATAbits;
- #define _LATA0 0x01
- #define _LATA1 0x02
- #define _LATA2 0x04
- #define _LATA3 0x08
- #define _LATA4 0x10
- #define _LATA5 0x20
- #define _LATA6 0x40
- //==============================================================================
- //==============================================================================
- // LATB Bits
- extern __at(0x0F8A) __sfr LATB;
- typedef struct
- {
- unsigned LATB0 : 1;
- unsigned LATB1 : 1;
- unsigned LATB2 : 1;
- unsigned LATB3 : 1;
- unsigned LATB4 : 1;
- unsigned LATB5 : 1;
- unsigned LATB6 : 1;
- unsigned LATB7 : 1;
- } __LATBbits_t;
- extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
- #define _LATB0 0x01
- #define _LATB1 0x02
- #define _LATB2 0x04
- #define _LATB3 0x08
- #define _LATB4 0x10
- #define _LATB5 0x20
- #define _LATB6 0x40
- #define _LATB7 0x80
- //==============================================================================
- //==============================================================================
- // LATC Bits
- extern __at(0x0F8B) __sfr LATC;
- typedef struct
- {
- unsigned LATC0 : 1;
- unsigned LATC1 : 1;
- unsigned LATC2 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned LATC6 : 1;
- unsigned LATC7 : 1;
- } __LATCbits_t;
- extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
- #define _LATC0 0x01
- #define _LATC1 0x02
- #define _LATC2 0x04
- #define _LATC6 0x40
- #define _LATC7 0x80
- //==============================================================================
- //==============================================================================
- // DDRA Bits
- extern __at(0x0F92) __sfr DDRA;
- typedef union
- {
- struct
- {
- unsigned TRISA0 : 1;
- unsigned TRISA1 : 1;
- unsigned TRISA2 : 1;
- unsigned TRISA3 : 1;
- unsigned TRISA4 : 1;
- unsigned TRISA5 : 1;
- unsigned TRISA6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned RA0 : 1;
- unsigned RA1 : 1;
- unsigned RA2 : 1;
- unsigned RA3 : 1;
- unsigned RA4 : 1;
- unsigned RA5 : 1;
- unsigned RA6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned RA : 7;
- unsigned : 1;
- };
- struct
- {
- unsigned TRISA : 7;
- unsigned : 1;
- };
- } __DDRAbits_t;
- extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
- #define _TRISA0 0x01
- #define _RA0 0x01
- #define _TRISA1 0x02
- #define _RA1 0x02
- #define _TRISA2 0x04
- #define _RA2 0x04
- #define _TRISA3 0x08
- #define _RA3 0x08
- #define _TRISA4 0x10
- #define _RA4 0x10
- #define _TRISA5 0x20
- #define _RA5 0x20
- #define _TRISA6 0x40
- #define _RA6 0x40
- //==============================================================================
- //==============================================================================
- // TRISA Bits
- extern __at(0x0F92) __sfr TRISA;
- typedef union
- {
- struct
- {
- unsigned TRISA0 : 1;
- unsigned TRISA1 : 1;
- unsigned TRISA2 : 1;
- unsigned TRISA3 : 1;
- unsigned TRISA4 : 1;
- unsigned TRISA5 : 1;
- unsigned TRISA6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned RA0 : 1;
- unsigned RA1 : 1;
- unsigned RA2 : 1;
- unsigned RA3 : 1;
- unsigned RA4 : 1;
- unsigned RA5 : 1;
- unsigned RA6 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned RA : 7;
- unsigned : 1;
- };
- struct
- {
- unsigned TRISA : 7;
- unsigned : 1;
- };
- } __TRISAbits_t;
- extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
- #define _TRISA_TRISA0 0x01
- #define _TRISA_RA0 0x01
- #define _TRISA_TRISA1 0x02
- #define _TRISA_RA1 0x02
- #define _TRISA_TRISA2 0x04
- #define _TRISA_RA2 0x04
- #define _TRISA_TRISA3 0x08
- #define _TRISA_RA3 0x08
- #define _TRISA_TRISA4 0x10
- #define _TRISA_RA4 0x10
- #define _TRISA_TRISA5 0x20
- #define _TRISA_RA5 0x20
- #define _TRISA_TRISA6 0x40
- #define _TRISA_RA6 0x40
- //==============================================================================
- //==============================================================================
- // DDRB Bits
- extern __at(0x0F93) __sfr DDRB;
- typedef union
- {
- struct
- {
- unsigned TRISB0 : 1;
- unsigned TRISB1 : 1;
- unsigned TRISB2 : 1;
- unsigned TRISB3 : 1;
- unsigned TRISB4 : 1;
- unsigned TRISB5 : 1;
- unsigned TRISB6 : 1;
- unsigned TRISB7 : 1;
- };
- struct
- {
- unsigned RB0 : 1;
- unsigned RB1 : 1;
- unsigned RB2 : 1;
- unsigned RB3 : 1;
- unsigned RB4 : 1;
- unsigned RB5 : 1;
- unsigned RB6 : 1;
- unsigned RB7 : 1;
- };
- } __DDRBbits_t;
- extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
- #define _TRISB0 0x01
- #define _RB0 0x01
- #define _TRISB1 0x02
- #define _RB1 0x02
- #define _TRISB2 0x04
- #define _RB2 0x04
- #define _TRISB3 0x08
- #define _RB3 0x08
- #define _TRISB4 0x10
- #define _RB4 0x10
- #define _TRISB5 0x20
- #define _RB5 0x20
- #define _TRISB6 0x40
- #define _RB6 0x40
- #define _TRISB7 0x80
- #define _RB7 0x80
- //==============================================================================
- //==============================================================================
- // TRISB Bits
- extern __at(0x0F93) __sfr TRISB;
- typedef union
- {
- struct
- {
- unsigned TRISB0 : 1;
- unsigned TRISB1 : 1;
- unsigned TRISB2 : 1;
- unsigned TRISB3 : 1;
- unsigned TRISB4 : 1;
- unsigned TRISB5 : 1;
- unsigned TRISB6 : 1;
- unsigned TRISB7 : 1;
- };
- struct
- {
- unsigned RB0 : 1;
- unsigned RB1 : 1;
- unsigned RB2 : 1;
- unsigned RB3 : 1;
- unsigned RB4 : 1;
- unsigned RB5 : 1;
- unsigned RB6 : 1;
- unsigned RB7 : 1;
- };
- } __TRISBbits_t;
- extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
- #define _TRISB_TRISB0 0x01
- #define _TRISB_RB0 0x01
- #define _TRISB_TRISB1 0x02
- #define _TRISB_RB1 0x02
- #define _TRISB_TRISB2 0x04
- #define _TRISB_RB2 0x04
- #define _TRISB_TRISB3 0x08
- #define _TRISB_RB3 0x08
- #define _TRISB_TRISB4 0x10
- #define _TRISB_RB4 0x10
- #define _TRISB_TRISB5 0x20
- #define _TRISB_RB5 0x20
- #define _TRISB_TRISB6 0x40
- #define _TRISB_RB6 0x40
- #define _TRISB_TRISB7 0x80
- #define _TRISB_RB7 0x80
- //==============================================================================
- //==============================================================================
- // DDRC Bits
- extern __at(0x0F94) __sfr DDRC;
- typedef union
- {
- struct
- {
- unsigned TRISC0 : 1;
- unsigned TRISC1 : 1;
- unsigned TRISC2 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned TRISC6 : 1;
- unsigned TRISC7 : 1;
- };
- struct
- {
- unsigned RC0 : 1;
- unsigned RC1 : 1;
- unsigned RC2 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned RC6 : 1;
- unsigned RC7 : 1;
- };
- } __DDRCbits_t;
- extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
- #define _TRISC0 0x01
- #define _RC0 0x01
- #define _TRISC1 0x02
- #define _RC1 0x02
- #define _TRISC2 0x04
- #define _RC2 0x04
- #define _TRISC6 0x40
- #define _RC6 0x40
- #define _TRISC7 0x80
- #define _RC7 0x80
- //==============================================================================
- //==============================================================================
- // TRISC Bits
- extern __at(0x0F94) __sfr TRISC;
- typedef union
- {
- struct
- {
- unsigned TRISC0 : 1;
- unsigned TRISC1 : 1;
- unsigned TRISC2 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned TRISC6 : 1;
- unsigned TRISC7 : 1;
- };
- struct
- {
- unsigned RC0 : 1;
- unsigned RC1 : 1;
- unsigned RC2 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned RC6 : 1;
- unsigned RC7 : 1;
- };
- } __TRISCbits_t;
- extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
- #define _TRISC_TRISC0 0x01
- #define _TRISC_RC0 0x01
- #define _TRISC_TRISC1 0x02
- #define _TRISC_RC1 0x02
- #define _TRISC_TRISC2 0x04
- #define _TRISC_RC2 0x04
- #define _TRISC_TRISC6 0x40
- #define _TRISC_RC6 0x40
- #define _TRISC_TRISC7 0x80
- #define _TRISC_RC7 0x80
- //==============================================================================
- //==============================================================================
- // OSCTUNE Bits
- extern __at(0x0F9B) __sfr OSCTUNE;
- typedef union
- {
- struct
- {
- unsigned TUN0 : 1;
- unsigned TUN1 : 1;
- unsigned TUN2 : 1;
- unsigned TUN3 : 1;
- unsigned TUN4 : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned INTSRC : 1;
- };
- struct
- {
- unsigned TUN : 5;
- unsigned : 3;
- };
- } __OSCTUNEbits_t;
- extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
- #define _TUN0 0x01
- #define _TUN1 0x02
- #define _TUN2 0x04
- #define _TUN3 0x08
- #define _TUN4 0x10
- #define _INTSRC 0x80
- //==============================================================================
- //==============================================================================
- // PIE1 Bits
- extern __at(0x0F9D) __sfr PIE1;
- typedef struct
- {
- unsigned TMR1IE : 1;
- unsigned TMR2IE : 1;
- unsigned CCP1IE : 1;
- unsigned SSPIE : 1;
- unsigned TXIE : 1;
- unsigned RCIE : 1;
- unsigned ADIE : 1;
- unsigned : 1;
- } __PIE1bits_t;
- extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
- #define _TMR1IE 0x01
- #define _TMR2IE 0x02
- #define _CCP1IE 0x04
- #define _SSPIE 0x08
- #define _TXIE 0x10
- #define _RCIE 0x20
- #define _ADIE 0x40
- //==============================================================================
- //==============================================================================
- // PIR1 Bits
- extern __at(0x0F9E) __sfr PIR1;
- typedef struct
- {
- unsigned TMR1IF : 1;
- unsigned TMR2IF : 1;
- unsigned CCP1IF : 1;
- unsigned SSPIF : 1;
- unsigned TXIF : 1;
- unsigned RCIF : 1;
- unsigned ADIF : 1;
- unsigned : 1;
- } __PIR1bits_t;
- extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
- #define _TMR1IF 0x01
- #define _TMR2IF 0x02
- #define _CCP1IF 0x04
- #define _SSPIF 0x08
- #define _TXIF 0x10
- #define _RCIF 0x20
- #define _ADIF 0x40
- //==============================================================================
- //==============================================================================
- // IPR1 Bits
- extern __at(0x0F9F) __sfr IPR1;
- typedef struct
- {
- unsigned TMR1IP : 1;
- unsigned TMR2IP : 1;
- unsigned CCP1IP : 1;
- unsigned SSPIP : 1;
- unsigned TXIP : 1;
- unsigned RCIP : 1;
- unsigned ADIP : 1;
- unsigned : 1;
- } __IPR1bits_t;
- extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
- #define _TMR1IP 0x01
- #define _TMR2IP 0x02
- #define _CCP1IP 0x04
- #define _SSPIP 0x08
- #define _TXIP 0x10
- #define _RCIP 0x20
- #define _ADIP 0x40
- //==============================================================================
- //==============================================================================
- // PIE2 Bits
- extern __at(0x0FA0) __sfr PIE2;
- typedef union
- {
- struct
- {
- unsigned CCP2IE : 1;
- unsigned TMR3IE : 1;
- unsigned HLVDIE : 1;
- unsigned BCLIE : 1;
- unsigned EEIE : 1;
- unsigned USBIE : 1;
- unsigned CMIE : 1;
- unsigned OSCFIE : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned LVDIE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- } __PIE2bits_t;
- extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
- #define _CCP2IE 0x01
- #define _TMR3IE 0x02
- #define _HLVDIE 0x04
- #define _LVDIE 0x04
- #define _BCLIE 0x08
- #define _EEIE 0x10
- #define _USBIE 0x20
- #define _CMIE 0x40
- #define _OSCFIE 0x80
- //==============================================================================
- //==============================================================================
- // PIR2 Bits
- extern __at(0x0FA1) __sfr PIR2;
- typedef union
- {
- struct
- {
- unsigned CCP2IF : 1;
- unsigned TMR3IF : 1;
- unsigned HLVDIF : 1;
- unsigned BCLIF : 1;
- unsigned EEIF : 1;
- unsigned USBIF : 1;
- unsigned CMIF : 1;
- unsigned OSCFIF : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned LVDIF : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- } __PIR2bits_t;
- extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
- #define _CCP2IF 0x01
- #define _TMR3IF 0x02
- #define _HLVDIF 0x04
- #define _LVDIF 0x04
- #define _BCLIF 0x08
- #define _EEIF 0x10
- #define _USBIF 0x20
- #define _CMIF 0x40
- #define _OSCFIF 0x80
- //==============================================================================
- //==============================================================================
- // IPR2 Bits
- extern __at(0x0FA2) __sfr IPR2;
- typedef union
- {
- struct
- {
- unsigned CCP2IP : 1;
- unsigned TMR3IP : 1;
- unsigned HLVDIP : 1;
- unsigned BCLIP : 1;
- unsigned EEIP : 1;
- unsigned USBIP : 1;
- unsigned CMIP : 1;
- unsigned OSCFIP : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned LVDIP : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- } __IPR2bits_t;
- extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
- #define _CCP2IP 0x01
- #define _TMR3IP 0x02
- #define _HLVDIP 0x04
- #define _LVDIP 0x04
- #define _BCLIP 0x08
- #define _EEIP 0x10
- #define _USBIP 0x20
- #define _CMIP 0x40
- #define _OSCFIP 0x80
- //==============================================================================
- //==============================================================================
- // EECON1 Bits
- extern __at(0x0FA6) __sfr EECON1;
- typedef struct
- {
- unsigned RD : 1;
- unsigned WR : 1;
- unsigned WREN : 1;
- unsigned WRERR : 1;
- unsigned FREE : 1;
- unsigned : 1;
- unsigned CFGS : 1;
- unsigned EEPGD : 1;
- } __EECON1bits_t;
- extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
- #define _RD 0x01
- #define _WR 0x02
- #define _WREN 0x04
- #define _WRERR 0x08
- #define _FREE 0x10
- #define _CFGS 0x40
- #define _EEPGD 0x80
- //==============================================================================
- extern __at(0x0FA7) __sfr EECON2;
- extern __at(0x0FA8) __sfr EEDATA;
- extern __at(0x0FA9) __sfr EEADR;
- //==============================================================================
- // RCSTA Bits
- extern __at(0x0FAB) __sfr RCSTA;
- typedef union
- {
- struct
- {
- unsigned RX9D : 1;
- unsigned OERR : 1;
- unsigned FERR : 1;
- unsigned ADDEN : 1;
- unsigned CREN : 1;
- unsigned SREN : 1;
- unsigned RX9 : 1;
- unsigned SPEN : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned ADEN : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- } __RCSTAbits_t;
- extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
- #define _RX9D 0x01
- #define _OERR 0x02
- #define _FERR 0x04
- #define _ADDEN 0x08
- #define _ADEN 0x08
- #define _CREN 0x10
- #define _SREN 0x20
- #define _RX9 0x40
- #define _SPEN 0x80
- //==============================================================================
- //==============================================================================
- // TXSTA Bits
- extern __at(0x0FAC) __sfr TXSTA;
- typedef struct
- {
- unsigned TX9D : 1;
- unsigned TRMT : 1;
- unsigned BRGH : 1;
- unsigned SENDB : 1;
- unsigned SYNC : 1;
- unsigned TXEN : 1;
- unsigned TX9 : 1;
- unsigned CSRC : 1;
- } __TXSTAbits_t;
- extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
- #define _TX9D 0x01
- #define _TRMT 0x02
- #define _BRGH 0x04
- #define _SENDB 0x08
- #define _SYNC 0x10
- #define _TXEN 0x20
- #define _TX9 0x40
- #define _CSRC 0x80
- //==============================================================================
- extern __at(0x0FAD) __sfr TXREG;
- extern __at(0x0FAE) __sfr RCREG;
- extern __at(0x0FAF) __sfr SPBRG;
- extern __at(0x0FB0) __sfr SPBRGH;
- //==============================================================================
- // T3CON Bits
- extern __at(0x0FB1) __sfr T3CON;
- typedef union
- {
- struct
- {
- unsigned TMR3ON : 1;
- unsigned TMR3CS : 1;
- unsigned NOT_T3SYNC : 1;
- unsigned T3CCP1 : 1;
- unsigned T3CKPS0 : 1;
- unsigned T3CKPS1 : 1;
- unsigned T3CCP2 : 1;
- unsigned RD16 : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned T3SYNC : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned T3NSYNC : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 4;
- unsigned T3CKPS : 2;
- unsigned : 2;
- };
- } __T3CONbits_t;
- extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
- #define _T3CON_TMR3ON 0x01
- #define _T3CON_TMR3CS 0x02
- #define _T3CON_NOT_T3SYNC 0x04
- #define _T3CON_T3SYNC 0x04
- #define _T3CON_T3NSYNC 0x04
- #define _T3CON_T3CCP1 0x08
- #define _T3CON_T3CKPS0 0x10
- #define _T3CON_T3CKPS1 0x20
- #define _T3CON_T3CCP2 0x40
- #define _T3CON_RD16 0x80
- //==============================================================================
- extern __at(0x0FB2) __sfr TMR3;
- extern __at(0x0FB2) __sfr TMR3L;
- extern __at(0x0FB3) __sfr TMR3H;
- //==============================================================================
- // CMCON Bits
- extern __at(0x0FB4) __sfr CMCON;
- typedef union
- {
- struct
- {
- unsigned CM0 : 1;
- unsigned CM1 : 1;
- unsigned CM2 : 1;
- unsigned CIS : 1;
- unsigned C1INV : 1;
- unsigned C2INV : 1;
- unsigned C1OUT : 1;
- unsigned C2OUT : 1;
- };
- struct
- {
- unsigned CM : 3;
- unsigned : 5;
- };
- } __CMCONbits_t;
- extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
- #define _CM0 0x01
- #define _CM1 0x02
- #define _CM2 0x04
- #define _CIS 0x08
- #define _C1INV 0x10
- #define _C2INV 0x20
- #define _C1OUT 0x40
- #define _C2OUT 0x80
- //==============================================================================
- //==============================================================================
- // CVRCON Bits
- extern __at(0x0FB5) __sfr CVRCON;
- typedef union
- {
- struct
- {
- unsigned CVR0 : 1;
- unsigned CVR1 : 1;
- unsigned CVR2 : 1;
- unsigned CVR3 : 1;
- unsigned CVRSS : 1;
- unsigned CVRR : 1;
- unsigned CVROE : 1;
- unsigned CVREN : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned CVREF : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned CVR : 4;
- unsigned : 4;
- };
- } __CVRCONbits_t;
- extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
- #define _CVR0 0x01
- #define _CVR1 0x02
- #define _CVR2 0x04
- #define _CVR3 0x08
- #define _CVRSS 0x10
- #define _CVREF 0x10
- #define _CVRR 0x20
- #define _CVROE 0x40
- #define _CVREN 0x80
- //==============================================================================
- //==============================================================================
- // CCP1AS Bits
- extern __at(0x0FB6) __sfr CCP1AS;
- typedef union
- {
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned PSSAC0 : 1;
- unsigned PSSAC1 : 1;
- unsigned ECCPAS0 : 1;
- unsigned ECCPAS1 : 1;
- unsigned ECCPAS2 : 1;
- unsigned ECCPASE : 1;
- };
- struct
- {
- unsigned : 2;
- unsigned PSSAC : 2;
- unsigned : 4;
- };
- struct
- {
- unsigned : 4;
- unsigned ECCPAS : 3;
- unsigned : 1;
- };
- } __CCP1ASbits_t;
- extern __at(0x0FB6) volatile __CCP1ASbits_t CCP1ASbits;
- #define _PSSAC0 0x04
- #define _PSSAC1 0x08
- #define _ECCPAS0 0x10
- #define _ECCPAS1 0x20
- #define _ECCPAS2 0x40
- #define _ECCPASE 0x80
- //==============================================================================
- //==============================================================================
- // ECCP1AS Bits
- extern __at(0x0FB6) __sfr ECCP1AS;
- typedef union
- {
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned PSSAC0 : 1;
- unsigned PSSAC1 : 1;
- unsigned ECCPAS0 : 1;
- unsigned ECCPAS1 : 1;
- unsigned ECCPAS2 : 1;
- unsigned ECCPASE : 1;
- };
- struct
- {
- unsigned : 2;
- unsigned PSSAC : 2;
- unsigned : 4;
- };
- struct
- {
- unsigned : 4;
- unsigned ECCPAS : 3;
- unsigned : 1;
- };
- } __ECCP1ASbits_t;
- extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
- #define _ECCP1AS_PSSAC0 0x04
- #define _ECCP1AS_PSSAC1 0x08
- #define _ECCP1AS_ECCPAS0 0x10
- #define _ECCP1AS_ECCPAS1 0x20
- #define _ECCP1AS_ECCPAS2 0x40
- #define _ECCP1AS_ECCPASE 0x80
- //==============================================================================
- //==============================================================================
- // CCP1DEL Bits
- extern __at(0x0FB7) __sfr CCP1DEL;
- typedef struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned PRSEN : 1;
- } __CCP1DELbits_t;
- extern __at(0x0FB7) volatile __CCP1DELbits_t CCP1DELbits;
- #define _PRSEN 0x80
- //==============================================================================
- //==============================================================================
- // ECCP1DEL Bits
- extern __at(0x0FB7) __sfr ECCP1DEL;
- typedef struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned PRSEN : 1;
- } __ECCP1DELbits_t;
- extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
- #define _ECCP1DEL_PRSEN 0x80
- //==============================================================================
- //==============================================================================
- // BAUDCON Bits
- extern __at(0x0FB8) __sfr BAUDCON;
- typedef union
- {
- struct
- {
- unsigned ABDEN : 1;
- unsigned WUE : 1;
- unsigned : 1;
- unsigned BRG16 : 1;
- unsigned TXCKP : 1;
- unsigned RXDTP : 1;
- unsigned RCIDL : 1;
- unsigned ABDOVF : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned SCKP : 1;
- unsigned : 1;
- unsigned RCMT : 1;
- unsigned : 1;
- };
- } __BAUDCONbits_t;
- extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
- #define _ABDEN 0x01
- #define _WUE 0x02
- #define _BRG16 0x08
- #define _TXCKP 0x10
- #define _SCKP 0x10
- #define _RXDTP 0x20
- #define _RCIDL 0x40
- #define _RCMT 0x40
- #define _ABDOVF 0x80
- //==============================================================================
- //==============================================================================
- // BAUDCTL Bits
- extern __at(0x0FB8) __sfr BAUDCTL;
- typedef union
- {
- struct
- {
- unsigned ABDEN : 1;
- unsigned WUE : 1;
- unsigned : 1;
- unsigned BRG16 : 1;
- unsigned TXCKP : 1;
- unsigned RXDTP : 1;
- unsigned RCIDL : 1;
- unsigned ABDOVF : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned SCKP : 1;
- unsigned : 1;
- unsigned RCMT : 1;
- unsigned : 1;
- };
- } __BAUDCTLbits_t;
- extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
- #define _BAUDCTL_ABDEN 0x01
- #define _BAUDCTL_WUE 0x02
- #define _BAUDCTL_BRG16 0x08
- #define _BAUDCTL_TXCKP 0x10
- #define _BAUDCTL_SCKP 0x10
- #define _BAUDCTL_RXDTP 0x20
- #define _BAUDCTL_RCIDL 0x40
- #define _BAUDCTL_RCMT 0x40
- #define _BAUDCTL_ABDOVF 0x80
- //==============================================================================
- //==============================================================================
- // CCP2CON Bits
- extern __at(0x0FBA) __sfr CCP2CON;
- typedef union
- {
- struct
- {
- unsigned CCP2M0 : 1;
- unsigned CCP2M1 : 1;
- unsigned CCP2M2 : 1;
- unsigned CCP2M3 : 1;
- unsigned DC2B0 : 1;
- unsigned DC2B1 : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned CCP2M : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned : 4;
- unsigned DC2B : 2;
- unsigned : 2;
- };
- } __CCP2CONbits_t;
- extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
- #define _CCP2M0 0x01
- #define _CCP2M1 0x02
- #define _CCP2M2 0x04
- #define _CCP2M3 0x08
- #define _DC2B0 0x10
- #define _DC2B1 0x20
- //==============================================================================
- extern __at(0x0FBB) __sfr CCPR2;
- extern __at(0x0FBB) __sfr CCPR2L;
- extern __at(0x0FBC) __sfr CCPR2H;
- //==============================================================================
- // CCP1CON Bits
- extern __at(0x0FBD) __sfr CCP1CON;
- typedef union
- {
- struct
- {
- unsigned CCP1M0 : 1;
- unsigned CCP1M1 : 1;
- unsigned CCP1M2 : 1;
- unsigned CCP1M3 : 1;
- unsigned DC1B0 : 1;
- unsigned DC1B1 : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned CCP1M : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned : 4;
- unsigned DC1B : 2;
- unsigned : 2;
- };
- } __CCP1CONbits_t;
- extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
- #define _CCP1M0 0x01
- #define _CCP1M1 0x02
- #define _CCP1M2 0x04
- #define _CCP1M3 0x08
- #define _DC1B0 0x10
- #define _DC1B1 0x20
- //==============================================================================
- extern __at(0x0FBE) __sfr CCPR1;
- extern __at(0x0FBE) __sfr CCPR1L;
- extern __at(0x0FBF) __sfr CCPR1H;
- //==============================================================================
- // ADCON2 Bits
- extern __at(0x0FC0) __sfr ADCON2;
- typedef union
- {
- struct
- {
- unsigned ADCS0 : 1;
- unsigned ADCS1 : 1;
- unsigned ADCS2 : 1;
- unsigned ACQT0 : 1;
- unsigned ACQT1 : 1;
- unsigned ACQT2 : 1;
- unsigned : 1;
- unsigned ADFM : 1;
- };
- struct
- {
- unsigned ADCS : 3;
- unsigned : 5;
- };
- struct
- {
- unsigned : 3;
- unsigned ACQT : 3;
- unsigned : 2;
- };
- } __ADCON2bits_t;
- extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
- #define _ADCS0 0x01
- #define _ADCS1 0x02
- #define _ADCS2 0x04
- #define _ACQT0 0x08
- #define _ACQT1 0x10
- #define _ACQT2 0x20
- #define _ADFM 0x80
- //==============================================================================
- //==============================================================================
- // ADCON1 Bits
- extern __at(0x0FC1) __sfr ADCON1;
- typedef union
- {
- struct
- {
- unsigned PCFG0 : 1;
- unsigned PCFG1 : 1;
- unsigned PCFG2 : 1;
- unsigned PCFG3 : 1;
- unsigned VCFG0 : 1;
- unsigned VCFG1 : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned PCFG : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned : 4;
- unsigned VCFG : 2;
- unsigned : 2;
- };
- } __ADCON1bits_t;
- extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
- #define _PCFG0 0x01
- #define _PCFG1 0x02
- #define _PCFG2 0x04
- #define _PCFG3 0x08
- #define _VCFG0 0x10
- #define _VCFG1 0x20
- //==============================================================================
- //==============================================================================
- // ADCON0 Bits
- extern __at(0x0FC2) __sfr ADCON0;
- typedef union
- {
- struct
- {
- unsigned ADON : 1;
- unsigned GO_NOT_DONE : 1;
- unsigned CHS0 : 1;
- unsigned CHS1 : 1;
- unsigned CHS2 : 1;
- unsigned CHS3 : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned GO_DONE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned DONE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned GO : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned NOT_DONE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 2;
- unsigned CHS : 4;
- unsigned : 2;
- };
- } __ADCON0bits_t;
- extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
- #define _ADON 0x01
- #define _GO_NOT_DONE 0x02
- #define _GO_DONE 0x02
- #define _DONE 0x02
- #define _GO 0x02
- #define _NOT_DONE 0x02
- #define _CHS0 0x04
- #define _CHS1 0x08
- #define _CHS2 0x10
- #define _CHS3 0x20
- //==============================================================================
- extern __at(0x0FC3) __sfr ADRES;
- extern __at(0x0FC3) __sfr ADRESL;
- extern __at(0x0FC4) __sfr ADRESH;
- //==============================================================================
- // SSPCON2 Bits
- extern __at(0x0FC5) __sfr SSPCON2;
- typedef struct
- {
- unsigned SEN : 1;
- unsigned RSEN : 1;
- unsigned PEN : 1;
- unsigned RCEN : 1;
- unsigned ACKEN : 1;
- unsigned ACKDT : 1;
- unsigned ACKSTAT : 1;
- unsigned GCEN : 1;
- } __SSPCON2bits_t;
- extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
- #define _SEN 0x01
- #define _RSEN 0x02
- #define _PEN 0x04
- #define _RCEN 0x08
- #define _ACKEN 0x10
- #define _ACKDT 0x20
- #define _ACKSTAT 0x40
- #define _GCEN 0x80
- //==============================================================================
- //==============================================================================
- // SSPCON1 Bits
- extern __at(0x0FC6) __sfr SSPCON1;
- typedef union
- {
- struct
- {
- unsigned SSPM0 : 1;
- unsigned SSPM1 : 1;
- unsigned SSPM2 : 1;
- unsigned SSPM3 : 1;
- unsigned CKP : 1;
- unsigned SSPEN : 1;
- unsigned SSPOV : 1;
- unsigned WCOL : 1;
- };
- struct
- {
- unsigned SSPM : 4;
- unsigned : 4;
- };
- } __SSPCON1bits_t;
- extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
- #define _SSPM0 0x01
- #define _SSPM1 0x02
- #define _SSPM2 0x04
- #define _SSPM3 0x08
- #define _CKP 0x10
- #define _SSPEN 0x20
- #define _SSPOV 0x40
- #define _WCOL 0x80
- //==============================================================================
- //==============================================================================
- // SSPSTAT Bits
- extern __at(0x0FC7) __sfr SSPSTAT;
- typedef union
- {
- struct
- {
- unsigned BF : 1;
- unsigned UA : 1;
- unsigned R_NOT_W : 1;
- unsigned S : 1;
- unsigned P : 1;
- unsigned D_NOT_A : 1;
- unsigned CKE : 1;
- unsigned SMP : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned R_W : 1;
- unsigned I2C_START : 1;
- unsigned I2C_STOP : 1;
- unsigned D_A : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned I2C_READ : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned I2C_DAT : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned NOT_W : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned NOT_A : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned NOT_WRITE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned NOT_ADDRESS : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned READ_WRITE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned DATA_ADDRESS : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned R : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned D : 1;
- unsigned : 1;
- unsigned : 1;
- };
- } __SSPSTATbits_t;
- extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
- #define _BF 0x01
- #define _UA 0x02
- #define _R_NOT_W 0x04
- #define _R_W 0x04
- #define _I2C_READ 0x04
- #define _NOT_W 0x04
- #define _NOT_WRITE 0x04
- #define _READ_WRITE 0x04
- #define _R 0x04
- #define _S 0x08
- #define _I2C_START 0x08
- #define _P 0x10
- #define _I2C_STOP 0x10
- #define _D_NOT_A 0x20
- #define _D_A 0x20
- #define _I2C_DAT 0x20
- #define _NOT_A 0x20
- #define _NOT_ADDRESS 0x20
- #define _DATA_ADDRESS 0x20
- #define _D 0x20
- #define _CKE 0x40
- #define _SMP 0x80
- //==============================================================================
- extern __at(0x0FC8) __sfr SSPADD;
- extern __at(0x0FC9) __sfr SSPBUF;
- //==============================================================================
- // T2CON Bits
- extern __at(0x0FCA) __sfr T2CON;
- typedef union
- {
- struct
- {
- unsigned T2CKPS0 : 1;
- unsigned T2CKPS1 : 1;
- unsigned TMR2ON : 1;
- unsigned T2OUTPS0 : 1;
- unsigned T2OUTPS1 : 1;
- unsigned T2OUTPS2 : 1;
- unsigned T2OUTPS3 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned TOUTPS0 : 1;
- unsigned TOUTPS1 : 1;
- unsigned TOUTPS2 : 1;
- unsigned TOUTPS3 : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned T2CKPS : 2;
- unsigned : 6;
- };
- struct
- {
- unsigned : 3;
- unsigned TOUTPS : 4;
- unsigned : 1;
- };
- struct
- {
- unsigned : 3;
- unsigned T2OUTPS : 4;
- unsigned : 1;
- };
- } __T2CONbits_t;
- extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
- #define _T2CKPS0 0x01
- #define _T2CKPS1 0x02
- #define _TMR2ON 0x04
- #define _T2OUTPS0 0x08
- #define _TOUTPS0 0x08
- #define _T2OUTPS1 0x10
- #define _TOUTPS1 0x10
- #define _T2OUTPS2 0x20
- #define _TOUTPS2 0x20
- #define _T2OUTPS3 0x40
- #define _TOUTPS3 0x40
- //==============================================================================
- extern __at(0x0FCB) __sfr PR2;
- extern __at(0x0FCC) __sfr TMR2;
- //==============================================================================
- // T1CON Bits
- extern __at(0x0FCD) __sfr T1CON;
- typedef union
- {
- struct
- {
- unsigned TMR1ON : 1;
- unsigned TMR1CS : 1;
- unsigned NOT_T1SYNC : 1;
- unsigned T1OSCEN : 1;
- unsigned T1CKPS0 : 1;
- unsigned T1CKPS1 : 1;
- unsigned T1RUN : 1;
- unsigned RD16 : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned T1SYNC : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned : 4;
- unsigned T1CKPS : 2;
- unsigned : 2;
- };
- } __T1CONbits_t;
- extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
- #define _TMR1ON 0x01
- #define _TMR1CS 0x02
- #define _NOT_T1SYNC 0x04
- #define _T1SYNC 0x04
- #define _T1OSCEN 0x08
- #define _T1CKPS0 0x10
- #define _T1CKPS1 0x20
- #define _T1RUN 0x40
- #define _RD16 0x80
- //==============================================================================
- extern __at(0x0FCE) __sfr TMR1;
- extern __at(0x0FCE) __sfr TMR1L;
- extern __at(0x0FCF) __sfr TMR1H;
- //==============================================================================
- // RCON Bits
- extern __at(0x0FD0) __sfr RCON;
- typedef union
- {
- struct
- {
- unsigned NOT_BOR : 1;
- unsigned NOT_POR : 1;
- unsigned NOT_PD : 1;
- unsigned NOT_TO : 1;
- unsigned NOT_RI : 1;
- unsigned : 1;
- unsigned SBOREN : 1;
- unsigned IPEN : 1;
- };
- struct
- {
- unsigned BOR : 1;
- unsigned POR : 1;
- unsigned PD : 1;
- unsigned TO : 1;
- unsigned RI : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned NOT_IPEN : 1;
- };
- } __RCONbits_t;
- extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
- #define _NOT_BOR 0x01
- #define _BOR 0x01
- #define _NOT_POR 0x02
- #define _POR 0x02
- #define _NOT_PD 0x04
- #define _PD 0x04
- #define _NOT_TO 0x08
- #define _TO 0x08
- #define _NOT_RI 0x10
- #define _RI 0x10
- #define _SBOREN 0x40
- #define _IPEN 0x80
- #define _NOT_IPEN 0x80
- //==============================================================================
- //==============================================================================
- // WDTCON Bits
- extern __at(0x0FD1) __sfr WDTCON;
- typedef union
- {
- struct
- {
- unsigned SWDTEN : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned SWDTE : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- } __WDTCONbits_t;
- extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
- #define _SWDTEN 0x01
- #define _SWDTE 0x01
- //==============================================================================
- //==============================================================================
- // HLVDCON Bits
- extern __at(0x0FD2) __sfr HLVDCON;
- typedef union
- {
- struct
- {
- unsigned HLVDL0 : 1;
- unsigned HLVDL1 : 1;
- unsigned HLVDL2 : 1;
- unsigned HLVDL3 : 1;
- unsigned HLVDEN : 1;
- unsigned IRVST : 1;
- unsigned : 1;
- unsigned VDIRMAG : 1;
- };
- struct
- {
- unsigned LVDL0 : 1;
- unsigned LVDL1 : 1;
- unsigned LVDL2 : 1;
- unsigned LVDL3 : 1;
- unsigned LVDEN : 1;
- unsigned IVRST : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned LVV0 : 1;
- unsigned LVV1 : 1;
- unsigned LVV2 : 1;
- unsigned LVV3 : 1;
- unsigned : 1;
- unsigned BGST : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned LVV : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned HLVDL : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned LVDL : 4;
- unsigned : 4;
- };
- } __HLVDCONbits_t;
- extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
- #define _HLVDL0 0x01
- #define _LVDL0 0x01
- #define _LVV0 0x01
- #define _HLVDL1 0x02
- #define _LVDL1 0x02
- #define _LVV1 0x02
- #define _HLVDL2 0x04
- #define _LVDL2 0x04
- #define _LVV2 0x04
- #define _HLVDL3 0x08
- #define _LVDL3 0x08
- #define _LVV3 0x08
- #define _HLVDEN 0x10
- #define _LVDEN 0x10
- #define _IRVST 0x20
- #define _IVRST 0x20
- #define _BGST 0x20
- #define _VDIRMAG 0x80
- //==============================================================================
- //==============================================================================
- // LVDCON Bits
- extern __at(0x0FD2) __sfr LVDCON;
- typedef union
- {
- struct
- {
- unsigned HLVDL0 : 1;
- unsigned HLVDL1 : 1;
- unsigned HLVDL2 : 1;
- unsigned HLVDL3 : 1;
- unsigned HLVDEN : 1;
- unsigned IRVST : 1;
- unsigned : 1;
- unsigned VDIRMAG : 1;
- };
- struct
- {
- unsigned LVDL0 : 1;
- unsigned LVDL1 : 1;
- unsigned LVDL2 : 1;
- unsigned LVDL3 : 1;
- unsigned LVDEN : 1;
- unsigned IVRST : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned LVV0 : 1;
- unsigned LVV1 : 1;
- unsigned LVV2 : 1;
- unsigned LVV3 : 1;
- unsigned : 1;
- unsigned BGST : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned LVV : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned HLVDL : 4;
- unsigned : 4;
- };
- struct
- {
- unsigned LVDL : 4;
- unsigned : 4;
- };
- } __LVDCONbits_t;
- extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
- #define _LVDCON_HLVDL0 0x01
- #define _LVDCON_LVDL0 0x01
- #define _LVDCON_LVV0 0x01
- #define _LVDCON_HLVDL1 0x02
- #define _LVDCON_LVDL1 0x02
- #define _LVDCON_LVV1 0x02
- #define _LVDCON_HLVDL2 0x04
- #define _LVDCON_LVDL2 0x04
- #define _LVDCON_LVV2 0x04
- #define _LVDCON_HLVDL3 0x08
- #define _LVDCON_LVDL3 0x08
- #define _LVDCON_LVV3 0x08
- #define _LVDCON_HLVDEN 0x10
- #define _LVDCON_LVDEN 0x10
- #define _LVDCON_IRVST 0x20
- #define _LVDCON_IVRST 0x20
- #define _LVDCON_BGST 0x20
- #define _LVDCON_VDIRMAG 0x80
- //==============================================================================
- //==============================================================================
- // OSCCON Bits
- extern __at(0x0FD3) __sfr OSCCON;
- typedef union
- {
- struct
- {
- unsigned SCS0 : 1;
- unsigned SCS1 : 1;
- unsigned IOFS : 1;
- unsigned OSTS : 1;
- unsigned IRCF0 : 1;
- unsigned IRCF1 : 1;
- unsigned IRCF2 : 1;
- unsigned IDLEN : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned FLTS : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- };
- struct
- {
- unsigned SCS : 2;
- unsigned : 6;
- };
- struct
- {
- unsigned : 4;
- unsigned IRCF : 3;
- unsigned : 1;
- };
- } __OSCCONbits_t;
- extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
- #define _SCS0 0x01
- #define _SCS1 0x02
- #define _IOFS 0x04
- #define _FLTS 0x04
- #define _OSTS 0x08
- #define _IRCF0 0x10
- #define _IRCF1 0x20
- #define _IRCF2 0x40
- #define _IDLEN 0x80
- //==============================================================================
- //==============================================================================
- // T0CON Bits
- extern __at(0x0FD5) __sfr T0CON;
- typedef union
- {
- struct
- {
- unsigned T0PS0 : 1;
- unsigned T0PS1 : 1;
- unsigned T0PS2 : 1;
- unsigned PSA : 1;
- unsigned T0SE : 1;
- unsigned T0CS : 1;
- unsigned T08BIT : 1;
- unsigned TMR0ON : 1;
- };
- struct
- {
- unsigned T0PS : 3;
- unsigned : 5;
- };
- } __T0CONbits_t;
- extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
- #define _T0PS0 0x01
- #define _T0PS1 0x02
- #define _T0PS2 0x04
- #define _PSA 0x08
- #define _T0SE 0x10
- #define _T0CS 0x20
- #define _T08BIT 0x40
- #define _TMR0ON 0x80
- //==============================================================================
- extern __at(0x0FD6) __sfr TMR0;
- extern __at(0x0FD6) __sfr TMR0L;
- extern __at(0x0FD7) __sfr TMR0H;
- //==============================================================================
- // STATUS Bits
- extern __at(0x0FD8) __sfr STATUS;
- typedef struct
- {
- unsigned C : 1;
- unsigned DC : 1;
- unsigned Z : 1;
- unsigned OV : 1;
- unsigned N : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- } __STATUSbits_t;
- extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
- #define _C 0x01
- #define _DC 0x02
- #define _Z 0x04
- #define _OV 0x08
- #define _N 0x10
- //==============================================================================
- extern __at(0x0FD9) __sfr FSR2L;
- extern __at(0x0FDA) __sfr FSR2H;
- extern __at(0x0FDB) __sfr PLUSW2;
- extern __at(0x0FDC) __sfr PREINC2;
- extern __at(0x0FDD) __sfr POSTDEC2;
- extern __at(0x0FDE) __sfr POSTINC2;
- extern __at(0x0FDF) __sfr INDF2;
- extern __at(0x0FE0) __sfr BSR;
- extern __at(0x0FE1) __sfr FSR1L;
- extern __at(0x0FE2) __sfr FSR1H;
- extern __at(0x0FE3) __sfr PLUSW1;
- extern __at(0x0FE4) __sfr PREINC1;
- extern __at(0x0FE5) __sfr POSTDEC1;
- extern __at(0x0FE6) __sfr POSTINC1;
- extern __at(0x0FE7) __sfr INDF1;
- extern __at(0x0FE8) __sfr WREG;
- extern __at(0x0FE9) __sfr FSR0L;
- extern __at(0x0FEA) __sfr FSR0H;
- extern __at(0x0FEB) __sfr PLUSW0;
- extern __at(0x0FEC) __sfr PREINC0;
- extern __at(0x0FED) __sfr POSTDEC0;
- extern __at(0x0FEE) __sfr POSTINC0;
- extern __at(0x0FEF) __sfr INDF0;
- //==============================================================================
- // INTCON3 Bits
- extern __at(0x0FF0) __sfr INTCON3;
- typedef union
- {
- struct
- {
- unsigned INT1IF : 1;
- unsigned INT2IF : 1;
- unsigned : 1;
- unsigned INT1IE : 1;
- unsigned INT2IE : 1;
- unsigned : 1;
- unsigned INT1IP : 1;
- unsigned INT2IP : 1;
- };
- struct
- {
- unsigned INT1F : 1;
- unsigned INT2F : 1;
- unsigned : 1;
- unsigned INT1E : 1;
- unsigned INT2E : 1;
- unsigned : 1;
- unsigned INT1P : 1;
- unsigned INT2P : 1;
- };
- } __INTCON3bits_t;
- extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
- #define _INT1IF 0x01
- #define _INT1F 0x01
- #define _INT2IF 0x02
- #define _INT2F 0x02
- #define _INT1IE 0x08
- #define _INT1E 0x08
- #define _INT2IE 0x10
- #define _INT2E 0x10
- #define _INT1IP 0x40
- #define _INT1P 0x40
- #define _INT2IP 0x80
- #define _INT2P 0x80
- //==============================================================================
- //==============================================================================
- // INTCON2 Bits
- extern __at(0x0FF1) __sfr INTCON2;
- typedef union
- {
- struct
- {
- unsigned RBIP : 1;
- unsigned : 1;
- unsigned TMR0IP : 1;
- unsigned : 1;
- unsigned INTEDG2 : 1;
- unsigned INTEDG1 : 1;
- unsigned INTEDG0 : 1;
- unsigned NOT_RBPU : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned T0IP : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned RBPU : 1;
- };
- } __INTCON2bits_t;
- extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
- #define _RBIP 0x01
- #define _TMR0IP 0x04
- #define _T0IP 0x04
- #define _INTEDG2 0x10
- #define _INTEDG1 0x20
- #define _INTEDG0 0x40
- #define _NOT_RBPU 0x80
- #define _RBPU 0x80
- //==============================================================================
- //==============================================================================
- // INTCON Bits
- extern __at(0x0FF2) __sfr INTCON;
- typedef union
- {
- struct
- {
- unsigned RBIF : 1;
- unsigned INT0IF : 1;
- unsigned TMR0IF : 1;
- unsigned RBIE : 1;
- unsigned INT0IE : 1;
- unsigned TMR0IE : 1;
- unsigned PEIE_GIEL : 1;
- unsigned GIE_GIEH : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned INT0F : 1;
- unsigned T0IF : 1;
- unsigned : 1;
- unsigned INT0E : 1;
- unsigned T0IE : 1;
- unsigned PEIE : 1;
- unsigned GIE : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned GIEL : 1;
- unsigned GIEH : 1;
- };
- } __INTCONbits_t;
- extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
- #define _RBIF 0x01
- #define _INT0IF 0x02
- #define _INT0F 0x02
- #define _TMR0IF 0x04
- #define _T0IF 0x04
- #define _RBIE 0x08
- #define _INT0IE 0x10
- #define _INT0E 0x10
- #define _TMR0IE 0x20
- #define _T0IE 0x20
- #define _PEIE_GIEL 0x40
- #define _PEIE 0x40
- #define _GIEL 0x40
- #define _GIE_GIEH 0x80
- #define _GIE 0x80
- #define _GIEH 0x80
- //==============================================================================
- extern __at(0x0FF3) __sfr PROD;
- extern __at(0x0FF3) __sfr PRODL;
- extern __at(0x0FF4) __sfr PRODH;
- extern __at(0x0FF5) __sfr TABLAT;
- extern __at(0x0FF6) __sfr TBLPTR;
- extern __at(0x0FF6) __sfr TBLPTRL;
- extern __at(0x0FF7) __sfr TBLPTRH;
- extern __at(0x0FF8) __sfr TBLPTRU;
- extern __at(0x0FF9) __sfr PC;
- extern __at(0x0FF9) __sfr PCL;
- extern __at(0x0FFA) __sfr PCLATH;
- extern __at(0x0FFB) __sfr PCLATU;
- //==============================================================================
- // STKPTR Bits
- extern __at(0x0FFC) __sfr STKPTR;
- typedef union
- {
- struct
- {
- unsigned STKPTR0 : 1;
- unsigned STKPTR1 : 1;
- unsigned STKPTR2 : 1;
- unsigned STKPTR3 : 1;
- unsigned STKPTR4 : 1;
- unsigned : 1;
- unsigned STKUNF : 1;
- unsigned STKFUL : 1;
- };
- struct
- {
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned : 1;
- unsigned STKOVF : 1;
- };
- struct
- {
- unsigned STKPTR : 5;
- unsigned : 3;
- };
- } __STKPTRbits_t;
- extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
- #define _STKPTR0 0x01
- #define _STKPTR1 0x02
- #define _STKPTR2 0x04
- #define _STKPTR3 0x08
- #define _STKPTR4 0x10
- #define _STKUNF 0x40
- #define _STKFUL 0x80
- #define _STKOVF 0x80
- //==============================================================================
- extern __at(0x0FFD) __sfr TOS;
- extern __at(0x0FFD) __sfr TOSL;
- extern __at(0x0FFE) __sfr TOSH;
- extern __at(0x0FFF) __sfr TOSU;
- //==============================================================================
- //
- // Configuration Bits
- //
- //==============================================================================
- #define __CONFIG1L 0x300000
- #define __CONFIG1H 0x300001
- #define __CONFIG2L 0x300002
- #define __CONFIG2H 0x300003
- #define __CONFIG3H 0x300005
- #define __CONFIG4L 0x300006
- #define __CONFIG5L 0x300008
- #define __CONFIG5H 0x300009
- #define __CONFIG6L 0x30000A
- #define __CONFIG6H 0x30000B
- #define __CONFIG7L 0x30000C
- #define __CONFIG7H 0x30000D
- //----------------------------- CONFIG1L Options -------------------------------
- #define _PLLDIV_1_1L 0xF8 // No prescale (4 MHz oscillator input drives PLL directly).
- #define _PLLDIV_2_1L 0xF9 // Divide by 2 (8 MHz oscillator input).
- #define _PLLDIV_3_1L 0xFA // Divide by 3 (12 MHz oscillator input).
- #define _PLLDIV_4_1L 0xFB // Divide by 4 (16 MHz oscillator input).
- #define _PLLDIV_5_1L 0xFC // Divide by 5 (20 MHz oscillator input).
- #define _PLLDIV_6_1L 0xFD // Divide by 6 (24 MHz oscillator input).
- #define _PLLDIV_10_1L 0xFE // Divide by 10 (40 MHz oscillator input).
- #define _PLLDIV_12_1L 0xFF // Divide by 12 (48 MHz oscillator input).
- #define _CPUDIV_OSC1_PLL2_1L 0xE7 // [Primary Oscillator Src: /1][96 MHz PLL Src: /2].
- #define _CPUDIV_OSC2_PLL3_1L 0xEF // [Primary Oscillator Src: /2][96 MHz PLL Src: /3].
- #define _CPUDIV_OSC3_PLL4_1L 0xF7 // [Primary Oscillator Src: /3][96 MHz PLL Src: /4].
- #define _CPUDIV_OSC4_PLL6_1L 0xFF // [Primary Oscillator Src: /4][96 MHz PLL Src: /6].
- #define _USBDIV_1_1L 0xDF // USB clock source comes directly from the primary oscillator block with no postscale.
- #define _USBDIV_2_1L 0xFF // USB clock source comes from the 96 MHz PLL divided by 2.
- //----------------------------- CONFIG1H Options -------------------------------
- #define _FOSC_XT_XT_1H 0xF0 // XT oscillator (XT).
- #define _FOSC_XTPLL_XT_1H 0xF2 // XT oscillator, PLL enabled (XTPLL).
- #define _FOSC_ECIO_EC_1H 0xF4 // EC oscillator, port function on RA6 (ECIO).
- #define _FOSC_EC_EC_1H 0xF5 // EC oscillator, CLKO function on RA6 (EC).
- #define _FOSC_ECPLLIO_EC_1H 0xF6 // EC oscillator, PLL enabled, port function on RA6 (ECPIO).
- #define _FOSC_ECPLL_EC_1H 0xF7 // EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL).
- #define _FOSC_INTOSCIO_EC_1H 0xF8 // Internal oscillator, port function on RA6, EC used by USB (INTIO).
- #define _FOSC_INTOSC_EC_1H 0xF9 // Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO).
- #define _FOSC_INTOSC_XT_1H 0xFA // Internal oscillator, XT used by USB (INTXT).
- #define _FOSC_INTOSC_HS_1H 0xFB // Internal oscillator, HS oscillator used by USB (INTHS).
- #define _FOSC_HS_1H 0xFC // HS oscillator (HS).
- #define _FOSC_HSPLL_HS_1H 0xFE // HS oscillator, PLL enabled (HSPLL).
- #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
- #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
- #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
- #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
- //----------------------------- CONFIG2L Options -------------------------------
- #define _PWRT_ON_2L 0xFE // PWRT enabled.
- #define _PWRT_OFF_2L 0xFF // PWRT disabled.
- #define _BOR_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
- #define _BOR_SOFT_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
- #define _BOR_ON_ACTIVE_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
- #define _BOR_ON_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
- #define _BORV_0_2L 0xE7 // Maximum setting.
- #define _BORV_1_2L 0xEF
- #define _BORV_2_2L 0xF7
- #define _BORV_3_2L 0xFF // Minimum setting.
- #define _VREGEN_OFF_2L 0xDF // USB voltage regulator disabled.
- #define _VREGEN_ON_2L 0xFF // USB voltage regulator enabled.
- //----------------------------- CONFIG2H Options -------------------------------
- #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
- #define _WDT_ON_2H 0xFF // WDT enabled.
- #define _WDTPS_1_2H 0xE1 // 1:1.
- #define _WDTPS_2_2H 0xE3 // 1:2.
- #define _WDTPS_4_2H 0xE5 // 1:4.
- #define _WDTPS_8_2H 0xE7 // 1:8.
- #define _WDTPS_16_2H 0xE9 // 1:16.
- #define _WDTPS_32_2H 0xEB // 1:32.
- #define _WDTPS_64_2H 0xED // 1:64.
- #define _WDTPS_128_2H 0xEF // 1:128.
- #define _WDTPS_256_2H 0xF1 // 1:256.
- #define _WDTPS_512_2H 0xF3 // 1:512.
- #define _WDTPS_1024_2H 0xF5 // 1:1024.
- #define _WDTPS_2048_2H 0xF7 // 1:2048.
- #define _WDTPS_4096_2H 0xF9 // 1:4096.
- #define _WDTPS_8192_2H 0xFB // 1:8192.
- #define _WDTPS_16384_2H 0xFD // 1:16384.
- #define _WDTPS_32768_2H 0xFF // 1:32768.
- //----------------------------- CONFIG3H Options -------------------------------
- #define _CCP2MX_OFF_3H 0xFE // CCP2 input/output is multiplexed with RB3.
- #define _CCP2MX_ON_3H 0xFF // CCP2 input/output is multiplexed with RC1.
- #define _PBADEN_OFF_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
- #define _PBADEN_ON_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
- #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
- #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
- #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR pin disabled.
- #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
- //----------------------------- CONFIG4L Options -------------------------------
- #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
- #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
- #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
- #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
- #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
- #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
- #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
- #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
- //----------------------------- CONFIG5L Options -------------------------------
- #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) is code-protected.
- #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) is not code-protected.
- #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) is code-protected.
- #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) is not code-protected.
- #define _CP2_ON_5L 0xFB // Block 2 (004000-005FFFh) is code-protected.
- #define _CP2_OFF_5L 0xFF // Block 2 (004000-005FFFh) is not code-protected.
- #define _CP3_ON_5L 0xF7 // Block 3 (006000-007FFFh) is code-protected.
- #define _CP3_OFF_5L 0xFF // Block 3 (006000-007FFFh) is not code-protected.
- //----------------------------- CONFIG5H Options -------------------------------
- #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) is code-protected.
- #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) is not code-protected.
- #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
- #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
- //----------------------------- CONFIG6L Options -------------------------------
- #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) is write-protected.
- #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) is not write-protected.
- #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) is write-protected.
- #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) is not write-protected.
- #define _WRT2_ON_6L 0xFB // Block 2 (004000-005FFFh) is write-protected.
- #define _WRT2_OFF_6L 0xFF // Block 2 (004000-005FFFh) is not write-protected.
- #define _WRT3_ON_6L 0xF7 // Block 3 (006000-007FFFh) is write-protected.
- #define _WRT3_OFF_6L 0xFF // Block 3 (006000-007FFFh) is not write-protected.
- //----------------------------- CONFIG6H Options -------------------------------
- #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
- #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
- #define _WRTB_ON_6H 0xBF // Boot block (000000-0007FFh) is write-protected.
- #define _WRTB_OFF_6H 0xFF // Boot block (000000-0007FFh) is not write-protected.
- #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
- #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
- //----------------------------- CONFIG7L Options -------------------------------
- #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) is protected from table reads executed in other blocks.
- #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks.
- #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) is protected from table reads executed in other blocks.
- #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks.
- #define _EBTR2_ON_7L 0xFB // Block 2 (004000-005FFFh) is protected from table reads executed in other blocks.
- #define _EBTR2_OFF_7L 0xFF // Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks.
- #define _EBTR3_ON_7L 0xF7 // Block 3 (006000-007FFFh) is protected from table reads executed in other blocks.
- #define _EBTR3_OFF_7L 0xFF // Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks.
- //----------------------------- CONFIG7H Options -------------------------------
- #define _EBTRB_ON_7H 0xBF // Boot block (000000-0007FFh) is protected from table reads executed in other blocks.
- #define _EBTRB_OFF_7H 0xFF // Boot block (000000-0007FFh) is not protected from table reads executed in other blocks.
- //==============================================================================
- #define __DEVID1 0x3FFFFE
- #define __DEVID2 0x3FFFFF
- #define __IDLOC0 0x200000
- #define __IDLOC1 0x200001
- #define __IDLOC2 0x200002
- #define __IDLOC3 0x200003
- #define __IDLOC4 0x200004
- #define __IDLOC5 0x200005
- #define __IDLOC6 0x200006
- #define __IDLOC7 0x200007
- #endif // #ifndef __PIC18F2550_H__
|