Date: Mon, 29 Oct 2007 09:48:35 +0300 From: Achilleas Mantzios <achill@matrix.gatewaynet.com> To: Mark Tinguely <tinguely@casselton.net> Cc: freebsd-multimedia@freebsd.org Subject: Re: bktr and GPIO Message-ID: <200710290848.35710.achill@matrix.gatewaynet.com> In-Reply-To: <200710261555.l9QFtnW6097987@casselton.net> References: <200710261555.l9QFtnW6097987@casselton.net>
next in thread | previous in thread | raw e-mail | index | archive | help
=CE=A3=CF=84=CE=B9=CF=82 =CE=A0=CE=B1=CF=81=CE=B1=CF=83=CE=BA=CE=B5=CF=85= =CE=AE 26 =CE=9F=CE=BA=CF=84=CF=8E=CE=B2=CF=81=CE=B9=CE=BF=CF=82 2007 18:55= , =CE=BF/=CE=B7 Mark Tinguely =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > <delete> > > > In relation to bits assignments on LMLBT4M and LMLBT44 cards: > > > > /* to allow access to GPIO bits for sensors input and > > alarms output > > > > GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | > > assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | | > > > > IN - sensor inputs, INx - sensor inputs and TI XORed together > > O1,O2,O3 - alarm outputs (relays) > > > > GPIO bits should be enabled for outpus as follows: > > > > OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 =3D3D 0x= 6C0 > > > > */ > > In your user program after compiling/booting kernel with BKTR_GPIO_ACCESS, > all you should need to do is: > > #define BKTR_ZONEMINDER_ALARM1 0x040 > #define BKTR_ZONEMINDER_ALARM2 0x080 > #define BKTR_ZONEMINDER_ALARM3 0x200 > int value; > if (ioctl(tuner, BT848_GPIO_GET_EN, &value) < 0) > error(); > value |=3D BKTR_ZONEMINDER_ALARM1; /* or other alarm */ > if (ioctl(tuner, BT848_GPIO_SET_EN, &value) < 0) > error(); > > error() > { > perform some error routine and exit > } I was able to enable GPIO with =20 BT848_GPIO_SET_EN, and then write data to output and check the written value with BT848_GPIO_SET_DATA, BT848_GPIO_GET_DATA. Thanx. > > --Mark Tinguely =2D-=20 Achilleas Mantzios
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710290848.35710.achill>