oximeter5 2.0.0.0
Oximeter 5 Click Driver

API for configuring and manipulating Oximeter 5 Click driver. More...

Topics

 Oximeter 5 Registers List
 List of registers of Oximeter 5 Click driver.
 
 Oximeter 5 Registers Settings
 Settings for registers of Oximeter 5 Click driver.
 
 Oximeter 5 MikroBUS Map
 MikroBUS pin mapping of Oximeter 5 Click driver.
 

Functions

void oximeter5_cfg_setup (oximeter5_cfg_t *cfg)
 Oximeter 5 configuration object setup function.
 
err_t oximeter5_init (oximeter5_t *ctx, oximeter5_cfg_t *cfg)
 Oximeter 5 initialization function.
 
err_t oximeter5_default_cfg (oximeter5_t *ctx)
 Oximeter 5 default configuration function.
 
err_t oximeter5_generic_write (oximeter5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Oximeter 5 I2C writing function.
 
err_t oximeter5_generic_read (oximeter5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Oximeter 5 I2C reading function.
 
uint8_t oximeter5_check_interrupt (oximeter5_t *ctx)
 Oximeter 5 check interrupt function.
 
err_t oximeter5_sw_reset (oximeter5_t *ctx)
 Oximeter 5 soft reset function.
 
err_t oximeter5_read_temperature (oximeter5_t *ctx, float *temperature)
 Oximeter 5 read temperature function.
 
err_t oximeter5_set_fifo_wr_pointer (oximeter5_t *ctx, uint8_t fifo_wr_p)
 Oximeter 5 set FIFO write pointer function.
 
err_t oximeter5_set_fifo_rd_pointer (oximeter5_t *ctx, uint8_t fifo_rd_p)
 Oximeter 5 set FIFO read pointer function.
 
err_t oximeter5_set_fifo_cfg (oximeter5_t *ctx, uint8_t smp_ave, uint8_t fifo_ro_en, uint8_t fifo_a_full)
 Oximeter 5 set FIFO config function.
 
err_t oximeter5_set_mode_cfg (oximeter5_t *ctx, uint8_t mode)
 Oximeter 5 set mode config function.
 
err_t oximeter5_set_spo2_cfg (oximeter5_t *ctx, uint8_t spo2_adc_rge, uint8_t spo2_sr, uint8_t led_pw)
 Oximeter 5 set SpO2 config function.
 
err_t oximeter5_read_sensor_data (oximeter5_t *ctx, uint32_t *ir, uint32_t *red)
 Oximeter 5 get sensor data function.
 
err_t oximeter5_get_oxygen_saturation (uint32_t *pun_ir_buffer, int32_t n_ir_buffer_length, uint32_t *pun_red_buffer, uint8_t *pn_spo2)
 Oximeter 5 get oxygen saturation function.
 
err_t oximeter5_get_heart_rate (uint32_t *pun_ir_buffer, int32_t n_ir_buffer_length, uint32_t *pun_red_buffer, int32_t *pn_heart_rate)
 Oximeter 5 get heart rate function.
 

Detailed Description

API for configuring and manipulating Oximeter 5 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ oximeter5_cfg_setup()

void oximeter5_cfg_setup ( oximeter5_cfg_t * cfg)

Oximeter 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See oximeter5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ oximeter5_check_interrupt()

uint8_t oximeter5_check_interrupt ( oximeter5_t * ctx)

Oximeter 5 check interrupt function.

This function get states of the INT pin of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_default_cfg()

err_t oximeter5_default_cfg ( oximeter5_t * ctx)

Oximeter 5 default configuration function.

This function executes a default configuration of Oximeter 5 click board.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ oximeter5_generic_read()

err_t oximeter5_generic_read ( oximeter5_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Oximeter 5 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_generic_write()

err_t oximeter5_generic_write ( oximeter5_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Oximeter 5 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_get_heart_rate()

err_t oximeter5_get_heart_rate ( uint32_t * pun_ir_buffer,
int32_t n_ir_buffer_length,
uint32_t * pun_red_buffer,
int32_t * pn_heart_rate )

Oximeter 5 get heart rate function.

This function read heart rate data autoincrements the register address pointer of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]pun_ir_buffer: IR ADC data buffer pointer.
[in]n_ir_buffer_length: Number of IR ADC data buffer.
[in]pun_red_buffer: IR ADC data buffer pointer.
[out]pn_heart_rate: Heart rate data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_get_oxygen_saturation()

err_t oximeter5_get_oxygen_saturation ( uint32_t * pun_ir_buffer,
int32_t n_ir_buffer_length,
uint32_t * pun_red_buffer,
uint8_t * pn_spo2 )

Oximeter 5 get oxygen saturation function.

This function get oxygen saturation data autoincrements the register address pointer of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]pun_ir_buffer: IR ADC data buffer pointer.
[in]n_ir_buffer_length: Number of IR ADC data buffer.
[in]pun_red_buffer: IR ADC data buffer pointer.
[out]pn_spo2: SpO2 Oxygen saturation data, from 0 percent to 100 percent.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Oxygen saturation is the fraction of oxygen-saturated hemoglobin relative to total hemoglobin (unsaturated + saturated) in the blood. The human body requires and regulates a very precise and specific balance of oxygen in the blood. Normal arterial blood oxygen saturation levels in humans are 95–100 percent.

◆ oximeter5_init()

err_t oximeter5_init ( oximeter5_t * ctx,
oximeter5_cfg_t * cfg )

Oximeter 5 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See oximeter5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_read_sensor_data()

err_t oximeter5_read_sensor_data ( oximeter5_t * ctx,
uint32_t * ir,
uint32_t * red )

Oximeter 5 get sensor data function.

This function read sensor data autoincrements the register address pointer of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[out]ir: IR ADC data.
[out]red: Red ADC data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The data FIFO consists of a 32-sample memory bank that can store IR and Red ADC data.

◆ oximeter5_read_temperature()

err_t oximeter5_read_temperature ( oximeter5_t * ctx,
float * temperature )

Oximeter 5 read temperature function.

This function reads a temperature data of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[out]temperature: Temperature in degree Celsius.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_set_fifo_cfg()

err_t oximeter5_set_fifo_cfg ( oximeter5_t * ctx,
uint8_t smp_ave,
uint8_t fifo_ro_en,
uint8_t fifo_a_full )

Oximeter 5 set FIFO config function.

This function set FIFO configuration of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]smp_ave: Sample Averaging data.
[in]fifo_ro_en: FIFO Rolls on Full enable data.
[in]fifo_a_full: FIFO Almost Full Value.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_set_fifo_rd_pointer()

err_t oximeter5_set_fifo_rd_pointer ( oximeter5_t * ctx,
uint8_t fifo_rd_p )

Oximeter 5 set FIFO read pointer function.

This function set FIFO read points to the location of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]fifo_rd_p: FIFO read pointer points data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This pointer advances for each sample pushed on to the FIFO.

◆ oximeter5_set_fifo_wr_pointer()

err_t oximeter5_set_fifo_wr_pointer ( oximeter5_t * ctx,
uint8_t fifo_wr_p )

Oximeter 5 set FIFO write pointer function.

This function set FIFO write points to the location of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]fifo_wr_p: FIFO write pointer points data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This pointer advances for each sample pushed on to the FIFO.

◆ oximeter5_set_mode_cfg()

err_t oximeter5_set_mode_cfg ( oximeter5_t * ctx,
uint8_t mode )

Oximeter 5 set mode config function.

This function set mode configuration of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]mode: Mode Control data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_set_spo2_cfg()

err_t oximeter5_set_spo2_cfg ( oximeter5_t * ctx,
uint8_t spo2_adc_rge,
uint8_t spo2_sr,
uint8_t led_pw )

Oximeter 5 set SpO2 config function.

This function set SpO2 configuration of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
[in]spo2_adc_rge: SpO2 ADC Range Control data.
[in]spo2_sr: SpO2 Sample Rate Control data.
[in]led_pw: LED Pulse Width Control and ADC Resolution data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ oximeter5_sw_reset()

err_t oximeter5_sw_reset ( oximeter5_t * ctx)

Oximeter 5 soft reset function.

This function executes a software reset of the MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health on the Oximeter 5 Click board™.

Parameters
[in]ctx: Click context object. See oximeter5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.