Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r2c16de14d2acd2aa1e36943f95c3855da094dc97 -rf41df62e07626151238a2900eaac07ae3a405f5e --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 2c16de14d2acd2aa1e36943f95c3855da094dc97) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision f41df62e07626151238a2900eaac07ae3a405f5e) @@ -73,6 +73,7 @@ #define FPGA_NIBP_CMD_MASK 0x0F ///< Bit mask for NIBP command bits #define FPGA_NIBP_CMD_RDY 0x10 ///< NIBP command ready pulse bit +#define FPGA_BARCODE_COMMAND_BYTE_COUNT 16 ///< Number of barcode command bytes supported by the FPGA. /// Control bits to run syringe pump in reverse direction // TODO - move to syringe pump controller unit when implemented. static const U08 SYRINGE_PUMP_CONTROL_RUN_REVERSE = SYRINGE_PUMP_CONTROL_SLEEP_OFF | @@ -184,6 +185,11 @@ U16 bpSystolic; ///< Reg 388. Systolic BP in mmHg. U16 bpDiastolic; ///< Reg 390. Diastolic BP in mmHg. U16 bpHr; ///< Reg 392. Heart rate in BPM. + U08 reservedBarcode[8]; ///< Reg 394-401. Reserved. + U16 barcodeUartError; ///< Reg 402. Barcode UART error counter. + U16 barcodeFIFORespStatus; ///< Reg 404. Barcode response FIFO status. + U08 barcodeCommandStatus; ///< Reg 406. Barcode command/trigger ready status. + U32 barcodeFIFORespData; ///< Reg 407. Barcode FIFO response data. } FPGA_SENSORS_T; /// Record structure for FPGA continuous priority writes. @@ -227,6 +233,12 @@ U16 h19InputWord3; ///< Reg 64. H19 input word 3. U08 h19FPGACmd; ///< Reg 66. H19 FPGA command register. U08 h19EnableReset; ///< Reg 67. H19 enable and reset register. + U08 reservedBarcode68; ///< Reg 68. Reserved. + U08 barcodeTriggerCtrl; ///< Reg 69. Barcode scan trigger control. + U08 barcodeResponseFIFOCtrl; ///< Reg 70. Barcode response FIFO read control. + U08 reservedBarcode71; ///< Reg 71. Reserved. + U08 barcodeCommandByte[16]; ///< Reg 72-87. Barcode command bytes. + U08 barcodeCommandCtrl; ///< Reg 88. Barcode command valid control. } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -286,6 +298,11 @@ // Reset pinch valve position change command bits setH1Control( ( getH1Control() & ~FPGA_PINCH_VALVES_NEW_POS_CMD ) ); setH19Control( ( getH19Control() & ~FPGA_PINCH_VALVES_NEW_POS_CMD ) ); + + // Reset barcode transitory command bits + setFPGABarcodeTriggerControl( 0 ); + setFPGABarcodeFIFOControl( 0 ); + setFPGABarcodeCommandControl( 0 ); } /*********************************************************************//** @@ -1295,6 +1312,114 @@ /*********************************************************************//** * @brief + * The setFPGABarcodeTriggerControl function sets the barcode reader + * trigger control register. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.barcodeTriggerCtrl + * @param value Barcode trigger control value. + * @return none + *************************************************************************/ +void setFPGABarcodeTriggerControl( U08 value ) +{ + fpgaActuatorSetPoints.barcodeTriggerCtrl = value; +} + +/*********************************************************************//** + * @brief + * The setFPGABarcodeFIFOControl function sets the barcode response FIFO + * control register. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.barcodeResponseFIFOCtrl + * @param value Barcode FIFO control value. + * @return none + *************************************************************************/ +void setFPGABarcodeFIFOControl( U08 value ) +{ + fpgaActuatorSetPoints.barcodeResponseFIFOCtrl = value; +} + +/*********************************************************************//** + * @brief + * The setFPGABarcodeCommandByte function sets one barcode reader command + * byte in the FPGA command buffer. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.barcodeCommandByte[] + * @param index Barcode command byte index from 0 to 15. + * @param value Barcode command byte value. + * @return none + *************************************************************************/ +void setFPGABarcodeCommandByte( U08 index, U08 value ) +{ + if ( index < FPGA_BARCODE_COMMAND_BYTE_COUNT ) + { + fpgaActuatorSetPoints.barcodeCommandByte[index] = value; + } +} + +/*********************************************************************//** + * @brief + * The setFPGABarcodeCommandControl function sets the barcode reader + * command control register. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.barcodeCommandCtrl + * @param value Barcode command control value. + * @return none + *************************************************************************/ +void setFPGABarcodeCommandControl( U08 value ) +{ + fpgaActuatorSetPoints.barcodeCommandCtrl = value; +} + +/*********************************************************************//** + * @brief + * The getFPGABarcodeUartError function returns the barcode UART error count. + * @details \b Inputs: fpgaSensorReadings.barcodeUartError + * @details \b Outputs: none + * @return Barcode UART error count. + *************************************************************************/ +U16 getFPGABarcodeUartError( void ) +{ + return fpgaSensorReadings.barcodeUartError; +} + +/*********************************************************************//** + * @brief + * The getFPGABarcodeFIFOStatus function returns the barcode FIFO status. + * @details \b Inputs: fpgaSensorReadings.barcodeFIFORespStatus + * @details \b Outputs: none + * @return Barcode FIFO response status. + *************************************************************************/ +U16 getFPGABarcodeFIFOStatus( void ) +{ + return fpgaSensorReadings.barcodeFIFORespStatus; +} + +/*********************************************************************//** + * @brief + * The getFPGABarcodeCommandStatus function returns the barcode command status. + * @details \b Inputs: fpgaSensorReadings.barcodeCommandStatus + * @details \b Outputs: none + * @return Barcode command status. + *************************************************************************/ +U08 getFPGABarcodeCommandStatus( void ) +{ + return fpgaSensorReadings.barcodeCommandStatus; +} + +/*********************************************************************//** + * @brief + * The getFPGABarcodeFIFOData function returns the barcode FIFO data. + * @details \b Inputs: fpgaSensorReadings.barcodeFIFORespData + * @details \b Outputs: none + * @return Barcode FIFO response data. + *************************************************************************/ +U32 getFPGABarcodeFIFOData( void ) +{ + return fpgaSensorReadings.barcodeFIFORespData; +} + +/*********************************************************************//** + * @brief * The getFPGAPBAADCTemperature function returns the PBA ADC temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none