SC5305A Operating & Programming Manual
Rev 2.1.0
34
Function:
sc5305a_RegWrite
Definition:
int sc5305a_RegWrite(unsigned int *deviceHandle, unsigned char commandByte,
unsigned int instructWord)
Return:
The status of the function
Input:
unsigned int *deviceHandle
(handle to the opened device)
unsigned char commandByte
(the address byte of the register to write to)
unsigned int instructWord
(the data for the register)
Description:
sc5305a_RegWrite
writes the instructWord data to the register specified by the
commandByte. See the register map in Table 2 for more information. This function
should rarely be used.
Example:
To set the RF attenuator value to 10 dB:
Function:
sc5305a_RegRead
Definition:
int sc5305a_RegRead(unsigned int *deviceHandle, unsigned char commandByte,
unsigned int instructWord, unsigned int *receivedWord)
Return:
The status of the function
Input:
unsigned int *deviceHandle
(handle to the opened device)
unsigned char commandByte
(the address byte of the register to write to)
unsigned int instructWord
(the data for the register)
unsigned int *receivedWord
(data to be received)
Description:
sc5305a_RegRead
reads the data requested by the instructWord data to the register
specified by the commandByte. See the register map in Table 3 for more information.
Example:
To read the status of the device:
Function:
sc5305a_InitDevice
Definition:
int sc5305a_InitDevice(unsigned int *deviceHandle, bool Mode)
Return:
The status of the function
Input:
unsigned int *deviceHandle
(handle to the opened device)
bool Mode
(0 or 1)
Description:
sc5305a_InitDevice
initializes the device to power up state if Mode = 0, or reprograms
all device components again to the current programmed state if Mode = 1.
unsigned
int
deviceStatus;
int
status = sc5305a_RegRead(deviceHandle,0x18,0x01,&deviceStatus);
int
status = sc5305a_RegWrite(deviceHandle, 0x11, 0x020A);