Register Access
[EDT DMA Library]


Detailed Description

Register access functions.


Functions

uchar_t edt_intfc_read (EdtDev *edt_p, uint_t offset)
 A convenience routine, partly for backward compatability, to access the user interface XILINX registers.
uint_t edt_intfc_read_32 (EdtDev *edt_p, uint_t offset)
 A convenience routine, partly for backward compatability, to access the user interface XILINX registers.
u_short edt_intfc_read_short (EdtDev *edt_p, uint_t offset)
 A convenience routine, partly for backward compatability, to access the user interface XILINX registers.
void edt_intfc_write_32 (EdtDev *edt_p, uint_t offset, uint_t val)
 A convenience routine, partly for backward compatability, to access the user interface XILINX registers.
void edt_intfc_write_short (EdtDev *edt_p, uint_t offset, u_short val)
 A convenience routine, partly for backward compatability, to access the user interface XILINX registers.
uint_t edt_reg_and (EdtDev *edt_p, uint_t desc, uint_t val)
 Performs a bitwise logical AND of the value of the specified register and the value provided in the argument; the result becomes the new value of the register.
void edt_reg_clearset (EdtDev *edt_p, uint_t desc, uint_t val)
 Toggles the bits specified in the mask argument off then on in a single ioctl call.
uint_t edt_reg_or (EdtDev *edt_p, uint_t desc, uint_t val)
 Performs a bitwise logical OR of the value of the specified register and the value provided in the argument; the result becomes the new value of the register.
uint_t edt_reg_read (EdtDev *edt_p, uint_t desc)
 Reads the specified register and returns its value.
void edt_reg_setclear (EdtDev *edt_p, uint_t desc, uint_t val)
 Toggles the bits specified in the mask argument on then off in a single ioctl call.
void edt_reg_write (EdtDev *edt_p, uint_t desc, uint_t val)
 Write the specified value to the specified register.


Function Documentation

uchar_t edt_intfc_read ( EdtDev edt_p,
uint_t  offset 
)

A convenience routine, partly for backward compatability, to access the user interface XILINX registers.

The register descriptors used by edt_reg_read can also be used, since edt_intfc_read masks off the offset.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset integer offset into user interface XILINX, or edt_reg_read style register descriptor
Returns:
The value of the 8 bit register.
Example u_char func_reg = edt_intfc_read(edt_p, PCD_FUNC);

See also:
edt_intfc_write, edt_reg_read, edt_intfc_read_short

Definition at line 3369 of file libedt.c.

uint_t edt_intfc_read_32 ( EdtDev edt_p,
uint_t  offset 
)

A convenience routine, partly for backward compatability, to access the user interface XILINX registers.

The register descriptors used be edt_reg_read can also be used, since edt_intfc_read_32 masks off the offset.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset integer offset into the user interface XILINX, or edt_reg_read style register descriptor.
Returns:
The value of the 32 bit register.

Definition at line 3490 of file libedt.c.

u_short edt_intfc_read_short ( EdtDev edt_p,
uint_t  offset 
)

A convenience routine, partly for backward compatability, to access the user interface XILINX registers.

The register descriptors used by edt_reg_read can also be used, since edt_intfc_read_short masks off the offset.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset integer offset into user interface XILINX, or edt_reg_read style register descriptor
Returns:
Value of the 16 bit register.
Example
 int i;
 puts("Directions for each channel of 16-channel card using
 user interface xilinx 'ssdio.bit':");
 u_short channel_direction_reg = edt_intfc_read_short(edt_p, SSD16_CHDIR);
 for (i = 0; i < 16; ++i) {
     int dir = channel_dir_reg & (1 << i);
           printf("Channel %d configured for: ", i);
     if (dir == 0) {
         printf("input\n");
     } else if (dir == 1) {
         printf("output");
     }
 }

See also:
edt_intfc_read, edt_reg_read

Definition at line 3439 of file libedt.c.

void edt_intfc_write_32 ( EdtDev edt_p,
uint_t  offset,
uint_t  data 
)

A convenience routine, partly for backward compatability, to access the user interface XILINX registers.

The register descriptors used by edt_reg_write can also be used, since edt_intfc_write_32 masks off the offset.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset integer offset into user interface XILINX, or edt_reg_write style register descriptor
data The 32 bit value to set the register to.
See also:
edt_intfc_read32, edt_reg_write

Definition at line 3514 of file libedt.c.

void edt_intfc_write_short ( EdtDev edt_p,
uint_t  offset,
u_short  data 
)

A convenience routine, partly for backward compatability, to access the user interface XILINX registers.

The register descriptors used by edt_reg_write() can also be used, since edt_intfc_write_short masks off the offset.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset,: integer offset into user interface XILINX, or edt_reg_write style register descriptor
data unsigned short integer value to set
Example
 puts("Enabling all 16 DMA channels on PCDa with 'ssdio.bit'
 loaded in user interface xilinx");
 edt_intfc_write_short(edt_p, SSD16_CHEN, 0xffff);

See also:
edt_intfc_write, edt_reg_write

Definition at line 3470 of file libedt.c.

uint_t edt_reg_and ( EdtDev edt_p,
uint_t  desc,
uint_t  mask 
)

Performs a bitwise logical AND of the value of the specified register and the value provided in the argument; the result becomes the new value of the register.

Use this routine instead of using ioctls.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
desc The name of the register to modify. Use the names provided in the register descriptions in Hardware Addendum for the card you are using (e.g. "PCI DV C-Link Hardware Addendum").
mask The value to AND with the register.
Returns:
The new value of the register

Definition at line 2902 of file libedt.c.

void edt_reg_clearset ( EdtDev edt_p,
uint_t  desc,
uint_t  mask 
)

Toggles the bits specified in the mask argument off then on in a single ioctl call.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
desc The name of the register to modify. Use the names provided in the register descriptions in Hardware Addendum for the card you are using (e.g. "PCI DV C-Link Hardware Addendum").
mask The value to XOR with the register.

Definition at line 2936 of file libedt.c.

uint_t edt_reg_or ( EdtDev edt_p,
uint_t  desc,
uint_t  mask 
)

Performs a bitwise logical OR of the value of the specified register and the value provided in the argument; the result becomes the new value of the register.

Use this routine instead of using ioctls.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
desc The name of the register to modify. Use the names provided in the register descriptions in Hardware Addendum for the card you are using (e.g. "PCI DV C-Link Hardware Addendum").
mask The value to OR with the register.
Returns:
The new value of the register.

Definition at line 2864 of file libedt.c.

uint_t edt_reg_read ( EdtDev edt_p,
uint_t  desc 
)

Reads the specified register and returns its value.

Use this routine instead of using ioctls.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
desc The name of the register to read. Use the names provided in the register descriptions in Hardware Addendum for the card you are using (e.g. "PCI DV C-Link Hardware Addendum").
Returns:
The value of register.

Definition at line 2820 of file libedt.c.

void edt_reg_setclear ( EdtDev edt_p,
uint_t  desc,
uint_t  mask 
)

Toggles the bits specified in the mask argument on then off in a single ioctl call.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
desc The name of the register to modify. Use the names provided in the register descriptions in Hardware Addendum for the card you are using (e.g. "PCI DV C-Link Hardware Addendum").
mask The value to XOR with the register.

Definition at line 2962 of file libedt.c.

void edt_reg_write ( EdtDev edt_p,
uint_t  desc,
uint_t  value 
)

Write the specified value to the specified register.

Use this routine instead of using ioctls.

Note:
Use this routine with care; it writes directly to the hardware. An incorrect value can crash your system, possibly causing loss of data.
Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
desc The name of the register to write. Use the names provided in the register descriptions in Hardware Addendum for the card you are using (e.g. "PCI DV C-Link Hardware Addendum").
value The desired value to write in register.

Definition at line 2993 of file libedt.c.


Generated on Mon May 12 16:39:08 2008 by  doxygen 1.5.1