Software Library API naibrd 1.62
See all documentation at naii.docs.com
Connection Setup Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetAddress (int32_t cardIndex, uint32_t address)
 Specifies the address to communicate with the card when communicating over VME, using another card as a master, or using custom IO functions specified by naibrd_SetIOFnc and naibrd_SetFifoIOFnc.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetAddress (int32_t cardIndex, uint32_t *address)
 Get the address to communicate with the card when communicating over VME/PCI, using another card as a master, or using custom IO functions specified by naibrd_SetIOFnc and naibrd_SetFifoIOFnc.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetIPAddress (int32_t cardIndex, const char *ipaddress, const char *port)
 Sets the IP address to connect to in NAIBRD_COMM_ETHER_TCP and NAIBRD_COMM_ETHER_UDP.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetBusDev (int32_t cardIndex, int16_t lane, int16_t bus, int16_t dev, int16_t func)
 Sets the lane (VxWorks only), bus, dev, and func to connect to when using NAIBRD_COMM_PCI.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEEndian (int32_t cardIndex, nai_endian_t brdEndian)
 sets the board physical Endianess.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMEEndian (int32_t cardIndex, int32_t *brdEndian)
 Gets the board physical Endianess.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEGeoEn (int32_t cardIndex, bool_t enable)
 Sets the board geographic mode configuration.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMEGeoEn (int32_t cardIndex, bool_t *p_outEnable)
 Gets the board geographic mode configuration.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEDataWidth (int32_t cardIndex, int32_t brdDataWidth)
 sets the board physical data width.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMEDataWidth (int32_t cardIndex, int32_t *brdDataWidth)
 Gets the board physical data width.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEBoardIsNaiSbc (int32_t cardIndex, bool_t brdIsSbc)
 sets the board is a NAI SBC.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMESlotAddr (int32_t cardIndex, int32_t slot, uint32_t vmeSlaveBaseAddr, uint32_t vmeLocalAddr, uint32_t vmeAddrMod)
 sets the board physical slot in rack with the beginning of the boards VME slave window
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMESlotAddr (int32_t cardIndex, int32_t *slot, uint32_t *vmeSlaveBaseAddr, uint32_t *vmeLocalAddr, uint32_t *vmeAddrMod)
 gets the board physical slot in rack with the beginning of the boards VME slave window
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetBusDev (int32_t cardIndex, int16_t *lane, int16_t *bus, int16_t *dev, int16_t *func)
 Gets the lane, bus, dev, and func assigned to cardIndex when using NAIBRD_COMM_PCI.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetMaster (int32_t cardIndex, int32_t masterCardIndex)
 Specifies another card as the card's master, sending all I/O operations though it.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_OpenBCDevice (int16_t swDevice, int32_t cardIndex, int32_t module, int32_t channel, int32_t rtaddr, bool_t busAEnable, naibrd_comm_t comm, const char *device)
 Opens a 1553 BC device on a FTx or N7 module (must be an NAI card).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_OpenDevice (int32_t cardIndex, naibrd_comm_t comm, const char *device)
 Opens access to the board based on the device name and communication mode.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_Close (int32_t cardIndex)
 Closes a connection to a card.
 

Detailed Description


Function Documentation

◆ naibrd_Close()

NAIBRDFUNC nai_status_t NAIAPI naibrd_Close ( int32_t cardIndex)

Closes a connection to a card.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
Returns
  • NAI_SUCCESS when the board is ready.
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_VALUE when the communications mode is invalid.
  • NAI_ERROR_NOT_SUPPORTED if naibrd does not support that communications mode as configured and NAIBRD_IOFLAGS_NO_DEFAULT_INTF was not specified to naibrd_SetIOFnc.
  • NAI_ERROR_NOT_OPEN if no connection has been established.
  • An error returned by internal calls closing the connection.

◆ naibrd_GetAddress()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetAddress ( int32_t cardIndex,
uint32_t * address )

Get the address to communicate with the card when communicating over VME/PCI, using another card as a master, or using custom IO functions specified by naibrd_SetIOFnc and naibrd_SetFifoIOFnc.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
address: (Output) Memory where the base address of the card is written to.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_GetBusDev()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetBusDev ( int32_t cardIndex,
int16_t * lane,
int16_t * bus,
int16_t * dev,
int16_t * func )

Gets the lane, bus, dev, and func assigned to cardIndex when using NAIBRD_COMM_PCI.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
lane: (Output) PCI lane in VxWorks. Must be 0 for all other operating systems.
bus: (Output) PCI bus number.
dev: (Output) PCI device number.
func: (Output) PCI function number.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_GetVMEDataWidth()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMEDataWidth ( int32_t cardIndex,
int32_t * brdDataWidth )

Gets the board physical data width.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
brdDataWidth: (Output) Boards physical data width (2, 4).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_GetVMEEndian()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMEEndian ( int32_t cardIndex,
int32_t * brdEndian )

Gets the board physical Endianess.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
brdEndian: (Output) Boards physical Endianess (NAI_BIG_ENDIAN, NAI_LITTLE_ENDIAN).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_GetVMEGeoEn()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMEGeoEn ( int32_t cardIndex,
bool_t * p_outEnable )

Gets the board geographic mode configuration.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
p_outEnable: (Output) Geographic mode enable.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_GetVMESlotAddr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetVMESlotAddr ( int32_t cardIndex,
int32_t * slot,
uint32_t * vmeSlaveBaseAddr,
uint32_t * vmeLocalAddr,
uint32_t * vmeAddrMod )

gets the board physical slot in rack with the beginning of the boards VME slave window

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
slot: (Output) Boards physical slot in chassis beginning wiht slot 1.
vmeSlaveBaseAddr: (Output) The base of the board VME slave window.
vmeLocalAddr: (Output) The local (PCI) address of the VME slave window.
vmeAddrMod: (Output) VME address modifier to access the board VME slave window.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_OpenBCDevice()

NAIBRDFUNC nai_status_t NAIAPI naibrd_OpenBCDevice ( int16_t swDevice,
int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t rtaddr,
bool_t busAEnable,
naibrd_comm_t comm,
const char * device )

Opens a 1553 BC device on a FTx or N7 module (must be an NAI card).

Parameters
swDevice: (Input) Unit index (0-31).
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
rtaddr: (Input) RT Address.
busAEnable: (Input) TRUE for bus A, FALSE for bus B.
comm: (Input) The communications mode to use.
device: (Input) Device name (NAI_DEV_NAME_64C2, NAI_DEV_NAME_75C5, etc).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_OpenDevice()

NAIBRDFUNC nai_status_t NAIAPI naibrd_OpenDevice ( int32_t cardIndex,
naibrd_comm_t comm,
const char * device )

Opens access to the board based on the device name and communication mode.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
comm: (Input) The communications mode to use.
device: (Input) Device name (NAI_DEV_NAME_64C2, NAI_DEV_NAME_75C5, etc). Refer to Device Name Declarations in naibrd.h file.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetAddress()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetAddress ( int32_t cardIndex,
uint32_t address )

Specifies the address to communicate with the card when communicating over VME, using another card as a master, or using custom IO functions specified by naibrd_SetIOFnc and naibrd_SetFifoIOFnc.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
address: (Input) The start address of the card.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetBusDev()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetBusDev ( int32_t cardIndex,
int16_t lane,
int16_t bus,
int16_t dev,
int16_t func )

Sets the lane (VxWorks only), bus, dev, and func to connect to when using NAIBRD_COMM_PCI.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
lane: (Input) PCI lane in VxWorks. Must be 0 for all other operating systems.
bus: (Input) PCI bus number.
dev: (Input) PCI device number.
func: (Input) PCI function number.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetIPAddress()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetIPAddress ( int32_t cardIndex,
const char * ipaddress,
const char * port )

Sets the IP address to connect to in NAIBRD_COMM_ETHER_TCP and NAIBRD_COMM_ETHER_UDP.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
ipaddress: (Input) IP Address or host name to connect to.
port: (Input) Port or service name to connect to.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetMaster()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetMaster ( int32_t cardIndex,
int32_t masterCardIndex )

Specifies another card as the card's master, sending all I/O operations though it.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
masterCardIndex: (Input) Logical Card Index assigned to the connection with the master card.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetVMEBoardIsNaiSbc()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEBoardIsNaiSbc ( int32_t cardIndex,
bool_t brdIsSbc )

sets the board is a NAI SBC.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
brdIsSbc: (Input) Boards is a SBC (TRUE, FALSE).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetVMEDataWidth()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEDataWidth ( int32_t cardIndex,
int32_t brdDataWidth )

sets the board physical data width.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
brdDataWidth: (Input) Boards physical data width (2, 4).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetVMEEndian()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEEndian ( int32_t cardIndex,
nai_endian_t brdEndian )

sets the board physical Endianess.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
brdEndian: (Input) Boards physical Endianess (NAI_BIG_ENDIAN, NAI_LITTLE_ENDIAN).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetVMEGeoEn()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMEGeoEn ( int32_t cardIndex,
bool_t enable )

Sets the board geographic mode configuration.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
enable: (Input) Geographic mode enable.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SetVMESlotAddr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetVMESlotAddr ( int32_t cardIndex,
int32_t slot,
uint32_t vmeSlaveBaseAddr,
uint32_t vmeLocalAddr,
uint32_t vmeAddrMod )

sets the board physical slot in rack with the beginning of the boards VME slave window

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
slot: (Input) Boards physical slot in chassis beginning with slot 1.
vmeSlaveBaseAddr: (Input) The base of the board VME slave window.
vmeLocalAddr: (Input) The local (PCI) address of the VME slave window.
vmeAddrMod: (Input) VME address modifier to access the board VME slave window.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.