/*
	Z0SEND.C

	Port Z0 device send program. This program demonstrates how to use port
	Z0 as an AASC device for sending a stream of data.
*/

#use aascz0.lib

main() {
	char rBuf[0x100];
	char wBuf[0x100];
	auto char localBuf[0x80];
	auto unsigned count;
	auto struct _Channel *chan;
	
	_GLOBAL_INIT();

	chan = aascOpen(DEV_Z0,
		0,
		ASCI_PARAM_8N1+ASCI_PARAM_1200*16,
		NULL);

	aascSetReadBuf(chan,rBuf,sizeof(rBuf));
	aascSetWriteBuf(chan,wBuf,sizeof(wBuf));
	aascTxSwitch(chan,1);
	aascRxSwitch(chan,1);
	
	while (1) {
		hitwd();
		while (!aascWriteBlk(chan,"012345678",9,1));
	}
}
