Index: firmware/App/HDCommon.h =================================================================== diff -u -r31c4bf94671f58375d2e1dbbbb37b37c6949e0c4 -r07cdd44ffd0905cb115405e22cc7586585034e7f --- firmware/App/HDCommon.h (.../HDCommon.h) (revision 31c4bf94671f58375d2e1dbbbb37b37c6949e0c4) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision 07cdd44ffd0905cb115405e22cc7586585034e7f) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file HDCommon.h +* @file HDCommon.h * -* @author (last) Dara Navaei -* @date (last) 09-Jul-2020 +* @author (last) Dara Navaei +* @date (last) 23-May-2022 * -* @author (original) Sean -* @date (original) 27-Feb-2020 +* @author (original) Sean +* @date (original) 27-Feb-2020 * ***************************************************************************/ @@ -23,35 +23,31 @@ // ********** version ********** #define HD_VERSION_MAJOR 0 -#define HD_VERSION_MINOR 4 -#define HD_VERSION_MICRO 5 -#define HD_VERSION_BUILD 7 +#define HD_VERSION_MINOR 6 +#define HD_VERSION_MICRO 0 +#define HD_VERSION_BUILD 47 -// ********** build switches ********** +// ********** development build switches ********** +// TODO - remove build switches before release #ifndef _RELEASE_ -#define UF_TEST_ENABLED 1 // ultrafiltration test build (hard codes treatment params, re-purposes off/stop buttons) -#define UF_TEST_WITH_DG 1 // ultrafiltration test build (sets up DG in standby mode) #ifndef _VECTORCAST_ -// #define RM46_EVAL_BOARD_TARGET 1 // limited build runs on RM46 eval board -// #define BREADBOARD_TARGET 1 // old breadboard system build - no longer used? -// #define SIMULATE_UI 1 // build w/o requirement that UI be there -// #define TASK_TIMING_OUTPUT_ENABLED 1 // re-purposes alarm lamp pins for task timing - #define SKIP_POST 1 // skip POST tests - all pass - #define DISABLE_CRC_ERROR 1 // do not error on bad CRC for CAN messages - #define DISABLE_ACK_ERRORS 1 // do not error on failure of other node(s) to ACK a message - #define DISABLE_MOTOR_CURRENT_CHECKS 1 // do not error on HD pump current checks - #define DISABLE_PUMP_FLOW_CHECKS 1 // do not error on HD pump flow checks - #define DISABLE_PUMP_SPEED_CHECKS 1 // do not error on HD pump speed checks - #define DISABLE_PUMP_DIRECTION_CHECKS 1 // do not error on HD pump direction checks - #define DISABLE_PRESSURE_CHECKS 1 // do not error on HD pressure checks - #define DISABLE_UF_ALARMS 1 // do not error on HD ultrafiltration checks -// #define RAW_FLOW_SENSOR_DATA 1 // test build will not filter flow sensor data -// #define READ_FPGA_ASYNC_DATA 1 // test build reads non-priority register page every other time -// #define FLOW_DEBUG 1 // test build sends flow, signal strength, and occlusion readings to debug UART +// Build switches. NOTE: These build switches will remain as #define +// #define USING_DEBUGGER 1 // Want to be able to use the debugger and have break points +// #define BOARD_WITH_NO_HARDWARE 1 // Target is a PCB w/ no hardware +// #define RUN_WITHOUT_DG 1 // Run HD w/o DG +// #define SIMULATE_UI 1 // Build w/o requirement that UI be there +// #define TASK_TIMING_OUTPUT_ENABLED 1 // Re-purposes alarm lamp pins for task timing +// #define DISABLE_BATT_COMM 1 // Disable battery communication // TODO soft switch +// #define READ_FPGA_ASYNC_DATA 1 // Test build reads non-priority register page every other time +// #define DISABLE_FPGA_COUNTER_CHECKS 1 // Disable alarms associated with FPGA read/error counters // #define EMC_TEST_BUILD 1 // EMC test build - HD/DG run separately but connected, HD pumps toggle on/off w/ stop button - #define ALARMS_DEBUG 1 // triggered alarms sent to debug UART + #define DISABLE_WD_AND_SFTY_POST_TESTS 1 // Disable watchdog and safety shutdown POST tests +// #define DISABLE_UI_POST_TEST 1 // Disable the UI POST + // TODO stays as a build switch until the calibration structure is updated with the build + #define SKIP_CAL_CHECK 1 // Implement software configuration + #include #include #endif @@ -69,13 +65,72 @@ // **** Common Definitions **** +#pragma pack(push,1) -// **** Common Macros **** +/// Payload record structure for an HD versions message. +typedef struct +{ + U08 major; + U08 minor; + U08 micro; + U16 build; + U08 fpgaId; + U08 fpgaMajor; + U08 fpgaMinor; + U08 fpgaLab; + U32 compatibilityRev; +} HD_VERSIONS_T; +/// DG version struct. +typedef struct +{ + U08 major; ///< DG version major revision + U08 minor; ///< DG version major revision + U08 micro; ///< DG version micro revision + U16 build; ///< DG build version + U08 fpgaId; ///< DG FPGA ID + U08 fpgaMajor; ///< DG FPGA major revision + U08 fpgaMinor; ///< DG FPGA minor revision + U08 fpgaLab; ///< DG FPGA lab revision + U32 compatibilityRev; ///< DG compatibility revision +} DG_VERSIONS_T; -/**@}*/ +/// Record defining the fields in a UI version request message. +typedef struct +{ + U08 major; ///< Major version for UI software + U08 minor; ///< Minor version for UI software + U08 micro; ///< Micro version for UI software + U16 build; ///< Build number for UI software + U32 compatibility; ///< Compatibility revision +} UI_VERSIONS_T; +/// Payload record structure for a peristaltic pump data message. +typedef struct +{ + U32 setPoint; + F32 measFlow; + F32 measRotorSpd; + F32 measPumpSpd; + F32 measMCSpd; + F32 measMCCurr; + F32 pwmDC; +} PERISTALTIC_PUMP_STATUS_PAYLOAD_T; +/// Payload record structure for a pump set point override message. +typedef struct +{ + BOOL reset; + S32 setPt; + U32 ctrlMode; +} OVERRIDE_PUMP_SET_PT_PAYLOAD_T; + +#pragma pack(pop) + +// **** Common Macros **** + +/**@}*/ + // **** VectorCAST Definitions **** #ifdef _VECTORCAST_