/************************************************************************** * * Copyright (c) 2019-2020 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 * * @author (last) Sean Nash * @date (last) 14-Oct-2020 * * @author (original) Sean * @date (original) 27-Feb-2020 * ***************************************************************************/ #ifndef __HD_COMMON_H__ #define __HD_COMMON_H__ #include "hal_stdtypes.h" // ********** version ********** #define HD_VERSION_MAJOR 0 #define HD_VERSION_MINOR 4 #define HD_VERSION_MICRO 5 #define HD_VERSION_BUILD 0 // ********** development build switches ********** // TODO - remove build switches before release #ifndef _RELEASE_ #ifndef _VECTORCAST_ // #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_ALARM_AUDIO 1 // Disable alarm audio #define SKIP_POST 1 // Skip POST tests - all pass // #define LIMITED_NVDATA_CRC_CHECKS 1 // Only perform POST CRC checks on nv-data records that are implemented so far #define DISABLE_AIR_TRAP_LEVELING 1 // Disable air trap level control // #define DISABLE_3WAY_VALVES 1 // Disable 3-way valves // #define TST_3WAY_VALVES_ALWAYS_OPEN 1 // After POST and homing, open all 4 valves #define DISABLE_ACCELS 1 // Disable accelerometer POST and monitoring #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_SALINE_BOLUS_CHECKS 1 // Do not error on HD saline bolus 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 DISABLE_VALVE_ALARMS 1 // Do not error on HD valve position // #define RUN_PUMPS_OPEN_LOOP 1 // BP and DPi pumps will be run open loop (no flow sensor feedback) // #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 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 V1_5_SYSTEM 1 // Build for v1.5 system #include #include #endif #endif #include "Common.h" /** * @defgroup CommonHDHeader CommonHDHeader * @brief Provides commonly used definitions and macros for HD firmware. * * @addtogroup CommonHDHeader * @{ */ // **** Common Definitions **** #pragma pack(push,1) /// 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; } HD_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_ #endif #endif