2 * Copyright 2004-2008, François Revol, <revol@free.fr>.
3 * Distributed under the terms of the MIT License.
8 #include "addons/sonix/SonixCamDevice.h"
12 static const uint8 sProbeAddressList
[] = {
13 0x01,0x02,0x03,0x04,0x05,0x06,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x10
15 static const uint8 sProbeMatchList
[] = {
16 0x70,0x02,0x12,0x05,0x05,0x06,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x06
19 class PAS106BSensor
: public CamSensor
{
21 PAS106BSensor(CamDevice
*_camera
);
26 virtual bool Use400kHz() const { return true; }; // supports both
27 virtual bool UseRealIIC() const { return true; };
34 PAS106BSensor::PAS106BSensor(CamDevice
*_camera
)
37 fIsSonix
= (dynamic_cast<SonixCamDevice
*>(_camera
) != NULL
);
41 PRINT((CH
": unknown camera device!" CT
));
47 PAS106BSensor::~PAS106BSensor()
53 PAS106BSensor::Probe()
55 Device()->PowerOnSensor(false);
56 Device()->PowerOnSensor(true);
58 Device()->WriteReg8(SN9C102_CHIP_CTRL
, 0x00); /* power on the sensor, Fsys_clk=12MHz */
59 Device()->WriteReg8(SN9C102_CLOCK_SEL
, 0x17); /* enable sensor, force 24MHz */
62 return ProbeByIICSignature(sProbeAddressList
, sProbeMatchList
,
63 sizeof(sProbeMatchList
));
70 return "PixArt Imaging pas106b";
74 B_WEBCAM_DECLARE_SENSOR(PAS106BSensor
, pas106b
)