diff --git a/src/max44000/max44000.cxx b/src/max44000/max44000.cxx index d755a760..447b3892 100644 --- a/src/max44000/max44000.cxx +++ b/src/max44000/max44000.cxx @@ -64,7 +64,7 @@ MAX44000::getProximity () { uint16_t MAX44000::getAmbient () { uint16_t data = 0; - + data = (i2cReadReg_8 (ALSDATA_HIGH) & 0x7F) << 8; data = data | i2cReadReg_8 (ALSDATA_LOW); diff --git a/src/max44000/max44000.h b/src/max44000/max44000.h index d2d4ff72..23f00c54 100644 --- a/src/max44000/max44000.h +++ b/src/max44000/max44000.h @@ -102,8 +102,26 @@ class MAX44000 { return m_name; } + /** + * Read one byte register + * + * @param reg address of a register + */ uint8_t i2cReadReg_8 (int reg); + + /** + * Read two bytes register + * + * @param reg address of a register + */ uint16_t i2cReadReg_16 (int reg); + + /** + * Write to one byte register + * + * @param reg address of a register + * @param value byte to be written + */ maa_result_t i2cWriteReg (uint8_t reg, uint8_t value); private: