Solution: Direct access to Printer I/O lines

jkndeja at my-deja.com jkndeja at my-deja.com
Tue Dec 19 04:33:32 EST 2000


Hi Alex


[...'how about this']
>
> Seems nice, though I'd call the method which acquires the resource
> 'acquire' rather than 'claim' -- but that's quibbling.

I can live with acquire(), that's fine ;-)

I was also thinking of having a couple of methods of specifying the
actual LPT 'port number'. Although we have LPT1:, LPT2, LPT3: etc, they
don't actually necessarily correspond to the same port addresses across
PCs! Usually, for sure, but I have encountered exceptions, and Ralph
Brown's interrupt list mentions alternative sets of ports for each of
these. so I may have some constants so you can instantiate in a couple
of ways:

L = directlpt.directlpt(1)
# or
L = directlpt.directlpt(0x278)    # would mean the same thing.

This would allow use on a 'non-standard' implementation.

[...]
>
> The only issue (which depends on the device attached to the
> port, alas...) is IF reading is actually 'non-invasive' so it
> can be allowed without requiring 'acquisition'.  I guess in
> most cases it will be, but...
>

It should be fine, because an 'inb()' is only reading the voltages at
the LPT: pins - it's not strobing anything. Any device connected will
not be able to tell that an inb() has occurred.

Thanks for your suggestions on all of this!

    Jon N


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list