HSIMEM(3H) — MISC REFERENCE MANUAL PAGES
NAME
HsiSendMem− send data in host memory to HSI
HsiRecvMem− receive data into host memory from HSI
SYNOPSIS
#include <hsidefs.h>
int HsiSendMem(hsi, buf, npxl, nlines, format, rcvaddr)
HSIDEV ∗hsi;
unsigned long ∗buf;
int npxl, nlines, format, rcvaddr;
int HsiRecvMem(hsi, buf, npxl, nlines, format, rcvaddr)
HSIDEV ∗hsi;
unsigned long ∗buf;
int npxl, nlines, format, rcvaddr;
DESCRIPTION
HsiSendMem transfers pixel data from the host memory buffer buf to a Chap through the specified HSI device. Prior to calling this routine, a Chap routine must be started to accept data from the HSI. The Chap will receive nlines lines of pixels, with npxl pixels in each line. npxl must be a multiple of 16 and must not exceed HSI_MAXNPXL (defined in hsidefs.h). The Chap reads each line with one call to YFxCopy, YFyCopy, or YSCopy. The rcvaddr argument given to the Chap routine must match rcvaddr.
HsiRecvMem receives data from the specified HSI device into the buffer buf. This function is similar to HsiSendMem, except that data flows in the opposite direction, and the format values are more limited. Rcvaddr specifies the yapbus address used by the HSI, and it must match the address used by the sending routine on the Chap. After calling this routine, a Chap routine (such as FxYCopy or SYCopy) must be started to send data to the HSI.
FORMATS
When the HSI is sending, the format argument may be one of the following values (see the HSI Tutorial for an explanation of HSI pixel formats). The numbers in square brackets represent the ratio of 32-bit longs entering the HSI to pixels leaving the HSI for the yapbus; the first number of each pair should be doubled when using 16-bit short values. Alpha8 and alpha16 are integers representing 8-bit and 16-bit alpha values, respectively. HSI_FMT_16RGBA[2/1]
HSI_FMT_8RGBA [1/1]
HSI_FMT_16RGB(alpha16) [3/2]
HSI_FMT_8RGB(alpha8) [3/4]
Optionally, the constant HSI_FMT_REORDER may be logically ored with one of the above values; this causes the ordering of the four bytes in each long to be reversed as they enter the HSI from the VMEbus.
When the HSI is receiving, the format argument may be either 0 or HSI_FMT_REORDER. The number of longs read from the HSI data window is twice the number of pixels received from the Chap.
RETURN VALUE
HsiSendMem and HsiRecvMem return when the transfer is complete. The return value is 0 upon success, or −1 upon failure (HsiGetStatus may be used to determine the nature of the failure).
SEE ALSO
HSI Tutorial
Sun Release 4.1 — Last change: