Add method ProbeByIICSignature().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31625 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2009-07-18 14:52:45 +00:00
parent e48c731ca7
commit 586b09a499
2 changed files with 25 additions and 0 deletions
@@ -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;