software:firmware
MakAir Firmware
parameters.h File Reference

Various settings. More...

#include "Arduino.h"
#include "../includes/config.h"

Go to the source code of this file.

Macros

#define VERSION   "dev"
 Current version of the software. More...
 
#define ADC_RESOLUTION_MAKAIR   12
 
Core parameters
#define MAIN_CONTROLLER_COMPUTE_PERIOD_MS   10u
 
#define MAIN_CONTROLLER_COMPUTE_PERIOD_MICROSECONDS   (1000u * MAIN_CONTROLLER_COMPUTE_PERIOD_MS)
 
#define CONST_MAX_PEAK_PRESSURE   700
 
#define CONST_MIN_PEAK_PRESSURE   100
 
#define CONST_MAX_PLATEAU_PRESSURE   400
 
#define CONST_MIN_PLATEAU_PRESSURE   50
 
#define CONST_MAX_PEEP_PRESSURE   300
 
#define CONST_MIN_PEEP_PRESSURE   0
 
#define CONST_MIN_TRIGGER_OFFSET   0u
 
#define CONST_MAX_TRIGGER_OFFSET   100u
 
#define CONST_INITIAL_ZERO_PRESSURE   0u
 
#define CONST_INITIAL_ZERO_VOLUME   0u
 
#define CONST_MIN_TIDAL_VOLUME   50u
 
#define CONST_MAX_TIDAL_VOLUME   2000u
 
#define CONST_MAX_INSPIRATORY_TRIGGER_FLOW   100u
 
#define CONST_MIN_INSPIRATORY_TRIGGER_FLOW   0u
 
#define CONST_MAX_EXPIRATORY_TRIGGER_FLOW   100u
 
#define CONST_MIN_EXPIRATORY_TRIGGER_FLOW   0u
 
#define CONST_MIN_MIN_INSPIRATION_DURATION   100u
 
#define CONST_MAX_MIN_INSPIRATION_DURATION   3000u
 
#define CONST_MIN_MAX_INSPIRATION_DURATION   200u
 
#define CONST_MAX_MAX_INSPIRATION_DURATION   5000u
 
#define CONST_MIN_PLATEAU_DURATION   0u
 
#define CONST_MAX_PLATEAU_DURATION   2000u
 
#define CONST_MIN_INSPIRATORY_FLOW   5000
 
#define CONST_MAX_INSPIRATORY_FLOW   80000
 
#define CONST_MIN_INSPIRATORY_DURATION   200u
 
#define CONST_MAX_INSPIRATORY_DURATION   3000u
 
#define CONST_MIN_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   0u
 
#define CONST_MAX_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20u
 
#define CONST_MIN_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   0u
 
#define CONST_MAX_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20u
 
#define CONST_MIN_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   1u
 
#define CONST_MAX_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   40u
 
#define CONST_MIN_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   1u
 
#define CONST_MAX_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   40u
 
#define CONST_MIN_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD   5u
 
#define CONST_MAX_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD   25u
 
#define CONST_MIN_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD   15u
 
#define CONST_MAX_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD   35u
 
#define CONST_MIN_LOW_TIDAL_VOLUME_ALARM_THRESHOLD   0u
 
#define CONST_MAX_LOW_TIDAL_VOLUME_ALARM_THRESHOLD   1000u
 
#define CONST_MIN_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD   50u
 
#define CONST_MAX_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD   2000u
 
#define CONST_MIN_LEAK_ALARM_THRESHOLD   0u
 
#define CONST_MIN_LEAK_ALARM_THRESHOLD   10000u
 
#define CONST_MIN_PEAK_PRESSURE_ALARM_THRESHOLD   50
 
#define CONST_MAX_PEAK_PRESSURE_ALARM_THRESHOLD   700
 
#define CONST_MIN_PATIENT_HEIGHT   30
 
#define CONST_MAX_PATIENT_HEIGHT   250
 
#define CONST_MIN_PATIENT_GENDER   0
 
#define CONST_MAX_PATIENT_GENDER   1
 
#define CONST_MIN_EXPIRATORY_TERM   10u
 
#define CONST_MAX_EXPIRATORY_TERM   60u
 
#define DEFAULT_PEEP_COMMAND   50u
 
#define DEFAULT_PLATEAU_COMMAND   200u
 
#define DEFAULT_PEAK_PRESSURE_COMMAND   200u
 
#define DEFAULT_EXPIRATORY_TERM_COMMAND   20u
 
#define DEFAULT_TIDAL_VOLUME_COMMAND   400u
 
#define DEFAULT_PLATEAU_DURATION_COMMAND   200u
 
#define DEFAULT_TRIGGER_OFFSET   20u
 
#define DEFAULT_INSPIRATORY_TRIGGER_FLOW_COMMAND   10u
 
#define DEFAULT_EXPIRATORY_TRIGGER_FLOW_COMMAND   30u
 
#define DEFAULT_MIN_INSPIRATION_DURATION_COMMAND   200u
 
#define DEFAULT_MAX_INSPIRATION_DURATION_COMMAND   1000u
 
#define DEFAULT_TARGET_FLOW_COMMAND   40000u
 
#define DEFAULT_INSPIRATORY_DURATION   800u
 
#define DEFAULT_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   3000u
 
#define DEFAULT_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   3000u
 
#define DEFAULT_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20000u
 
#define DEFAULT_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20000u
 
#define DEFAULT_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD   16u
 
#define DEFAULT_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD   24u
 
#define DEFAULT_LOW_TIDAL_VOLUME_ALARM_THRESHOLD   200u
 
#define DEFAULT_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD   1000u
 
#define DEFAULT_LEAK_ALARM_THRESHOLD   2000u
 
#define DEFAULT_PEAK_PRESSURE_ALARM_THRESHOLD   500u
 
#define DEFAULT_PATIENT_HEIGHT   170u
 
#define DEFAULT_PATIENT_GENDER   0u
 
#define PEAK_PRESSURE_ALARM_THRESHOLD_OFFSET_FROM_PLATEAU   150
 
#define AIR_EXHAUST_THRESHOLD_FROM_PEAK_PRESSURE_ALARM   100
 
#define DEFAULT_CYCLE_PER_MINUTE_COMMAND   20u
 
#define CONST_MAX_CYCLE   35u
 
#define CONST_MIN_CYCLE   5u
 
#define DEFAULT_PEAK_PRESSURE_DELTA   10u
 
#define MAX_PRESSURE_OFFSET   40
 
#define MIN_EXPIRATORY_FLOW_OFFSET   2.5
 
#define TRIGGER_MODE_ENABLED_BY_DEFAULT   false
 
Valves
#define VALVE_OPEN_STATE   0u
 Angle when opened. More...
 
#define VALVE_CLOSED_STATE   125u
 Angle when closed. More...
 
#define VALVE_PERIOD   1000
 
#define FAULHABER_OPENED   660
 
#define FAULHABER_CLOSED   900
 
#define VALVE_RESPONSE_TIME_MS   50
 
#define PIN_INSPIRATORY_VALVE   D5
 
#define PIN_EXPIRATORY_VALVE   D4
 
#define TIM_CHANNEL_INSPIRATORY_VALVE   1
 
#define TIM_CHANNEL_EXPIRATORY_VALVE   2
 
#define ESC_PPM_PERIOD    10000
 
Blower
#define MIN_BLOWER_SPEED   300u
 
#define MAX_BLOWER_SPEED   1800u
 
#define DEFAULT_BLOWER_SPEED   900u
 
LCD screen
#define PIN_LCD_RS   PA8
 
#define PIN_LCD_RW   PC12
 
#define PIN_LCD_EN   PA5
 
#define PIN_LCD_D4   PC7
 
#define PIN_LCD_D5   PB10
 
#define PIN_LCD_D6   PA7
 
#define PIN_LCD_D7   PA6
 
#define SCREEN_LINE_NUMBER   4
 Number of lines. More...
 
#define SCREEN_LINE_LENGTH   20
 Number of characters per line. More...
 
#define LCD_UPDATE_PERIOD_US   300000u
 Period between screen updates in microsecond. More...
 
#define LCD_RESET_PERIOD   5
 Period between screen resets in minutes. More...
 
Buttons
#define PIN_BTN_ALARM_OFF   PB2
 
#define PIN_BTN_START   PC13
 
#define PIN_BTN_STOP   PB15
 
#define PIN_OUT_COL1   PC2
 
#define PIN_OUT_COL2   PC3
 
#define PIN_OUT_COL3   PC6
 
#define PIN_IN_ROW1   PC9
 
#define PIN_IN_ROW2   PC10
 
#define PIN_IN_ROW3   PC11
 
#define PIN_IN_MAINS_CONNECTED   PB1
 
#define PIN_IN_CONNECTION_TO_SUPPLY_OK   PB6
 
LED
#define PIN_LED_START   PC8
 
#define PIN_LED_GREEN   PB13
 
#define PIN_LED_YELLOW   PB14
 
#define PIN_LED_RED   PC4
 
#define LED_START_ACTIVE   HIGH
 
#define LED_START_INACTIVE   LOW
 
#define LED_RED_ACTIVE   HIGH
 
#define LED_RED_INACTIVE   LOW
 
#define LED_YELLOW_ACTIVE   HIGH
 
#define LED_YELLOW_INACTIVE   LOW
 
#define LED_GREEN_ACTIVE   HIGH
 
#define LED_GREEN_INACTIVE   LOW
 
Other I/O
#define PIN_PRESSURE_SENSOR   PA1
 
#define PIN_BUZZER   PB7
 
#define PIN_ESC_BLOWER   PA10
 
#define TIM_CHANNEL_ESC_BLOWER   3
 
#define PIN_TEMP_BLOWER   PC1
 
#define PIN_BATTERY   PA4
 
#define PIN_TELEMETRY_SERIAL_RX   PB3
 
#define PIN_TELEMETRY_SERIAL_TX   PA9
 
#define PIN_ENABLE_PWR_RASP   PD2
 
#define PWR_RASP_ACTIVE   LOW
 
#define PWR_RASP_INACTIVE   HIGH
 
Flow meter
#define MASS_FLOW_TIMER   TIM10
 
#define MASS_FLOW_CHANNEL   1
 
#define PIN_I2C_SDA   PB9
 
#define PIN_I2C_SCL   PB8
 
#define MFM_ANALOG_INPUT   A3
 
#define MFM_POWER_CONTROL   PC0
 
#define MFM_POWER_OFF   LOW
 
#define MFM_POWER_ON   HIGH
 
#define MASS_FLOW_ERROR_VALUE   999999
 
Alarm thresholds
#define ALARM_THRESHOLD_MIN_PRESSURE   20
 
#define ALARM_THRESHOLD_DIFFERENCE_PERCENT   20
 
#define ALARM_THRESHOLD_DIFFERENCE_PRESSURE   20
 

PID gains & settings

#define PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN   10u
 
#define NUMBER_OF_SAMPLE_LAST_VALUES   20u
 
#define NUMBER_OF_BREATH_PERIOD   3u
 Number of periods used for calculating the respiratory rate. More...
 
static const int32_t PID_BLOWER_KP = 2000
 
static const int32_t PID_BLOWER_KI = 50
 
static const int32_t PID_BLOWER_KD = 0
 
static const int32_t PID_BLOWER_INTEGRAL_MAX = 1000
 
static const int32_t PID_BLOWER_INTEGRAL_MIN = -1000
 
static const int32_t PID_PATIENT_KP = 15000
 
static const int32_t PID_PATIENT_KI = 200
 
static const int32_t PID_PATIENT_KD = 110
 
static const int32_t PID_PATIENT_INTEGRAL_MAX = 1000
 
static const int32_t PID_PATIENT_INTEGRAL_MIN = -1000
 
static const int32_t PID_PATIENT_SAFETY_PEEP_OFFSET = 0
 Increase target pressure by an offset (in mmH2O) for safety, to avoid going below the target pressure. More...
 

Detailed Description

Various settings.

Author
Makers For Life

Definition in file parameters.h.

Macro Definition Documentation

◆ ADC_RESOLUTION_MAKAIR

#define ADC_RESOLUTION_MAKAIR   12

Definition at line 317 of file parameters.h.

◆ AIR_EXHAUST_THRESHOLD_FROM_PEAK_PRESSURE_ALARM

#define AIR_EXHAUST_THRESHOLD_FROM_PEAK_PRESSURE_ALARM   100

Definition at line 115 of file parameters.h.

◆ ALARM_THRESHOLD_DIFFERENCE_PERCENT

#define ALARM_THRESHOLD_DIFFERENCE_PERCENT   20

Definition at line 312 of file parameters.h.

◆ ALARM_THRESHOLD_DIFFERENCE_PRESSURE

#define ALARM_THRESHOLD_DIFFERENCE_PRESSURE   20

Definition at line 313 of file parameters.h.

◆ ALARM_THRESHOLD_MIN_PRESSURE

#define ALARM_THRESHOLD_MIN_PRESSURE   20

Definition at line 311 of file parameters.h.

◆ CONST_INITIAL_ZERO_PRESSURE

#define CONST_INITIAL_ZERO_PRESSURE   0u

Definition at line 41 of file parameters.h.

◆ CONST_INITIAL_ZERO_VOLUME

#define CONST_INITIAL_ZERO_VOLUME   0u

Definition at line 42 of file parameters.h.

◆ CONST_MAX_CYCLE

#define CONST_MAX_CYCLE   35u

Definition at line 118 of file parameters.h.

◆ CONST_MAX_EXPIRATORY_TERM

#define CONST_MAX_EXPIRATORY_TERM   60u

Definition at line 86 of file parameters.h.

◆ CONST_MAX_EXPIRATORY_TRIGGER_FLOW

#define CONST_MAX_EXPIRATORY_TRIGGER_FLOW   100u

Definition at line 47 of file parameters.h.

◆ CONST_MAX_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MAX_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   40u

Definition at line 66 of file parameters.h.

◆ CONST_MAX_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MAX_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   40u

Definition at line 64 of file parameters.h.

◆ CONST_MAX_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD

#define CONST_MAX_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD   35u

Definition at line 70 of file parameters.h.

◆ CONST_MAX_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD

#define CONST_MAX_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD   2000u

Definition at line 74 of file parameters.h.

◆ CONST_MAX_INSPIRATORY_DURATION

#define CONST_MAX_INSPIRATORY_DURATION   3000u

Definition at line 58 of file parameters.h.

◆ CONST_MAX_INSPIRATORY_FLOW

#define CONST_MAX_INSPIRATORY_FLOW   80000

Definition at line 56 of file parameters.h.

◆ CONST_MAX_INSPIRATORY_TRIGGER_FLOW

#define CONST_MAX_INSPIRATORY_TRIGGER_FLOW   100u

Definition at line 45 of file parameters.h.

◆ CONST_MAX_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MAX_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20u

Definition at line 62 of file parameters.h.

◆ CONST_MAX_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MAX_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20u

Definition at line 60 of file parameters.h.

◆ CONST_MAX_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD

#define CONST_MAX_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD   25u

Definition at line 68 of file parameters.h.

◆ CONST_MAX_LOW_TIDAL_VOLUME_ALARM_THRESHOLD

#define CONST_MAX_LOW_TIDAL_VOLUME_ALARM_THRESHOLD   1000u

Definition at line 72 of file parameters.h.

◆ CONST_MAX_MAX_INSPIRATION_DURATION

#define CONST_MAX_MAX_INSPIRATION_DURATION   5000u

Definition at line 52 of file parameters.h.

◆ CONST_MAX_MIN_INSPIRATION_DURATION

#define CONST_MAX_MIN_INSPIRATION_DURATION   3000u

Definition at line 50 of file parameters.h.

◆ CONST_MAX_PATIENT_GENDER

#define CONST_MAX_PATIENT_GENDER   1

Definition at line 82 of file parameters.h.

◆ CONST_MAX_PATIENT_HEIGHT

#define CONST_MAX_PATIENT_HEIGHT   250

Definition at line 80 of file parameters.h.

◆ CONST_MAX_PEAK_PRESSURE

#define CONST_MAX_PEAK_PRESSURE   700

Definition at line 33 of file parameters.h.

◆ CONST_MAX_PEAK_PRESSURE_ALARM_THRESHOLD

#define CONST_MAX_PEAK_PRESSURE_ALARM_THRESHOLD   700

Definition at line 78 of file parameters.h.

◆ CONST_MAX_PEEP_PRESSURE

#define CONST_MAX_PEEP_PRESSURE   300

Definition at line 37 of file parameters.h.

◆ CONST_MAX_PLATEAU_DURATION

#define CONST_MAX_PLATEAU_DURATION   2000u

Definition at line 54 of file parameters.h.

◆ CONST_MAX_PLATEAU_PRESSURE

#define CONST_MAX_PLATEAU_PRESSURE   400

Definition at line 35 of file parameters.h.

◆ CONST_MAX_TIDAL_VOLUME

#define CONST_MAX_TIDAL_VOLUME   2000u

Definition at line 44 of file parameters.h.

◆ CONST_MAX_TRIGGER_OFFSET

#define CONST_MAX_TRIGGER_OFFSET   100u

Definition at line 40 of file parameters.h.

◆ CONST_MIN_CYCLE

#define CONST_MIN_CYCLE   5u

Definition at line 119 of file parameters.h.

◆ CONST_MIN_EXPIRATORY_TERM

#define CONST_MIN_EXPIRATORY_TERM   10u

Definition at line 85 of file parameters.h.

◆ CONST_MIN_EXPIRATORY_TRIGGER_FLOW

#define CONST_MIN_EXPIRATORY_TRIGGER_FLOW   0u

Definition at line 48 of file parameters.h.

◆ CONST_MIN_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MIN_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   1u

Definition at line 65 of file parameters.h.

◆ CONST_MIN_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MIN_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   1u

Definition at line 63 of file parameters.h.

◆ CONST_MIN_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD

#define CONST_MIN_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD   15u

Definition at line 69 of file parameters.h.

◆ CONST_MIN_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD

#define CONST_MIN_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD   50u

Definition at line 73 of file parameters.h.

◆ CONST_MIN_INSPIRATORY_DURATION

#define CONST_MIN_INSPIRATORY_DURATION   200u

Definition at line 57 of file parameters.h.

◆ CONST_MIN_INSPIRATORY_FLOW

#define CONST_MIN_INSPIRATORY_FLOW   5000

Definition at line 55 of file parameters.h.

◆ CONST_MIN_INSPIRATORY_TRIGGER_FLOW

#define CONST_MIN_INSPIRATORY_TRIGGER_FLOW   0u

Definition at line 46 of file parameters.h.

◆ CONST_MIN_LEAK_ALARM_THRESHOLD [1/2]

#define CONST_MIN_LEAK_ALARM_THRESHOLD   0u

Definition at line 76 of file parameters.h.

◆ CONST_MIN_LEAK_ALARM_THRESHOLD [2/2]

#define CONST_MIN_LEAK_ALARM_THRESHOLD   10000u

Definition at line 76 of file parameters.h.

◆ CONST_MIN_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MIN_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   0u

Definition at line 61 of file parameters.h.

◆ CONST_MIN_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define CONST_MIN_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   0u

Definition at line 59 of file parameters.h.

◆ CONST_MIN_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD

#define CONST_MIN_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD   5u

Definition at line 67 of file parameters.h.

◆ CONST_MIN_LOW_TIDAL_VOLUME_ALARM_THRESHOLD

#define CONST_MIN_LOW_TIDAL_VOLUME_ALARM_THRESHOLD   0u

Definition at line 71 of file parameters.h.

◆ CONST_MIN_MAX_INSPIRATION_DURATION

#define CONST_MIN_MAX_INSPIRATION_DURATION   200u

Definition at line 51 of file parameters.h.

◆ CONST_MIN_MIN_INSPIRATION_DURATION

#define CONST_MIN_MIN_INSPIRATION_DURATION   100u

Definition at line 49 of file parameters.h.

◆ CONST_MIN_PATIENT_GENDER

#define CONST_MIN_PATIENT_GENDER   0

Definition at line 81 of file parameters.h.

◆ CONST_MIN_PATIENT_HEIGHT

#define CONST_MIN_PATIENT_HEIGHT   30

Definition at line 79 of file parameters.h.

◆ CONST_MIN_PEAK_PRESSURE

#define CONST_MIN_PEAK_PRESSURE   100

Definition at line 34 of file parameters.h.

◆ CONST_MIN_PEAK_PRESSURE_ALARM_THRESHOLD

#define CONST_MIN_PEAK_PRESSURE_ALARM_THRESHOLD   50

Definition at line 77 of file parameters.h.

◆ CONST_MIN_PEEP_PRESSURE

#define CONST_MIN_PEEP_PRESSURE   0

Definition at line 38 of file parameters.h.

◆ CONST_MIN_PLATEAU_DURATION

#define CONST_MIN_PLATEAU_DURATION   0u

Definition at line 53 of file parameters.h.

◆ CONST_MIN_PLATEAU_PRESSURE

#define CONST_MIN_PLATEAU_PRESSURE   50

Definition at line 36 of file parameters.h.

◆ CONST_MIN_TIDAL_VOLUME

#define CONST_MIN_TIDAL_VOLUME   50u

Definition at line 43 of file parameters.h.

◆ CONST_MIN_TRIGGER_OFFSET

#define CONST_MIN_TRIGGER_OFFSET   0u

Definition at line 39 of file parameters.h.

◆ DEFAULT_BLOWER_SPEED

#define DEFAULT_BLOWER_SPEED   900u

Definition at line 194 of file parameters.h.

◆ DEFAULT_CYCLE_PER_MINUTE_COMMAND

#define DEFAULT_CYCLE_PER_MINUTE_COMMAND   20u

Definition at line 117 of file parameters.h.

◆ DEFAULT_EXPIRATORY_TERM_COMMAND

#define DEFAULT_EXPIRATORY_TERM_COMMAND   20u

Definition at line 91 of file parameters.h.

◆ DEFAULT_EXPIRATORY_TRIGGER_FLOW_COMMAND

#define DEFAULT_EXPIRATORY_TRIGGER_FLOW_COMMAND   30u

Definition at line 96 of file parameters.h.

◆ DEFAULT_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define DEFAULT_HIGH_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20000u

Definition at line 104 of file parameters.h.

◆ DEFAULT_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define DEFAULT_HIGH_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   20000u

Definition at line 103 of file parameters.h.

◆ DEFAULT_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD

#define DEFAULT_HIGH_RESPIRATORY_RATE_ALARM_THRESHOLD   24u

Definition at line 106 of file parameters.h.

◆ DEFAULT_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD

#define DEFAULT_HIGH_TIDAL_VOLUME_ALARM_THRESHOLD   1000u

Definition at line 108 of file parameters.h.

◆ DEFAULT_INSPIRATORY_DURATION

#define DEFAULT_INSPIRATORY_DURATION   800u

Definition at line 100 of file parameters.h.

◆ DEFAULT_INSPIRATORY_TRIGGER_FLOW_COMMAND

#define DEFAULT_INSPIRATORY_TRIGGER_FLOW_COMMAND   10u

Definition at line 95 of file parameters.h.

◆ DEFAULT_LEAK_ALARM_THRESHOLD

#define DEFAULT_LEAK_ALARM_THRESHOLD   2000u

Definition at line 109 of file parameters.h.

◆ DEFAULT_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define DEFAULT_LOW_EXPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   3000u

Definition at line 102 of file parameters.h.

◆ DEFAULT_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD

#define DEFAULT_LOW_INSPIRATORY_MINUTE_VOLUME_ALARM_THRESHOLD   3000u

Definition at line 101 of file parameters.h.

◆ DEFAULT_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD

#define DEFAULT_LOW_RESPIRATORY_RATE_ALARM_THRESHOLD   16u

Definition at line 105 of file parameters.h.

◆ DEFAULT_LOW_TIDAL_VOLUME_ALARM_THRESHOLD

#define DEFAULT_LOW_TIDAL_VOLUME_ALARM_THRESHOLD   200u

Definition at line 107 of file parameters.h.

◆ DEFAULT_MAX_INSPIRATION_DURATION_COMMAND

#define DEFAULT_MAX_INSPIRATION_DURATION_COMMAND   1000u

Definition at line 98 of file parameters.h.

◆ DEFAULT_MIN_INSPIRATION_DURATION_COMMAND

#define DEFAULT_MIN_INSPIRATION_DURATION_COMMAND   200u

Definition at line 97 of file parameters.h.

◆ DEFAULT_PATIENT_GENDER

#define DEFAULT_PATIENT_GENDER   0u

Definition at line 112 of file parameters.h.

◆ DEFAULT_PATIENT_HEIGHT

#define DEFAULT_PATIENT_HEIGHT   170u

Definition at line 111 of file parameters.h.

◆ DEFAULT_PEAK_PRESSURE_ALARM_THRESHOLD

#define DEFAULT_PEAK_PRESSURE_ALARM_THRESHOLD   500u

Definition at line 110 of file parameters.h.

◆ DEFAULT_PEAK_PRESSURE_COMMAND

#define DEFAULT_PEAK_PRESSURE_COMMAND   200u

Definition at line 90 of file parameters.h.

◆ DEFAULT_PEAK_PRESSURE_DELTA

#define DEFAULT_PEAK_PRESSURE_DELTA   10u

Definition at line 121 of file parameters.h.

◆ DEFAULT_PEEP_COMMAND

#define DEFAULT_PEEP_COMMAND   50u

Definition at line 88 of file parameters.h.

◆ DEFAULT_PLATEAU_COMMAND

#define DEFAULT_PLATEAU_COMMAND   200u

Definition at line 89 of file parameters.h.

◆ DEFAULT_PLATEAU_DURATION_COMMAND

#define DEFAULT_PLATEAU_DURATION_COMMAND   200u

Definition at line 93 of file parameters.h.

◆ DEFAULT_TARGET_FLOW_COMMAND

#define DEFAULT_TARGET_FLOW_COMMAND   40000u

Definition at line 99 of file parameters.h.

◆ DEFAULT_TIDAL_VOLUME_COMMAND

#define DEFAULT_TIDAL_VOLUME_COMMAND   400u

Definition at line 92 of file parameters.h.

◆ DEFAULT_TRIGGER_OFFSET

#define DEFAULT_TRIGGER_OFFSET   20u

Definition at line 94 of file parameters.h.

◆ ESC_PPM_PERIOD

#define ESC_PPM_PERIOD    10000

Definition at line 181 of file parameters.h.

◆ FAULHABER_CLOSED

#define FAULHABER_CLOSED   900

Definition at line 173 of file parameters.h.

◆ FAULHABER_OPENED

#define FAULHABER_OPENED   660

Definition at line 172 of file parameters.h.

◆ LCD_RESET_PERIOD

#define LCD_RESET_PERIOD   5

Period between screen resets in minutes.

Definition at line 222 of file parameters.h.

◆ LCD_UPDATE_PERIOD_US

#define LCD_UPDATE_PERIOD_US   300000u

Period between screen updates in microsecond.

Should be a multiple of MAIN_CONTROLLER_COMPUTE_PERIOD_MICROSECONDS

Definition at line 219 of file parameters.h.

◆ LED_GREEN_ACTIVE

#define LED_GREEN_ACTIVE   HIGH

Definition at line 263 of file parameters.h.

◆ LED_GREEN_INACTIVE

#define LED_GREEN_INACTIVE   LOW

Definition at line 264 of file parameters.h.

◆ LED_RED_ACTIVE

#define LED_RED_ACTIVE   HIGH

Definition at line 259 of file parameters.h.

◆ LED_RED_INACTIVE

#define LED_RED_INACTIVE   LOW

Definition at line 260 of file parameters.h.

◆ LED_START_ACTIVE

#define LED_START_ACTIVE   HIGH

Definition at line 257 of file parameters.h.

◆ LED_START_INACTIVE

#define LED_START_INACTIVE   LOW

Definition at line 258 of file parameters.h.

◆ LED_YELLOW_ACTIVE

#define LED_YELLOW_ACTIVE   HIGH

Definition at line 261 of file parameters.h.

◆ LED_YELLOW_INACTIVE

#define LED_YELLOW_INACTIVE   LOW

Definition at line 262 of file parameters.h.

◆ MAIN_CONTROLLER_COMPUTE_PERIOD_MICROSECONDS

#define MAIN_CONTROLLER_COMPUTE_PERIOD_MICROSECONDS   (1000u * MAIN_CONTROLLER_COMPUTE_PERIOD_MS)

Definition at line 30 of file parameters.h.

◆ MAIN_CONTROLLER_COMPUTE_PERIOD_MS

#define MAIN_CONTROLLER_COMPUTE_PERIOD_MS   10u

Definition at line 28 of file parameters.h.

◆ MASS_FLOW_CHANNEL

#define MASS_FLOW_CHANNEL   1

Definition at line 294 of file parameters.h.

◆ MASS_FLOW_ERROR_VALUE

#define MASS_FLOW_ERROR_VALUE   999999

Definition at line 302 of file parameters.h.

◆ MASS_FLOW_TIMER

#define MASS_FLOW_TIMER   TIM10

Definition at line 293 of file parameters.h.

◆ MAX_BLOWER_SPEED

#define MAX_BLOWER_SPEED   1800u

Definition at line 193 of file parameters.h.

◆ MAX_PRESSURE_OFFSET

#define MAX_PRESSURE_OFFSET   40

Definition at line 123 of file parameters.h.

◆ MFM_ANALOG_INPUT

#define MFM_ANALOG_INPUT   A3

Definition at line 297 of file parameters.h.

◆ MFM_POWER_CONTROL

#define MFM_POWER_CONTROL   PC0

Definition at line 298 of file parameters.h.

◆ MFM_POWER_OFF

#define MFM_POWER_OFF   LOW

Definition at line 299 of file parameters.h.

◆ MFM_POWER_ON

#define MFM_POWER_ON   HIGH

Definition at line 300 of file parameters.h.

◆ MIN_BLOWER_SPEED

#define MIN_BLOWER_SPEED   300u

Definition at line 192 of file parameters.h.

◆ MIN_EXPIRATORY_FLOW_OFFSET

#define MIN_EXPIRATORY_FLOW_OFFSET   2.5

Definition at line 125 of file parameters.h.

◆ NUMBER_OF_BREATH_PERIOD

#define NUMBER_OF_BREATH_PERIOD   3u

Number of periods used for calculating the respiratory rate.

Definition at line 157 of file parameters.h.

◆ NUMBER_OF_SAMPLE_LAST_VALUES

#define NUMBER_OF_SAMPLE_LAST_VALUES   20u

Definition at line 154 of file parameters.h.

◆ PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN

#define PC_NUMBER_OF_SAMPLE_DERIVATIVE_MOVING_MEAN   10u

Definition at line 152 of file parameters.h.

◆ PEAK_PRESSURE_ALARM_THRESHOLD_OFFSET_FROM_PLATEAU

#define PEAK_PRESSURE_ALARM_THRESHOLD_OFFSET_FROM_PLATEAU   150

Definition at line 114 of file parameters.h.

◆ PIN_BATTERY

#define PIN_BATTERY   PA4

Definition at line 278 of file parameters.h.

◆ PIN_BTN_ALARM_OFF

#define PIN_BTN_ALARM_OFF   PB2

Definition at line 231 of file parameters.h.

◆ PIN_BTN_START

#define PIN_BTN_START   PC13

Definition at line 232 of file parameters.h.

◆ PIN_BTN_STOP

#define PIN_BTN_STOP   PB15

Definition at line 233 of file parameters.h.

◆ PIN_BUZZER

#define PIN_BUZZER   PB7

Definition at line 274 of file parameters.h.

◆ PIN_ENABLE_PWR_RASP

#define PIN_ENABLE_PWR_RASP   PD2

Definition at line 281 of file parameters.h.

◆ PIN_ESC_BLOWER

#define PIN_ESC_BLOWER   PA10

Definition at line 275 of file parameters.h.

◆ PIN_EXPIRATORY_VALVE

#define PIN_EXPIRATORY_VALVE   D4

Definition at line 178 of file parameters.h.

◆ PIN_I2C_SCL

#define PIN_I2C_SCL   PB8

Definition at line 296 of file parameters.h.

◆ PIN_I2C_SDA

#define PIN_I2C_SDA   PB9

Definition at line 295 of file parameters.h.

◆ PIN_IN_CONNECTION_TO_SUPPLY_OK

#define PIN_IN_CONNECTION_TO_SUPPLY_OK   PB6

Definition at line 243 of file parameters.h.

◆ PIN_IN_MAINS_CONNECTED

#define PIN_IN_MAINS_CONNECTED   PB1

Definition at line 242 of file parameters.h.

◆ PIN_IN_ROW1

#define PIN_IN_ROW1   PC9

Definition at line 238 of file parameters.h.

◆ PIN_IN_ROW2

#define PIN_IN_ROW2   PC10

Definition at line 239 of file parameters.h.

◆ PIN_IN_ROW3

#define PIN_IN_ROW3   PC11

Definition at line 240 of file parameters.h.

◆ PIN_INSPIRATORY_VALVE

#define PIN_INSPIRATORY_VALVE   D5

Definition at line 177 of file parameters.h.

◆ PIN_LCD_D4

#define PIN_LCD_D4   PC7

Definition at line 206 of file parameters.h.

◆ PIN_LCD_D5

#define PIN_LCD_D5   PB10

Definition at line 207 of file parameters.h.

◆ PIN_LCD_D6

#define PIN_LCD_D6   PA7

Definition at line 208 of file parameters.h.

◆ PIN_LCD_D7

#define PIN_LCD_D7   PA6

Definition at line 209 of file parameters.h.

◆ PIN_LCD_EN

#define PIN_LCD_EN   PA5

Definition at line 205 of file parameters.h.

◆ PIN_LCD_RS

#define PIN_LCD_RS   PA8

Definition at line 203 of file parameters.h.

◆ PIN_LCD_RW

#define PIN_LCD_RW   PC12

Definition at line 204 of file parameters.h.

◆ PIN_LED_GREEN

#define PIN_LED_GREEN   PB13

Definition at line 253 of file parameters.h.

◆ PIN_LED_RED

#define PIN_LED_RED   PC4

Definition at line 255 of file parameters.h.

◆ PIN_LED_START

#define PIN_LED_START   PC8

Definition at line 252 of file parameters.h.

◆ PIN_LED_YELLOW

#define PIN_LED_YELLOW   PB14

Definition at line 254 of file parameters.h.

◆ PIN_OUT_COL1

#define PIN_OUT_COL1   PC2

Definition at line 235 of file parameters.h.

◆ PIN_OUT_COL2

#define PIN_OUT_COL2   PC3

Definition at line 236 of file parameters.h.

◆ PIN_OUT_COL3

#define PIN_OUT_COL3   PC6

Definition at line 237 of file parameters.h.

◆ PIN_PRESSURE_SENSOR

#define PIN_PRESSURE_SENSOR   PA1

Definition at line 273 of file parameters.h.

◆ PIN_TELEMETRY_SERIAL_RX

#define PIN_TELEMETRY_SERIAL_RX   PB3

Definition at line 279 of file parameters.h.

◆ PIN_TELEMETRY_SERIAL_TX

#define PIN_TELEMETRY_SERIAL_TX   PA9

Definition at line 280 of file parameters.h.

◆ PIN_TEMP_BLOWER

#define PIN_TEMP_BLOWER   PC1

Definition at line 277 of file parameters.h.

◆ PWR_RASP_ACTIVE

#define PWR_RASP_ACTIVE   LOW

Definition at line 282 of file parameters.h.

◆ PWR_RASP_INACTIVE

#define PWR_RASP_INACTIVE   HIGH

Definition at line 283 of file parameters.h.

◆ SCREEN_LINE_LENGTH

#define SCREEN_LINE_LENGTH   20

Number of characters per line.

Definition at line 215 of file parameters.h.

◆ SCREEN_LINE_NUMBER

#define SCREEN_LINE_NUMBER   4

Number of lines.

Definition at line 212 of file parameters.h.

◆ TIM_CHANNEL_ESC_BLOWER

#define TIM_CHANNEL_ESC_BLOWER   3

Definition at line 276 of file parameters.h.

◆ TIM_CHANNEL_EXPIRATORY_VALVE

#define TIM_CHANNEL_EXPIRATORY_VALVE   2

Definition at line 180 of file parameters.h.

◆ TIM_CHANNEL_INSPIRATORY_VALVE

#define TIM_CHANNEL_INSPIRATORY_VALVE   1

Definition at line 179 of file parameters.h.

◆ TRIGGER_MODE_ENABLED_BY_DEFAULT

#define TRIGGER_MODE_ENABLED_BY_DEFAULT   false

Definition at line 127 of file parameters.h.

◆ VALVE_CLOSED_STATE

#define VALVE_CLOSED_STATE   125u

Angle when closed.

Definition at line 170 of file parameters.h.

◆ VALVE_OPEN_STATE

#define VALVE_OPEN_STATE   0u

Angle when opened.

Definition at line 167 of file parameters.h.

◆ VALVE_PERIOD

#define VALVE_PERIOD   1000

Definition at line 171 of file parameters.h.

◆ VALVE_RESPONSE_TIME_MS

#define VALVE_RESPONSE_TIME_MS   50

Definition at line 175 of file parameters.h.

◆ VERSION

#define VERSION   "dev"

Current version of the software.

Definition at line 20 of file parameters.h.

Variable Documentation

◆ PID_BLOWER_INTEGRAL_MAX

const int32_t PID_BLOWER_INTEGRAL_MAX = 1000
static

Definition at line 139 of file parameters.h.

◆ PID_BLOWER_INTEGRAL_MIN

const int32_t PID_BLOWER_INTEGRAL_MIN = -1000
static

Definition at line 140 of file parameters.h.

◆ PID_BLOWER_KD

const int32_t PID_BLOWER_KD = 0
static

Definition at line 138 of file parameters.h.

◆ PID_BLOWER_KI

const int32_t PID_BLOWER_KI = 50
static

Definition at line 137 of file parameters.h.

◆ PID_BLOWER_KP

const int32_t PID_BLOWER_KP = 2000
static

Definition at line 136 of file parameters.h.

◆ PID_PATIENT_INTEGRAL_MAX

const int32_t PID_PATIENT_INTEGRAL_MAX = 1000
static

Definition at line 145 of file parameters.h.

◆ PID_PATIENT_INTEGRAL_MIN

const int32_t PID_PATIENT_INTEGRAL_MIN = -1000
static

Definition at line 146 of file parameters.h.

◆ PID_PATIENT_KD

const int32_t PID_PATIENT_KD = 110
static

Definition at line 144 of file parameters.h.

◆ PID_PATIENT_KI

const int32_t PID_PATIENT_KI = 200
static

Definition at line 143 of file parameters.h.

◆ PID_PATIENT_KP

const int32_t PID_PATIENT_KP = 15000
static

Definition at line 142 of file parameters.h.

◆ PID_PATIENT_SAFETY_PEEP_OFFSET

const int32_t PID_PATIENT_SAFETY_PEEP_OFFSET = 0
static

Increase target pressure by an offset (in mmH2O) for safety, to avoid going below the target pressure.

Definition at line 150 of file parameters.h.