User guide

Orange Tree Technologies
Page 48 of 57
ZestSC1ReadRegister
ZESTSC1_STATUS ZestSC1ReadRegister( ZESTSC1_HANDLE Handle,
unsigned long Offset,
unsigned char *Value);
Parameters
Handle Handle of open ZestSC1 card. See ZestSC1OpenCard.
Offset Address of register in FPGA.
Value Pointer to location to receive register value.
Return Value
ZESTSC1_SUCCESS Function succeeded
ZESTSC1_ILLEGAL_HANDLE Attempt to use illegal card handle
ZESTSC1_NULL_PARAMETER NULL was used illegally as one of the
parameter values
ZESTSC1_INTERNAL_ERROR An unspecified internal error occurred while
communicating with the driver
ZESTSC1_TIMEOUT Operation timed out
Description
ZestSC1ReadRegister returns the value of a register from the memory-mapped
interface on the ZestSC1 card FPGA.
Boards fitted with the Cypress FX2 USB controller chip (part number CY7C68013) allow
an offset of 0x0000 to 0x8000. Boards fitted with the Cypress FX2LP USB controller chip
(part number CY7C68013A) allow an offset of 0x2000 to 0x6000.
For example:
ZESTSC1_HANDLE Handle;
char Value;
/* Open a card with ID of 1 */
ZestSC1OpenCard(1, &Handle);
/* Get value of register 0 from board */
ZestSC1ReadRegister(Handle, 0, &Value);
/* Close the card */
ZestSC1CloseCard(Handle);
Attempting to transfer data to/from the FPGA without a
suitable slave interface configured may result in the ZestSC1
‘hanging’.
!