summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-01-21 13:14:56 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-01-21 13:14:56 +0100
commit86d9cc4be4ff5203b682091e90256758097f2f73 (patch)
tree70bcfd9ddcfe1684218a41a93cafe5137b966bd3 /src
parentfe969749996bd31024068ea25d22b1a98e71dbfe (diff)
VEML6075: I²C reads need just one byte written per register
Diffstat (limited to 'src')
-rw-r--r--src/driver/veml6075.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/driver/veml6075.cc b/src/driver/veml6075.cc
index 0ef3c08..dd6df25 100644
--- a/src/driver/veml6075.cc
+++ b/src/driver/veml6075.cc
@@ -26,25 +26,25 @@ bool VEML6075::readUVCounts(float *uva, float *uvb)
{
uint16_t uva_counts, uvb_counts, comp_visible, comp_ir;
txbuf[0] = 0x07;
- if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) {
+ if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) {
return false;
}
uva_counts = ((uint16_t)rxbuf[1] << 8) + rxbuf[0];
txbuf[0] = 0x09;
- if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) {
+ if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) {
return false;
}
uvb_counts = ((uint16_t)rxbuf[1] << 8) + rxbuf[0];
txbuf[0] = 0x0a;
- if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) {
+ if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) {
return false;
}
comp_visible = ((uint16_t)rxbuf[1] << 8) + rxbuf[0];
txbuf[0] = 0x0b;
- if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) {
+ if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) {
return false;
}
comp_ir = ((uint16_t)rxbuf[1] << 8) + rxbuf[0];