10.07.2015 Views

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>QPBSetup -- Set up the QPB for future asynchronous transfersDescription:Prototype:Inputs:Returns:This function sets up all of the internal registers of the PicoBus and prepares for anasynchronous transaction. QPBTransact calls this function every time it is called, but in asynchronous mode.bool QPBSetup(QPB *qpb, vfptr asynchf, ushort count, ushort *spidata);qpb is the QPB structure that corresponds to the slot of the desired device. The device musteither be unlocked or the lock must belong to the QPB struct passed here.asynchf is a volatile function pointer to the handler to be called when an asynchronous readcompletes.count is the number of 16 bit words that will be passed in the variable arguments. Themaximum number of of words to be passed is 16, making count's maximum 16 also.spidata is a pointer to the data for the transaction.Returns TRUE if the requested setup could be performed.QPBTestBusy -- Set up the QPB for future asynchronous transfersDescription:Prototype:Returns:This function allows you to test whether or not a transaction (obviously an asynchronous one) iscurrently occurring on the QPB.QPB *QPBTestBusy (void);Returns a pointer to the QPB structure that is currently transacting or NULL if the bus is free.QPBTestLocked -- See if the QPB is lockedDescription:Prototype:Returns:This function allows you to test whether or not the QPB is currently locked.QPB *QPBTestLocked (void);Returns a pointer to the QPB structure that is currently locking or NULL if the bus is free.QPBTransact -- Conduct a PicoBUS sessionDescription:Prototype:Inputs:This function executes a transaction on the QPB.short *QPBTransact(QPB *qpb, vfptr asynchf, ushort count, ushort *spidata);qpb is the QPB structure that corresponds to the slot of the desired device. The device musteither be unlocked or the lock must belong to the QPB struct passed here.asynchf is a volatile function pointer to the handler to be called when an asynchronous readcompletes. If it is 0 then the call will be synchronous.count is the number of 16 bit words that will be passed in the variable arguments. Themaximum number of of words to be passed is 16, making count's maximum 16 also.spidata is a pointer to the data for the transaction.Returns: ??Notes:This function takes data as an array of up to 16 words (which are 16 bits wide in the 332 buteach word will be truncated to your device's word size before transacting. In other words if youwant to send 8 words to a device with an 8 bit word length, you would put 8 shorts with paddedMSBs into spidata.) The QPB structure returned by QPBInitSlot designates which device is toreceive the transaction and the count is the number of 16 bit words (up to 16) to read off thestack to be transmitted. You may also make this call asynchronous by providing a pointer to acompletion routine in the asynchf parameter.PERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.47 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!