Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2007 10:55:49 -0500 (CDT)
From:      Mark Tinguely <tinguely@casselton.net>
To:        achill@matrix.gatewaynet.com, tinguely@casselton.net
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: bktr and GPIO
Message-ID:  <200710261555.l9QFtnW6097987@casselton.net>
In-Reply-To: <200710261827.25933.achill@matrix.gatewaynet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<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   =3D 0x6C0
>
>  */

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 |= BKTR_ZONEMINDER_ALARM1; /* or other alarm */
	if (ioctl(tuner, BT848_GPIO_SET_EN, &value) < 0)
		error();

error()
{
  perform some error routine and exit
}

--Mark Tinguely



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710261555.l9QFtnW6097987>