外文翻译格式参考Word文档格式.docx
《外文翻译格式参考Word文档格式.docx》由会员分享,可在线阅读,更多相关《外文翻译格式参考Word文档格式.docx(13页珍藏版)》请在冰豆网上搜索。
![外文翻译格式参考Word文档格式.docx](https://file1.bdocx.com/fileroot1/2022-11/23/c3c04118-3a21-4012-993d-223130e9d00d/c3c04118-3a21-4012-993d-223130e9d00d1.gif)
1.1µ
C/GUIfeatures
C/GUIisdesignedtoprovideanefficient,processor-andLCDcontroller-indepen-dentgraphicaluserinterfaceforanyapplicationthatoperateswithagraphicalLCD.Itiscompatiblewithsingle-taskandmultitaskenvironments,withaproprietaryoperatingsystemorwithanycommercialRTOS.µ
C/GUIisshippedas"
sourcecode.ItmaybeadaptedtoanysizephysicalandvirtualdisplaywithanyLCDcon-trollerandCPU.Itsfeaturesincludethefollowing:
1.1.1General
Any8/16/32-bitCPU;
onlyanANSI"
compilerisrequired.
Any(monochrome,grayscaleorcolor)LCDwithanycontrollersupported(iftherightdriverisavailable).
MayworkwithoutLCDcontrolleronsmallerdisplays.
Anyinterfacesupportedusingconfigurationmacros.
Display-sizeconfigurable.
CharactersandbitmapsmaybewrittenatanypointontheLCD,notjustoneven-numberedbyteaddresses.
Routinesareoptimizedforbothsizeandspeed.
Compiletimeswitchesallowfordifferentoptimizations.
ForslowerLCDcontrollers,LCDcanbecachedinmemory,reducingaccesstoaminimumandresultinginveryhighspeed.
Clearstructure.
Virtualdisplaysupport;
thevirtualdisplaycanbelargerthantheactualdisplay.
1.1.2Graphiclibrary
Bitmapsofdifferentcolordepthssupported.
Bitmapconverteravailable.
Absolutelynofloating-pointusage.
Fastline/pointdrawing(withoutfloating-pointusage).
Veryfastdrawingofcircles/polygons.
Differentdrawingmodes.
1.1.3Fonts
Avarietyofdifferentfontsareshippedwiththebasicsoftware:
4*6,6*8,6*9,8*8,8*9,8*16,8*17,8*18,24*32,andproportionalfontswithpixel-heightsof8,10,13,16.Formoreinformation,seeChapter25:
"
StandardFonts"
.
Newfontscanbedefinedandsimplylinkedin.
Onlythefontsusedbytheapplicationareactuallylinkedtotheresultingexecut-able,resultinginminimumROMusage.
Fontsarefullyscalable,separatelyinXandY.
Fontconverteravailable;
anyfontavailableonyourhostsystem(i.e.Microsoft
Windows)canbeconverted.
1.1.4String/valueoutputroutines
Routinestoshowvaluesindecimal,binary,hexadecimal,anyfont.
Routinestoeditvaluesindecimal,binary,hexadecimal,anyfont.
1.1.5Windowmanager(WM)
Completewindowmanagementincludingclipping.OverwritingofareasoutsideaWindow’sclientareaisimpossible.
Windowscanbemovedandresized.
Callbackroutinessupported(usageoptional).
WMusesminimumRAM(app.20bytesperwindow).
1.1.6OptionalwidgetsforPClookandfeel
Widgets(windowobjects,alsoknownascontrols)areavailable.TheygenerallyOperateautomaticallyandaresimpletouse.
Touch-screen&
mousesupport
Forwindowobjectssuchasthebuttonwidget,µ
C/GUIofferstouch-screenand
Mousesupport.
1.1.7PCtools
Simulationplusviewer.
Bitmapconverter.
Fontconverter
1.2HowtoconnecttheLCDtothemicrocontroller
C/GUIhandlesallaccesstotheLCD.VirtuallyanyLCDcontrollercanbesupported,independentlyofhowitisaccessed.Fordetails,pleaserefertoChapter20:
Low-LevelConfiguration"
.Also,pleasegetincontactwithusifyourLCDcontrollerisnotsupported.WearecurrentlywritingdriversforallLCDcontrollersavailableonthemarketandmayalreadyhaveaprovendriverfortheLCDcontrollerthatyouintendtouse.Itisusuallyverysimpletowritetheroutines(ormacros)usedtoaccesstheLCDinyourapplication.MIcriumoffersthecustomizationservices,ifnecessarywithyourtargethardware.
ItdoesnotreallymatterhowtheLCDisconnectedtothesystemaslongasitissomehowaccessiblebysoftware,whichmaybeaccomplishedinavarietyofways.Mostoftheseinterfacesaresupportedbyadriverwhichissuppliedinsourcecodeform.Thisdriverdoesnotnormallyrequiremodifications,butisconfiguredforyourhardwarebymakingchangesinthefileLCDConf.h.DetailsabouthowtocustomizeadrivertoyourhardwareasnecessaryareexplainedinChapter22:
LCDDrivers"
.ThemostcommonwaystoaccesstheLCDaredescribedasfollows.Ifyousimplywanttounderstandhowtouseµ
C/GUI,youmayskipthissection.
1.2.1LCDwithmemory-mappedLCDcontroller:
TheLCDcontrollerisconnecteddirectlytothedatabusofthesystem,whichmeansthecontrollercanbeaccessedjustlikeaRAM.Thisisaveryefficientwayofaccess-ingtheLCDcontrollerandismostrecommended.TheLCDaddressesaredefinedtothesegmentLCDSEG,andinordertobeabletoaccesstheLCDthelinker/locatorsimplyneedstobetoldwheretolocatethissegment.Thelocationmustbeidenticaltotheaccessaddressinphysicaladdressspace.DriversareavailableforthistypeofinterfaceandfordifferentLCDcontrollers.
1.2.2LCDwithLCDcontrollerconnectedtoport/buffer
ForslowerLCDcontrollersusedonfastprocessors,theuseofport-linesmaybetheonlysolution.ThismethodofaccessingtheLCDhasthedisadvantageofbeingsome-whatslowerthandirectbus-interfacebut,particularlywithacachethatminimizestheaccessestotheLCD,theLCDupdateisnotsloweddownsignificantly.Allthatneedstobedoneistodefineroutinesormacroswhichsetorreadthehardwareports/buffersthattheLCDisconnectedto.ThistypeofinterfaceisalsosupportedbydifferentdriversforthedifferentLCDcontrollers.
1.2.3Proprietarysolutions:
LCDwithoutLCDcontroller
TheLCDcanalsobeconnectedwithoutanLCDcontroller.Inthiscase,theLCDdataisusuallysupplieddirectlybythecontrollerviaa4-or8-bitshiftregister.Thesepro-prietaryhardwaresolutionshavetheadvantageofbeinginexpensive,butthedisad-vantageofusingupmuchoftheavailablecomputationtime.DependingontheCPU,thiscanbeanythingbetween20andalmost100percent;
withslowerCPUs,itisreallynotpossibleatall.ThistypeofinterfacedoesnotrequireaspecificLCDdriverbecauseµ
C/GUIsimplyplacesallthedisplaydataintotheLCDcache.Youmustwritethehardware-dependentportionthatperiodicallytransfersthedatainthecachememorytoyourLCD.Samplecodefortransferringthevideoimageintothedisplayisavailableinboth"
andoptimizedassemblerforM16CandM16C/80.
1.3Configuringµ
TheConfigfoldershouldcontaintheconfigurationfilesmatchingyourorder.ThefileLCDConf.hnormallycontainsallthedefinitionsnecessarytoadoptµ
C/GUItoyourLCD,whichisthemaintaskwhenconfiguringµ
C/GUI.Fordetails,pleaseseeChapter20:
Ifµ
C/GUIisnotconfiguredcorrectly,becauseyoudidnotselecttherightdisplayres-olutionorchosethewrongLCDcontroller,itwillprobablynotdisplayanythingatallordisplaysomethingthatdoesnotresemblewhatyouexpected.Sotakecaretotai-lorLCDConf.htoyourneeds.Ifyoudonotwishtodealwiththisprocess,Micriµ
mcandoitforyou,aswellastestµ
C/GUIinyourapplicationwithyourhardwareandyourLCD.
Typesofconfigurationmacros
Thefollowingtypesofconfigurationmacrosexist:
1.3.1Binaryswitches"
B"
Switchescanhaveavalueofeither0or1,where0meansdeactivatedand1meansactivated(actuallyanythingotherthan0wouldwork,butusing1makesiteasiertoreadaconfigfile).Theseswitchescanenableordisableacertainfunctionalityorbehavior.Switchesarethesimplestformofconfigurationmacro.
1.3.2Numericalvalues"
N"
Numericalvaluesareusedsomewhereinthecodeinplaceofanumericalconstant.TypicalexamplesareintheconfigurationoftheresolutionofanLCD.
1.3.3Selectionswitches"
S"
Selectionswitchesareusedtoselectoneoutofmultipleoptionswhereonlyoneofthoseoptionscanbeselected.AtypicalexamplemightbetheselectionofthetypeofLCDcontrollerused,wherethenumberselecteddenoteswhichsourcecode(inwhichLCDdriver)isusedtogenerateobjectcode.
1.3.4Alias"
A"
Amacrowhichoperateslikeasimpletextsubstitute.AnexamplewouldbethedefineU8,inwhichthepreprocessorwouldreplacewithunsignedchar.
1.3.5Functionreplacements"
F"
Macroscanbasicallybetreatedlikeregularfunctionsalthoughcertainlimitationsapply,asamacroisstillputintothecodeassimpletextreplacement.Functionreplacementsaremainlyusedtoaddspecificfunctionalitytoamodule(suchastheaccesstoanLCD)whichishighlyhardware-dependent.Thistypeofmacroisalwaysdeclaredusingbrackets(andoptionalparameters).µ
1.4Initializingµ
TheroutineGUI_Init()initializestheLCDandtheinternaldatastructuresofµ
C/GUI,andmustbecalledbeforeanyotherµ
C/GUIfunction.Thisisdonebyplacingthefollowinglineintotheinitsequenceofyourprogram:
GUI_Init();
Ifthiscallisleftout,theentiregraphicssystemwillnotbeinitializedandwillthere-forenotbeready.
1.5Usingµ
C/GUIwithtargethardware
Thefollowingisjustabasicoutlineofthegeneralstepsthatshouldbetakenwhenstartingtoprogramwithµ
C/GU