Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r51147222d369a3023a11b2ee675178d058ffaf46 -r9d4666bf3064df18a6d935125d7a69e4e8234e84 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 51147222d369a3023a11b2ee675178d058ffaf46) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 9d4666bf3064df18a6d935125d7a69e4e8234e84) @@ -80,32 +80,53 @@ typedef struct // TODO - add all sensor readings to this structure per FPGA register map { + U08 errorCountProcessor; // 256 + U08 errorCountPC; U08 bloodFlowMeterDataPktCount; U08 bloodFlowMeterSlowPktCounts; - U08 bloodFlowMeterDeviceStatus; + F32 bloodFlowLast; // 260 + U08 bloodFlowMeterDeviceStatus; // 264 U08 bloodFlowMeterResponse; - F32 bloodFlowLast; U08 dialysateFlowMeterDataPktCount; U08 dialysateFlowMeterSlowPckCounts; - U08 dialysateFlowMeterDeviceStatus; + F32 dialysateFlowLast; // 268 + U08 dialysateFlowMeterDeviceStatus; // 272 U08 dialysateFlowMeterResponse; - F32 dialysateFlowLast; U08 bloodFlowMeterErrorCount; U08 dialysateFlowMeterErrorCount; - U16 bloodOcclusionData; + U16 bloodOcclusionData; // 276 U08 bloodOcclusionReadCount; U08 bloodOcclusionErrorCount; - U16 dialysateInOcclusionData; + U16 dialysateInOcclusionData; // 280 U08 dialysateInOcclusionReadCount; U08 dialysateInOcclusionErrorCount; - U16 dialysateOutOcclusionData; + U16 dialysateOutOcclusionData; // 284 U08 dialysateOutOcclusionReadCount; U08 dialysateOutOcclusionErrorCount; - U16 arterialPressureData; - U08 arterialPressureReadCount; - U08 arterialPressureErrorCount; - U16 dialysateTempPrimaryData; - U16 dialysateTempBackupData; + U16 bloodPumpHallSensorCount; // 288 + U08 bloodPumpHallSensorStatus; + U08 dialInPumpHallSensorStatus; + U32 adc1Channel0; // 292 + U32 adc1Channel1; // 296 + U32 adc1Channel2; // 300 + U32 adc1Channel3; // 304 + U32 adc1channel4; // 308 + U08 adc1SequenceCount; // 312 + U08 adc1ErrorCount; + U16 accelX; + U16 accelY; // 316 + U16 accelZ; + U16 accelXMax; // 320 + U16 accelYMax; + U16 accelZMax; // 324 + U16 accelFaultRegister; + U16 accelSampleCounter; // 328 + U16 venousPressure; + U16 venousTemperature; // 332 + U08 venousReadCounter; + U08 dialOutPumpSensorStatus; + U16 dialInPumpHallSensorCount; // 336 + U16 dialOutPumpHallSensorCount; } FPGA_SENSORS_T; typedef struct // TODO - add all actuator set points to this structure per FPGA register map @@ -554,7 +575,7 @@ fpgaWriteCmdBuffer[ FPGA_WRITE_CMD_HDR_LEN + sizeof( FPGA_ACTUATORS_T ) + 1 ] = GET_LSB_OF_WORD( crc ); // construct bulk read command to read sensor data registers starting at address 8 fpgaReadCmdBuffer[ 0 ] = FPGA_READ_CMD_CODE; - fpgaReadCmdBuffer[ 1 ] = 0x08; // start at FPGA address 0x108 (264) + fpgaReadCmdBuffer[ 1 ] = 0x00; // start at FPGA address 0x100 (256) fpgaReadCmdBuffer[ 2 ] = 0x01; fpgaReadCmdBuffer[ 3 ] = sizeof(FPGA_SENSORS_T); crc = crc16( fpgaReadCmdBuffer, FPGA_READ_CMD_HDR_LEN ); @@ -938,7 +959,7 @@ *************************************************************************/ U16 getFPGAArterialPressure( void ) { - return fpgaSensorReadings.arterialPressureData; + return 0; // TODO - return reading when available } /*************************************************************************