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