Texas Instruments TLV320AIC3007EVM-K TV Converter Box User Manual


 
G.3WritingScripts
www.ti.com
WritingScripts
Ascriptissimplyatextfilethatcontainsdatatosendtotheserialcontrolbuses.Thescriptinglanguageis
simple,asistheparserforthelanguage.Therefore,althoughtheprogramisnotforgivingaboutmistakes
madeinthesourcescriptfile,theformattingofthefileissimple.Consequently,mistakesarerare.
Eachlineinascriptfileisonecommand.Linescannotbeextendedbeyondoneline.Alineisterminated
byacarriagereturn.
Thefirstcharacterofalineisthecommand.Commandsare:
ISetinterfacebustouse
rReadfromtheserialcontrolbus
wWritetotheserialcontrolbus
#Comment
bBreak
dDelay
Thefirstcommand,I,setstheinterfacetouseforthecommandstofollow.Thiscommandmustbe
followedbyoneofthefollowingparameters:
i2cstdStandardmodeI
2
Cbus
i2cfastFastmodeI
2
Cbus
spi8SPIbuswith8-bitregisteraddressing
spi16SPIbuswith16-bitregisteraddressing
gpioUsetheUSB-MODEVMGPIOcapability
Forexample,ifafastmodeI
2
Cbusistobeused,thescriptbeginswith:
Ii2cfast
Nodatafollowsthebreakcommand.Anythingfollowingacommentcommandisignoredbytheparser,
providedthatitisonthesameline.Thedelaycommandallowstheusertospecifyatime,inmilliseconds,
thatthescriptpausesbeforeproceeding.
Note:Unlikeallothernumbersusedinthescriptcommands,thedelaytimeisenteredinadecimal
format.Also,notethatbecauseoflatencyintheUSBbusaswellasthetimeittakesthe
processorontheUSB-MODEVMtohandlerequests,thedelaytimemaynotbeprecise.
Aseriesofbytevaluesfollowseitherareadorwritecommand.Eachbytevalueisexpressedin
hexadecimal,andeachbytemustbeseparatedbyaspace.Commandsareinterpretedandsenttothe
TAS1020bytheprogramusingtheprotocoldescribedinSectionG.1.
ThefirstbytefollowingareadorwritecommandistheI
2
Cslaveaddressofthedevice(ifI
2
Cisused)or
thefirstdatabytetowrite(ifSPIisused—notethatSPIinterfacesarenotstandardizedonprotocols,so
themeaningofthisbytevarieswiththedevicebeingaddressedontheSPIbus).Thesecondbyteisthe
startingregisteraddressthatdataiswrittento(again,withI
2
C;SPIvaries—seeSectionG.1foradditional
informationaboutwhatvariationsmaybenecessaryforaparticularSPImode).Followingthesetwobytes
aredata,ifwriting;ifreading,thethirdbytevalueisthenumberofbytestoread,(expressedin
hexadecimal).
Forexample,towritethevalues0xAA0x55toanI
2
Cdevicewithaslaveaddressof0x90,startingata
registeraddressof0x03,onewouldwrite:
#examplescript
Ii2cfast
w9003AA55
r90032
SLAU286June2009USB-MODEVMProtocol49
SubmitDocumentationFeedback