[Armadillo:03221] Re: Armadillo-500 GPIO入出力(CON16)について

与賀田 朝史 email@hidden
2008年 8月 1日 (金) 15:06:33 JST


$BM?2lED$G$9!#(B
$B$*@$OC$K$J$C$F$*$j$^$9!#(B

>$B$3$3$G$N(B"printk$B$G5-=R$5$l$?FbMF(B"$B$H$O2?$r;X$7$F$^$9$+!)(B
>armadillo5x0_gpio_ioctl()$BFb$N(Bprintk$B$N$b$N$O$G$^$;$s$h!)(B

"printk$B$G5-=R$5$l$?FbMF(B"$B$H$O!"(B"KDEBUG_FUNC()"$B$d(B
"KDEBUG_INFO()"$B$NItJ,$r;X$7$F$$$^$7$?$,!"5/F0%m%0(B
$B$K$O=PNO$5$l$J$$$H$$$&;v$G$9$M!#?=$7Lu$"$j$^$;$s!#(B

>$B%F%9%H%W%m%0%i%`E=$C$F$b$i$($^$9$+!)(B

$B0J2<$,%F%9%H%W%m%0%i%`$H$J$j$^$9!#(B
int main(int argc, char **argv)
{
    int fd;
    int ret;
    unsigned int data = 0;

	fd = open("/dev/gpio", O_RDWR);
	if (fd < 0) {
		printf("!! open error\n");
		return -1;
	}
	ret = ioctl(fd, 0, &data);
	printf("data = 0x%x\n", data);

	if (ret < 0) {
		printf("!! ioctl error : ret = %d\n", ret);
		return -1;
	}
	close(fd);
    return(0);
}

>gpio:Armadillo-5x0 GPIO Sample driver
>$B$H5/F0%m%0$KI=<($5$l$^$9$+!)(B
>$B$5$l$J$$>l9g$O!"(Bconfig$B$G%I%i%$%PL58z$H$J$C$F$$$k$H;W$$$^$9!#(B

"gpio:Armadillo-5x0 GPIO Sample driver"$B$O!"5/F0%m%0$K(B
$BI=<($5$l$F$*$j$^$9$N$G!"M-8z$K$J$C$F$$$k$H;W$o$l$^$9!#(B

>$B$5$l$k>l9g$O!"(B
>	cat /dev/gpio
>$B$H%3%^%s%I$r<B9T$9$k$H!"(B
>armadillo_gpio_open()
>$B$HI=<($5$l$^$9$+!)(B

cat$B$r<B9T$7$^$7$?$H$3$m!"(B"armadillo_gpio_open()"$B$OI=<($5$l$:!"(B
"cat: Read error: Invalid argument"$B$,I=<($5$l$k>uBV$H$J$C$F(B
$B$*$j$^$9!#(B

$B$d$O$j!"%S%k%I$KLdBj$,$"$k$H$$$&$3$H$G$7$g$&$+!#(B
$B$*K;$7$$$H$O;W$$$^$9$,!"$h$m$7$/$*4j$$CW$7$^$9!#(B


-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of nakai
Sent: Friday, August 01, 2008 12:32 PM
To: Armadillo series general discussion list
Subject: [Armadillo:03219] Re: Armadillo-500 GPIO$BF~=PNO(B(CON16)$B$K$D$$$F(B


nakai$B$G$9!#(B

> $B$7$+$7!"5/F0%m%0$K$O(Bprintk$B$G5-=R$5$l$?FbMF$,=P$F$3$J$+$C$?0Y!"(B

$B$3$3$G$N(B"printk$B$G5-=R$5$l$?FbMF(B"$B$H$O2?$r;X$7$F$^$9$+!)(B
armadillo5x0_gpio_ioctl()$BFb$N(Bprintk$B$N$b$N$O$G$^$;$s$h!)(B

> $B%S%k%I$email@hidden$7$F$$$J$$$N$G$O$H;W$C$F$*$j$^$9!#(B
> $B$^$?!"%F%9%H%W%m%0%i%`$H$7$^$7$F!"(B/dev/gpio$B$r(Bopen$B8e!"(Bioc$B#t(Bl$B$r(B

$B%F%9%H%W%m%0%i%`E=$C$F$b$i$($^$9$+!)(B

> $B;n$7$F$_$^$7$?$,!">e<j$/$$$+$J$$>u67$G$9!#(B
> $BF1$8$h$&$J7P83$,$"$j!"%"%I%P%$%9$7$FD:$1$kJ}$,$*$i$l$^$7$?$i!"(B
> $B$465<(4j$$$^$9!#$h$m$7$/$*4j$$CW$7$^$9!#(B

gpio:Armadillo-5x0 GPIO Sample driver
$B$H5/F0%m%0$KI=<($5$l$^$9$+!)(B
$B$5$l$J$$>l9g$O!"(Bconfig$B$G%I%i%$%PL58z$H$J$C$F$$$k$H;W$$$^$9!#(B

$B$5$l$k>l9g$O!"(B
	cat /dev/gpio
$B$H%3%^%s%I$r<B9T$9$k$H!"(B
armadillo_gpio_open()
$B$HI=<($5$l$^$9$+!)(B


$BM?2lED!!D+;K(B $B$5$s$O=q$-$^$7$?(B:
> $B$$$D$b$*@$OC$K$J$C$F$*$j$^$9!#(B
> $BM?2lED$G$9!#(B
>
> Armadillo-500 GPIO$BF~=PNO(B(CON16)$B$N7o$K$D$-$^$7$F!"(B
> $B:FEY<ALd$r$5$;$F$/$@$5$$!#(B
>
> $BA02s65$($FD:$$$?J}K!$r;29M$K!"(Barmadillo5x0_gpio.c$B$N(B
> $BJQ99$r9T$$!"2<5-$N:n6H$r9T$C$F$_$^$7$?!#(B
>
> $B-!(Barmadillo5x0_gpio.c$B$NJQ99(B
> $B!!!&(B#if 0 $B$r(B #if 1 $B$KJQ99!J#22U=j!K(B
> $B!!!&(B#define DEBUG$B$NDI2C(B
> $B!!!&(Barmadillo5x0_gpio_ioctl()$B$NJQ99(B
> $B!!!!!!!!!!(Bunsigned int val;
> 	KDEBUG_FUNC();
> 	if (cmd) {
> 	$B!!!!!!(B//writel();
> 	}
> 	else {
> 	$B!!!!!!(Bval = readl(0x53FCC000);
> 	$B!!!!!!(Barg = val;
> 	$B!!!!!!(BKDEBUG_INFO("arg=%x",arg);
> 	}
> $B-"%S%k%I!J(Blinux.bin.gz$B!?(Bromfs.img.gz$B$N:email@hidden!K(B
> $B-#%U%i%C%7%e%a%b%j=q$-49$((B
>
> $B$7$+$7!"5/F0%m%0$K$O(Bprintk$B$G5-=R$5$l$?FbMF$,=P$F$3$J$+$C$?0Y!"(B
> $B%S%k%I$email@hidden$7$F$$$J$$$N$G$O$H;W$C$F$*$j$^$9!#(B
> $B$^$?!"%F%9%H%W%m%0%i%`$H$7$^$7$F!"(B/dev/gpio$B$r(Bopen$B8e!"(Bioc$B#t(Bl$B$r(B
> $B;n$7$F$_$^$7$?$,!">e<j$/$$$+$J$$>u67$G$9!#(B
> $BF1$8$h$&$J7P83$,$"$j!"%"%I%P%$%9$7$FD:$1$kJ}$,$*$i$l$^$7$?$i!"(B
> $B$465<(4j$$$^$9!#$h$m$7$/$*4j$$CW$7$^$9!#(B
>
>
> -----Original Message-----
> From: email@hidden
> [mailto:email@hidden] On Behalf Of nakai
> Sent: Tuesday, July 29, 2008 7:47 PM
> To: Armadillo series general discussion list
> Subject: [Armadillo:03202] Re: Armadillo-500 GPIO$BF~=PNO(B(CON16)$B$K$D$$$F(B
>
> nakai$B$G$9!#(B
>
>> GPIO$B$N%"%/%;%9<jCJ$H$7$^$7$F$O!"%G%P%$%9%U%!%$%k$N(B
>> "/dev/gpio"$B$r%*!<%W%s$7!"(Bioctl$B4X?t$GF~=PNO$N$?$a$N(B
>> $B%G!<%?$rFI$_=q$-$7$h$&$H$7$F$*$j$^$9$,!"(Bioctl$B$N0z?t$r(B
>> $B$I$N$h$&$email@hidden$9$l$P$h$$$+$,J,$+$i$:email@hidden$7$F$*$j$^$9!#(B
>
> misc$B%G%P%$%9$H$7$FEPO?$7$F$"$2$k$H4JC1$@$H;W$$$^$9!#(B
>
>> $B$^$?!"(BGPIO$B$GMxMQ$7$?$$2U=j$O!"(BCON16$B!'(BGPIO10$B!A(B19$B!J(B+3V$B!K(B
>> $B$K$J$j$^$9$,!"%G%P%$%9%I%i%$%P$OMQ0U$5$l$F$$$J$$$N$G$7$g$&$+!#(B
>
> $B%5%s%W%k%I%i%$%P$G$O(BGPIO0-7$B$^$G$7$+BP1~$7$F$$$^$;$s!#(B
> sysfs$B7PM3$G$h$$$N$G$7$?$i!"(B
> drivers/char/armadillo5x0_gpio.c
> $B$r3HD%$9$l$P$h$$$H;W$$$^$9!#(B
> # miscdevice$B$H$7$F:email@hidden$G$-$k$h$&$K(B"$BF~$j8}(B"$B$^$G$O<BAu$7$F$"$k$_$?$$$G$9!#(B
> # $BHs>o$KCfESH>C<$G$9$,!#!#(B
>
> $B>e5-%=!<%9%3!<%ICf$N(B #if 0 $B$r$O$:$7$F$"$2$k$H!"(B
> miscdevice$B$H$7$FEPO?$5$l$^$9!#(B
>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B8CN$NJ}$,$*$i$l$^$7$?$i!"$465<(4j$$$^$9!#(B
>>
>>
>> _______________________________________________
>> armadillo mailing list
>> email@hidden
>> http://lists.atmark-techno.com/mailman/listinfo/armadillo
> _______________________________________________
> armadillo mailing list
> email@hidden
> http://lists.atmark-techno.com/mailman/listinfo/armadillo
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> armadillo mailing list
> email@hidden
> http://lists.atmark-techno.com/mailman/listinfo/armadillo




armadillo メーリングリストの案内