User manual

SPI API reference
37 © 2007-2010 Analytica GmbH
SPIGetGlobals
SPIGetGlobals — Returns the currently used global settings of the AnaGate SPI.
Syntax
#include <AnaGateDllSPI.h>
int SPIGetGlobals(int hHandle, int * pnBaudrate, unsigned char *
pnSigLevel, unsigned char * pnAuxVoltage, unsigned char * pnClockMode);
Parameter
hHandle Valid access handle.
pnBaudrate The baud rate currently used on the SPI bus in kBit.
pnSigLevel The voltage level currently used by the AnaGate SPI. Following values are possible:
• 0 = Outputs in High Impedance Modus (Standard mode).
• 1 = +5.0V for the signals.
• 2 = +3.3V for the signals.
• 3 = +2.5V for the signals.
pnAuxVoltage The voltage level of the support voltage currently used by the AnaGate SPI. Following
values are possible:
• 0 = support voltage is +3.3V.
• 1 = support voltage is 2.5V.
pnClockMode The phase and polarity of the colck signal currently used by the AnaGate SPI. Following
values are possible:
• 0 = CPHA=0 and CPOL=0.
• 1 = CPHA=0 and CPOL=1.
• 2 = CPHA=1 and CPOL=0.
• 3 = CPHA=1 and CPOL=1.
Return value
Returns Null if successful, or an error value otherwise (Appendix A, Return Codes).
Description
Returns the currently used global settings of SPI interface of the AnaGate SPI or the AnaGate Universal
Programmer.