Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 1998 16:12:33 +0200
From:      Ian Freislich <iang@digs.iafrica.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        Joachim.Wunder@lrz-muenchen.de, rhh@ct.picker.com, multimedia@FreeBSD.ORG
Subject:   Re: Status on detect fix for Hauppauge FI1236 MK2 Tuner Cards 
Message-ID:  <E0yEE9R-0000Y8-00@brane.digs.iafrica.com>
In-Reply-To: Your message of "Fri, 06 Mar 1998 12:59:56 %2B0100." <199803061159.MAA01514@labinfo.iet.unipi.it> 

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi Rizzo...
> there is a small program at http://www.iet.unipi.it/~luigi/txt.c
> which i use to control various features of my card, and uses the
> I2C commands to fetch Teletext pages from the SAA5246. The command
> are very simple.

That ioctl won't work (I don't think) because it only supports the
following format:

        MSB                                                   LSB
| 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 |
  0 - read          i^2c address      Internal reg      Data
  1 - write

I presume that these bytes are just consecutive bytes written onto
the serial bus. If we're going to write stuff to the MSP3410 chips
we need to get 6 or 4 consecutive byte commands onto the i^2c bus.

The following telegrams will need to be supported:

write:
<80 sa ah al dh dl>
<80 sa dh dl>

read:
<80 sa ah al> <81 dh dl>

sa - Sub address (internal part address)
ah - Register Address MSB
al - Register Address LSB
dh - Data MSB
dl - Data LSB

Reads are done by writing the sub-address and the register address
and the readiing two bytes from the device read address. I also
don't think that this ioctl() will provide that functionality.

If you can write something to get the data onto the bus, I should
be able to get it to initialise the chip correctly. I'd propose
something like this:

ioctl (int, BT848_I2CWR6, u_long *)
BT848_I2CWR6 - Write 6 bytes:
u_long:	MSB 7 - Device address
	    6 - Not used
	    5 - Not used
	    4 - Byte 4	(sa)
            3 - Byte 3	(ah)
	    2 - Byte 2	(al)
	    1 - Byte 1	(dh)
	LSB 0 - Byte 0	(dl)
The write must terminate with a STOP from the i^2c master.

ioctl (int, BT848_I2CWR4, u_long *)
BT848_I2CWR4 - Write 4 bytes:
u_long: MSB 7 - Device address
	    6 - Not used
	    5 - Not used
	    4 - Not used
	    3 - Not used
	    2 - byte 2	(sa)
	    1 - Byte 1	(dh)
	LSB 0 - Byte 0	(dl)
The write must terminate with a STOP from the i^2c master.

ioctl (int, BT848_I2CRD2, u_long *)
BT848_I2CRD2 - Read 2 bytes:
u_long: MSB 7 - Device address
	    6 - Byte 2	(sa)
	    5 - Byte 1	(ah)
	    4 - byte 0	(al)
	    3 - Not used
	    2 - Not used
	    1 - Byte 1	(dh returned by read)
	LSB 0 - Byte 0	(dl returned by read)
Bytes 6-4 of the u_long are written to the Device address on the
i^2c bus followed by a START condition from the master. 2 bytes
are read from the device address into bytes 1-0 of the u_long
followed by a STOP condition from the master.

-- igf (Ian Freislich)
http://copernicus.cpt.tech.iafrica.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0yEE9R-0000Y8-00>