Register Access
[EDT DMA Library]


Detailed Description

Register access functions.


Functions

u_int edt_bar1_read (EdtDev *edt_p, u_int offset)
 A convenience routine to access the EDT BAR1 registers.
void edt_bar1_write (EdtDev *edt_p, u_int offset, u_int val)
 A convenience routine to access the EDT BAR1 registers.
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

u_int edt_bar1_read ( EdtDev edt_p,
u_int  offset 
)

A convenience routine to access the EDT BAR1 registers.

Passed the BAR1 byte address for a 32-bit word; note that the LS two bits of the address are ignored.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset integer byte offset into EDT BAR1 register memory, addressing a 32-bit value. Note that the LS two bits of the address are ignored.
Returns:
The value of the 32-bit register.
Example u_int reg24 = edt_bar1_read(edt_p, 0x24);

See also:
edt_bar1_write, edt_reg_read.

Definition at line 9416 of file libedt.c.

void edt_bar1_write ( EdtDev edt_p,
u_int  offset,
u_int  data 
)

A convenience routine to access the EDT BAR1 registers.

Passed the BAR1 byte address for a 32-bit word; note that the LS two bits of the address are ignored.

Parameters:
edt_p pointer to edt device structure returned by edt_open or edt_open_channel
offset integer byte offset into EDT BAR1 register memory, addressing a 32-bit value. Note that the LS two bits of the address are ignored.
data 32-bit value to set register with.
Example
 u_int reg24 = 0xb01d_bee;
 edt_bar1_write(edt_p, 0x24, reg24);

See also:
edt_bar1_read, edt_reg_write.

Definition at line 9445 of file libedt.c.

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 3535 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 3656 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 3605 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 3680 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 3636 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 3062 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 3099 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 3021 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 2974 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 3125 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 3156 of file libedt.c.


Generated on 19 Jun 2015 by  doxygen 1.4.7