repo time

Dependencies:   mbed MAX14720 MAX30205 USBDevice

Committer:
darienf
Date:
Tue Apr 06 06:41:40 2021 +0000
Revision:
20:6d2af70c92ab
another repo

Who changed what in which revision?

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