Darien Figueroa / Mbed 2 deprecated repo3

Dependencies:   mbed MAX14720 MAX30205 USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MAX30205Info.cs Source File

MAX30205Info.cs

00001 /*******************************************************************************
00002 * Copyright (C) 2016 Maxim Integrated Products, Inc., All rights Reserved.
00003 * 
00004 * This software is protected by copyright laws of the United States and
00005 * of foreign countries. This material may also be protected by patent laws
00006 * and technology transfer regulations of the United States and of foreign
00007 * countries. This software is furnished under a license agreement and/or a
00008 * nondisclosure agreement and may only be used or reproduced in accordance
00009 * with the terms of those agreements. Dissemination of this information to
00010 * any party or parties not specified in the license agreement and/or
00011 * nondisclosure agreement is expressly prohibited.
00012 *
00013 * The above copyright notice and this permission notice shall be included
00014 * in all copies or substantial portions of the Software.
00015 *
00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00017 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00019 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
00020 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00021 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00022 * OTHER DEALINGS IN THE SOFTWARE.
00023 *
00024 * Except as contained in this notice, the name of Maxim Integrated
00025 * Products, Inc. shall not be used except as stated in the Maxim Integrated
00026 * Products, Inc. Branding Policy.
00027 *
00028 * The mere transfer of this software does not imply any licenses
00029 * of trade secrets, proprietary technology, copyrights, patents,
00030 * trademarks, maskwork rights, or any other form of intellectual
00031 * property whatsoever. Maxim Integrated Products, Inc. retains all
00032 * ownership rights.
00033 *******************************************************************************
00034 */
00035 
00036 using System;
00037 using System.Collections.Generic;
00038 using System.Linq;
00039 using System.Text;
00040 using HealthSensorPlatform.DeviceDescriptions;
00041 using RPCSupport.DeviceSupport;
00042 
00043 namespace Maxim.CustomControls
00044 {
00045     public class MAX30205Info : Device
00046     {
00047 
00048         public MAX30205Info()
00049         {
00050             deviceDetails = new DeviceDetails();
00051             deviceDetails.InitI2c(1, 0x90);
00052 
00053             initalizeDescription();
00054 
00055         }
00056 
00057         public MAX30205Info(byte i2cAddress)
00058         {
00059             deviceDetails = new DeviceDetails();
00060             deviceDetails.InitI2c(1, i2cAddress);
00061 
00062             initalizeDescription();
00063         }
00064 
00065         void initalizeDescription()
00066         {
00067             Info = new RegisterInfo[] {
00068                 new RegisterInfo("TEMPERATURE",0x00,2),
00069                 new RegisterInfo("CONFIGURATION",0x01),
00070                 new RegisterInfo("T_HYST",0x02,2),
00071                 new RegisterInfo("T_OS",0x03,2)
00072            };
00073 
00074             // register 0x00
00075             Descriptions(0x00).Add("Bit [15:0]", "TEMP", "Temperature Data");
00076             // register 0x01
00077             Descriptions(0x01).Add("Bit 7", "ONE-SHOT", "One-Shot");
00078             Descriptions(0x01).Add("Bit 6", "/TIMEOUT", "Timeout");
00079             Descriptions(0x01).Add("Bit 5", "DATA_FORMAT", "Data Format");
00080             Descriptions(0x01).Add("Bit 4", "FAULT_QUEUE[1]", "Fault Queue");
00081             Descriptions(0x01).Add("Bit 3", "FAULT_QUEUE[0]", "Fault Queue");
00082             Descriptions(0x01).Add("Bit 2", "OS_POLARITY", "OS Polarity");
00083             Descriptions(0x01).Add("Bit 1", "CMPRTR/INTRRPT", "Comparator and Interrupt");
00084             Descriptions(0x01).Add("Bit 0", "SHUTDOWN", "Shutdown");
00085             // register 0x02
00086             Descriptions(0x02).Add("Bit [15:0]", "T_HYST", "Hysteresis Set Point");
00087             // register 0x03
00088             Descriptions(0x03).Add("Bit [15:0]", "T_OS", "Overtemperature Shutdown Set Point");
00089         }
00090     }
00091 }