CF2 API Reference (PDF) - Persistor Instruments Inc
CF2 API Reference (PDF) - Persistor Instruments Inc CF2 API Reference (PDF) - Persistor Instruments Inc
CF2 API ReferenceTPUChannelFunctionSelect – Set the TPU channel functionDescription:Prototype:Inputs:Notes:This function is thin wrapper for setting up and fielding the function select bits for insertion intothe TPU registers.void TPUChannelFunctionSelect(ushort tpuch, ushort function);tpuch is the TPU channel number (1 to 15).function is one of the possible TPU functions from the TPUCF2Function enumeration list.See TPURefManual_tpurmad.pdf for more information and for a description of theTPUCF2Function enumeration list.TPUChannelPrioritySelect – Set the TPU channel priorityDescription:Prototype:Inputs:Notes:This function is thin wrapper for setting up and fielding the priority select bits for insertion intothe TPU registers.void TPUChannelPrioritySelect(ushort tpuch, TPUPriority priority);tpuch is the TPU channel number (1 to 15).priority is the requested priority value from the TPUPriority enumeration list.See TPURefManual_tpurmad.pdf for more information and for a description of theTPUPriority enumeration list.TPUHostServiceSession – Initiate TPU channel host service request sessionDescription:Prototype:Inputs:Notes:This is a workhorse wrapper that combines four TPU function initialization stages into a singlefunction. These are in order: host sequence setup, host service request, channel priorityselection, and host service check complete with optional wait.void TPUHostServiceSession(ushort tpuch, ushort request, ushort sequence,TPUPriority priority, bool waitstatus);tpuch is the TPU channel number (1 to 15).request is the host service request value appropriate for the particular TPU function.sequence is the host sequence value appropriate for the particular TPU function.priority is the requested priority value from the TPUPriority enumeration list.waitstatus should be set to true to wait or false to return immediately.The PicoDOS DIO and TLC, as well as several examples, use this mechanism for efficientinitialization. A complete channel initialization will typically include something like:TPUChannelPrioritySelect(tch, tpuDisabled);TPUDisableInterrupt(tch);TPUChannelFunctionSelect(tch, funct);TPUHostServiceSession(tch, req, hsq, pri, true);TPUHostSequenceSelect – Set the TPU channel host sequence bitsDescription:This function is thin wrapper for setting up and fielding the host sequence bits for insertion intothe TPU registers.PERSISTORInstruments Inc.66 of 84CF2 API Reference7/19/2005
CF2 API ReferencePrototype:Inputs:Notes:void TPUHostSequenceSelect(ushort tpuch, short hsq);tpuch is the TPU channel number (1 to 15).hsq is the host sequence value appropriate for the particular TPU function.See TPURefManual_tpurmad.pdf and the specific TPU function document for more informationthe function dependent context and values for the host sequence bits.TPUHostServiceCheckComplete – Check the host service status and optionally waitDescription:Prototype:Inputs:Returns:This function returns true if the TPU has completed the last host service request. It will wait forthe TPU to complete if argument waitstatus is true, otherwise it will just return with the status.bool TPUHostServiceCheckComplete(ushort tpuch, bool waitstatus);tpuch is the TPU channel number (1 to 15).waitstatus should be set to true to wait or false to return immediately.true if the TPU completed the service request, false if not.TPUGetTCR1Clock – Get the TCR1 clock rate in HzDescription:Prototype:Returns:Notes:This function returns the current frequency of the TCR1 clock which varies with the system clockfrequency and the TCR1 divider.rettype TPUGetTCR1Clock(void);The TCR1 clock frequency in Hz.The TCR1 divider is contained in a write-once register that must be written by PicoDOS to startthe TPU and TLC. The default is divide-by-one which yields 4MHz for the default 16MHz systemclock because of the built in divide-by-four from the TPU hardware. You can change the defaultusing the SYS.TCR1P persistent environment variable using the SET command from PicoDOS orVEE API calls with the following alternates:"0"= divide-by-1, "1"= divide-by-2, "2"= divide-by-4, "3"= divide-by-8See also: TPUDisableInterrupt – Disable interrupts for the specified TPU channelDescription:Prototype:This inline macro disables interrupt for the specified channelvoid TPUDisableInterrupt(ushort tch);Inputs: tch is the TPU channel number (1 to 15).TPUEnableInterrupt – Enable interrupts for the specified TPU channelDescription:Prototype:This inline macro disables interrupt for the specified channelvoid TPUEnableInterrupt(ushort tch);Inputs: tch is the TPU channel number (1 to 15).PERSISTORInstruments Inc.67 of 84CF2 API Reference7/19/2005
- 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 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
- Page 65: CF2 API ReferenceTime Processing Un
- 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>TPUChannelFunctionSelect – Set the TPU channel functionDescription:Prototype:Inputs:Notes:This function is thin wrapper for setting up and fielding the function select bits for insertion intothe TPU registers.void TPUChannelFunctionSelect(ushort tpuch, ushort function);tpuch is the TPU channel number (1 to 15).function is one of the possible TPU functions from the TPU<strong>CF2</strong>Function enumeration list.See TPURefManual_tpurmad.pdf for more information and for a description of theTPU<strong>CF2</strong>Function enumeration list.TPUChannelPrioritySelect – Set the TPU channel priorityDescription:Prototype:Inputs:Notes:This function is thin wrapper for setting up and fielding the priority select bits for insertion intothe TPU registers.void TPUChannelPrioritySelect(ushort tpuch, TPUPriority priority);tpuch is the TPU channel number (1 to 15).priority is the requested priority value from the TPUPriority enumeration list.See TPURefManual_tpurmad.pdf for more information and for a description of theTPUPriority enumeration list.TPUHostServiceSession – Initiate TPU channel host service request sessionDescription:Prototype:Inputs:Notes:This is a workhorse wrapper that combines four TPU function initialization stages into a singlefunction. These are in order: host sequence setup, host service request, channel priorityselection, and host service check complete with optional wait.void TPUHostServiceSession(ushort tpuch, ushort request, ushort sequence,TPUPriority priority, bool waitstatus);tpuch is the TPU channel number (1 to 15).request is the host service request value appropriate for the particular TPU function.sequence is the host sequence value appropriate for the particular TPU function.priority is the requested priority value from the TPUPriority enumeration list.waitstatus should be set to true to wait or false to return immediately.The PicoDOS DIO and TLC, as well as several examples, use this mechanism for efficientinitialization. A complete channel initialization will typically include something like:TPUChannelPrioritySelect(tch, tpuDisabled);TPUDisableInterrupt(tch);TPUChannelFunctionSelect(tch, funct);TPUHostServiceSession(tch, req, hsq, pri, true);TPUHostSequenceSelect – Set the TPU channel host sequence bitsDescription:This function is thin wrapper for setting up and fielding the host sequence bits for insertion intothe TPU registers.PERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.66 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005