Commands of Script

param:
    param is used to set the parameter of the environment, supported parameters are:
    1. exit_on_fail: exit when a failure is detected, default value is 0.
    2. no_commit: do not commit automatically on write commands. Commands will be commited on "commit" command or any read commands.

    Format: param PARAM VALUE
    Example: param exit_on_fail 1

misc-help:
    This command is used to display all supported commands.

shell:
    This command is used to enter into a new command shell, command shells can be nested. It's usually used with -V option to enter shell mode.

run:
    This command is used to run a script file, currently supported script file is Versaloon Test Script ---- .vts files. And "run" command can be used in one script file to call another script file.

    Format: run SCRIPT_FILE [quiet]
    Example: run test.vts quiet

loop:
    This command is used to define the number of times next valid command will be executed. It's only valid on the next command.

    Format: loop COUNT
    Example: loop 10000

exit:
    This command is used to exit current shell. If shells are nested, the latest shell will be exited.

close:
    This command is used to close the vsprog program, all nested shells will be exited.

log_info:
    This command is used to output information on the screen.

    Format: log_info "text to be outputted on the screen"

getchar:
    This command is used to wait for input from keyboard.

sleep:
    This command is used to make vsprog to sleep for defined ms.

    Format: sleep MS
    Example: sleep 100

quiet:
    This command is used to enter/exit quiet mode. If no parameter or the paramter is '1', vsprog will enter into quiet mode. If the parameter is '0', vsprog will exit quiet mode.

    Format: quiet [0/1]
    Example: quiet

free-all:
    This command is used to free all the memory allocated for the current target. This command is usually called to prepare for the next operation.

o:
    This command is parser for -o option. It has the same usage as -o option. Note that there should be a space after "o" command.

s:
    This command is parser for -s option. It has the same usage as -s option. Note that there should be a space after "s" command.

c:
    This command is parser for -c option. It has the same usage as -c option. Note that there should be a space after "c" command.

t:
    This command is parser for -t option. It has the same usage as -t option. Note that there should be a space after "t" command.

F:
    This command is parser for -F option. It has the same usage as -F option. Note that there should be a space after "F" command.

K:
    This command is parser for -K option. It has the same usage as -K option. Note that there should be a space after "K" command.

W:
    This command is parser for -W option. It has the same usage as -W option. Note that there should be a space after "W" command.

A:
    This command is parser for -A option. It has the same usage as -A option.

J:
    This command is parser for -J option. It has the same usage as -J option. Note that there should be a space after "J" command.

m:
    This command is parser for -m option. It has the same usage as -m option. Note that there should be a space after "m" command.

x:
    This command is parser for -x option. It has the same usage as -x option. Note that there should be a space after "x" command.

I:
    This command is parser for -I option. It has the same usage as -I option. Note that there should be a space after "I" command.

O:
    This command is parser for -O option. It has the same usage as -O option. Note that there should be a space after "O" command.

C:
    This command is parser for -C option. It has the same usage as -C option. Note that there should be a space after "C" command.

operate:
    This command is used to perform the operation defined by "o" command.

L:
    This command is used to display all the connected programmers.

p:
    This command is used to define and init a programmer. The default programmer is Versaloon. If "p" is called without parameter, the default programmer is specified. If "p" command is called when a programmer is initialized, the programmer will be finalized, and then the new programmer will be initialized even though the new programmer is the same as the older one. So this command is usually used to re-initialize a programmer.

get_tvcc:
    This command is used to get the voltage on target VCC.

set_tvcc:
    This command is used to set the voltage on target VCC. It has one parameter defining the mV to output. If the parameter is 0, voltage output is disabled. For VersaloonMiniRelease1 hardware, only 3300 can be applied as the parameter to set_tvcc.

    Format: set_tvcc MV
    Example: set_tvcc 3300, set_tvcc 0

gpio_init:
    This command is used to initialize the GPIO module, if it has parameters compatible to gpio_config, gpio_config will be called with the parameters. GPIO module MUST be first initialized before using. And if GPIO module is no longer used, gpio_fini should be called.

    Format: gpio_init [MASK IN_OUT VALUE]
    Example: gpio_init 1 0 1

gpio_fini:
    This command is used to finalize the GPIO module when GPIO module is no longer used.

gpio_config:
    This command is used to configure the GPIO pin. It has 3 parameters. The 1st is MASK used to define the GPIO Port affected by the command. The 2nd is IN_OUT value, 1 for output; 0 for input. The 3rd is VALUE, if the corresponding port is configured to be in put, VALUE is used to define the pull status, 1 for pull up; 0 for pull down. The most frequently used MASK is 0x01, which is SRST.

    Format: gpio_config MASK IN_OUT VALUE
    Example: gpio_config 1 0 1

gpio_out:
    This command is used to output on a GPIO port.

    Format: gpio_out MASK VALUE
    Example: gpio_out 1 0

gpio_in:
    This command is used to read the specified GPIO port.

    Format: gpio_in MASK
    Example: gpio_in 1

spi_init:
    This command initialize the SPI module, if it has parameters compatible to spi_config, spi_config will be called with the parameters. SPI module should be initialized before using. And if SPI module is no longer used, spi_fini should be called.

    Format: spi_init [KHZ CPOL CPHA FIRSTBITS]
    Example: spi_init 1000 1 1 1

spi_fini:
    This command is used to finalize the SPI module when SPI module is no longer used.

spi_config:
    This command is used to configure the SPI interface.

    Format: spi_config KHZ CPOL CPHA FIRSTBIT
    Example: spi_config 1000 1 1 1

spi_io:
    This command is used to send data to MOSI and received reply from MISO.

    Format: spi_io SIZE DATA
    Example: spi_io 4 0xAC 0x53 0x00 0x00

iic_init:
    This command initialize the IIC module, if it has parameters compatible to iic_config, iic_config will be called with the parameters. IIC module should be initialized before using. And if IIC module is no longer used, iic_fini should be called.

    Format: iic_init KHZ MAX_DELAY_US
    Example: iic_init 100 20000

iic_fini:
    This command is used to finalize the IIC module when IIC module is no longer used.

iic_config:
    This command is used to configure IIC interface.

    Format: iic_config KHZ MAX_DELAY_US
    Example: iic_config 100 20000

iic_write:
    This command is used to write data to IIC slave.

    Format: iic_write ADDR SIZE DATA
    Example: iic_write 0x22 4 0x00 0x01 0x02 0x03

iic_read:
    This command is used to read data from IIC slave.

    Format: iic_read ADDR SIZE
    Example: iic_read 0x22 4

delayus:
    This command is used to make programmer delay for defined us.

    Format: delayus US
    Example: delayus 10

delayms:
    This command is used to make programmer delay for defined ms.

    Format: delayms MS
    Example: delayms 100

commit:
    This command is used to commit all uncommitted operations.