MakeAddr — pack primary and secondary address into an Addr4882_t value
#include <gpib/ib.h>
static __inline__ Addr4882_t MakeAddr( | pad, | |
sad); |
unsigned int pad;unsigned int sad; 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.
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;
An Addr4882_t value corresponding to the specified primary and secondary GPIB address.