![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
pachas
Dependencies: mbed QEI FastPWM
project_defines.h@2:6f618b905d4f, 2020-04-16 (annotated)
- Committer:
- miguelangel_2511
- Date:
- Thu Apr 16 13:22:16 2020 +0000
- Revision:
- 2:6f618b905d4f
- Parent:
- 1:aa5df1878126
- Child:
- 3:45299e7882b9
Los parametros del sistema fueron movidos desde tft_interface.cpp a ventilator.cpp.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miguelangel_2511 | 0:9d0b9785d3d6 | 1 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 2 | #ifndef PROJECT_DEFINES_H_ |
miguelangel_2511 | 0:9d0b9785d3d6 | 3 | #define PROJECT_DEFINES_H_ |
miguelangel_2511 | 0:9d0b9785d3d6 | 4 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 5 | /* File inclusion */ |
miguelangel_2511 | 0:9d0b9785d3d6 | 6 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 7 | /* Pin definition */ |
miguelangel_2511 | 0:9d0b9785d3d6 | 8 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 9 | // Switches and buttons |
miguelangel_2511 | 0:9d0b9785d3d6 | 10 | #define ENTER_SW_PIN PA_15 |
miguelangel_2511 | 0:9d0b9785d3d6 | 11 | #define LIMIT_SW_01_PIN PB_7 |
miguelangel_2511 | 0:9d0b9785d3d6 | 12 | #define GAS_INPUT_SW_PIN PC_13 |
miguelangel_2511 | 0:9d0b9785d3d6 | 13 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 14 | // Rotary encoder |
miguelangel_2511 | 0:9d0b9785d3d6 | 15 | #define ENCODER_A_SIGNAL PA_13 |
miguelangel_2511 | 0:9d0b9785d3d6 | 16 | #define ENCODER_B_SIGNAL PA_14 |
miguelangel_2511 | 0:9d0b9785d3d6 | 17 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 18 | //TFT display |
miguelangel_2511 | 0:9d0b9785d3d6 | 19 | #define TFT_D0 D8 |
miguelangel_2511 | 0:9d0b9785d3d6 | 20 | #define TFT_D1 D9 |
miguelangel_2511 | 0:9d0b9785d3d6 | 21 | #define TFT_D2 D2 |
miguelangel_2511 | 0:9d0b9785d3d6 | 22 | #define TFT_D3 D3 |
miguelangel_2511 | 0:9d0b9785d3d6 | 23 | #define TFT_D4 D4 |
miguelangel_2511 | 0:9d0b9785d3d6 | 24 | #define TFT_D5 D5 |
miguelangel_2511 | 0:9d0b9785d3d6 | 25 | #define TFT_D6 D6 |
miguelangel_2511 | 0:9d0b9785d3d6 | 26 | #define TFT_D7 D7 |
miguelangel_2511 | 0:9d0b9785d3d6 | 27 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 28 | //Stepper motor |
miguelangel_2511 | 0:9d0b9785d3d6 | 29 | #define STEPPER_PULSE_PIN PC_8 |
miguelangel_2511 | 0:9d0b9785d3d6 | 30 | #define STEPPER_ENABLE_PIN PC_6 |
miguelangel_2511 | 0:9d0b9785d3d6 | 31 | #define STEPPER_DIRECTION_PIN PC_5 |
miguelangel_2511 | 1:aa5df1878126 | 32 | #define STEPPER_PULSE_FEEDBACK_PIN PA_12 |
miguelangel_2511 | 0:9d0b9785d3d6 | 33 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 34 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 35 | /* Constants and macros */ |
miguelangel_2511 | 0:9d0b9785d3d6 | 36 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 37 | /* Defines for the switches and buttons */ |
miguelangel_2511 | 0:9d0b9785d3d6 | 38 | #define ENTER_SW 0 |
miguelangel_2511 | 0:9d0b9785d3d6 | 39 | #define LIMIT_SW_01 1 |
miguelangel_2511 | 0:9d0b9785d3d6 | 40 | #define GAS_INPUT_SW 2 |
miguelangel_2511 | 0:9d0b9785d3d6 | 41 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 42 | /* Defines for the encoder user interface */ |
miguelangel_2511 | 0:9d0b9785d3d6 | 43 | #define ENCODER_THRESHOLD 8 |
miguelangel_2511 | 0:9d0b9785d3d6 | 44 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 45 | #define PARAMETER_SELECTION_INDEX_LIMIT 3 |
miguelangel_2511 | 0:9d0b9785d3d6 | 46 | #define VOLUME_SETPOINT_INDEX_LIMIT 11 |
miguelangel_2511 | 0:9d0b9785d3d6 | 47 | #define RESP_FREQUENCY_INDEX_LIMIT 21 |
miguelangel_2511 | 0:9d0b9785d3d6 | 48 | #define I_E_RATIO_INDEX_LIMIT 3 |
miguelangel_2511 | 0:9d0b9785d3d6 | 49 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 50 | #define PARAMETER_SELECTION_INDEX_DEFAULT 0 |
miguelangel_2511 | 0:9d0b9785d3d6 | 51 | #define VOLUME_SETPOINT_INDEX_DEFAULT 5 |
miguelangel_2511 | 0:9d0b9785d3d6 | 52 | #define RESP_FREQUENCY_INDEX_DEFAULT 10 |
miguelangel_2511 | 0:9d0b9785d3d6 | 53 | #define I_E_RATIO_INDEX_DEFAULT 0 |
miguelangel_2511 | 0:9d0b9785d3d6 | 54 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 55 | /* Defines for the TFT user interface */ |
miguelangel_2511 | 0:9d0b9785d3d6 | 56 | #define BACKGROUND_COLOR Black |
miguelangel_2511 | 0:9d0b9785d3d6 | 57 | #define INDICATOR_BOX_LINE_COLOR Green |
miguelangel_2511 | 0:9d0b9785d3d6 | 58 | #define INDICATOR_HEADER_TEXT_COLOR Yellow |
miguelangel_2511 | 0:9d0b9785d3d6 | 59 | #define INDICATOR_VALUE_TEXT_COLOR White |
miguelangel_2511 | 0:9d0b9785d3d6 | 60 | #define INDICATOR_UNITS_TEXT_COLOR White |
miguelangel_2511 | 0:9d0b9785d3d6 | 61 | #define PARAMETER_SELECTION_BOX_COLOR Yellow |
miguelangel_2511 | 0:9d0b9785d3d6 | 62 | #define PARAMETER_ADJUST_TEXT_COLOR Green |
miguelangel_2511 | 0:9d0b9785d3d6 | 63 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 64 | #define HEADERS_ROW1_Y_POS 20 |
miguelangel_2511 | 0:9d0b9785d3d6 | 65 | #define HEADERS_ROW2_Y_POS 180 |
miguelangel_2511 | 0:9d0b9785d3d6 | 66 | #define UNITS_ROW1_Y_POS 103 |
miguelangel_2511 | 0:9d0b9785d3d6 | 67 | #define UNITS_ROW2_Y_POS 263 |
miguelangel_2511 | 0:9d0b9785d3d6 | 68 | #define VALUES_ROW1_Y_POS 60 |
miguelangel_2511 | 0:9d0b9785d3d6 | 69 | #define VALUES_ROW2_Y_POS 220 |
miguelangel_2511 | 0:9d0b9785d3d6 | 70 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 71 | #define VOLUME_SETPOINT_VALUE_DEFAULT 500 |
miguelangel_2511 | 0:9d0b9785d3d6 | 72 | #define RESP_FREQUENCY_VALUE_DEFAULT 20 |
miguelangel_2511 | 0:9d0b9785d3d6 | 73 | #define INSPIRATION_TIME_VALUE_DEFAULT 1.0 |
miguelangel_2511 | 0:9d0b9785d3d6 | 74 | #define EXPIRATION_TIME_VALUE_DEFAULT 2.0 |
miguelangel_2511 | 0:9d0b9785d3d6 | 75 | |
miguelangel_2511 | 2:6f618b905d4f | 76 | #define VOLUME_SETPOINT_MINIMUM_VALUE 250 |
miguelangel_2511 | 2:6f618b905d4f | 77 | #define VOLUME_SETPOINT_STEP 50 |
miguelangel_2511 | 2:6f618b905d4f | 78 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 79 | #define AIR_INPUT 0 |
miguelangel_2511 | 0:9d0b9785d3d6 | 80 | #define OXYGEN_INPUT 1 |
miguelangel_2511 | 0:9d0b9785d3d6 | 81 | |
miguelangel_2511 | 1:aa5df1878126 | 82 | |
miguelangel_2511 | 1:aa5df1878126 | 83 | #define MAIN_SCREEN_DEFAULT_STATE Main_Screen_Cursor_Disable |
miguelangel_2511 | 1:aa5df1878126 | 84 | |
miguelangel_2511 | 1:aa5df1878126 | 85 | /* Defines for the stepper motor control */ |
miguelangel_2511 | 1:aa5df1878126 | 86 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 87 | |
miguelangel_2511 | 1:aa5df1878126 | 88 | #define TO_HOME 0 |
miguelangel_2511 | 1:aa5df1878126 | 89 | #define TO_AIRBAG 1 |
miguelangel_2511 | 1:aa5df1878126 | 90 | #define STEPPER_ENABLED 0 |
miguelangel_2511 | 1:aa5df1878126 | 91 | #define STEPPER_DISABLED 1 |
miguelangel_2511 | 1:aa5df1878126 | 92 | |
miguelangel_2511 | 1:aa5df1878126 | 93 | #define STEPPER_DRIVER_PULSE_MIN_PERIOD_US 100 |
miguelangel_2511 | 1:aa5df1878126 | 94 | #define STEPPER_DRIVER_PULSE_HOME_PERIOD_US 1000 |
miguelangel_2511 | 1:aa5df1878126 | 95 | #define STEPPER_DRIVER_DEFAULT_PULSE_PERIOD_US 1000 |
miguelangel_2511 | 1:aa5df1878126 | 96 | |
miguelangel_2511 | 1:aa5df1878126 | 97 | #define STEPPER_DRIVER_MAX_PULSES 6000 // Limite de pasos cuando no encuentra el sensor |
miguelangel_2511 | 1:aa5df1878126 | 98 | #define STEPPER_DRIVER_MIN_PULSES (2*RAMP_STEPS + 2) |
miguelangel_2511 | 1:aa5df1878126 | 99 | #define STEPPER_DRIVER_INSPIRATION_PULSES_DEFAULT 2000 |
miguelangel_2511 | 1:aa5df1878126 | 100 | |
miguelangel_2511 | 1:aa5df1878126 | 101 | #define STEPPER_DRIVER_DEFAULT_STATE Stepper_Driver_Home_Ramp |
miguelangel_2511 | 1:aa5df1878126 | 102 | |
miguelangel_2511 | 1:aa5df1878126 | 103 | #define STEPPER_CALIBRATION_FREQUENCY_HZ 200 |
miguelangel_2511 | 1:aa5df1878126 | 104 | #define STEPPER_START_BRAKE_FREQUENCY_HZ 100 |
miguelangel_2511 | 1:aa5df1878126 | 105 | |
miguelangel_2511 | 1:aa5df1878126 | 106 | // Number of steps used for the speed ramp, can be either 50 or 100 |
miguelangel_2511 | 1:aa5df1878126 | 107 | #define RAMP_STEPS 50 |
miguelangel_2511 | 1:aa5df1878126 | 108 | #define STEPPER_START_BRAKE_PERIOD_US (1000000.0/STEPPER_START_BRAKE_FREQUENCY_HZ) |
miguelangel_2511 | 0:9d0b9785d3d6 | 109 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 110 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 111 | #endif |