CF2 API Reference (PDF) - Persistor Instruments Inc
CF2 API Reference (PDF) - Persistor Instruments Inc CF2 API Reference (PDF) - Persistor Instruments Inc
CF2 API ReferenceConsole I/O Functions and MacrosSummary of Console I/O Functions and Macros The Console I/O functions provide patchable low levelaccess to your routines that interact with a user through a console interface. By default, all of these functionswork through the 68332 SCI (Serial Controller Interface), and all the PicoDOS command shell functions workthrough CIO functions, as do the default standard library console functions.CIOdrainCIOgetcCIOgetqCIOgetsCIOhexdumpCIOiflushCIOoflushCIOprintfCIOputcCIOputsgetchkbflushkbhitputchputflushputstruprintfWait for all transmissions to completeWait for, and return the next characterReturn non-zero count if input data is availableInput line with minimal editing featuresDump memory in hex and ASCII to the consoleFlush any pending input dataDiscard any queued transmit charactersSimple printf to consoleSend a characterSend zero terminated stringWait for and return the next byteEmpty the input buffer and returnDetect the availability of a character on the UARTWrites a byte out the main UARTWait for all transmission to completeWrite a NULL terminated string to the main UARTA clone of stdio's printf without floating point supportPERSISTORInstruments Inc.14 of 84CF2 API Reference7/19/2005
CF2 API ReferenceBelow are macros defined in along with their derivations.Red items are documented in this Console sectionBlue items are documented in the SCI sectionMACRO MAPS to MACRO MAPS TO FUNCTION USES BY DEFAULTkbhit() cgetq() CIOgetq() SCIRxQueuedCount()getch() cgetc() CIOgetc() SCIRxGetChar()kbflush() ciflush() CIOiflush() (SCIRxGetCharWaitIdle(1) !=putch(c) cputc(c) CIOputc(c) SCITxPutChar(c)putflush() cdrain() CIOdrain() SCITxWaitCompletion()coflush() CIOoflush() SCITxFlush()cgetclp(x) CIOgetclp(x) SCIRxGetChar() + low powercgetclp(x) CIOgetclp(x) SCIRxGetChar() + low powergetstr(s,n) cgets(s,n) CIOgets(s,n) uses CIOgetcputstr(s) cputs(s) CIOputs(s) uses CIOputc with CR-LFuprintf cprintf CIOprintf uses CIOputc with CR-LFcsprintf CIOsprintf uses no I/Ocvprintf CIOvprintf uses CIOputc with CR-LFhexdump chexdump CIOhexdump uses CIOputc/CIOgetqcstructdump(st)carraydump(ar)chexdump((void*)&st,(ulong)&st,1,sizeof(st))chexdump((void*)ar,(ulong)&ar,sizeof(*ar),sizeof(ar))CIOdrain – Wait for all transmissions to completeDescription:Prototype:Inputs:Returns:Forces and waits for all characters in the transmit buffer to be transmitted.void CIOdrain(void);NothingNothingCIOgetc – Wait for, and return the next characterDescription:Prototype:Inputs:Returns:Wait for the next input character.short CIOgetc(void);NoneThe character received.PERSISTORInstruments Inc.15 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: CF2 API ReferenceCompactFlash Low L
- 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 and 52: CF2 API ReferenceRTCtime -- ANSI st
- Page 53 and 54: CF2 API ReferenceSTDIO WarningThe A
- 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
<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>Console I/O Functions and MacrosSummary of Console I/O Functions and Macros The Console I/O functions provide patchable low levelaccess to your routines that interact with a user through a console interface. By default, all of these functionswork through the 68332 SCI (Serial Controller Interface), and all the PicoDOS command shell functions workthrough CIO functions, as do the default standard library console functions.CIOdrainCIOgetcCIOgetqCIOgetsCIOhexdumpCIOiflushCIOoflushCIOprintfCIOputcCIOputsgetchkbflushkbhitputchputflushputstruprintfWait for all transmissions to completeWait for, and return the next characterReturn non-zero count if input data is availableInput line with minimal editing featuresDump memory in hex and ASCII to the consoleFlush any pending input dataDiscard any queued transmit charactersSimple printf to consoleSend a characterSend zero terminated stringWait for and return the next byteEmpty the input buffer and returnDetect the availability of a character on the UARTWrites a byte out the main UARTWait for all transmission to completeWrite a NULL terminated string to the main UARTA clone of stdio's printf without floating point supportPERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.14 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005