3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / media-add-ons / usb_webcam / sensors / pb0100.cpp
blobde2bd8e2087b1661031b21c3d20f5a01086de1d9
1 /*
2 * Copyright 2004-2008, François Revol, <revol@free.fr>.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "CamSensor.h"
7 #include "CamDebug.h"
9 #define PB_ADDR_QC 0xba
11 #define PB_IDENT 0x00
14 class PB0100Sensor : public CamSensor {
15 public:
16 PB0100Sensor(CamDevice *_camera);
17 ~PB0100Sensor();
18 virtual status_t Probe();
20 virtual uint8 IICReadAddress() const { return PB_ADDR_QC; };
21 virtual uint8 IICWriteAddress() const { return PB_ADDR_QC; };
25 PB0100Sensor::PB0100Sensor(CamDevice *_camera)
26 : CamSensor(_camera)
28 Device()->SetIICBitsMode(16);
33 PB0100Sensor::~PB0100Sensor()
38 status_t
39 PB0100Sensor::Probe()
41 status_t err;
42 uint16 data;
43 PRINT((CH "()" CT));
44 Device()->SetIICBitsMode(16);
45 // QuickCam only ?
46 err = Device()->ReadIIC16(PB_IDENT, &data);
47 if (err < B_OK)
48 return ENODEV;
49 if (data == 0x64) {
50 PRINT((CH ": found %s sensor!" CT, Name()));
51 return B_OK;
53 return ENODEV;
57 B_WEBCAM_DECLARE_SENSOR(PB0100Sensor, pb0100)