Darien Figueroa / Mbed OS Final_Program

Dependencies:   USBDevice

Committer:
darienf
Date:
Sun May 02 23:09:04 2021 +0000
Revision:
5:bc128a16232f
Parent:
3:36de8b9e4b1a
This is the program that was last used, that has the working temperature and some comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
darienf 3:36de8b9e4b1a 1 /*******************************************************************************
darienf 3:36de8b9e4b1a 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
darienf 3:36de8b9e4b1a 3 *
darienf 3:36de8b9e4b1a 4 * Permission is hereby granted, free of charge, to any person obtaining a
darienf 3:36de8b9e4b1a 5 * copy of this software and associated documentation files (the "Software"),
darienf 3:36de8b9e4b1a 6 * to deal in the Software without restriction, including without limitation
darienf 3:36de8b9e4b1a 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
darienf 3:36de8b9e4b1a 8 * and/or sell copies of the Software, and to permit persons to whom the
darienf 3:36de8b9e4b1a 9 * Software is furnished to do so, subject to the following conditions:
darienf 3:36de8b9e4b1a 10 *
darienf 3:36de8b9e4b1a 11 * The above copyright notice and this permission notice shall be included
darienf 3:36de8b9e4b1a 12 * in all copies or substantial portions of the Software.
darienf 3:36de8b9e4b1a 13 *
darienf 3:36de8b9e4b1a 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
darienf 3:36de8b9e4b1a 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
darienf 3:36de8b9e4b1a 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
darienf 3:36de8b9e4b1a 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
darienf 3:36de8b9e4b1a 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
darienf 3:36de8b9e4b1a 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
darienf 3:36de8b9e4b1a 20 * OTHER DEALINGS IN THE SOFTWARE.
darienf 3:36de8b9e4b1a 21 *
darienf 3:36de8b9e4b1a 22 * Except as contained in this notice, the name of Maxim Integrated
darienf 3:36de8b9e4b1a 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
darienf 3:36de8b9e4b1a 24 * Products, Inc. Branding Policy.
darienf 3:36de8b9e4b1a 25 *
darienf 3:36de8b9e4b1a 26 * The mere transfer of this software does not imply any licenses
darienf 3:36de8b9e4b1a 27 * of trade secrets, proprietary technology, copyrights, patents,
darienf 3:36de8b9e4b1a 28 * trademarks, maskwork rights, or any other form of intellectual
darienf 3:36de8b9e4b1a 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
darienf 3:36de8b9e4b1a 30 * ownership rights.
darienf 3:36de8b9e4b1a 31 *******************************************************************************
darienf 3:36de8b9e4b1a 32 */
darienf 3:36de8b9e4b1a 33 #ifndef _PERIPHERALS_H_
darienf 3:36de8b9e4b1a 34 #define _PERIPHERALS_H_
darienf 3:36de8b9e4b1a 35
darienf 3:36de8b9e4b1a 36 #include "mbed.h"
darienf 3:36de8b9e4b1a 37 #include "USBSerial.h"
darienf 3:36de8b9e4b1a 38 #include "MAX30101.h"
darienf 3:36de8b9e4b1a 39 #include "HspLed.h"
darienf 3:36de8b9e4b1a 40 #include "MAX30205.h"
darienf 3:36de8b9e4b1a 41 #include "LIS2DH.h"
darienf 3:36de8b9e4b1a 42 #include "MAX30001.h"
darienf 3:36de8b9e4b1a 43 #include "BMP280.h"
darienf 3:36de8b9e4b1a 44 #include "S25FS512.h"
darienf 3:36de8b9e4b1a 45 #include "PushButton.h"
darienf 3:36de8b9e4b1a 46 #include "BLE.h"
darienf 3:36de8b9e4b1a 47 #include "MAX14720.h"
darienf 3:36de8b9e4b1a 48 #include "HspBLE.h"
darienf 3:36de8b9e4b1a 49
darienf 3:36de8b9e4b1a 50 /**
darienf 3:36de8b9e4b1a 51 * This static class is used as a central locatoin for all devices on the HSP platform
darienf 3:36de8b9e4b1a 52 * it gives (in-effect) a singleton interface for each device so that anywhere in code
darienf 3:36de8b9e4b1a 53 * one can reference on of these devices
darienf 3:36de8b9e4b1a 54 */
darienf 3:36de8b9e4b1a 55 class Peripherals {
darienf 3:36de8b9e4b1a 56 public:
darienf 3:36de8b9e4b1a 57 static USBSerial *setUSBSerial(USBSerial * device) { mUSBSerial = device; return device; }
darienf 3:36de8b9e4b1a 58 static USBSerial *usbSerial(void) { return mUSBSerial; }
darienf 3:36de8b9e4b1a 59
darienf 3:36de8b9e4b1a 60 static MAX30101 *max30101(void) { return mMAX30101; }
darienf 3:36de8b9e4b1a 61 static MAX30101 *setMAX30101(MAX30101 *device) { mMAX30101 = device; return device; }
darienf 3:36de8b9e4b1a 62
darienf 3:36de8b9e4b1a 63 static MAX30205 *max30205_top(void) { return mMAX30205_top; }
darienf 3:36de8b9e4b1a 64 static MAX30205 *setMAX30205_top(MAX30205 *device) { mMAX30205_top = device; return device; }
darienf 3:36de8b9e4b1a 65
darienf 3:36de8b9e4b1a 66 static MAX30205 *max30205_bottom(void) { return mMAX30205_bottom; }
darienf 3:36de8b9e4b1a 67 static MAX30205 *setMAX30205_bottom(MAX30205 *device) { mMAX30205_bottom = device; return device; }
darienf 3:36de8b9e4b1a 68
darienf 3:36de8b9e4b1a 69 static HspLed *hspLed(void) { return mHspLed; }
darienf 3:36de8b9e4b1a 70 static HspLed *setHspLed(HspLed *device) { mHspLed = device; return device; }
darienf 3:36de8b9e4b1a 71
darienf 3:36de8b9e4b1a 72 static LIS2DH *lis2dh(void) { return mLIS2DH; }
darienf 3:36de8b9e4b1a 73 static LIS2DH *setLIS2DH(LIS2DH *device) { mLIS2DH = device; return device; }
darienf 3:36de8b9e4b1a 74
darienf 3:36de8b9e4b1a 75 static MAX30001 *max30001(void) { return mMAX30001; }
darienf 3:36de8b9e4b1a 76 static MAX30001 *setMAX30001(MAX30001 *device) { mMAX30001 = device; return device; }
darienf 3:36de8b9e4b1a 77
darienf 3:36de8b9e4b1a 78 static BMP280 *bmp280(void) { return mBMP280; }
darienf 3:36de8b9e4b1a 79 static BMP280 *setBMP280(BMP280 *device) { mBMP280 = device; return device; }
darienf 3:36de8b9e4b1a 80
darienf 3:36de8b9e4b1a 81 static Timer *timestampTimer(void) { return mTimestampTimer; }
darienf 3:36de8b9e4b1a 82 static Timer *setTimestampTimer(Timer *timer) { mTimestampTimer = timer; return timer; }
darienf 3:36de8b9e4b1a 83
darienf 3:36de8b9e4b1a 84 static I2C *i2c1(void) { return mI2c1; }
darienf 3:36de8b9e4b1a 85 static I2C *setI2c1(I2C *i2cPort) { mI2c1 = i2cPort; return i2cPort; }
darienf 3:36de8b9e4b1a 86
darienf 3:36de8b9e4b1a 87 static I2C *i2c2(void) { return mI2c2; }
darienf 3:36de8b9e4b1a 88 static I2C *setI2c2(I2C *i2cPort) { mI2c2 = i2cPort; return i2cPort; }
darienf 3:36de8b9e4b1a 89
darienf 3:36de8b9e4b1a 90 static S25FS512 *s25FS512(void) { return mS25FS512; }
darienf 3:36de8b9e4b1a 91 static S25FS512 *setS25FS512(S25FS512 *s25FS512) { mS25FS512 = s25FS512; return s25FS512; }
darienf 3:36de8b9e4b1a 92
darienf 3:36de8b9e4b1a 93 static PushButton *pushButton(void) { return mPushButton; }
darienf 3:36de8b9e4b1a 94 static PushButton *setPushButton(PushButton *pushButton) { mPushButton = pushButton; return pushButton; }
darienf 3:36de8b9e4b1a 95
darienf 3:36de8b9e4b1a 96 static BLE *ble(void) { return mBLE; }
darienf 3:36de8b9e4b1a 97 static BLE *setBLE(BLE *_ble) { mBLE = _ble; return _ble; }
darienf 3:36de8b9e4b1a 98
darienf 3:36de8b9e4b1a 99 static HspBLE *hspBLE(void) { return mhspBLE; }
darienf 3:36de8b9e4b1a 100 static HspBLE *setHspBLE(HspBLE *_hspBLE) { mhspBLE = _hspBLE; return _hspBLE; }
darienf 3:36de8b9e4b1a 101
darienf 3:36de8b9e4b1a 102 static MAX14720 *max14720(void) { return mMAX14720; }
darienf 3:36de8b9e4b1a 103 static MAX14720 *setMAX14720(MAX14720 *_MAX14720) { mMAX14720 = _MAX14720; return _MAX14720; }
darienf 3:36de8b9e4b1a 104
darienf 3:36de8b9e4b1a 105 private:
darienf 3:36de8b9e4b1a 106 static I2C *mI2c1;
darienf 3:36de8b9e4b1a 107 static I2C *mI2c2;
darienf 3:36de8b9e4b1a 108 static USBSerial *mUSBSerial;
darienf 3:36de8b9e4b1a 109 static MAX30101 *mMAX30101;
darienf 3:36de8b9e4b1a 110 static MAX30001 *mMAX30001;
darienf 3:36de8b9e4b1a 111 static BMP280 *mBMP280;
darienf 3:36de8b9e4b1a 112 static HspLed *mHspLed;
darienf 3:36de8b9e4b1a 113 static Serial *mSerial;
darienf 3:36de8b9e4b1a 114 static MAX30205 *mMAX30205_top;
darienf 3:36de8b9e4b1a 115 static MAX30205 *mMAX30205_bottom;
darienf 3:36de8b9e4b1a 116 static LIS2DH *mLIS2DH;
darienf 3:36de8b9e4b1a 117 static Timer *mTimestampTimer;
darienf 3:36de8b9e4b1a 118 static S25FS512 *mS25FS512;
darienf 3:36de8b9e4b1a 119 static PushButton *mPushButton;
darienf 3:36de8b9e4b1a 120 static BLE *mBLE;
darienf 3:36de8b9e4b1a 121 static MAX14720 *mMAX14720;
darienf 3:36de8b9e4b1a 122 static HspBLE *mhspBLE;
darienf 3:36de8b9e4b1a 123 };
darienf 3:36de8b9e4b1a 124
darienf 3:36de8b9e4b1a 125 #endif // _PERIPHERALS_H_
darienf 3:36de8b9e4b1a 126