Kabuki Starship / Mbed 2 deprecated GHVentilator

Dependencies:   mbed SickBayTek

Committer:
kabukistarship
Date:
Wed Apr 08 12:36:36 2020 +0000
Revision:
5:da629056644f
Parent:
4:de69851cf725
Child:
6:b2672da545f1
Fixed compile errors.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kabukistarship 2:1578ecfa9377 1 /** Gravity Hookah Ventilator @version 0.x
kabukistarship 3:d15b6579b5ae 2 @link https://github.com/KabukiStarship/SickBay.git
kabukistarship 3:d15b6579b5ae 3 @file /GHVentilator.h
kabukistarship 2:1578ecfa9377 4 @author Cale McCollough <https://cale-mccollough.github.io>
kabukistarship 2:1578ecfa9377 5 @license Copyright 2020 (C) Kabuki Starship <kabukistarship.com>.
kabukistarship 2:1578ecfa9377 6 This Source Code Form is subject to the terms of the Mozilla Public License,
kabukistarship 2:1578ecfa9377 7 v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain
kabukistarship 2:1578ecfa9377 8 one at <https://mozilla.org/MPL/2.0/>. */
kabukistarship 2:1578ecfa9377 9 #pragma once
kabukistarship 2:1578ecfa9377 10 #ifndef GHVentilatorDecl
kabukistarship 2:1578ecfa9377 11 #define GHVentilatorDecl
kabukistarship 2:1578ecfa9377 12 #include "GHVentilatorChannel.h"
kabukistarship 2:1578ecfa9377 13 namespace SickBay {
kabukistarship 2:1578ecfa9377 14
kabukistarship 2:1578ecfa9377 15 /* A Gravity Hookah Ventilator. */
kabukistarship 2:1578ecfa9377 16 class GHVentilator {
kabukistarship 3:d15b6579b5ae 17 public:
kabukistarship 3:d15b6579b5ae 18
kabukistarship 3:d15b6579b5ae 19 enum {
kabukistarship 3:d15b6579b5ae 20 ChannelCountMax = 4,
kabukistarship 3:d15b6579b5ae 21 };
kabukistarship 3:d15b6579b5ae 22
kabukistarship 3:d15b6579b5ae 23 // The tick and negative calibrating positive running states.
kabukistarship 3:d15b6579b5ae 24 int Ticks,
kabukistarship 4:de69851cf725 25 TicksMax, //< The max tick count before it gets reset.
kabukistarship 4:de69851cf725 26 TicksSecond, //< The number of Ticks per Second.
kabukistarship 4:de69851cf725 27 TicksInhaleMin, //< The min inhale ticks.
kabukistarship 4:de69851cf725 28 TicksInhaleMax, //< The max breath period of 20 seconds.
kabukistarship 4:de69851cf725 29 TicksExhaleMin, //< The min ticks in an exhale.
kabukistarship 4:de69851cf725 30 TicksExhaleMax, //< The max ticks in an exhale.
kabukistarship 4:de69851cf725 31 TicksCalibration, //< The number of ticks in the calibration state.
kabukistarship 4:de69851cf725 32 ChannelsCount; //< The number of GHVentilatorChannels.
kabukistarship 4:de69851cf725 33 GHVentilatorChannel* Channels[ChannelCountMax];
kabukistarship 4:de69851cf725 34 BMP280 Atmosphere; //< Pressure sensor for the air tank.
kabukistarship 4:de69851cf725 35 float Pressure, //< The Pressure in the tank.
kabukistarship 4:de69851cf725 36 PressureMin, //< The min Pressure.
kabukistarship 4:de69851cf725 37 PressureMax, //< The max Pressure.
kabukistarship 5:da629056644f 38 HysteresisChamber, //< The pressure chamber hystersis +/- percent.
kabukistarship 5:da629056644f 39 HysteresisPatient; //< The patient Hystersis percent muliplier.
kabukistarship 4:de69851cf725 40 DigitalOut Blower; //< A blower powered by a Solid State Relay.
kabukistarship 4:de69851cf725 41 DigitalOut Status; //< Status pin for outputing the Device status.
kabukistarship 4:de69851cf725 42 Ticker UpdateTicker; //< The x times per second update ticker.
kabukistarship 3:d15b6579b5ae 43
kabukistarship 4:de69851cf725 44 /* Constructs a GHV with 1 channel. */
kabukistarship 3:d15b6579b5ae 45 GHVentilator (int TicksPerSecond, int TicksCalibration,
kabukistarship 4:de69851cf725 46 I2C& AtmosphereBus, char AtmosphereAddress,
kabukistarship 4:de69851cf725 47 float PressureHysteresis,
kabukistarship 5:da629056644f 48 float HysteresisPatient,
kabukistarship 4:de69851cf725 49 PinName BlowerPin, PinName StatusPin,
kabukistarship 4:de69851cf725 50 GHVentilatorChannel* A);
kabukistarship 3:d15b6579b5ae 51
kabukistarship 4:de69851cf725 52 /* Constructs a GHV with 2 channels. */
kabukistarship 3:d15b6579b5ae 53 GHVentilator (int TicksPerSecond, int TicksCalibration,
kabukistarship 4:de69851cf725 54 I2C& AtmosphereBus, char AtmosphereAddress,
kabukistarship 5:da629056644f 55 float HysteresisChamber,
kabukistarship 4:de69851cf725 56 float PressureHysteresis,
kabukistarship 4:de69851cf725 57 PinName BlowerPin, PinName StatusPin,
kabukistarship 4:de69851cf725 58 GHVentilatorChannel* A,
kabukistarship 4:de69851cf725 59 GHVentilatorChannel* B);
kabukistarship 3:d15b6579b5ae 60
kabukistarship 4:de69851cf725 61 /* Constructs a GHV with 3 channels. */
kabukistarship 3:d15b6579b5ae 62 GHVentilator (int TicksPerSecond, int TicksCalibration,
kabukistarship 4:de69851cf725 63 I2C& AtmosphereBus, char AtmosphereAddress,
kabukistarship 4:de69851cf725 64 float PressureHysteresis,
kabukistarship 5:da629056644f 65 float HysteresisPatient,
kabukistarship 4:de69851cf725 66 PinName BlowerPin, PinName StatusPin,
kabukistarship 4:de69851cf725 67 GHVentilatorChannel* A,
kabukistarship 4:de69851cf725 68 GHVentilatorChannel* B,
kabukistarship 4:de69851cf725 69 GHVentilatorChannel* C);
kabukistarship 3:d15b6579b5ae 70
kabukistarship 4:de69851cf725 71 /* Constructs a GHV with 4 channels. */
kabukistarship 4:de69851cf725 72 GHVentilator (int TicksPerSecond, int TicksCalibration,
kabukistarship 4:de69851cf725 73 I2C& AtmosphereBus, char AtmosphereAddress,
kabukistarship 4:de69851cf725 74 float PressureHysteresis,
kabukistarship 5:da629056644f 75 float HysteresisPatient,
kabukistarship 4:de69851cf725 76 PinName BlowerPin, PinName StatusPin,
kabukistarship 4:de69851cf725 77 GHVentilatorChannel* A,
kabukistarship 4:de69851cf725 78 GHVentilatorChannel* B,
kabukistarship 4:de69851cf725 79 GHVentilatorChannel* C,
kabukistarship 4:de69851cf725 80 GHVentilatorChannel* D);
kabukistarship 3:d15b6579b5ae 81
kabukistarship 3:d15b6579b5ae 82 /* Gets the GHVentilatorChannel with the given Index. \
kabukistarship 3:d15b6579b5ae 83 @return Nil if the Index is out of bounds. */
kabukistarship 3:d15b6579b5ae 84 GHVentilatorChannel* Channel(int Index);
kabukistarship 4:de69851cf725 85
kabukistarship 3:d15b6579b5ae 86 /* Reads the Atmospher.Pressure() and Atmospher.Temperature () */
kabukistarship 5:da629056644f 87 void Tare();
kabukistarship 3:d15b6579b5ae 88
kabukistarship 4:de69851cf725 89 /* Sets the inhale and exhale ticks for the give channel Index. */
kabukistarship 4:de69851cf725 90 int TicksInhaleExhaleSet (int Index, int TicksInhale, int TicksExhale);
kabukistarship 3:d15b6579b5ae 91
kabukistarship 3:d15b6579b5ae 92 /* Starts the system. */
kabukistarship 4:de69851cf725 93 void Run ();
kabukistarship 3:d15b6579b5ae 94
kabukistarship 3:d15b6579b5ae 95 /* Updates the main device and it's channels. */
kabukistarship 3:d15b6579b5ae 96 void Update ();
kabukistarship 2:1578ecfa9377 97 };
kabukistarship 2:1578ecfa9377 98
kabukistarship 2:1578ecfa9377 99 } //< namespace SickBay
kabukistarship 2:1578ecfa9377 100 #endif
kabukistarship 4:de69851cf725 101 #undef GHVentilatorChannelsCount