Darien Figueroa / Mbed 2 deprecated repo3

Dependencies:   mbed MAX14720 MAX30205 USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MAX30101Info.cs Source File

MAX30101Info.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 Maxim.CustomControls;
00041 using HealthSensorPlatform.DeviceDescriptions;
00042 using RPCSupport.DeviceSupport;
00043 
00044 namespace Maxim.CustomControls
00045 {
00046     public class MAX30101Info : Device
00047     {  
00048 
00049         public MAX30101Info() 
00050         {
00051             deviceDetails = new DeviceDetails();
00052             deviceDetails.InitI2c(2, 0xAE);
00053 
00054             Info = new RegisterInfo[] {
00055                             new RegisterInfo("Interrupt Status 1",0x00),
00056                             new RegisterInfo("Interrupt Status 2",0x01),
00057                             new RegisterInfo("Interrupt Enable 1",0x02),
00058                             new RegisterInfo("Interrupt Enable 2",0x03),
00059                             new RegisterInfo("FIFO Write Pointer",0x04),
00060                             new RegisterInfo("Over Flow Counter",0x05),
00061                             new RegisterInfo("FIFO Read Pointer",0x06),
00062                             new RegisterInfo("FIFO Data Register",0x07), 
00063                             new RegisterInfo("FIFO Configuration",0x08),
00064                             new RegisterInfo("Mode Configuration",0x09),
00065                             new RegisterInfo("SPO2 Configuration",0x0A),
00066                             new RegisterInfo("LED1 Pulse Amplitude (Red)",0x0C),
00067                             new RegisterInfo("LED2 Pulse Amplitude (IR)",0x0D),
00068                             new RegisterInfo("LED3 Pulse Amplitude (Green)",0x0E), 
00069                             new RegisterInfo("LED4 Pulse Amplitude (Green)",0x0F),
00070                             new RegisterInfo("Proximity Mode LED Pulse Amplitude",0x10), 
00071                             new RegisterInfo("Multi-LED Mode Control Register timeslot 1 and 2",0x11),
00072                             new RegisterInfo("Multi-LED Mode Control Register timeslot 3 and 4",0x12),
00073                             new RegisterInfo("Die Temperature integer",0x1F),
00074                             new RegisterInfo("Die Temperature fraction",0x20), 
00075                             new RegisterInfo("Die Temperature Config",0x21),
00076                             new RegisterInfo("Proximity Interrupt Threshold",0x30), 
00077                             new RegisterInfo("Revision ID",0xFE),
00078                             new RegisterInfo("Part ID",0xFF)
00079                         };
00080 
00081             // register 0x00
00082             Descriptions(0x00).Add("Bit 7", "A_FULL", "FIFO Almost Full Flag");
00083             Descriptions(0x00).Add("Bit 6", "PPG_RDY", "New FIFO Data Ready");
00084             Descriptions(0x00).Add("Bit 5", "ALC_OVF", "Ambient Light Cancellation Overflow");
00085             Descriptions(0x00).Add("Bit 4", "PROX_INT", "Proximity Threshold Triggered");
00086             Descriptions(0x00).Add("Bit 0", "PWR_RDY", "Power Ready Flag");
00087             // register 0x01
00088             Descriptions(0x01).Add("Bit 1", "DIE_TEMP_RDY", "Internal Temperature Ready Flag");
00089             // register 0x02
00090             Descriptions(0x02).Add("Bit 7", "A_FULL_EN", "FIFO Almost Full Flag Enable");
00091             Descriptions(0x02).Add("Bit 6", "PPG_RDY_EN", "New FIFO Data Ready Enable");
00092             Descriptions(0x02).Add("Bit 5", "ALC_OVF_EN", "Ambient Light Cancellation Overflow Enable");
00093             Descriptions(0x02).Add("Bit 4", "PROX_INT_EN", "Proximity Threshold Enable");
00094             // register 0x03
00095             Descriptions(0x03).Add("Bit 1", "DIE_TEMP_RDY_EN", "Internal Temperature Ready Flag Enable");
00096             // register 0x04
00097             Descriptions(0x04).Add("Bit [4:0]", "FIFO_WR_PTR[4:0]", "FIFO Write Pointer");
00098             // register 0x05
00099             Descriptions(0x05).Add("Bit [4:0]", "OVF_COUNTER[4:0]", "FIFO Overflow Counter");
00100             // register 0x06
00101             Descriptions(0x06).Add("Bit [4:0]", "FIFO_RD_PTR[4:0]", "FIFO Read Pointer");
00102             // register 0x07
00103             Descriptions(0x07).Add("Bit [7:0]", "FIFO_DATA[7:0]", "FIFO Data Register");
00104             // register 0x08
00105             Descriptions(0x08).Add("Bit [7:5]", "SMP_AVE[2:0]", "Sample Averaging");
00106             Descriptions(0x08).Add("Bit 4", "FIFO_ROLLOVER_EN", "FIFO Rolls on Full");
00107             Descriptions(0x08).Add("Bit [3:0]", "FIFO_A_FULL[3:0]", "FIFO Almost Full Value");
00108             // register 0x09
00109             Descriptions(0x09).Add("Bit 7", "SHDN", "Shutdown Control");
00110             Descriptions(0x09).Add("Bit 6", "RESET", "Reset Control");
00111             Descriptions(0x09).Add("Bit [2:0]", "MODE[2:0]", "Mode Control");
00112             // register 0x0a
00113             Descriptions(0x0a).Add("Bit [6:5]", "SPO2_ADC_RGE[1:0]", "SP02 ADC Range Control");
00114             Descriptions(0x0a).Add("Bit [4:2]", "SPO2_SR[2:0]", "SP02 Sample Rate Control");
00115             Descriptions(0x0a).Add("Bit [1:0]", "LED_PW[1:0]", "LED Pulse Width Control and ADC Resolution");
00116             // register 0x0c
00117             Descriptions(0x0c).Add("Bit [7:0]", "LED1_PA[7:0]", "LED1 Pulse Amplitude (RED)");
00118             Descriptions(0x0d).Add("Bit [7:0]", "LED2_PA[7:0]", "LED2 Pulse Amplitude (IR)");
00119             // register 0x0f
00120             Descriptions(0x0f).Add("Bit [7:0]", "LED4_PA[7:0]", "LED4 Pulse Amplitude (Green)");
00121             // register 0x10
00122             Descriptions(0x10).Add("Bit [7:0]", "PILOT_PA[7:0]", "Proximity Mode LED Pulse Amplitude");
00123             // register 0x11
00124             Descriptions(0x11).Add("Bit [6:4]", "SLOT2[2:0]", "Time slot 2");
00125             Descriptions(0x11).Add("Bit [2:0]", "SLOT1[2:0]", "Time slot 1");
00126             // register 0x12
00127             Descriptions(0x12).Add("Bit [6:4]", "SLOT4[2:0]", "Time slot 4");
00128             Descriptions(0x12).Add("Bit [2:0]", "SLOT3[2:0]", "Time slot 3");
00129             // register 0x1f
00130             Descriptions(0x1f).Add("Bit [7:0]", "TINT[7:0]", "Temperature Integer");
00131             // register 0x20
00132             Descriptions(0x20).Add("Bit [7:0]", "TFRAC[3:0]", "Temperature Fraction");
00133             // register 0x21
00134             Descriptions(0x21).Add("Bit 0", "TEMP_EN", "Temperature Enable");
00135             // register 0x30
00136             Descriptions(0x30).Add("Bit [7:0]", "PROX_INT_THRESH[7:0]", "Proximity Mode Interrupt Threshold");
00137             // register 0xfe
00138             Descriptions(0xfe).Add("Bit [7:0]", "REV_ID[7:0]", "Revision ID");
00139             // register 0xff
00140             Descriptions(0xff).Add("Bit [7:0]", "PART_ID[7:0]", "Part ID");
00141         }
00142     }
00143 }