13 #include "../includes/main_controller.h"
16 #include "../includes/cpu_load.h"
166 DBG_DO(Serial.println(
"Setup the controller");)
177 DBG_DO(Serial.println(
"Init respiratory cycle");)
258 if ((
m_tick % moduloValue) == 0u) {
288 if ((
m_tick % moduloValue) == 0u) {
297 #ifdef MASS_FLOW_METER_ENABLED
305 ((volume > 0xFFFE) || (volume < 0)) ? 0xFFFFu :
static_cast<uint16_t
>(volume);
374 uint32_t currentMillis = p_currentMillis;
453 int32_t A1MultiplyBy100 = 7853;
454 int32_t rhoMultiplyBy10 = 12;
456 int32_t divider = (rhoMultiplyBy10
458 - (100 * A2MultiplyBy100 / A1MultiplyBy100)
459 * (100 * A2MultiplyBy100 / A1MultiplyBy100)));
460 int32_t tempRatioX100 = (divider <= 0) ? 0 : (100 * (2 *
pressure * 980000 / divider));
462 (tempRatioX100 < 0) ? 0 : (A2MultiplyBy100 * sqrt(tempRatioX100) * 60) / 1000;
530 int16_t minPlateauBeforeAlarm =
532 int16_t maxPlateauBeforeAlarm =
567 int32_t inspiratoryMinuteVolume =
572 inspiratoryMinuteVolume);
577 inspiratoryMinuteVolume);
585 int32_t expiratoryMinuteVolume =
590 expiratoryMinuteVolume);
595 expiratoryMinuteVolume);
755 DBG_DO(Serial.println(
"Cycle --");)
767 DBG_DO(Serial.println(
"Cycle ++");)
794 DBG_DO(Serial.println(
"Peep Pressure --");)
807 DBG_DO(Serial.println(
"Peep Pressure ++");)
838 DBG_DO(Serial.println(
"Plateau Pressure --");)
856 DBG_DO(Serial.println(
"Plateau Pressure ++");)
886 DBG_DO(Serial.println(
"Peak Pressure --");)
911 DBG_DO(Serial.println(
"Peak Pressure ++");)
951 if ((p_triggerEnabled == 0u) || (p_triggerEnabled == 1u)) {
1023 uint16_t p_lowInspiratoryMinuteVolumeAlarmThreshold) {
1025 if ((p_lowInspiratoryMinuteVolumeAlarmThreshold
1028 && (p_lowInspiratoryMinuteVolumeAlarmThreshold
1032 1000 * (int32_t)p_lowInspiratoryMinuteVolumeAlarmThreshold;
1041 uint16_t p_highInspiratoryMinuteVolumeAlarmThreshold) {
1042 if ((p_highInspiratoryMinuteVolumeAlarmThreshold
1044 && (p_highInspiratoryMinuteVolumeAlarmThreshold
1047 1000 * (int32_t)p_highInspiratoryMinuteVolumeAlarmThreshold;
1056 uint16_t p_lowExpiratoryMinuteVolumeAlarmThreshold) {
1058 if ((p_lowExpiratoryMinuteVolumeAlarmThreshold
1061 && (p_lowExpiratoryMinuteVolumeAlarmThreshold
1065 1000 * (int32_t)p_lowExpiratoryMinuteVolumeAlarmThreshold;
1074 uint16_t p_highExpiratoryMinuteVolumeAlarmThreshold) {
1075 if ((p_highExpiratoryMinuteVolumeAlarmThreshold
1077 && (p_highExpiratoryMinuteVolumeAlarmThreshold
1080 1000 * (int32_t)p_highExpiratoryMinuteVolumeAlarmThreshold;
1089 uint16_t p_lowRespiratoryRateAlarmThreshold) {
1101 uint16_t p_highRespiratoryRateAlarmThreshold) {
1103 && (p_highRespiratoryRateAlarmThreshold
1172 int32_t temporaryValue =
static_cast<int32_t
>(p_targetInspiratoryFlow) * 1000;
1236 int32_t theoricalWeight = 0;
1237 int32_t tidalVolume = 0;
1246 tidalVolume = theoricalWeight * 7;
1248 tidalVolume = tidalVolume - (tidalVolume % 10);
AlarmController alarmController
Instance of the alarm controller.
uint32_t getBatteryLevelX100()
Returns battery level x100 for better accuracy.
uint32_t getBatteryLevel()
Returns battery level.
bool isSnoozed() const
Check if alarms are currently snoozed.
void updateCoreData(uint32_t p_tick, uint16_t p_pressure, CyclePhases p_phase, uint32_t p_cycle_number)
Update internal state of alarm controller with data from pressure controller.
void detectedAlarm(uint8_t p_alarmCode, uint32_t p_cycleNumber, uint32_t p_expected, uint32_t p_measured)
Mark a specific alarm as detected.
uint8_t * triggeredAlarms()
Get the alarms triggered during this cycle.
void updateEnabledAlarms(Alarms enabledAlarms)
Update the list of enabled alarms (alarms not provided here will have no effects)
void notDetectedAlarm(uint8_t p_alarmCode)
Reset detection of a specific alarm.
uint16_t getSpeed() const
Get speed value.
void stop()
Stops the blower.
Controls breathing cycle.
void onTargetInspiratoryFlow(uint16_t p_targetInspiratoryFlow)
Set the inspiratory flow target.
void sendStopMessageToUi()
Send a "stopped" telemetry message.
int16_t m_pressure
Measured pressure.
void onTriggerOffsetSet(uint16_t p_triggerOffset)
Set the desired offset for expiratory trigger.
void onInspiratoryDuration(uint16_t p_inspiratoryDuration)
Set the inspiration duration.
void executeCommands()
Send the computed commands to actuators.
void updatePhase()
Update the cycle phase.
uint16_t m_PlateauMeasureCount
Count for calulating plateau value.
void onPeakPressureIncrease()
Increase the desired peak pressure.
int16_t m_tiMaxNextCommand
Max duration of inspiration in ms for next cycle.
uint32_t m_cycleNb
Number of elapsed cycles since beginning.
void updateFakeExpiratoryFlow()
Calculate expiratory flow from pressure and valve angle.
uint16_t m_expiratoryTermCommand
Actual expiratory term.
int16_t m_plateauPressureCommand
Actual desired plateau pressure.
int32_t m_highExpiratoryMinuteVolumeAlarmThresholdCommand
Threshold for high inspiratory minute volume alarm.
int16_t m_expiratoryTriggerFlowNextCommand
Desired expiratory trigger flow for next cycle (in percent of max flow)
int16_t m_peakPressureNextCommand
Peak pressure desired by the operator for the next cycle.
void onCycleSet(uint16_t p_cpm)
Set the desired number of cycles per minute.
int16_t m_inspiratoryDurationNextCommand
Duration of inspiration.
VentilationController * m_ventilationControllerNextCommand
Ventilation controller for the next cycle.
uint32_t m_tick
Actual tick number (given by the main state machine)
int16_t m_tiMinCommand
Minimum duration of inspiration in ms.
void checkCycleAlarm()
At the end of a respiratory cycle, check if some alarms are triggered.
void onLowTidalVolumeAlarmThresholdSet(uint16_t p_lowTidalVolumeAlarmThreshold)
Set threshold on tidal volume below which an alarm is raised.
void onlowRespiratoryRateAlarmThresholdSet(uint16_t p_lowRespiratoryRateAlarmThreshold)
Set alarm threshold for low respiratory rate.
int32_t m_highInspiratoryMinuteVolumeAlarmThresholdNextCommand
Threshold for high inspiratory minute volume alarm for next cycle.
void onPeakPressureDecrease()
Decrease the desired peak pressure.
void onLeakAlarmThresholdSet(uint16_t p_leakAlarmThreshold)
Set the threshold for leak that raise the alarm.
void onCycleIncrease()
Increase the desired number of cycles per minute.
uint16_t m_cyclesPerMinuteNextCommand
Number of cycles per minute desired by the operator for the next cycle.
void onExpiratoryTermSet(uint16_t p_expiratoryTerm)
Set the desired expiratory term.
uint16_t m_cyclesPerMinuteCommand
Actual desired number of cycles per minute.
int16_t m_lastPressureValues[MAX_PRESSURE_SAMPLES]
Last pressure values.
int16_t m_plateauDurationCommand
Plateau duration command (used in VC modes)
int32_t m_highRespiratoryRateAlarmThresholdNextCommand
Threshold for low respiratory rate for next cycle.
void onhighRespiratoryRateAlarmThresholdSet(uint16_t p_highRespiratoryRateAlarmThreshold)
Set alarm threshold for high respiratory rate.
int16_t m_tidalVolumeMeasure
Measured value of the Tidal volume (volume of air pushed in patient lungs in last inspiration)
void onPatientComputePreset()
Updates patient computed params.
int16_t m_rebouncePeakPressureMeasure
Measured value of rebounce peak pressure.
int32_t m_leakAlarmThresholdCommand
Threshold for leak alarm.
int32_t m_lowExpiratoryMinuteVolumeAlarmThresholdNextCommand
Threshold for low inspiratory minute volume alarm for next cycle.
int32_t m_lowInspiratoryMinuteVolumeAlarmThresholdCommand
Threshold for low inspiratory minute volume alarm.
void endRespiratoryCycle(uint32_t p_currentMillis)
End a respiratory cycle.
void onTiMinSet(uint16_t p_tiMin)
Set min inspiratory time.
int32_t m_highTidalVolumeAlarmThresholdCommand
Threshold for high tidal Volume Alarm.
int32_t m_lowExpiratoryMinuteVolumeAlarmThresholdCommand
Threshold for low inspiratory minute volume alarm.
int32_t m_maxExpiratoryFlow
Measured max inspiratory flow.
int16_t m_plateauPressureMeasure
Measured value of the plateau pressure.
int32_t m_highTidalVolumeAlarmThresholdNextCommand
Threshold for high tidal Volume Alarm next cycle.
int16_t pressure() const
Get the current measured pressure.
void onInspiratoryTriggerFlowSet(uint16_t p_inspiratoryTriggerFlow)
Set inspiratory trigger flow.
void onPlateauPressureIncrease()
Increase the desired plateau pressure.
void updateDt(int32_t p_dt)
Input the real duration since the last pressure controller computation.
void updateExpiratoryFlow(int32_t p_currentExpiratoryFlow)
Input an expiratory flow reading.
VentilationController * m_ventilationController
Ventilation controller in use (for everything related to breathing control)
void updateCurrentExpiratoryVolume(int32_t p_expiratoryVolume)
int32_t m_pressureCommand
Requested pressure at a given point in time.
uint16_t m_numberOfPressures
Number of the current cycle's pressures.
uint32_t m_plateauDurationMs
Duration of the plateau.
bool m_isPeepDetected
Is PEEP pressure detected in the cycle?
uint16_t m_ticksPerCycle
Number of hundredth of second per cycle.
void onCycleDecrease()
Decrease the desired number of cycles per minute.
int16_t m_tidalVolumeCommand
Tidal volume command (used in VC modes)
void onTiMaxSet(uint16_t p_tiMax)
Set max inspiratory time.
int16_t m_tiMinNextCommand
Minimum duration of inspiration in ms for next cycle.
int16_t m_peakPressureAlarmThresholdNextCommand
Threshold for peak pressure alarmfor next cycle.
void onPeepPressureIncrease()
Increase the minimal PEEP desired.
void updateCurrentDeliveredVolume(int32_t p_currentDeliveredVolume)
Input the current delivered volume in inspiratory branch since beginning of the respiratory cycle.
void onPeepSet(int16_t p_peep)
Set the desired PEEP.
void onPeepPressureDecrease()
Decrease the minimal PEEP desired.
uint32_t m_inspiratoryValveAngle
Blower valve angle at peak.
int16_t m_pressureTriggerOffsetNextCommand
Desired pressure trigger offset for the next cycle.
uint32_t m_lastBreathPeriodsMsIndex
Index for the m_lastBreathPeriodsMs array.
void onPeakPressureAlarmThreshold(int16_t p_peakPressureAlarmThreshold)
Set the desired threshold for max peak pressure.
int32_t m_highExpiratoryMinuteVolumeAlarmThresholdNextCommand
Threshold for high inspiratory minute volume alarm for next cycle.
int16_t m_tiMaxCommand
Max duration of inspiration in ms.
uint32_t m_sumOfPressures
Sum of the current cycle's pressures.
void onLowExpiratoryMinuteVolumeAlarmThresholdSet(uint16_t p_lowExpiratoryMinuteVolumeAlarmThreshold)
Set alarm threshold for low expiratory minute volume.
int32_t m_lowRespiratoryRateAlarmThresholdCommand
Threshold for low respiratory rate.
int16_t m_inspiratoryTriggerFlowNextCommand
Desired inspiratory trigger flow for next cycle.
int32_t m_lowTidalVolumeAlarmThresholdCommand
Threshold for low tidal Volume Alarm.
void sendMachineState()
Send a "machine state snapshot" telemetry message.
int32_t m_highInspiratoryMinuteVolumeAlarmThresholdCommand
Threshold for high inspiratory minute volume alarm.
void updatePressure(int16_t p_currentPressure)
Input a pressure reading.
int16_t m_inhalationLastPressure
Last pressure of inhalation.
void computeTickParameters()
Compute various cycle durations given the desired number of cycles per minute.
void exhale()
Perform the pressure control and compute the actuators commands during the exhalation phase.
bool m_tidalVolumeAlreadyRead
True if Tidal volume has already been read during cycle.
uint32_t m_ticksPerInhalation
Number of hundredth of second per inhalation.
int32_t m_expiratoryVolume
Volume expired by the patient during the exhalation phase.
int16_t m_peepMeasure
Measured value of the PEEP.
void printDebugValues()
Print debug values, used to tweak PID, and triggers.
int32_t m_dt
Time since the last computation (in microsecond)
uint32_t m_cyclesPerMinuteMeasure
Measured number of cycles per minute.
bool m_triggered
Is inspiratory triggered or not?
void setup()
Initialize actuators.
void onPlateauPressureSet(int16_t p_plateauPressure)
Set the desired plateau pressure.
int32_t m_currentDeliveredVolume
Current delivered volume by the blower.
CyclePhases m_phase
Current respiratory cycle phase.
int32_t m_leakAlarmThresholdNextCommand
Threshold for leak alarm for next cycle.
int16_t m_inspiratoryTriggerFlowCommand
Desired inspiratory trigger flow.
int16_t m_peakPressureMeasure
Measured value of peak pressure.
void initRespiratoryCycle()
Begin a respiratory cycle.
int32_t m_lowTidalVolumeAlarmThresholdNextCommand
Threshold for low tidal Volume Alarm next cycle.
int16_t m_pressureTriggerOffsetCommand
Actual pressure trigger offset.
int32_t m_targetInspiratoryFlowNextCommand
inspiratory flow required (used in VC modes) for next cycle
void onPatientHeight(int16_t p_patientHeight)
Set the desired patient height.
void onPatientGender(int16_t p_patientGender)
Set the desired patient gender.
int16_t m_plateauPressureNextCommand
Plateau pressure desired by the operator for the next cycle.
void onLowInspiratoryMinuteVolumeAlarmThresholdSet(uint16_t p_lowInspiratoryMinuteVolumeAlarmThreshold)
Set alarm threshold for low inspiratory minute volume.
int64_t m_PlateauMeasureSum
Sum for calulating plateau value.
void stop(uint32_t p_currentMillis)
Stop the breathing.
int32_t m_targetInspiratoryFlowCommand
inspiratory flow required (used in VC modes)
int16_t m_plateauPressureToDisplay
Measured value of the plateau pressure for display.
void onPlateauPressureDecrease()
Decrease the desired plateau pressure.
VentilationController * m_ventilationControllersTable[NUMBER_OF_VENTILATION_MODES+1u]
Array containing pointers to different ventilation controllers.
int16_t m_peakPressureCommand
Actual desired peak pressure.
void onHighInspiratoryMinuteVolumeAlarmThresholdSet(uint16_t p_highInspiratoryMinuteVolumeAlarmThreshold)
Set alarm threshold for high inspiratory minute volume.
void onVentilationModeSet(uint16_t p_ventilationControllerMode)
Set ventilation mode.
void reachSafetyPosition()
Put actuators in safety position.
void onTargetTidalVolumeSet(uint16_t p_targetTidalVolume)
Set target tidal volume (used in VC modes)
void onHighExpiratoryMinuteVolumeAlarmThresholdSet(uint16_t p_highExpiratoryMinuteVolumeAlarmThreshold)
Set alarm threshold for high expiratory minute volume.
void compute()
Perform the pressure control.
int16_t m_expiratoryTriggerFlowCommand
Desired expiratory trigger flow (in percent of max flow)
void inhale()
Perform the pressure control and compute the actuators commands during the inhalation phase.
int32_t m_highRespiratoryRateAlarmThresholdCommand
Threshold for low respiratory rate.
int16_t m_peepCommand
Actual desired PEEP.
int16_t m_inspiratoryDurationCommand
Duration of inspiration.
uint32_t m_lastBreathPeriodsMs[NUMBER_OF_BREATH_PERIOD]
Period durations of last beathings.
int16_t m_plateauDurationNextCommand
Plateau duration command for next cycle.
uint32_t m_lastEndOfRespirationDateMs
Date of the last ending of a respiration.
int32_t m_lowInspiratoryMinuteVolumeAlarmThresholdNextCommand
Threshold for low inspiratory minute volume alarm for next cycle.
void onPlateauDurationSet(uint16_t p_plateauDuration)
Set the duration of Pause at the end of expiration in VC modes.
uint16_t m_lastPressureValuesIndex
Last pressure index.
int16_t m_tidalVolumeNextCommand
Tidal volume command for next cycle.
int32_t m_expiratoryFlow
Measured inspiratory flow.
int16_t m_peepNextCommand
Desired PEEP for the next cycle.
void updateTick(uint32_t p_tick)
Input a tick number.
int32_t m_maxInspiratoryFlow
Measured max inspiratory flow.
void updateInspiratoryFlow(int32_t p_currentInspiratoryFlow)
Input an inspiratory flow reading.
int32_t m_inspiratoryFlow
Measured inspiratory flow.
bool m_triggerModeEnabledNextCommand
Desired state of enabling of trigger mode for the next cycle.
VentilationModes m_ventilationControllerMode
uint16_t m_expiratoryTermNextCommand
Desired expiratory term for the next cycle.
void onExpiratoryTriggerFlowSet(uint16_t p_expiratoryTriggerFlow)
Set expiratory trigger flow.
bool m_triggerModeEnabledCommand
Actual state of enabling of trigger mode.
void onTriggerModeEnabledSet(uint16_t p_triggerEnabled)
Enable or disable expiratory trigger mode.
void onHighTidalVolumeAlarmThresholdSet(uint16_t p_highTidalVolumeAlarmThreshold)
Set threshold on tidal volume for which an alarm is raised.
MainController()
Default constructor.
int32_t m_lowRespiratoryRateAlarmThresholdNextCommand
Threshold for low respiratory rate for next cycle.
int16_t m_peakPressureAlarmThresholdCommand
Threshold for peak pressure alarm.
int32_t m_lastMaxExpiratoryFlow
Measured max inspiratory flow.
uint16_t command
Value of the requested aperture.
int32_t getSectionBigHoseX100()
void execute()
Command the valve to go to the requested aperture.
void open()
Request opening of the Pressure Valve.
void close()
Request closing of the Pressure Valve.
uint16_t position
Current aperture.
virtual struct Alarms enabledAlarms() const =0
List of alarms that must be enabled for this mode.
virtual void endCycle()=0
End the current breathing cycle.
virtual void exhale()=0
Control the exhalation.
virtual void initCycle()=0
Begin a new breathing cycle.
virtual void inhale()=0
Control the inhalation.
virtual void setup()=0
Initialize controller.
uint8_t readCpuLoadPercent(void)
Get the value of the CPU load.
VentilationModes
Supported ventilation modes.
#define NUMBER_OF_VENTILATION_MODES
@ EXHALATION
Exhalation and pause.
@ INHALATION
Inspiration and inspiration holding.
#define DBG_DO(statement)
Expand arbitrary code only when in debug mode.
static const int32_t INVALID_ERROR_MARKER
MainController mainController
#define MAX_PRESSURE_SAMPLES
Number of values to aggregate when computing plateau pressure.
#define CONST_MAX_TRIGGER_OFFSET
#define CONST_MIN_PEAK_PRESSURE_ALARM_THRESHOLD
#define CONST_MAX_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MIN_TIDAL_VOLUME
#define DEFAULT_INSPIRATORY_TRIGGER_FLOW_COMMAND
#define CONST_MAX_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_PLATEAU_DURATION
#define ALARM_THRESHOLD_DIFFERENCE_PERCENT
#define TRIGGER_MODE_ENABLED_BY_DEFAULT
#define DEFAULT_LEAK_ALARM_THRESHOLD
#define VERSION
Current version of the software.
#define CONST_MIN_EXPIRATORY_TRIGGER_FLOW
#define DEFAULT_MIN_INSPIRATION_DURATION_COMMAND
#define CONST_MIN_TRIGGER_OFFSET
#define LED_START_INACTIVE
#define CONST_MIN_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_EXPIRATORY_TRIGGER_FLOW
#define CONST_MIN_PEEP_PRESSURE
#define CONST_MAX_PATIENT_HEIGHT
#define CONST_MAX_EXPIRATORY_TERM
#define ALARM_THRESHOLD_DIFFERENCE_PRESSURE
#define DEFAULT_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD
#define DEFAULT_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MIN_MIN_INSPIRATION_DURATION
#define DEFAULT_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_PEAK_PRESSURE_ALARM_THRESHOLD
#define CONST_MAX_INSPIRATORY_TRIGGER_FLOW
#define CONST_MIN_INSPIRATORY_TRIGGER_FLOW
#define CONST_MIN_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_MAX_INSPIRATION_DURATION
#define CONST_MAX_MIN_INSPIRATION_DURATION
#define ALARM_THRESHOLD_MIN_PRESSURE
#define DEFAULT_LOW_TIDAL_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_PLATEAU_PRESSURE
#define CONST_MIN_EXPIRATORY_TERM
#define CONST_MIN_INSPIRATORY_FLOW
#define MAIN_CONTROLLER_COMPUTE_PERIOD_MS
#define DEFAULT_EXPIRATORY_TRIGGER_FLOW_COMMAND
#define CONST_MIN_PATIENT_GENDER
#define CONST_MAX_PEEP_PRESSURE
#define CONST_MIN_MAX_INSPIRATION_DURATION
#define CONST_MAX_INSPIRATORY_FLOW
#define CONST_MIN_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD
#define MAIN_CONTROLLER_COMPUTE_PERIOD_MICROSECONDS
#define DEFAULT_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define PEAK_PRESSURE_ALARM_THRESHOLD_OFFSET_FROM_PLATEAU
#define AIR_EXHAUST_THRESHOLD_FROM_PEAK_PRESSURE_ALARM
#define DEFAULT_PLATEAU_DURATION_COMMAND
#define CONST_MIN_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD
#define CONST_MIN_PLATEAU_PRESSURE
#define DEFAULT_PLATEAU_COMMAND
#define DEFAULT_CYCLE_PER_MINUTE_COMMAND
#define CONST_MIN_PATIENT_HEIGHT
#define DEFAULT_MAX_INSPIRATION_DURATION_COMMAND
#define MIN_EXPIRATORY_FLOW_OFFSET
#define VALVE_CLOSED_STATE
Angle when closed.
#define DEFAULT_TIDAL_VOLUME_COMMAND
#define CONST_MAX_LOW_TIDAL_VOLUME_ALARM_THRESHOLD
#define DEFAULT_EXPIRATORY_TERM_COMMAND
#define CONST_MAX_INSPIRATORY_DURATION
#define CONST_MIN_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define DEFAULT_PEEP_COMMAND
#define DEFAULT_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD
#define MASS_FLOW_ERROR_VALUE
#define NUMBER_OF_BREATH_PERIOD
Number of periods used for calculating the respiratory rate.
#define DEFAULT_INSPIRATORY_DURATION
#define DEFAULT_TARGET_FLOW_COMMAND
#define CONST_MIN_LEAK_ALARM_THRESHOLD
#define DEFAULT_PATIENT_GENDER
#define CONST_INITIAL_ZERO_VOLUME
#define DEFAULT_PEAK_PRESSURE_COMMAND
#define DEFAULT_PEAK_PRESSURE_ALARM_THRESHOLD
#define DEFAULT_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MIN_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MIN_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD
#define CONST_MAX_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MAX_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD
#define CONST_MIN_INSPIRATORY_DURATION
#define CONST_MAX_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD
#define CONST_INITIAL_ZERO_PRESSURE
#define DEFAULT_TRIGGER_OFFSET
#define CONST_MAX_TIDAL_VOLUME
#define CONST_MAX_PATIENT_GENDER
#define DEFAULT_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD
#define CONST_MAX_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD
#define CONST_MIN_PLATEAU_DURATION
#define CONST_MIN_LOW_TIDAL_VOLUME_ALARM_THRESHOLD
#define DEFAULT_PATIENT_HEIGHT
PC_AC_Controller pcAcController
PC_CMV_Controller pcCmvController
PC_VSAI_Controller pcVsaiController
PressureValve inspiratoryValve
PressureValve expiratoryValve
void sendControlAck(uint8_t setting, uint16_t valueValue)
Send a "control ack" message.
uint8_t mmH2OtoCmH2O(uint16_t pressure)
Convert and round a pressure in mmH2O to a pressure in cmH2O.
void sendStoppedMessage(uint8_t peakCommand, uint8_t plateauCommand, uint8_t peepCommand, uint8_t cpmCommand, uint8_t expiratoryTerm, bool triggerEnabled, uint8_t triggerOffset, bool alarmSnoozed, uint8_t cpuLoad, VentilationModes ventilationMode, uint8_t inspiratoryTriggerFlow, uint8_t expiratoryTriggerFlow, uint16_t tiMinValue, uint16_t tiMaxValue, uint8_t lowInspiratoryMinuteVolumeAlarmThreshold, uint8_t highInspiratoryMinuteVolumeAlarmThreshold, uint8_t lowExpiratoryMinuteVolumeAlarmThreshold, uint8_t highExpiratoryMinuteVolumeAlarmThreshold, uint8_t lowRespiratoryRateAlarmThreshold, uint8_t highRespiratoryRateAlarmThreshold, uint16_t targetTidalVolumeValue, uint16_t lowTidalVolumeAlarmThresholdValue, uint16_t highTidalVolumeAlarmThresholdValue, uint16_t plateauDurationValue, uint16_t leakAlarmThresholdValue, uint8_t targetInspiratoryFlow, uint16_t inspiratoryDurationCommandValue, uint16_t batteryLevelValue, uint8_t currentAlarmCodes[ALARMS_SIZE], uint16_t localeValue, uint8_t patientHeight, uint8_t patientGender, uint16_t peakPressureAlarmThresholdValue)
Send a "stopped" message.
void sendDataSnapshot(uint16_t centileValue, int16_t pressureValue, CyclePhases phase, uint8_t blowerValvePosition, uint8_t patientValvePosition, uint8_t blowerRpm, uint8_t batteryLevel, int16_t inspiratoryFlowValue, int16_t expiratoryFlowValue)
Send a "data snapshot" message.
void sendMachineStateSnapshot(uint32_t cycleValue, uint8_t peakCommand, uint8_t plateauCommand, uint8_t peepCommand, uint8_t cpmCommand, uint16_t previousPeakPressureValue, uint16_t previousPlateauPressureValue, uint16_t previousPeepPressureValue, uint8_t currentAlarmCodes[ALARMS_SIZE], uint16_t volumeValue, uint8_t expiratoryTerm, bool triggerEnabled, uint8_t triggerOffset, uint8_t previouscpmValue, bool alarmSnoozed, uint8_t cpuLoad, VentilationModes ventilationMode, uint8_t inspiratoryTriggerFlow, uint8_t expiratoryTriggerFlow, uint16_t tiMinValue, uint16_t tiMaxValue, uint8_t lowInspiratoryMinuteVolumeAlarmThreshold, uint8_t highInspiratoryMinuteVolumeAlarmThreshold, uint8_t lowExpiratoryMinuteVolumeAlarmThreshold, uint8_t highExpiratoryMinuteVolumeAlarmThreshold, uint8_t lowRespiratoryRateAlarmThreshold, uint8_t highRespiratoryRateAlarmThreshold, uint16_t targetTidalVolumeValue, uint16_t lowTidalVolumeAlarmThresholdValue, uint16_t highTidalVolumeAlarmThresholdValue, uint16_t plateauDurationValue, uint16_t leakAlarmThresholdValue, uint8_t targetInspiratoryFlow, uint16_t inspiratoryDurationCommandValue, uint16_t previousInspiratoryDurationValue, uint16_t batteryLevelValue, uint16_t localeValue, uint8_t patientHeight, uint8_t patientGender, uint16_t peakPressureAlarmThresholdValue)
Send a "machine state snapshot" message.
VC_AC_Controller vcAcController
VC_CMV_Controller vcCmvController