Cteni dat pres lapling486

Marek Blasko blasko na vuje.sk
Čtvrtek Březen 14 08:50:14 CET 2002


> > - jeste sem si myslel, jestli by to neslo pres neco v cecku
> 
> ale slo pozri si lport programing howto (alebo tak nejak) da sa to
> riesit cez ioperm i cez inb.
> 
> > - ale netusim jak to naprogramovat.
> 
> pozriem sa a poslem to sem. (uz som par veci na LPT port zavesoval)

tak podla toho co som nasiel tak staci nastavit bit5 na BASE+2 na '0' a
datove linky su prepnute na citanie porom staci len citat z tohto portu
pi existencii signalu strobe (vysiela ho ustredna) ten mozes dat
napriklad na signal error (pin 15) ten je inverovany rovnako ako vystup
strobe. potom na citranie bude stacit nieco taketo:

---------------------------------
ioperm(BASE,3,1)			// vytvorenie pristupu k portu
do
	{
	while((inb(BASE+1)&4)==1);	// Cakanie na strobe signal

	putchar(inb(BASE));		// vypisanie prijateho znaku
	
	while(!(inb(BASE+1)&4);		// Cakanie na koniec strobe
while(1)
---------------------------------

dufam ze je to spravne uz som dlho v C nic nepisal :(


-- 
Niesom povinny byt taky, aky by som podla ostatnich mal byt.
Je to ich omyl nie moje zlyhanie.
		Richard Philips Feynman
---------------
First they came for the Communists,
     and I didn't speak up,
         because I wasn't a Communist.
Then they came for the Jews,
     and I didn't speak up,
         because I wasn't a Jew.
Then they came for the Catholics,
     and I didn't speak up,
         because I was a Protestant.
Then they came for me,
     and by that time there was no one
         left to speak up for me.

   by Rev. Martin Niemoller, 1945


Další informace o konferenci Linux