MAX32620HSP ECG with lead off detection

Dependencies:   mbed HSP_ECG MAX14720 USBDevice

Embed: (wiki syntax)

« Back to documentation index

MAX30101 Class Reference

Maxim Integrated MAX30101 Oximeter chip. More...

#include <MAX30101.h>

Data Structures

union  max30101_fifo_configuration_reg
 FIFO_CONFIGURATION (0x08) More...
union  max30101_fifo_rd_ptr_reg
 FIFO_READ_PTR (0x06) More...
union  max30101_fifo_wr_ptr_reg
 FIFO_WR_PTR (0x04) More...
union  max30101_Interrupt_Enable_1_reg
 INTERRUPT_ENABLE1 (0x02) More...
union  max30101_Interrupt_Enable_2_reg
 INTERRUPT_ENABLE2 (0x03) More...
union  max30101_Interrupt_Status_1_reg
 STATUS1 (0x00) More...
union  max30101_Interrupt_Status_2_reg
 STATUS2 (0x01) More...
union  max30101_mode_configuration_reg
 MODE_CONFIGURATION (0x09) More...
union  max30101_ovf_counter_reg
 OVF_COUNTER (0x05) More...
union  max30101_spo2_configuration_reg
 SPO2_CONGIGURATION (0x0A) More...

Public Types

typedef void(* DataCallbackFunction )(uint32_t id, uint32_t *buffer, uint32_t length)
 type definition for data interrupt
typedef void(* InterruptFunction )()
 type definition for general interrupt

Public Member Functions

 MAX30101 (PinName sda, PinName scl, int slaveAddress)
 MAX30101 constructor.
 MAX30101 (I2C *i2c, int slaveAddress)
 MAX30101 constructor.
 ~MAX30101 (void)
 MAX30101 destructor.
int i2c_reg_read (MAX30101_REG_map_t reg, char *value)
 Allows reading from MAX30101 register.
int i2c_reg_write (MAX30101_REG_map_t reg, char value)
 Allows writing to MAX30101 register.
int SpO2mode_init (uint8_t fifo_waterlevel_mark, uint8_t sample_avg, uint8_t sample_rate, uint8_t pulse_width, uint8_t red_led_current, uint8_t ir_led_current)
 This function sets up for the SpO2 mode.
int SpO2mode_stop (void)
 This function will stop the SpO2 mode and turn off all operating LED�s.
int HRmode_init (uint8_t fifo_waterlevel_mark, uint8_t sample_avg, uint8_t sample_rate, uint8_t pulse_width, uint8_t red_led_current)
 This function sets up for the HR mode.
int HRmode_stop (void)
 This function will stop the HR mode and turn off all operating LED’s.
int Multimode_init (uint8_t fifo_waterlevel_mark, uint8_t sample_avg, uint8_t sample_rate, uint8_t pulse_width, uint8_t red_led_current, uint8_t ir_led_current, uint8_t green_led_current, uint8_t slot_1, uint8_t slot_2, uint8_t slot_3, uint8_t slot_4)
 This function sets up for the Multi-mode.
int Multimode_stop (void)
 This function will stop the Multi-mode and turn off all operating LED’s.
int tempread (void)
 This is a function that sets up for temperature read and should be called after one of the mode.
int int_handler (void)
 This is a callback function which collects the data from the FIFO of the MAX30101 in a 32-bit.
void onInterrupt (InterruptFunction _onInterrupt)
 Used to connect a callback for when interrupt data is available.
void onDataAvailable (DataCallbackFunction _onDataAvailable)
 Used to connect a callback for when interrupt data is available.
void MAX30101_OnInterrupt (void)
 Interrupt callback.

Data Fields

uint8_t max30101_led1_pa
 LED1_PA (0x0C)
uint8_t max30101_led2_pa
 LED2_PA (0x0D)
uint8_t max30101_led3_pa
 LED3_PA (0x0E)
uint8_t max30101_pilot_pa
 PILOT_PA (0x10)

Detailed Description

Maxim Integrated MAX30101 Oximeter chip.

Definition at line 60 of file MAX30101.h.


Member Typedef Documentation

typedef void(* DataCallbackFunction)(uint32_t id, uint32_t *buffer, uint32_t length)

type definition for data interrupt

Definition at line 404 of file MAX30101.h.

typedef void(* InterruptFunction)()

type definition for general interrupt

Definition at line 409 of file MAX30101.h.


Constructor & Destructor Documentation

MAX30101 ( PinName  sda,
PinName  scl,
int  slaveAddress 
)

MAX30101 constructor.

Parameters:
sdambed pin to use for SDA line of I2C interface.
sclmbed pin to use for SCL line of I2C interface.

Definition at line 41 of file MAX30101.cpp.

MAX30101 ( I2C *  i2c,
int  slaveAddress 
)

MAX30101 constructor.

Parameters:
i2cI2C object to use.

Definition at line 52 of file MAX30101.cpp.

~MAX30101 ( void   )

MAX30101 destructor.

Definition at line 63 of file MAX30101.cpp.


Member Function Documentation

int HRmode_init ( uint8_t  fifo_waterlevel_mark,
uint8_t  sample_avg,
uint8_t  sample_rate,
uint8_t  pulse_width,
uint8_t  red_led_current 
)

This function sets up for the HR mode.

The data is returned in thecallback function max30101_int_handler in global array: buffer[].HR mode handles one LED (Red) data. Hence it can fill up the FIFO up to a maximum of 3bytes/sample x 32 = 96bytes. fifo_waterlevel_mark: corresponds to FIFO_A_FULL, In FIFO Configuration Register (0x08)

Parameters:
sample_avg,:corresponds to SMP_AVE, in FIFO Configuration Register (0x08)
sample_rate:correspondsto SPO2_SR, IN SpO2 Configuration Register (0x0A)
pulse_width,:corresponds to LED_PW in SpO2 Configuration Register(0x0A)
red_led_current,:corresponds to LED1_PA register (0x0C). Please see data sheet for values
Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 350 of file MAX30101.cpp.

int HRmode_stop ( void   )

This function will stop the HR mode and turn off all operating LED’s.

Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 431 of file MAX30101.cpp.

int i2c_reg_read ( MAX30101_REG_map_t  reg,
char *  value 
)

Allows reading from MAX30101 register.

Parameters:
reg,:is the register address, to read from (look at max30101.h and the data sheet for details)
value,:is the pointer to the value read from the register
Returns:
0-if no error. A non-zero value indicates an error.

Definition at line 619 of file MAX30101.cpp.

int i2c_reg_write ( MAX30101_REG_map_t  reg,
char  value 
)

Allows writing to MAX30101 register.

Parameters:
reg,:is the register address, to read from (look at max30101.h and the data sheet for details)
value,:is the value to write to the register
Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 608 of file MAX30101.cpp.

int int_handler ( void   )

This is a callback function which collects the data from the FIFO of the MAX30101 in a 32-bit.

unsigned global array called max30101_buffer[]. Upon every interrupt from the MAX30101, this function is called to service the FIFO of the MAX30101. This callback function also services the interrupt for the temp data. The temp data is collected in a floating point global variable final_temp.

Parameters:
max30101_buffer[],globaluint32_t
Returns:
0-if everything is good. A non-zero value indicates an error.

Definition at line 70 of file MAX30101.cpp.

void MAX30101_OnInterrupt ( void   )

Interrupt callback.

int Multimode_init ( uint8_t  fifo_waterlevel_mark,
uint8_t  sample_avg,
uint8_t  sample_rate,
uint8_t  pulse_width,
uint8_t  red_led_current,
uint8_t  ir_led_current,
uint8_t  green_led_current,
uint8_t  slot_1,
uint8_t  slot_2,
uint8_t  slot_3,
uint8_t  slot_4 
)

This function sets up for the Multi-mode.

The data is returned in the callback function max30101_int_handler in global array: buffer[]. Multi-LED mode can handle 1 to 4 LED combinations. Hence it can fill up the FIFO up to a maximum of 3bytes/sample x 32 x 4 = 384bytes.

Parameters:
fifo_waterlevel_mark,:corresponds to FIFO_A_FULL, In FIFO Configuration Register (0x08)
sample_avg,:corresponds to SMP_AVE, in FIFO Configuration Register (0x08)
sample_rate:correspondsto SPO2_SR, IN SpO2 Configuration Register (0x0A)
pulse_width,:corresponds to LED_PW in SpO2 Configuration register(0x0A)
red_led_current,:corresponds to LED1_PA register (0x0C). Please see data sheet for values
ir_led_current,:corresponds to LED2_PA register (0x0D). Please see data sheet for values
green_led_current,:corresponds to LED3_PA register (0x0E). Please see data sheet for values
slot_1,…,slot_4,:corresponds to Multi-LED Mode control Registers (0x11-0x12).
Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 454 of file MAX30101.cpp.

int Multimode_stop ( void   )

This function will stop the Multi-mode and turn off all operating LED’s.

Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 560 of file MAX30101.cpp.

void onDataAvailable ( DataCallbackFunction  _onDataAvailable )

Used to connect a callback for when interrupt data is available.

Definition at line 666 of file MAX30101.cpp.

void onInterrupt ( InterruptFunction  _onInterrupt )

Used to connect a callback for when interrupt data is available.

Definition at line 683 of file MAX30101.cpp.

int SpO2mode_init ( uint8_t  fifo_waterlevel_mark,
uint8_t  sample_avg,
uint8_t  sample_rate,
uint8_t  pulse_width,
uint8_t  red_led_current,
uint8_t  ir_led_current 
)

This function sets up for the SpO2 mode.

The data is returned in the callback function max30101_int_handler in global array: buffer[]. SP mode handles two LED (Red,IR) data. Hence it can fill up the FIFO up to a maximum of 3bytes/sample x 32 x 2 = 192bytes.

Parameters:
fifo_waterlevel_mark,:corresponds to FIFO_A_FULL, In FIFO Configuration Register (0x08)
sample_avg,:corresponds to SMP_AVE, in FIFO Configuration Register (0x08)
sample_rate,:corresponds to SPO2_SR, IN SpO2 Configuration Register (0x0A)
pulse_width,:corresponds to LED_PW in SpO2 Configuration register(0x0A)
red_led_current,:corresponds to LED1_PA register (0x0C). Please see data sheet for values
ir_led_current,:corresponds to LED2_PA register (0x0D). Please see data sheet for values
Returns:
0-if everything is good. A non-zero value indicates an error.

Definition at line 238 of file MAX30101.cpp.

int SpO2mode_stop ( void   )

This function will stop the SpO2 mode and turn off all operating LED�s.

Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 322 of file MAX30101.cpp.

int tempread ( void   )

This is a function that sets up for temperature read and should be called after one of the mode.

has been setup. The data is returned in the callback function max30101_int_handler. This function needs to be called every time temperature reading is required. Call the temp function after one of the MODES have been started Note that the temp is disabled after one read... also, it is not necessary to read the temp frequently...

Returns:
0-if if no error. A non-zero value indicates an error.

Definition at line 592 of file MAX30101.cpp.


Field Documentation

LED1_PA (0x0C)

Definition at line 218 of file MAX30101.h.

LED2_PA (0x0D)

Definition at line 221 of file MAX30101.h.

LED3_PA (0x0E)

Definition at line 224 of file MAX30101.h.

PILOT_PA (0x10)

Definition at line 227 of file MAX30101.h.