Index: App/Services/FPGA.c =================================================================== diff -u -r447eb904c9deb9536c04c9cc0e009a0b26b55573 -rcda7aca3cdae3f3a2c2bcefc009f96a9bf6e4bdd --- App/Services/FPGA.c (.../FPGA.c) (revision 447eb904c9deb9536c04c9cc0e009a0b26b55573) +++ App/Services/FPGA.c (.../FPGA.c) (revision cda7aca3cdae3f3a2c2bcefc009f96a9bf6e4bdd) @@ -40,6 +40,7 @@ } FPGA_STATE_T; #define FPGA_PAGE_SIZE 256 +#define FPGA_EXPECTED_ID 0x59 #define FPGA_WRITE_CMD_BUFFER_LEN (FPGA_PAGE_SIZE+8) #define FPGA_READ_CMD_BUFFER_LEN 8 @@ -76,36 +77,15 @@ typedef struct { - U08 gap1; - U08 bloodLeakLow; - U08 bloodLeakHigh; - U08 gap2; - U08 gap3; - U08 adc1bLow; - U08 adc1bMid; - U08 adc1bHigh; - U08 adc2bLow; - U08 adc2bMid; - U08 adc2bHigh; - U08 dialysateTemp1Low; - U08 dialysateTemp1Mid; - U08 dialysateTemp1High; - U08 venousPressureLow; - U08 venousPressureMid; - U08 venousPressureHigh; - U08 arterialPressureLow; - U08 arterialPressureMid; - U08 arterialPressureHigh; - U08 gap4; - U08 adc1aLow; - U08 adc1aMid; - U08 adc1aHigh; - U08 adc2aLow; - U08 adc2aMid; - U08 adc2aHigh; - U08 dialysateTemp2Low; - U08 dialysateTemp2Mid; - U08 dialysateTemp2High; + U16 bloodLeak; + U32 adc1b; + U32 adc2b; + U32 dialysateTemp1; + U32 venousPressure; + U32 arterialPressure; + U32 adc1a; + U32 adc2a; + U32 dialysateTemp2; } FPGA_SENSORS_T; typedef struct @@ -260,12 +240,6 @@ fpgaDMAReadRespControlRecord.ELSOFFSET = 0; // not used fpgaDMAReadRespControlRecord.FRDOFFSET = 0; // not used fpgaDMAReadRespControlRecord.FRSOFFSET = 0; // not used - - // TODO - this is a DMA xmit and recv via loopback test -// setupDMAForWriteResp( 8 ); -// setupDMAForWriteCmd( 8 ); -// startDMAReceiptOfWriteResp(); -// startDMAWriteCmd(); } /************************************************************************* @@ -592,6 +566,28 @@ } /************************************************************************* + * @brief execFPGATest + * The execFPGATest function executes the FPGA self-test. \n + * @details + * Inputs : fpgaHeader + * Outputs : none + * @param none + * @return passed, or failed + *************************************************************************/ +SELF_TEST_STATUS_T execFPGATest( void ) +{ + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_FAILED; + + // check FPGA reported correct ID + if ( FPGA_EXPECTED_ID == fpgaHeader.fpgaId ) + { + result = SELF_TEST_STATUS_PASSED; + } + + return result; +} + +/************************************************************************* * @brief setupDMAForWriteCmd * The setupDMAForWriteCmd function sets the byte count for the next DMA \n * write command to the FPGA.