|
|
@@ -217,18 +217,18 @@ bool getBatteryMeasurement_test(){
|
|
|
//delay_cycles(320000);
|
|
|
rxPacket.rxCount= 0;
|
|
|
rxPacket.rxLen= 8;
|
|
|
+
|
|
|
+ DL_I2C_flushControllerRXFIFO(I2C_1_INST);
|
|
|
/* Send a read request to Target */
|
|
|
- DL_I2C_startControllerTransfer(I2C_1_INST, 0x49, DL_I2C_CONTROLLER_DIRECTION_RX, 8);
|
|
|
- /*DL_I2C_startControllerTransferAdvanced(I2C_1_INST,
|
|
|
- 0x49,
|
|
|
- DL_I2C_CONTROLLER_DIRECTION_RX,
|
|
|
- 8,
|
|
|
- DL_I2C_CONTROLLER_START_ENABLE,
|
|
|
+ DL_I2C_startControllerTransferAdvanced(I2C_1_INST, 0x49, DL_I2C_CONTROLLER_DIRECTION_RX, 8, DL_I2C_CONTROLLER_START_ENABLE,
|
|
|
DL_I2C_CONTROLLER_STOP_ENABLE,
|
|
|
- DL_I2C_CONTROLLER_ACK_ENABLE);*/
|
|
|
+ DL_I2C_CONTROLLER_ACK_ENABLE);
|
|
|
|
|
|
while (DL_I2C_getControllerStatus(I2C_1_INST) & DL_I2C_CONTROLLER_STATUS_BUSY);
|
|
|
|
|
|
+ DL_I2C_enableInterrupt(I2C_1_INST, DL_I2C_INTERRUPT_CONTROLLER_RXFIFO_TRIGGER);
|
|
|
|
|
|
+ printf("Received Bytes[%d]: 0x%02X\n", rxPacket.rxCount, rxPacket.rxBuffer[rxPacket.rxCount]);
|
|
|
+
|
|
|
return true;
|
|
|
}
|