|
software:firmware
MakAir Firmware
|
Buttons related functions. More...
#include "../includes/keyboard.h"#include <OneButton.h>#include "../includes/activation.h"#include "../includes/buzzer.h"#include "../includes/calibration.h"#include "../includes/config.h"#include "../includes/debug.h"#include "../includes/main_controller.h"#include "../includes/parameters.h"Go to the source code of this file.
Macros | |
| #define | SM_DEBOUNCE 2u |
| #define | SM_REPEAT 20u |
| #define | SM_PERIOD 15u |
Functions | |
| static OneButton | buttonAlarmOff (PIN_BTN_ALARM_OFF, false, false) |
| static OneButton | buttonStart (PIN_BTN_START, false, false) |
| static OneButton | buttonStop (PIN_BTN_STOP, false, false) |
| void | onPeakPressureIncrease () |
| Handler of the button to increase the crete pressure. More... | |
| void | onPeakPressureDecrease () |
| Handler of the button to decrease the crete pressure. More... | |
| void | onPlateauPressureIncrease () |
| Handler of the button to increase the plateau pressure. More... | |
| void | onPlateauPressureDecrease () |
| Handler of the button to decrease the plateau pressure. More... | |
| void | onPeepPressureIncrease () |
| Handler of the button to increase the PEP pressure. More... | |
| void | onPeepPressureDecrease () |
| Handler of the button to decrease the PEP pressure. More... | |
| void | onCycleIncrease () |
| Handler of the button to increase the number of breathing cycles. More... | |
| void | onCycleDecrease () |
| Handler of the button to decrease the number of breathing cycles. More... | |
| void | onAlarmOff () |
| Handler of the button to stop alarm. More... | |
| void | onStart () |
| Handler of the button to start. More... | |
| void | onStop () |
| Handler of the button to stop. More... | |
| void | initKeyboard () |
| Initialize keyboard abstraction. More... | |
| void | scanMatrixLoop () |
| void | keyboardLoop () |
| Handle button events. More... | |
| void | calibrateButtons () |
| Helper to calibrate analog values of buttons. More... | |
Variables | |
| uint16_t | scanMatrixCurrentColumn = 1 |
| uint16_t | scanMatrixCounterC1R1 = 0 |
| uint16_t | scanMatrixCounterC1R2 = 0 |
| uint16_t | scanMatrixCounterC1R3 = 0 |
| uint16_t | scanMatrixCounterC2R1 = 0 |
| uint16_t | scanMatrixCounterC2R2 = 0 |
| uint16_t | scanMatrixCounterC2R3 = 0 |
| uint16_t | scanMatrixCounterC3R1 = 0 |
| uint16_t | scanMatrixCounterC3R2 = 0 |
| uint16_t | scanMatrixCounterC3R3 = 0 |
Buttons related functions.
This relies on the OneButton library (https://github.com/mathertel/OneButton).
Definition in file keyboard.cpp.
| #define SM_DEBOUNCE 2u |
Definition at line 106 of file keyboard.cpp.
| #define SM_PERIOD 15u |
Definition at line 108 of file keyboard.cpp.
| #define SM_REPEAT 20u |
Definition at line 107 of file keyboard.cpp.
|
static |
|
static |
|
static |
| void calibrateButtons | ( | ) |
| void initKeyboard | ( | ) |
Initialize keyboard abstraction.
Definition at line 78 of file keyboard.cpp.
| void keyboardLoop | ( | ) |
Handle button events.
Definition at line 223 of file keyboard.cpp.
| void onAlarmOff | ( | ) |
Handler of the button to stop alarm.
Definition at line 62 of file keyboard.cpp.
| void onCycleDecrease | ( | ) |
Handler of the button to decrease the number of breathing cycles.
Definition at line 59 of file keyboard.cpp.
| void onCycleIncrease | ( | ) |
Handler of the button to increase the number of breathing cycles.
Definition at line 56 of file keyboard.cpp.
| void onPeakPressureDecrease | ( | ) |
Handler of the button to decrease the crete pressure.
Definition at line 41 of file keyboard.cpp.
| void onPeakPressureIncrease | ( | ) |
Handler of the button to increase the crete pressure.
Definition at line 38 of file keyboard.cpp.
| void onPeepPressureDecrease | ( | ) |
Handler of the button to decrease the PEP pressure.
Definition at line 53 of file keyboard.cpp.
| void onPeepPressureIncrease | ( | ) |
Handler of the button to increase the PEP pressure.
Definition at line 50 of file keyboard.cpp.
| void onPlateauPressureDecrease | ( | ) |
Handler of the button to decrease the plateau pressure.
Definition at line 47 of file keyboard.cpp.
| void onPlateauPressureIncrease | ( | ) |
Handler of the button to increase the plateau pressure.
Definition at line 44 of file keyboard.cpp.
| void onStart | ( | ) |
Handler of the button to start.
Definition at line 65 of file keyboard.cpp.
| void onStop | ( | ) |
Handler of the button to stop.
Definition at line 76 of file keyboard.cpp.
| void scanMatrixLoop | ( | ) |
Definition at line 112 of file keyboard.cpp.
| uint16_t scanMatrixCounterC1R1 = 0 |
Definition at line 97 of file keyboard.cpp.
| uint16_t scanMatrixCounterC1R2 = 0 |
Definition at line 98 of file keyboard.cpp.
| uint16_t scanMatrixCounterC1R3 = 0 |
Definition at line 99 of file keyboard.cpp.
| uint16_t scanMatrixCounterC2R1 = 0 |
Definition at line 100 of file keyboard.cpp.
| uint16_t scanMatrixCounterC2R2 = 0 |
Definition at line 101 of file keyboard.cpp.
| uint16_t scanMatrixCounterC2R3 = 0 |
Definition at line 102 of file keyboard.cpp.
| uint16_t scanMatrixCounterC3R1 = 0 |
Definition at line 103 of file keyboard.cpp.
| uint16_t scanMatrixCounterC3R2 = 0 |
Definition at line 104 of file keyboard.cpp.
| uint16_t scanMatrixCounterC3R3 = 0 |
Definition at line 105 of file keyboard.cpp.
| uint16_t scanMatrixCurrentColumn = 1 |
Definition at line 96 of file keyboard.cpp.