************************************ * Full-Duplex Serial Driver v1.1 * * (C) 2006 Parallax, Inc. * ************************************ Object "FullDuplexSerial" Interface: PUB start(rxpin, txpin, mode, baudrate) : okay PUB stop PUB rxcheck : rxbyte PUB rx : rxbyte PUB tx(txbyte) PUB str(stringptr) PUB dec(value) PUB hex(value, digits) PUB bin(value, digits) Program: 156 Longs Variable: 18 Longs _______________________________________________ PUB start(rxpin, txpin, mode, baudrate) : okay Start serial driver - starts a cog returns false if no cog available mode bit 0 = invert rx mode bit 1 = invert tx mode bit 2 = open-drain/source tx mode bit 3 = ignore tx echo on rx _________ PUB stop Stop serial driver - frees a cog _____________________ PUB rxcheck : rxbyte Check if byte received (never waits) returns -1 if no byte, $00..$FF if byte ________________ PUB rx : rxbyte Receive byte (may wait for byte) returns $00..$FF _______________ PUB tx(txbyte) Send byte (may wait for room in buffer) ___________________ PUB str(stringptr) Send string _______________ PUB dec(value) Print a decimal number _______________________ PUB hex(value, digits) Print a hexadecimal number _______________________ PUB bin(value, digits) Print a binary number