rr
index
/home/dcobas/gnurabbit/python/rr.py

#   :vi:ts=4 sw=4 et

 
Modules
       
errno
os
re
struct
sys

 
Classes
       
__builtin__.object
Gennum
_ctypes.Array(_ctypes._CData)
c_long_Array_256
_ctypes.Structure(_ctypes._CData)
RR_Devsel
RR_Iocmd
_ctypes.Union(_ctypes._CData)
RR_U

 
class Gennum(__builtin__.object)
     Methods defined here:
__init__(self)
get a file descriptor for the Gennum device
bind(self, device)
bind the rawrabbit driver to a device
 
The device is specified with a syntax described in parse_addr
getdmasize(self)
return the size of the allocated DMA buffer (in bytes)
getplist(self)
get a list of pages for DMA access
 
The addresses returned, shifted by 12 bits, give the physical
addresses of the allocated pages
info(self)
get a string describing the interface the driver is bound to
 
The syntax of the string is 
    vendor:device/dubvendor:subdevice@bus:devfn
iread(self, bar, offset, width)
do a read by means of the ioctl interface
 
bar = 0, 2, 4 (or c for DMA buffer access
offset = address within bar
width = data size (1, 2, 4 or 8 bytes)
irqena(self)
enable the interrupt line
irqwait(self)
wait for an interrupt
iwrite(self, bar, offset, width, datum)
do a write by means of the ioctl interface
 
bar = 0, 2, 4 (or c for DMA buffer access
offset = address within bar
width = data size (1, 2, 4 or 8 bytes)
datum = value to be written
parse_addr(self, addr)
take a string of the form
       vendor:device[/subvendor:subdevice][@bus:devfn]
and return a dictionary object with the corresponding values,
initialized to RR_DEVSEL_UNUSED when absent
read(self, bar, offset, width)
do a read by means of lseek+read
 
bar = 0, 2, 4 (or c for DMA buffer access
offset = address within bar
width = data size (1, 2, 4 or 8 bytes)
write(self, bar, offset, width, datum)
do a write by means of lseek+write
 
bar = 0, 2, 4 (or c for DMA buffer access
offset = address within bar
width = data size (1, 2, 4 or 8 bytes)
datum = value to be written

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
device = '/dev/rawrabbit'
rrlib = './rrlib.so'

 
Plist = class c_long_Array_256(_ctypes.Array)
    
Method resolution order:
c_long_Array_256
_ctypes.Array
_ctypes._CData
__builtin__.object

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from _ctypes.Array:
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__delslice__(...)
x.__delslice__(i, j) <==> del x[i:j]
 
Use of negative indices is not supported.
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
__len__(...)
x.__len__() <==> len(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
__setslice__(...)
x.__setslice__(i, j, y) <==> x[i:j]=y
 
Use  of negative indices is not supported.

Data and other attributes inherited from _ctypes.Array:
__new__ = <built-in method __new__ of _ctypes.ArrayType object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
__setstate__(...)

 
class RR_Devsel(_ctypes.Structure)
    
Method resolution order:
RR_Devsel
_ctypes.Structure
_ctypes._CData
__builtin__.object

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
bus
Structure/Union member
devfn
Structure/Union member
device
Structure/Union member
subdevice
Structure/Union member
subvendor
Structure/Union member
vendor
Structure/Union member

Methods inherited from _ctypes.Structure:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from _ctypes.Structure:
__new__ = <built-in method __new__ of _ctypes.StructType object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
__setstate__(...)

 
class RR_Iocmd(_ctypes.Structure)
    
Method resolution order:
RR_Iocmd
_ctypes.Structure
_ctypes._CData
__builtin__.object

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
address
Structure/Union member
data
Structure/Union member
data16
Structure/Union member
data32
Structure/Union member
data64
Structure/Union member
data8
Structure/Union member
datasize
Structure/Union member

Methods inherited from _ctypes.Structure:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from _ctypes.Structure:
__new__ = <built-in method __new__ of _ctypes.StructType object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
__setstate__(...)

 
class RR_U(_ctypes.Union)
    
Method resolution order:
RR_U
_ctypes.Union
_ctypes._CData
__builtin__.object

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
data16
Structure/Union member
data32
Structure/Union member
data64
Structure/Union member
data8
Structure/Union member

Methods inherited from _ctypes.Union:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from _ctypes.Union:
__new__ = <built-in method __new__ of _ctypes.UnionType object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
__setstate__(...)

 
Functions
       
POINTER(...)
addressof(...)
addressof(C instance) -> integer
Return the address of the C instance internal buffer
alignment(...)
alignment(C type) -> integer
alignment(C instance) -> integer
Return the alignment requirements of a C instance
byref(...)
byref(C instance[, offset=0]) -> byref-object
Return a pointer lookalike to a C instance, only usable
as function argument
get_errno(...)
pointer(...)
resize(...)
Resize the memory buffer of a ctypes instance
set_conversion_mode(...)
set_conversion_mode(encoding, errors) -> (previous-encoding, previous-errors)
 
Set the encoding and error handling ctypes uses when converting
between unicode and strings.  Returns the previous values.
set_errno(...)
sizeof(...)
sizeof(C type) -> integer
sizeof(C instance) -> integer
Return the size in bytes of a C instance

 
Data
        DEFAULT_MODE = 0
RR_BAR_0 = 0
RR_BAR_2 = 536870912
RR_BAR_4 = 1073741824
RR_BAR_BUF = 3221225472L
RR_DEFAULT_DEVICE = 4
RR_DEFAULT_VENDOR = 6713
RR_DEVSEL_UNUSED = 65535
RTLD_GLOBAL = 256
RTLD_LOCAL = 0
bar_map = {0: 0, 2: 536870912, 4: 1073741824, 12: 3221225472L}
cdll = <ctypes.LibraryLoader object>
fmt = {1: 'B', 2: 'H', 4: 'I', 8: 'L'}
memmove = <CFunctionType object>
memset = <CFunctionType object>
pydll = <ctypes.LibraryLoader object>
pythonapi = <PyDLL 'None', handle b78398f8 at b73dd0ac>