English
Language : 

20-101-1051 Datasheet, PDF (153/165 Pages) List of Unclassifed Manufacturers – C-Programmable Core Module with NAND Flash Mass Storage and Ethernet
int rn_find(rn_search *srch);
Locates the first active device that matches the search criteria.
PARAMETER
srch is the search criteria structure rn_search:
unsigned int flags;
unsigned int ports;
char productid;
char productrev;
char coderev;
long serialnum;
// status flags see MATCH macros below
// port bitmask
// product id
// product rev
// code rev
// serial number
Use a maximum of 3 macros for the search criteria:
RN_MATCH_PORT
RN_MATCH_PNA
RN_MATCH_HANDLE
RN_MATCH_PRDID
RN_MATCH_PRDREV
RN_MATCH_CODEREV
RN_MATCH_SN
For example:
// match port bitmask
// match physical node address
// match instance (reg 3)
// match id/version (reg 1)
// match product revision
// match code revision
// match serial number
rn_search newdev;
newdev.flags = RN_MATCH_PORT|RN_MATCH_SN;
newdev.ports = 0x03; //search ports 0 and 1
newdev.serialnum = E3446C01L;
handle = rn_find(&newdev);
RETURN VALUE
Returns the handle of the first device matching the criteria. 0 indicates no such devices were found.
SEE ALSO
rn_device
int rn_echo(int handle, char sendecho,
char *recdata);
The peripheral card sends back the character the master sent. This function will check device information
to determine that the peripheral card is connected to a master.
PARAMETERS
handle is an address index to device information. Use rn_device() or rn_find() to establish the
handle.
sendecho is the character to echo back.
recdata is a pointer to the return address of the character from the device.
RETURN VALUE
The status byte from the previous command. -1 means that device information indicates the peripheral
card is not connected to the master.
User’s Manual
147