heartrate 2.0.0.0

Functions

void heartrate_cfg_setup (heartrate_cfg_t *cfg)
 Config Object Initialization function.
 
HEARTRATE_RETVAL heartrate_init (heartrate_t *ctx, heartrate_cfg_t *cfg)
 Initialization function.
 
void heartrate_default_cfg (heartrate_t *ctx)
 Click Default Configuration function.
 
uint8_t heartrate_get_revision_id (heartrate_t *ctx)
 Function for getting revision ID.
 
uint8_t heartrate_get_part_id (heartrate_t *ctx)
 Function for getting part ID.
 
uint8_t heartrate_get_config (heartrate_t *ctx)
 Function for getting configuration of the chip.
 
uint8_t heartrate_get_status (heartrate_t *ctx)
 Function for getting status of heartrate click.
 
void heartrate_set_config (heartrate_t *ctx, uint8_t cfg)
 Function for configuration heartrate chip.
 
void heartrate_set_interrupt (heartrate_t *ctx, uint8_t intrpts)
 Function for setting interrupt for heartrate click.
 
uint8_t heartrate_read_ir_red (heartrate_t *ctx, uint16_t *ir_buff, uint16_t *red_buff)
 Function for reading IR and RED values.
 
void heartrate_read_temp (heartrate_t *ctx, uint16_t *temp_value)
 Function for reading temperature.
 
uint8_t heartrate_data_ready (heartrate_t *ctx)
 Function checking if the data is ready for reading.
 
void heartrate_generic_write (heartrate_t *ctx, uint8_t reg, uint16_t len, uint8_t *data_buf)
 Generic write function.
 
void heartrate_generic_read (heartrate_t *ctx, uint8_t reg, uint16_t len, uint8_t *data_buf)
 Generic read function.
 
void hr_shut_down (heartrate_t *ctx, bool enable)
 Shut down function.
 
void hr_reset (heartrate_t *ctx)
 Reset function.
 
void hr_temp_enable (heartrate_t *ctx, bool enable)
 Single temperature reading function.
 
int8_t hr_set_mode (heartrate_t *ctx, uint8_t mode)
 Set mode function.
 
void hr_spo2_high_res_enable (heartrate_t *ctx, bool enable)
 Function for setting the SpO2 ADC resolution.
 
uint8_t hr_spo2_set_sample_rate (heartrate_t *ctx, uint8_t sample_rate)
 Function for setting.
 
uint8_t hr_set_led_pulse_width (heartrate_t *ctx, uint8_t _value)
 Function for setting LED pulse width.
 
uint8_t hr_set_red_current_level (heartrate_t *ctx, uint8_t level)
 Function for setting Red LED.
 
uint8_t hr_set_ir_current_level (heartrate_t *ctx, uint8_t level)
 Function for setting.
 
void hr_fifo_almost_full_int_enable (heartrate_t *ctx, bool enable)
 Function to enable/disable the FIFO almost full interrupt.
 
void hr_temp_ready_int_enable (heartrate_t *ctx, bool enable)
 Function to enable/disable the temperature data ready interrupt.
 
void hr_heartrate_data_ready_int_enable (heartrate_t *ctx, bool enable)
 Function to enable/disable heart rate data ready interrupt.
 
void hr_heartrate_spo2_data_ready_int_enable (heartrate_t *ctx, bool enable)
 Function to enable/disable the SpO2 data ready.
 
uint8_t hr_read_diodes (heartrate_t *ctx, uint16_t *ir_buff, uint16_t *red_buff)
 Function for reading the ADC values of the IR and RED LEDs from the FIFO buffer.
 
uint8_t hr_get_status (heartrate_t *ctx)
 Function for getting the value read from the interrupt status register.
 

Detailed Description

Function Documentation

◆ heartrate_cfg_setup()

void heartrate_cfg_setup ( heartrate_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ heartrate_data_ready()

uint8_t heartrate_data_ready ( heartrate_t * ctx)

Function checking if the data is ready for reading.

Parameters
ctxClick object.
Returns
1 - data ready; 0 - data not ready

@description Using this function we can check if the data is ready for reading

◆ heartrate_default_cfg()

void heartrate_default_cfg ( heartrate_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for HeartRate click.

◆ heartrate_generic_read()

void heartrate_generic_read ( heartrate_t * ctx,
uint8_t reg,
uint16_t len,
uint8_t * data_buf )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ heartrate_generic_write()

void heartrate_generic_write ( heartrate_t * ctx,
uint8_t reg,
uint16_t len,
uint8_t * data_buf )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ heartrate_get_config()

uint8_t heartrate_get_config ( heartrate_t * ctx)

Function for getting configuration of the chip.

Parameters
ctxClick object.

@description Using this function we can get configuration of the chip.

◆ heartrate_get_part_id()

uint8_t heartrate_get_part_id ( heartrate_t * ctx)

Function for getting part ID.

Parameters
ctxClick object.

@description Using this function we can get part ID.

◆ heartrate_get_revision_id()

uint8_t heartrate_get_revision_id ( heartrate_t * ctx)

Function for getting revision ID.

Parameters
ctxClick object.

@description Using this function we can get revision ID.

◆ heartrate_get_status()

uint8_t heartrate_get_status ( heartrate_t * ctx)

Function for getting status of heartrate click.

Parameters
ctxClick object.

@description Using this function we can get status of heartrate click.

◆ heartrate_init()

HEARTRATE_RETVAL heartrate_init ( heartrate_t * ctx,
heartrate_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ heartrate_read_ir_red()

uint8_t heartrate_read_ir_red ( heartrate_t * ctx,
uint16_t * ir_buff,
uint16_t * red_buff )

Function for reading IR and RED values.

Parameters
ctxClick object.
ir_buffIR values.
red_buffRED values.
Returns
0 - if success

@description Using this function we can read IR and RED values.

◆ heartrate_read_temp()

void heartrate_read_temp ( heartrate_t * ctx,
uint16_t * temp_value )

Function for reading temperature.

Parameters
ctxClick object.
temp_valueTemperature value to be read.

@description Using this function we can read temperature.

◆ heartrate_set_config()

void heartrate_set_config ( heartrate_t * ctx,
uint8_t cfg )

Function for configuration heartrate chip.

Parameters
ctxClick object.
cfgConfing byte.

@description Using this function we can configure heartrate chip.

◆ heartrate_set_interrupt()

void heartrate_set_interrupt ( heartrate_t * ctx,
uint8_t intrpts )

Function for setting interrupt for heartrate click.

Parameters
ctxClick object.
intrptsInterrup.

@description Using this function we can set interrupt for heartrate click.

◆ hr_fifo_almost_full_int_enable()

void hr_fifo_almost_full_int_enable ( heartrate_t * ctx,
bool enable )

Function to enable/disable the FIFO almost full interrupt.

Parameters
ctxClick object.
enableTrue - interrupt enabled, false - interrupt disabled

@description Enables/disables the FIFO almost full interrupt

◆ hr_get_status()

uint8_t hr_get_status ( heartrate_t * ctx)

Function for getting the value read from the interrupt status register.

Parameters
ctxClick object.
Returns
the status value

@description Returns the value read from the interrupt status register. The value shows which interrupts have been trigerred

◆ hr_heartrate_data_ready_int_enable()

void hr_heartrate_data_ready_int_enable ( heartrate_t * ctx,
bool enable )

Function to enable/disable heart rate data ready interrupt.

Parameters
ctxClick object.
enableTrue - interrupt enabled, false - interrupt disabled

@description Enables/disables heart rate data ready interrupt

◆ hr_heartrate_spo2_data_ready_int_enable()

void hr_heartrate_spo2_data_ready_int_enable ( heartrate_t * ctx,
bool enable )

Function to enable/disable the SpO2 data ready.

Parameters
ctxClick object.
enableTrue - interrupt enabled, false - interrupt disabled

@description Enables/disables the SpO2 data ready

◆ hr_read_diodes()

uint8_t hr_read_diodes ( heartrate_t * ctx,
uint16_t * ir_buff,
uint16_t * red_buff )

Function for reading the ADC values of the IR and RED LEDs from the FIFO buffer.

Parameters
ctxClick object.
ir_bufferBuffer to which to store the IR LED values
red_bufferBuffer to which to store the RED LED values
Returns
the number of samples

@description Reads the ADC values of the IR and RED LEDs from the FIFO buffer, and stores them into the given buffers.

◆ hr_reset()

void hr_reset ( heartrate_t * ctx)

Reset function.

Parameters
ctxClick object.

@description All configuration, threshold, and data registers are reset to their power-on-state.

◆ hr_set_ir_current_level()

uint8_t hr_set_ir_current_level ( heartrate_t * ctx,
uint8_t level )

Function for setting.

Parameters
ctxClick object.
levelDesired current level as stated in the datasheet
Returns
-1 if failed, 0 if successful

@description Sets the current level of the IR LED.

◆ hr_set_led_pulse_width()

uint8_t hr_set_led_pulse_width ( heartrate_t * ctx,
uint8_t _value )

Function for setting LED pulse width.

Parameters
ctxClick object.
_valueDesired pulse width as stated in the datasheet
Returns
-1 if failed, 0 if successful

@description Sets the (the IR and RED have the same pulse width)

◆ hr_set_mode()

int8_t hr_set_mode ( heartrate_t * ctx,
uint8_t mode )

Set mode function.

Parameters
ctxClick object.
modeDesired mode as stated in the datasheet
Returns
-1 if failed, 0 if successful

@description Sets the operating state of the MAX30100

◆ hr_set_red_current_level()

uint8_t hr_set_red_current_level ( heartrate_t * ctx,
uint8_t level )

Function for setting Red LED.

Parameters
ctxClick object.
levelDesired current level as stated in the datasheet
Returns
-1 if failed, 0 if successful

@description Sets the current level of the Red LED.

◆ hr_shut_down()

void hr_shut_down ( heartrate_t * ctx,
bool enable )

Shut down function.

Parameters
ctxClick object.
enableTrue - enables shut down, false - disables

@description Enables/disables power saving mode. While in power-save mode, all registers retain their values, and write/read operations function as normal.

Note
All interrupts are cleared to zero in this mode.

◆ hr_spo2_high_res_enable()

void hr_spo2_high_res_enable ( heartrate_t * ctx,
bool enable )

Function for setting the SpO2 ADC resolution.

Parameters
ctxClick object.
enableTrue - enables SpO2 high resolution, False - disables

@description Sets the SpO2 ADC resolution to 16-bit with 1.6ms LED pulse width.

◆ hr_spo2_set_sample_rate()

uint8_t hr_spo2_set_sample_rate ( heartrate_t * ctx,
uint8_t sample_rate )

Function for setting.

Parameters
ctxClick object.
sample_rateDesired sample rate as stated in the datasheet
Returns
-1 if failed, 0 if successful

@description Sets the operating state of the MAX30100

◆ hr_temp_enable()

void hr_temp_enable ( heartrate_t * ctx,
bool enable )

Single temperature reading function.

Parameters
ctxClick object.
enableTrue - enables the reading, false - disables

@description Initiates a single temperature reading from the temperature sensor. This bit is cleared automatically back to zero at the conclusion of the temperature reading when the bit is set to one in heart rate or SpO2 mode.

◆ hr_temp_ready_int_enable()

void hr_temp_ready_int_enable ( heartrate_t * ctx,
bool enable )

Function to enable/disable the temperature data ready interrupt.

Parameters
ctxClick object.
enableTrue - interrupt enabled, false - interrupt disabled

@description Enables/disables the temperature data ready interrupt