User guide

ZestSC1 User Guide
CONFIDENTIAL Page 49 of 57
ZestSC1WriteRegister
ZESTSC1_STATUS ZestSC1WriteRegister( 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 Value to write to register.
Return Value
ZESTSC1_SUCCESS Function succeeded
ZESTSC1_ILLEGAL_HANDLE Attempt to use illegal card handle
ZESTSC1_INTERNAL_ERROR An unspecified internal error occurred while
communicating with the driver
ZESTSC1_TIMEOUT Operation timed out
Description
ZestSC1WriteRegister sets the value of a register in 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;
/* Open a card with ID of 1 */
ZestSC1OpenCard(1, &Handle);
/* Set register 0 to value 0x12 */
ZestSC1WriteRegsiter(Handle, 0, 0x12);
/* 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’.
!