Add method ProbeByIICSignature().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31625 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -124,3 +124,23 @@ CamSensor::Device()
|
||||
{
|
||||
return fCamDevice;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
CamSensor::ProbeByIICSignature(const uint8 *regList, const uint8 *matchList,
|
||||
size_t count)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
uint8 value = 0;
|
||||
ssize_t len;
|
||||
len = Device()->ReadIIC8(regList[i], &value);
|
||||
PRINT((CH ": ReadIIC8 = %d val = %d" CT, len, value));
|
||||
if (len < 1)
|
||||
return ENODEV;
|
||||
if (value != matchList[i])
|
||||
return ENODEV;
|
||||
}
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,11 @@ class CamSensor
|
||||
virtual status_t ReadIIC(uint8 address, uint8 *data);
|
||||
#endif
|
||||
protected:
|
||||
|
||||
status_t ProbeByIICSignature(const uint8 *regList,
|
||||
const uint8 *matchList,
|
||||
size_t count);
|
||||
|
||||
status_t fInitStatus;
|
||||
bool fIsBigEndian;
|
||||
bool fTransferEnabled;
|
||||
|
||||
Reference in New Issue
Block a user