MakeAddr

Name

MakeAddr -- pack primary and secondary address into an Addr4882_t value

Synopsis

#include <gpib/ib.h>

static __inline__ Addr4882_t MakeAddr(unsigned int pad, unsigned int sad);

Description

MakeAddr() generates an Addr4882_t value that corresponds to the specified primary address pad and secondary address sad. It does so by putting pad into the least significant byte and left shifting sad up to the next byte.

Examples

Addr4882_t addressList[ 5 ];

addressList[ 0 ] = 5 /* primary address 5, no secondary address */
addressList[ 1 ] = MakeAddr(3, 0); /* primary address 3, no secondary address */
addressList[ 2 ] = MakeAddr(7, 0x70); /* primary address 3, secondary address 16 */
addressList[ 3 ] = MakeAddr(20, MSA(9)); /* primary address 20, secondary address 9 */
addressList[ 4 ] = NOADDR;

Return value

An Addr4882_t value corresponding to the specified primary and secondary GPIB address.