diff --git a/src/shared/sensors/analog/pressure/honeywell/HSCMRNN015PA.h b/src/shared/sensors/analog/pressure/honeywell/HSCMRNN015PA.h new file mode 100644 index 0000000000000000000000000000000000000000..7669f3f4f686ea4e024533f6d90d35384945f20a --- /dev/null +++ b/src/shared/sensors/analog/pressure/honeywell/HSCMRNN015PA.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2023 Skyward Experimental Rocketry + * Author: Federico Mandelli + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "HSCMRNN015PAData.h" +#include "HoneywellPressureSensor.h" + +namespace Boardcore +{ + +/** + * @brief Absolute pressure sensor with a 0-103kPa range (0-15psi) + */ +class HSCMRNN015PA final : public HoneywellPressureSensor<HSCMRNN015PAData> +{ +public: + HSCMRNN015PA(std::function<ADCData()> getSensorVoltage, + const float supplyVoltage = 5.0) + : HoneywellPressureSensor(getSensorVoltage, supplyVoltage, 103421.3594) + { + } +}; + +} // namespace Boardcore diff --git a/src/shared/sensors/analog/pressure/honeywell/HSCMRNN015PAData.h b/src/shared/sensors/analog/pressure/honeywell/HSCMRNN015PAData.h new file mode 100644 index 0000000000000000000000000000000000000000..7685633918d06c6c81529541c8b7e6beab602081 --- /dev/null +++ b/src/shared/sensors/analog/pressure/honeywell/HSCMRNN015PAData.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2020 Skyward Experimental Rocketry + * Author: Federico Mandelli + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include <sensors/SensorData.h> + +namespace Boardcore +{ + +struct HSCMRNN015PAData : public PressureData +{ + static std::string header() { return "pressureTimestamp,pressure\n"; } + + void print(std::ostream& os) const + { + os << pressureTimestamp << "," << pressure << "\n"; + } +}; + +} // namespace Boardcore diff --git a/src/shared/sensors/analog/pressure/honeywell/SSCMRNN030PA.h b/src/shared/sensors/analog/pressure/honeywell/SSCMRNN030PA.h new file mode 100644 index 0000000000000000000000000000000000000000..beaac6843465e6112b8f9348d11b1dde73636659 --- /dev/null +++ b/src/shared/sensors/analog/pressure/honeywell/SSCMRNN030PA.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2023 Skyward Experimental Rocketry + * Author: Federico Mandelli + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "HoneywellPressureSensor.h" +#include "SSCMRNN030PAData.h" + +namespace Boardcore +{ + +/** + * @brief Absolute pressure sensor with a 0-206kPa range (0-30psi) + */ +class SSCMRNN030PA final : public HoneywellPressureSensor<SSCMRNN030PAData> +{ +public: + SSCMRNN030PA(std::function<ADCData()> getSensorVoltage, + const float supplyVoltage = 5.0) + : HoneywellPressureSensor(getSensorVoltage, supplyVoltage, 206842.7188) + { + } +}; + +} // namespace Boardcore diff --git a/src/shared/sensors/analog/pressure/honeywell/SSCMRNN030PAData.h b/src/shared/sensors/analog/pressure/honeywell/SSCMRNN030PAData.h new file mode 100644 index 0000000000000000000000000000000000000000..70983cc860d246a000f6b4252ac46c1b2254738b --- /dev/null +++ b/src/shared/sensors/analog/pressure/honeywell/SSCMRNN030PAData.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2023 Skyward Experimental Rocketry + * Author: Federico Mandelli + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include <sensors/SensorData.h> + +namespace Boardcore +{ + +struct SSCMRNN030PAData : public PressureData +{ + static std::string header() { return "pressureTimestamp,pressure\n"; } + + void print(std::ostream& os) const + { + os << pressureTimestamp << "," << pressure << "\n"; + } +}; + +} // namespace Boardcore