Opening a Software Handle to Your Board

When you start writing your own application against the NAI SSK, you need to tell the library — in code — which board to talk to and how to reach it. This guide covers the naibrd_* API calls that open a software handle to your hardware. It is the programmatic equivalent of the prompts the NAI sample applications present when you launch them.

This guide assumes:

  • The SSK is built and your project is linked against it. See the Software Development Guide (or the 1.x version) for that.
  • Your hardware is powered, on the network if applicable, and reachable from where your application runs. See Connecting to Boards for cabling, IP configuration, terminal access, and NAI Ethernet Listener prerequisites.
  • You have successfully run an NAI sample application against the hardware first (strongly recommended). See Running Applications from the Target for the interactive menu walkthrough. Each sample application’s source is itself a working example of the naibrd_OpenDevice patterns shown below.

If you are not sure which SSK version your board uses, see Choosing the Right SSK.

NAI Board Access

The configurations below mirror the four scenarios on Running Applications from the Target — pick the row that matches your hardware setup and use the corresponding naibrd_* calls. The naibrd_OpenDevice transport argument is what changes across scenarios:

App runs onReaches modules viaAPI section (this guide)Sample-app menu walkthrough
External host PCEthernet (single NIU or single SBC)Onboard via EthernetNAIBRD_COMM_ETHER_TCPA — External host, ethernet
External host PCEthernet to SIU master + backplaneEthernet to NAI Master + PCI or + VMEA (SIU sub-case)
External host PCDirect PCIe / cPCI busNative PCI/cPCI/PCIe BusNAIBRD_COMM_PCIB — External host, direct bus
External host PCDirect VME busNative VME BusNAIBRD_COMM_VMEB (VME variant)
NAI processor (single SBC)Local modules via SerDesOnboard via SerDesNAIBRD_COMM_ONBOARDC — Onboard, single SBC
NAI master SBCBackplane PCIe / cPCI to slavesNAI Processor + PCID — Onboard master, backplane slaves
NAI master SBCBackplane VME to slavesNAI Processor + VMED (VME variant)

Depending on the system, access to the NAI boards can be configured as follows:

Type of accessDescription
Onboard via EthernetAccess to the board is via the Ethernet port on the board (ex. NIU1A, 75G5, 64G5, etc.)
Native PCI BusAccess to the NAI slave board is via the Native PCI/cPCI/PCIe bus (ex. 75G5).
Native VME BusAccess to the NAI slave board is via the Native VME bus (ex. 64G5).
NAI Processor access via Native PCI BusIn this configuration, the NAI Processor (ex. 75PPC1) is the master and slave boards (ex. 75G5) are accessed via the Native PCI/cPCI/PCIe bus.
NAI Processor access via Native VME BusIn this configuration, the NAI Processor (ex. 64PPC1) is the master and slave boards (ex. 64G5) are accessed via the Native VME bus.
Ethernet to NAI Master Board and access to Slaves via Native PCI BusIn this configuration, Ethernet is connected to only the NAI master board (ex. 75G5 is configured for master mode). Access to NAI slave board is done by sending Ethernet commands to the NAI master board which will then access the NAI slave board via the Native PCI/cPCI/PCIe bus.
Ethernet to NAI Master Board and access to Slaves via Native VME BusIn this configuration, Ethernet is connected to only the NAI master board (ex. 64G5 is configured for master mode). Access to NAI slave board is done by sending Ethernet commands to the NAI master board which will then access the NAI slave board via the Native VME bus.
Onboard via SerDes LanesIn this configuration, a custom application is developed on the master ARM processor (ex. 75ARM1, 64ARM1) and access to the onboard modules via SerDes lanes.

Onboard Via Ethernet

This applies to configurations where access to the NAI slave board is via the Ethernet port on the board (ex. NIU1A, 75G5, 64G5, etc).

Stepsnaibrd APIComment
Required naibrd_SetIPAddress
(int32_t cardIndex,
const char* ipaddress,
const char* port);
Sets the IP address and Ethernet port to access for Ethernet communication. Valid Ethernet ports for Generation 5 boards(NIU1A, 75G5, 64G5) are 52801 amd 52802 (TCP or UDP). Valid Ethernet ports for Generation 3 boards (75C5, 64C3) are 23 (TCP) or 1042 (UDP) or 1043 (UDP). The cardIndex is a unique user defined index (0-19) that is used to reference each card.
Required naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter for TCP or UDP Ethernet
Protocol:
- NAIBRD_COMM_ETHER_TCP
- NAIBRD_COMM_ETHER_UDP
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_NIU1A "NIU1A"
#define NAI_DEV_NAME_75G5 "75G5"
#define NAI_DEV_NAME_64ARM1 "64ARM1"
#define NAI_DEV_NAME_75C5 "75C5"
#define NAI_DEV_NAME_64C3 "64C3"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

define NIU1A_IDX 1 /* Card index (0 – 19) */
#define IP_ADDR "10.0.8.123"
#define IP_PORT "52801" /* 52801 or 52802 */
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Set the IP address and Port of the card */
 naibrd_SetIPAddress (NIU1A_IDX, IP_ADDR, IP_PORT);
 /* Open the card specifying Ethernet protocol and device name */
 naibrd_OpenDevice (NIU1A_IDX, NAIBRD_COMM_ETHER_TCP, NAI_DEV_NAME_NIU1A);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NIU1A_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NIU1A_IDX, unSerialNum);
 /* Close the card */
 naibrd_Close(NIU1A_IDX);
}

Native PCI/cPCI/PCIe Bus

This applies to configurations where access to the NAI slave board (ex. 75G5) is via the Native PCI/cPCI/PCIe bus.

Stepsnaibrd APIComment
Required naibrd_SetBusDev
(int32_t cardIndex,
int16_t lane,
int16_t bus,
int16_t dev, int16_t func);
Sets PCI lane to 1, PCI bus number, PCI device number and PCI function assigned to the board during PCI enumeration by the PCI Controller. The cardIndex is a unique user defined index (0-19) that is used to reference each card.
Required naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter for Native PCI/cPCI/PCIe Bus access:
- NAIBRD_COMM_PCI
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_75G5 "75G5"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI75G5_IDX 1 /* Card index (0 – 19) */
#define PCI_LANE 1
#define PCI_BUS 2
#define PCI_DEV 14
#define PCI_FNC 0
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Set the Lane, Bus, Device and Function of the card */
 naibrd_SetBusDev (NAI75G5_IDX, PCI_LANE, PCI_BUS, PCI_DEV, PCI_FNC);
 /* Open the card specifying PCI bus and device name */
 naibrd_OpenDevice (NAI75G5_IDX, NAIBRD_COMM_PCI, NAI_DEV_NAME_75G5);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI75G5_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI75G5_IDX, unSerialNum);
 /* Close the card */
 naibrd_Close(NAI75G5_IDX);
}

Native VME Bus

This applies to configurations where access to the NAI slave board (ex. 64G5) is via the Native VME bus.

Stepsnaibrd APIComment
Required naibrd_SetVMESlotAddr
(int32_t cardIndex,
int32_t slot,
int32_t vmeSlaveBaseAddr,
int32_t vmeLocalAddr,
int32_t vmeAddrMod);
Sets the VME chassis slot, VME Base Address and VME address modifier to the board. The vmeLocalAddr will be set by the controlling SBC and should be set to 0. The cardIndex is a unique user defined index (0-19) that is used to reference each card.
Required naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter for Native VME Bus access:
- NAIBRD_COMM_VME
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_64G5 "64G5"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI64G5_IDX 1 /* Card index (0 – 19) */
#define VME_SLOT 3 /* Slot in VME Frame the card occupies */
#define VME_BASE_ADDRESS 0x01000000 /* VME Base Address of card */
#define VME_ADDR_MOD 0x0D /* VME Address Modifier */
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Set the Slot, VME Address and Modifier of the card */
 naibrd_SetVMESlotAddr (NAI64G5_IDX, VME_SLOT, VME_BASE_ADDRESS, 0, VME_ADDR_MOD);
 /* Open the card specifying VME bus and device name */
 naibrd_OpenDevice (NAI64G5_IDX, NAIBRD_COMM_VME, NAI_DEV_NAME_64G5);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI64G5_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI64G5_IDX, unSerialNum);
 /* Close the card */
 naibrd_Close(NAI64G5_IDX);
}

NAI Processor access via Native PCI/cPCI/PCIe Bus

This applies to configurations where the system contains a board with a NAI Processor (ex. 75PPC1) configured as the master controller, and slave boards (ex. 75G5) are accessed via the Native PCI/cPCI/PCIe bus.

Stepsnaibrd APIComment
Required naibrd_SetBusDev
(int32_t cardIndex,
int16_t lane,
int16_t bus,
int16_t dev, int16_t func);
Sets PCI lane (0 for board with NAI Processor and 1 for NAI Slave Boards), PCI bus number, PCI device number and PCI function assigned to the board during PCI enumeration by the NAI Processor. The cardIndex is a unique user defined index (0-19) that is used to reference each card.
Required naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter to:
- NAIBRD_COMM_ONBOARD for access to board with NAI Processor
- NAIBRD_COMM_PCI for access to slave boards.
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_75PPC1 "75PPC1"
#define NAI_DEV_NAME_75INT2 "75INT2"
#define NAI_DEV_NAME_75G5 "75G5"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI75PPC1_IDX 0 /* Card index (0 – 19) */
#define MASTER_PCI_LANE 0 /* Lane 0 - on board, Lane 1 - off board */
#define MASTER_PCI_BUS 1
#define MASTER_PCI_DEV 0
#define MASTER_PCI_FNC 0
#define NAI75G5_IDX 1
#define SLAVE_PCI_LANE 1
#define SLAVE_PCI_BUS 2
#define SLAVE_PCI_DEV 14
#define SLAVE_PCI_FNC 0
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Master Card */
 /* Set the Lane, Bus, Device and Function of the card */
 naibrd_SetBusDev (NAI75PPC1_IDX, MASTER_PCI_LANE, MASTER_PCI_BUS, MASTER_PCI_DEV, MASTER_PCI_FNC);
 /* Open the card specifying bus and device name */
 naibrd_OpenDevice (NAI75PPC1_IDX, NAIBRD_COMM_ONBOARD, NAI_DEV_NAME_75PPC1);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI75PPC1_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI75PPC1_IDX, unSerialNum);
 
 /* Slave Card */
 /* Set the Lane, Bus, Device and Function of the card */
 naibrd_SetBusDev (NAI75G5_IDX, SLAVE_PCI_LANE, SLAVE_PCI_BUS, SLAVE_PCI_DEV, SLAVE_PCI_FNC);
 /* Open the card specifying bus and device name */
 naibrd_OpenDevice (NAI75G5_IDX, NAIBRD_COMM_PCI, NAI_DEV_NAME_75G5);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI75G5_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI75G5_IDX, unSerialNum);
 /* Close the cards */
 naibrd_Close(NAI75PPC1_IDX);
 naibrd_Close(NAI75G5_IDX);
}

NAI Processor access via Native VME Bus

This applies to configurations where the system contains a board with a NAI Processor (ex. 64PPC1) configured as the master controller, and slave boards (ex. 64G5) are accessed via the Native VME bus.

Stepsnaibrd APIComment
Required naibrd_SetVMESlotAddr
(int32_t cardIndex,
int32_t slot,
int32_t vmeSlaveBaseAddr,
int32_t vmeLocalMod,
int32_t vmeAddrMod);
Sets the VME chassis slot, VME Base address and VME address modifier to the board. The vmeLocalAddr will be set by the controlling SBC and should be set to 0. The cardIndex is a unique user defined index (0-19) that is used to reference each card.
Required naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter for Native VME Bus access:
- NAIBRD_COMM_VME
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_64PPC1 "64PPC1"
#define NAI_DEV_NAME_64ARM1 "64ARM1"
#define NAI_DEV_NAME_64G5 "64G5"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI64PPC1_IDX 0 /* Card index (0 – 19) */
#define NAI64ARM1_IDX 1
#define VME_SLOT 3 /* Slot in VME Frame the card occupies */
#define VME_BASE_ADDRESS 0x01000000 /* VME Base Address of card */
#define VME_ADDR_MOD 0x0D /* VME Address Modifier */
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Open the NAI SBC for on board access */
 naibrd_64PPC1_Open(NAI64PPC1_IDX, NAIBRD_COMM_ONBOARD);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI64PPC1_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI64PPC1_IDX, unSerialNum);
/* Set the Slot, VME Address and Modifier of the slave card */
 naibrd_SetVMESlotAddr (NAI64G5_IDX, VME_SLOT, VME_BASE_ADDRESS, 0, VME_ADDR_MOD);
 /* Open the slave card specifying VME bus and device name */
 naibrd_OpenDevice (NAI64G5_IDX, NAIBRD_COMM_VME, NAI_DEV_NAME_64G5);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI64G5_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI64G5_IDX, unSerialNum);
 /* Close the cards */
 naibrd_Close(NAI64PPC1_IDX);
 naibrd_Close(NAI64G5_IDX);
}

Ethernet to NAI Master Board and access to slaves via Native PCI/cPCI/PCIe Bus

This applies to configurations where Ethernet is connected to only the NAI master board (ex. 75G5 in configured for master mode). Access to NAI slave board is done by sending Ethernet commands to the NAI master board which will then access the NAI slave board via the Native PCI/cPCI/PCIe bus.

Stepsnaibrd APIComment
Required for Master naibrd_SetIPAddress
(int32_t masterCardIndex,
const char* ipaddress,
const char" port);
Sets the IP address and Ethernet port to access for Ethernet communication. Valid Ethernet ports for Generation 5 boards (75G5) are 52801 and 52802 (TCP or UDP). Valid Ethernet ports for Generation 3 boards (75C5) are 23 (TCP) or 1042 (UDP) or 1043 (UDP). The masterCardIndex is a unique user defined index (0-19) that is used to reference each card.
Required for Master naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter for TCP or UDP Ethernet Protocol:
- NAIBRD_COMM_ETHER_TCP
- NAIBRD_COMM_ETHER_UDP
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_75G5 "75G5"
Required for Slave naibrd_SetMaster
(int32_t cardIndex,
int32_t masterCardIndex);
Specifies another card as the card's master, all I/O operations though the master card
Required for Slave naibrd_SetAddress
(int32_t cardIndex,
uint32_t address);
Set address parameter to the assigned base address for the board during the PCI enumeration by the PCI Controller.
Required for Slave naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char* device);
Set comm parameter for PCI bus access to slave boards:
- NAIBRD_COMM_PCI
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_75G5 "75G5"
#define NAI_DEV_NAME_75C5 "75C5"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required for Master and Slaves naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI75G5_MASTER_IDX 1 /* Card index (0 – 19) */
#define NAI75G5_SLAVE_IDX 2
#define NAI75G5_SLAVE_ADDR 0xA4104000 /* PCI Base Address of Slave Card */
#define IP_ADDR "10.0.8.123"
#define IP_PORT "52801" /* 52801 or 52802 */
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Set the IP address and Port of the card */
 naibrd_SetIPAddress (NAI75G5_MASTER_IDX, IP_ADDR, IP_PORT);
 /* Open the card specifying Ethernet protocol and device name */
 naibrd_OpenDevice (NAI75G5_MASTER_IDX, NAIBRD_COMM_ETHER_TCP, NAI_DEV_NAME_75G5);
 /* Set the Card as a "Master" to enable pass through to Slave on Bus */
 naibrd_SetMaster(NAI75G5_SLAVE_IDX, NAI75G5_MASTER_IDX);
 /* Set the Base address of the Slave Card */
 naibrd_SetAddress(NAI75G5_SLAVE_IDX, NAI75G5_SLAVE_ADDR);
 /* Open the card specifying PCI bus and device name */
 naibrd_OpenDevice (NAI75G5_SLAVE_IDX, NAIBRD_COMM_PCI, NAI_DEV_NAME_75G5);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI75G5_SLAVE_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI75G5_SLAVE_IDX, unSerialNum);
 /* Close the cards */
 naibrd_Close(NAI75G5_MASTER_IDX);
 naibrd_Close(NAI75G5_SLAVE_IDX);
}

Ethernet to NAI Master Board and access to slaves via Native VME Bus

This applies to configurations where Ethernet is connected to only the NAI master board (ex. 64G5 in configured for master mode). Access to NAI slave board is done by sending Ethernet commands to the NAI master board which will then access the NAI slave board via the Native VME bus.

Stepsnaibrd APIComment
Required for Master naibrd_SetIPAddress
(int32_t masterCardIndex,
const char* ipaddress,
const char" port);
Sets the IP address and Ethernet port to access for Ethernet communication. Valid Ethernet ports for Generation 5 boards (64G5) are 52801 and 52802 (TCP or UDP). Valid Ethernet ports for Generation 3 boards (64C3) are 23 (TCP) or 1042 (UDP) or 1043 (UDP). The masterCardIndex is a unique user defined index (0-19) that is used to reference each card.
Required for Master naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter for TCP or UDP Ethernet Protocol:
- NAIBRD_COMM_ETHER_TCP
- NAIBRD_COMM_ETHER_UDP
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_64G5 "64G5"
Required for Slave naibrd_SetMaster
(int32_t cardIndex,
int32_t masterCardIndex);
Specifies another card as the card's master, all I/O operations though the master card
Required for Slave naibrd_SetVMESlotAddr
(int32_t cardIndex,
int32_t slot,
int32_t vmeSlaveBaseAddr,
int32_t vmeLocalAddr,
int32_t vmeAddrMod);
Sets the VME chassis slot, VME Base address and VME address modifier to the board. The vmeLocalAddr will be set by the controlling SBC and should be set to 0. The cardIndex is a unique user defined index (0-19) that is used to reference each card.
Required for Slave naibrd_SetAddress
(int32_t cardIndex,
uint32_t address);
Set address parameter to the assigned base address for the board during the PCI enumeration by the PCI Controller.
Required for Slave naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char* device);
Set comm parameter for PCI bus access to slave boards:
- NAIBRD_COMM_PCI
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_64G5 "64G5"
#define NAI_DEV_NAME_64C3 "64C3"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required for Master and Slaves naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI64G5_MASTER_IDX 1 /* Card index (0 – 19) */
#define NAI64G5_SLAVE_IDX 2
#define VME_SLOT 3 /* Slot in VME Frame the card occupies */
#define VME_BASE_ADDRESS 0x01000000 /* VME Base Address of card */
#define VME_ADDR_MOD 0x0D /* VME Address Modifier */
#define IP_ADDR "10.0.8.123"
#define IP_PORT "52801" /* 52801 or 52802 */
void sample (void)
{
 uint32_t unSerialNum = 0;
 
 /* Set the IP address and Port of the card */
 naibrd_SetIPAddress (NAI64G5_MASTER_IDX, IP_ADDR, IP_PORT);
 /* Open the card specifying Ethernet protocol and device name */
 naibrd_OpenDevice (NAI64G5_MASTER_IDX, NAIBRD_COMM_ETHER_TCP, NAI_DEV_NAME_64G5);
 /* Set the Card as a "Master" to enable pass through to Slave on Bus */
 naibrd_SetMaster(NAI64G5_SLAVE_IDX, NAI64G5_MASTER_IDX);
 /* Set the Slot, VME Address and Modifier of the slave card */
 naibrd_SetVMESlotAddr (NAI64G5_SLAVE_IDX, VME_SLOT, VME_BASE_ADDRESS, 0, VME_ADDR_MOD);
 /* Open the card specifying VME bus and device name */
 naibrd_OpenDevice (NAI64G5_SLAVE_IDX, NAIBRD_COMM_VME, NAI_DEV_NAME_64G5);
 /* Get and display the card serial number */
 naibrd_GetSerialNo (NAI64G5_SLAVE_IDX, &unSerialNum);
 printf("Card:%d - Serial Number:%d\n", NAI64G5_SLAVE_IDX, unSerialNum);
 /* Close the cards */
 naibrd_Close(NAI64G5_MASTER_IDX);
 naibrd_Close(NAI64G5_SLAVE_IDX);
}

Onboard via SerDes

This applies to configurations where a custom application is developed on the master ARM processor (ex. 75ARM1, 64ARM1, NIU1A) and access to the onboard modules via SerDes.

Stepsnaibrd APIComment
Required naibrd_OpenDevice
(int32_t cardIndex,
naibrd_comm_t comm,
const char * device);
Set comm parameter to Onboad Accwss via SerDes:
- NAIBRD_COMM_ONBOARD
Set device parameter to the #define specified in naibrd.h file - examples below:
#define NAI_DEV_NAME_NIU1A "NIU1A"
#define NAI_DEV_NAME_75ARM1 "75ARM1"
#define NAI_DEV_NAME_64ARM1 "64ARM1"
Board Specific Info naibrd_GetSerialNo
(int32_t cardIndex,
uint32_t* sn);
Retrieves the Serial number from the board.
General Module Info naibrd_GetModuleCount
(int32_t cardIndex,
int32_t* moduleCount);
Returns the maximum modules for the board. Note this information is specified in the naibrd library and not accessed from the board.
General Module Info uint32_t naibrd_GetModuleID
(int32_t cardIndex,
int32_t module);
Retrieves the Module ID for the module specified from the board.
Required naibrd_Close
(int32_t cardIndex);
Closes the connection to the board.

Example:

#define NAI64ARM1_IDX 0 /* Card index (0 – 19) */
#define MODULE_NUM 1
void sample (void)
{
 uint32_t unModuleId = 0;
 
 /* Open the card specifying Onboard SERDES and device name */
 naibrd_OpenDevice (NAI64ARM1_IDX, NAIBRD_COMM_ONBOARD, NAI_DEV_NAME_64ARM1);
 /* Get and display the ID of the first Module */
 unModuleId = naibrd_GetModuleID (NAI64ARM1_IDX, MODULE_NUM);
 printf("Card:%d - Module %d ID:0x%X\n", NAI64ARM1_IDX, MODULE_NUM, unModuleId);
 /* Close the card */
 naibrd_Close(NAI64ARM1_IDX);
}

Where to go next