Revision c4db2363
source/P9221R/v1/alld_P9221R_v1.c | ||
---|---|---|
71 | 71 |
apalDbgAssert(data != NULL); |
72 | 72 |
|
73 | 73 |
uint8_t buffer[num]; |
74 |
for (uint8_t i = 0; i < num; ++i) { |
|
75 |
buffer[i] = 1; |
|
76 |
} |
|
77 |
apalExitStatus_t status = apalI2CMasterTransmit(p9221r->i2cd, (P9221R_LLD_I2C_ADDR_FIXED | p9221r->addr), (uint8_t*)&addr, 1, buffer, num, timeout); |
|
74 |
|
|
75 |
apalExitStatus_t status = apalI2CMasterTransmit(p9221r->i2cd, (P9221R_LLD_I2C_ADDR_FIXED | p9221r->addr), (uint8_t*)&addr, 2, buffer, num, timeout); |
|
78 | 76 |
for (uint8_t dataIdx = 0; dataIdx < num; dataIdx++) { |
79 |
//data[dataIdx] = (buffer[2*dataIdx] << 8) | buffer[2*dataIdx+1]; |
|
80 | 77 |
data[dataIdx] = buffer[dataIdx]; |
81 |
// TODO test! |
|
82 | 78 |
} |
83 | 79 |
return status; |
84 | 80 |
} |
Also available in: Unified diff