Help: ICE_SERVICE
This file contains a text description of the application service.c located
in the test subdirectory of the ICE tree. It is a C program that reads in
simple script files to control basic functions of an ICE card including
configuration, reset, dma, fileIO, and status.
The script files treat any line starting with a !, /, or # as a comment.
White space is trimmed from the front and back of each line.
Tokens are delimited by a white space, usually 2 or 3 per line.
The first token is the command followed by 1 or more arguments.
Valid commands and their arguments are:
CARD N config ! defines configuration of card number N
RESET N1 N2 ! reset cards N1 through N2
DMA M config ! defines configuration of DMA channel M
START M1 M2 ! starts DMA channels M1 through M2
WAIT M ! wait for DMA channel M to complete
STOP M1 M2 ! stops DMA channels M1 through M2
SET M name value ! set run time parameter
GET M name value ! get run time parameter
The CARD and DMA indices N and M can be 0 or 1 based.
The CARD config string is stored by index for use in the RESET and DMA commands.
The string is passed as is to the RESET routine, and substituted for the CARD=N
in the DMA command config string. This config string is passed to pic_open()
for that operation.
The RESET command performs a pic_reset() on card indices N1 through N2.
If N2 is not supplied, it defaults to N1.
The DMA command sets up a DMA channel operation. The config string contains a
list of flags using a key=value syntax to define the operation.
Pertinent flags are:
CARD=N ! config string for card N is inserted here
PORT=port ! port on card to use (ie. MODULE1,TUNER2,TBANK21)
RATE=rate ! sample rate in Hertz
BITS=bits ! sample size in bits
LENGTH=len ! length of circular memory buffer in seconds
DIR=io ! direction of transfer (-1=input 1=output)
XFER=xlen ! transfer length in bytes
FUNC=func ! argument to pic_dmafunc() (-2=continuous, >0=#passes)
FILE=filename ! filename to write into or read from
A list of all flags available may be found in flags.hlp.
The START command starts a thread for each dma indices M1 through M2.
If M2 is not supplied, it defaults to M1.
The WAIT command waits for a thread for dma on index M to complete.
If M = -1, it waits for a user keypress.
The STOP command stops the thread performing a dma on indices M1 through M2.
If M2 is not supplied, it defaults to M1.
At the end of the script, all cards are closed before exiting.
Here is an example script:
!!!!!!!!!!!!!!!!!!!!!!!!!
! Example service script
! CARD=x in DMA subs that into config
!!!!!!!!!!!!!!!!!!!!!!!!!
CARD 0 ICEPIC,DEVNO=0,IOM1=LB2DR3,IOM2=D2AWGR3,MUXCLK=P,
CARD 1 ICEPIC,DEVNO=2,IOM1=LB2DR3,IOM2=D2RF,MUXCLK=P,
RESET 0 1
DMA 0 CARD=0,PORT=PM0TUNER1,RATE=100e6,BITS=-16,LENGTH=1,DEC=4,MBITS=-16,RFFREQ=950,RFBW=40,RFGAIN=15,RFOPTS=(ENABLE|DCS|AIS|LNA|XREF),XMTGO,TC=CPUP0
DMA 1 CARD=0,PORT=MODULE2,RATE=25e6,BITS=-16,LENGTH=1,DIR=1,RFFREQ=70,RFATTEN=0
DMA 2 CARD=1,PORT=PM0TUNER1,RATE=100e6,BITS=-16,LENGTH=1,DEC=4,MBITS=-16,RFFREQ=950,RFBW=40,RFGAIN=15,RFOPTS=(ENABLE|DCS|AIS|LNA|XREF),XMTGO,TC=CPUP0
DMA 3 CARD=1,PORT=MODULE2,RATE=25e6,BITS=-16,LENGTH=1,DIR=1,RFFREQ=70,RFATTEN=0
START 0 3
WAIT
STOP 0 3