CF2 API Reference (PDF) - Persistor Instruments Inc
CF2 API Reference (PDF) - Persistor Instruments Inc CF2 API Reference (PDF) - Persistor Instruments Inc
CF2 API ReferenceSerial Controller Interface Drivers and FunctionsSummary of Serial Interface Drivers and FunctionsThe Serial Controller Interface is the hardware subsystem that deals with all transactions over the main serialport (UART).SCIConfigureSCIGetConfigSCIRxBreakSCIRxFlushSCIRxGetByteSCIRxGetCharSCIRxGetCharWithTimeoutSCIRxHandshakeSCIRxQueuedCountSCIRxSetBufferedSCIRxTxIdleSCITxBreakSCITxFlushSCITxHandshakeSCITxPutByteSCITxPutCharSCITxQueuedCountSCITxSetBufferedSCITxWaitCompletionEIAAssertTXXEIACheckRXXEIAEnableRxEIAForceOffSet the baud rate and parityGet the baud rate and parityReturn true if break is seen for at least millisecsDelete any data in the receive queueReturn the next word, wait if block is trueWait for, and return the next wordReturn next byte from receive queue with timeoutSet receive flow controlReturn the number of characters in the receive queueSelect buffered (true) or non-buffered receiveReturn true if all Rx and Tx flags indicate idleStart (-1) , stop (0) , or send timed break (+ val)Delete any data in the transmit queueSet transmit flow controlTransmit byte, wait if block is trueTransmit byteReturn the number of words in the transmit queueSelect buffered (true) or non-buffered transmitWait for all transmission to completeAssert /TXXGet State of /RXXEnable RS232 receiversForce RS232 transmitters offPERSISTORInstruments Inc.52 of 84CF2 API Reference7/19/2005
CF2 API ReferenceSTDIO WarningThe ANSI C I/O libraries provided with the CF2 are, for the most part, even higher level wrappers to thesedriver functions. However, in an effort of duplicate exactly the behavior of the ANSI stdio system, the stdiofunctions often provide software buffering and queues. While you should feel free to use and inter-mingleboth these driver level functions and stdio functions, it should be noted that due to the software bufferingused by the stdio library, the outcome of intermingling these two groups of functions can yield unexpectedresults. If you, as a developer, choose to use both libraries, you should be careful to flush the buffers of eachsubsystem (driver calls and stdio) before using the other. Not doing so will not cause any fatal problems, butcan cause confusion. For instance, if you were using the stdio printf function, and then immediately followed itwith a driver call that also output data to the serial port, it is likely that the data output by the driver callwould appear on the serial port before the data printed with stdio printf.Error CodesMany of the driver calls, particularly those which deal with fetching a byte from the receive portion of themain UART, return a short integer (16 bits) instead of a char (8 bits) as you might expect. The reason for thisis so that error information can be passed back with the character. The character fetched is always in theLSB(low 8 bits) of the short so that if it is automatically typecast into a char, your character will survive andonly the error codes will be lost. Similarly, if a char is passed to a function that expects a short for thepurpose of holding error codes in the MSB, there should not be any unexpected behavior. In the MSB (high 8bits) are error codes that are tested using the following masks:enum {RxD_OR_MASK = 0x8000 // Overrun Error Flag, RxD_NF_MASK = 0x4000 // Noise Error Flag, RxD_FE_MASK = 0x2000 // Framing Error Flag, RxD_PF_MASK = 0x1000 // Parity Error Flag, RxD_BOV_MASK = 0x0800 // Buffer Overflow Flag, RxD_TOSS_MASK = 0x0400 // Throw Away Flag (user sets), RxD_RPTF_MASK = 0x0200 // Repeat Filter Call Flag (user sets), RxD_ERR_MASK = 0xF800 // Any Error Flags, RxD_DATA9_MASK = 0x01FF // Receive Data, 9 Bits, RxD_DATA8_MASK = 0x00FF // Receive Data, 8 Bits, RxD_DATA7_MASK = 0x007F // Receive Data, 7 Bits (ASCII), RxD_NO_DATA = 0xFCFF // Return value for no data available};By AND'ing any of these masks with the short that is returned with a given function, the user's application candetermine what, if any, error occurred during the operation._cfx_sercomm.h contains the error code enumeration.PERSISTORInstruments Inc.53 of 84CF2 API Reference7/19/2005
- Page 1 and 2: PERSISTOR ® CF2API ReferenceCopyri
- Page 3 and 4: CF2 API ReferenceATA Device Drivers
- Page 5 and 6: CF2 API ReferenceBigIDEA IDE Driver
- Page 7 and 8: CF2 API ReferenceBIOSVersionCheck -
- Page 9 and 10: CF2 API ReferenceCheckSum32 -- Upda
- Page 11 and 12: CF2 API ReferenceChip Select Wrappe
- Page 13 and 14: CF2 API ReferenceCompactFlash Low L
- Page 15 and 16: CF2 API ReferenceBelow are macros d
- Page 17 and 18: CF2 API ReferenceCIOprintf - Simple
- Page 19 and 20: CF2 API Referenceuprintf -- A clone
- Page 21 and 22: CF2 API ReferenceDIRMatchName -- Re
- Page 23 and 24: CF2 API ReferenceLED Signal Functio
- Page 25 and 26: CF2 API ReferencePeriodic Interrupt
- Page 27 and 28: CF2 API ReferencePicoDOS Initializa
- Page 29 and 30: CF2 API ReferencePin I/O Drivers, F
- Page 31 and 32: CF2 API ReferencePinIO -- Make an I
- Page 33 and 34: CF2 API ReferencePIOClear -- Config
- Page 35 and 36: CF2 API ReferencePing-Pong Buffer F
- Page 37 and 38: CF2 API ReferencePPBPutWord -- Writ
- Page 39 and 40: CF2 API ReferenceQSMRun - Start the
- Page 41 and 42: CF2 API ReferenceQuery/Reply Functi
- Page 43 and 44: CF2 API ReferenceQRdouble -- Query/
- Page 45 and 46: CF2 API ReferenceQueued PicoBUS (QS
- Page 47 and 48: CF2 API ReferenceQPBSetup -- Set up
- Page 49 and 50: CF2 API ReferenceReal Time Clock Dr
- Page 51: CF2 API ReferenceRTCtime -- ANSI st
- Page 55 and 56: CF2 API ReferenceSCIRxFlush -- Dele
- Page 57 and 58: CF2 API ReferenceSCIRxTxIdle -- Ret
- Page 59 and 60: CF2 API ReferenceSCITxWaitCompletio
- Page 61 and 62: CF2 API ReferenceTable Driven Comma
- Page 63 and 64: CF2 API ReferenceCmdIsNumber- Is Co
- Page 65 and 66: CF2 API ReferenceTime Processing Un
- Page 67 and 68: CF2 API ReferencePrototype:Inputs:N
- Page 69 and 70: CF2 API ReferenceTPU UartSummary of
- Page 71 and 72: CF2 API ReferenceTUOpen - Open a TP
- Page 73 and 74: CF2 API ReferenceTUTxFlush - Delete
- Page 75 and 76: CF2 API ReferenceUtility Functionse
- Page 77 and 78: CF2 API Referencesscantime -- scan
- Page 79 and 80: CF2 API ReferenceVEEDelete -- Delet
- Page 81 and 82: CF2 API ReferenceVEEStoreFloat -- S
- Page 83 and 84: CF2 API ReferencePinBus, 30PinClear
<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>Serial Controller Interface Drivers and FunctionsSummary of Serial Interface Drivers and FunctionsThe Serial Controller Interface is the hardware subsystem that deals with all transactions over the main serialport (UART).SCIConfigureSCIGetConfigSCIRxBreakSCIRxFlushSCIRxGetByteSCIRxGetCharSCIRxGetCharWithTimeoutSCIRxHandshakeSCIRxQueuedCountSCIRxSetBufferedSCIRxTxIdleSCITxBreakSCITxFlushSCITxHandshakeSCITxPutByteSCITxPutCharSCITxQueuedCountSCITxSetBufferedSCITxWaitCompletionEIAAssertTXXEIACheckRXXEIAEnableRxEIAForceOffSet the baud rate and parityGet the baud rate and parityReturn true if break is seen for at least millisecsDelete any data in the receive queueReturn the next word, wait if block is trueWait for, and return the next wordReturn next byte from receive queue with timeoutSet receive flow controlReturn the number of characters in the receive queueSelect buffered (true) or non-buffered receiveReturn true if all Rx and Tx flags indicate idleStart (-1) , stop (0) , or send timed break (+ val)Delete any data in the transmit queueSet transmit flow controlTransmit byte, wait if block is trueTransmit byteReturn the number of words in the transmit queueSelect buffered (true) or non-buffered transmitWait for all transmission to completeAssert /TXXGet State of /RXXEnable RS232 receiversForce RS232 transmitters offPERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.52 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005