CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc CF2 API Reference (PDF) - Persistor Instruments Inc

persistor.com
from persistor.com More from this publisher
10.07.2015 Views

CF2 API ReferenceTUClose – Close the specified port and release its memoryDescription:Prototype:Inputs:Returns:wordvoid TUClose(TUPort *tup);*tup is a pointer to the portNothingNotes:TUGetDefaultParams – Return the default TPU UART open parametersDescription:Prototype:Inputs:Returns:wordTUChParams *TUGetDefaultParams(void);NoneA pointer to a TUChParams struct containing the TPU UART parametersNotes:typedef struct{short bits;short parity;short autobaud;long baud;short rxpri;short txpri;short rxqsz;short txqsz;short tpfbsz;} TUChParams;// data bits exclusive of start, stop, parity// parity: 'o','O','e','E', all else is none// automatically adjust baud when clock changes// baud rate// receive channel TPUPriority// transmit channel TPUPriority// receive channel queue buffer size// transmit channel queue buffer size// transmit channel printf buffer sizeTUInit – Initialize the TPU UART moduleDescription:Prototype:Inputs:Returns:Call this at the start of your program before opening TPU UART ports.void TUInit(Callocf *callocf, Freef *freef);References to calloc and free functions used so that the TPU UART software can manage thememory used by the port.NothingPERSISTORInstruments Inc.70 of 84CF2 API Reference7/19/2005

CF2 API ReferenceTUOpen – Open a TPU UART port for serial communicationsDescription:Prototype:Inputs:Returns:Specify separate valid TPU channels (1 to 15) for receive and transmit. Specify -1 for rxch for atransmit only port, -1 for txch for receive only.TUPort *TUOpen(short rxch, short txch, long baud, TUChParams *tp);rxch is the receive TPU Channel Numbertxch is the transmit TPU Channel Numberbaud is the desired baud*tp is a pointer to the TUChParams containing the channel parametersA pointer to the port or NULL if an error occursNotes:TURelease – Close all ports then release all memory and resources allocated to TPU UARTsDescription:Prototype:Inputs:Returns:This is done automatically when your program quits. You use it if you need to dynamicallyreconfigure your systems TPUs.void TURelease(void);NoneNothingTURxFlush – Delete any data in the receive queueDescription:Prototype:Inputs:Returns:Delete any data in the receive queuevoid TURxFlush(TUPort *tup);*tup is a pointer to the portNothingTURxGetByte – Wait for, and return the next wordDescription:Prototype:Inputs:Returns:Wait for, and return the next wordshort TURxGetByte(TUPort *tup, bool block);*tup is a pointer to the portblock is TRUE if you want to wait for a character and FALSE if you do not wish to waitThe characterTURxGetByteWithTimeout – Return next wordDescription:Prototype:Inputs:Returns:Return next wordshort TURxGetByteWithTimeout(TUPort *tup, short millisecs);*tup is a pointer to the portmillisecs is the timeout value in millisecondsReturns the next word or -1 on timeoutPERSISTORInstruments Inc.71 of 84CF2 API Reference7/19/2005

<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>TUClose – Close the specified port and release its memoryDescription:Prototype:Inputs:Returns:wordvoid TUClose(TUPort *tup);*tup is a pointer to the portNothingNotes:TUGetDefaultParams – Return the default TPU UART open parametersDescription:Prototype:Inputs:Returns:wordTUChParams *TUGetDefaultParams(void);NoneA pointer to a TUChParams struct containing the TPU UART parametersNotes:typedef struct{short bits;short parity;short autobaud;long baud;short rxpri;short txpri;short rxqsz;short txqsz;short tpfbsz;} TUChParams;// data bits exclusive of start, stop, parity// parity: 'o','O','e','E', all else is none// automatically adjust baud when clock changes// baud rate// receive channel TPUPriority// transmit channel TPUPriority// receive channel queue buffer size// transmit channel queue buffer size// transmit channel printf buffer sizeTUInit – Initialize the TPU UART moduleDescription:Prototype:Inputs:Returns:Call this at the start of your program before opening TPU UART ports.void TUInit(Callocf *callocf, Freef *freef);<strong>Reference</strong>s to calloc and free functions used so that the TPU UART software can manage thememory used by the port.NothingPERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.70 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!