Page 1 of 1

VS1010 utility programs

Posted: Fri 2019-08-23 7:48
by Aleksi
Greetings!


Here are two small utility programs called "Delete" and "Copy". With these programs you can delete and copy files (NOT folders) directly from terminal.

To use program "Delete" you need to insert delete.dlx file into your SYS folder and to delete some file (lets say test.txt from sys folder) you can give command "delete D:sys/test.txt".

To use program "Copy" you need to insert copy.dlx as well as program ParamSpl.dlx (handles the parameters given to program Copy) to your sys folder. To copy a file you need to give command "copy source destination". For example "copy D:test.txt D:newTest.txt". Note that destination filename can not be longer than 8.3 characters. For example "12345678.123" is fine.

Binaries are provided below as well as solution files for further development.


I hope this is helpful for you. Feedback and questions are welcome!


Kind regards,

VLSI Solution's trainee
Aleksi

Re: VS1010 utility programs

Posted: Fri 2019-11-08 12:37
by Panu
DiskFree, ported from VS1005 VSOS 3.54 root sources to VS1010D.

Here's a handy way to run DiskFree from your program:

Code: Select all

extern u_int32 scratch;
ioresult main (char *params) {

	RunLib("DISKFREE","-p 1401 D:");
	printf("D: has %ld kB free.\n",scratch);

}
And the result:
VS1010>free
D: has 959968 kB free.

VS1010>
This takes advantage of 5 words of fixed scratch area in VS1010, which is in X address 1401. Make sure you have both DiskFree.dlx and ParamSpl.dlx in your SYS folder.

GpioCheckPins

Posted: Tue 2019-11-19 12:10
by Panu
Here's a small program, GpioCheckPins, which keeps printing the states of all GPIO pins until ESC key is pressed. It's useful for checking which pins your board's buttons are connected to. Pushing the buttons causes the corresponding number to change between 0 and 1.

Here's the printout:

Code: Select all

VS1010>GpioPinCheck
 0.0123456789abcdef 1.0123456789abcdef 2.0123456789abcdef
   0001101110100000   1111000010011100   1111101100001100
Here's the code:

Code: Select all

ioresult main (char *params) {
	int i,j;
	for (j=0; j<3; j++) {
		printf(" %d.",j);
		for (i=0; i<16; i++) {
			printf("%x",i);
		}
	}
	printf("\n");
	while(USEX(1700) != 27) { // Check for UART0 console ESC key in VS1010 without requiring symbols
		printf("\r");
		for (j=0; j<3; j++) {
			printf("   ");
			for (i=0; i<16; i++) {
				printf("%x",GpioReadPin(j*16+i));
			}
		}
	}
}