heartrate2 2.0.0.0

Functions

void heartrate2_cfg_setup (heartrate2_cfg_t *cfg)
 Config Object Initialization function.
 
HEARTRATE2_RETVAL heartrate2_init (heartrate2_t *ctx, heartrate2_cfg_t *cfg)
 Initialization function.
 
void heartrate2_default_cfg (heartrate2_t *ctx, uint8_t cfg_led)
 Click Default Configuration function.
 
void heartrate2_generic_write (heartrate2_t *ctx, uint8_t reg_adr, uint8_t write_data)
 Generic write function.
 
uint8_t heartrate2_generic_read (heartrate2_t *ctx, uint8_t reg_adr)
 Generic read function.
 
void heartrate2_read_buf (heartrate2_t *ctx, uint8_t reg_adr, uint8_t *read_buf, uint8_t buf_size)
 Function for reading data buffer from registar.
 
void heartrate2_read_fifo (heartrate2_t *ctx, heartrate2_fifo_data_t *fifo)
 Generic function for reading data from fifo registar.
 
float heartrate2_read_temp (heartrate2_t *ctx)
 Function for reading temperature of device.
 
void heartrate2_soft_reset (heartrate2_t *ctx)
 Function for restarting device.
 
uint8_t heartrate2_ppg_config (heartrate2_t *ctx, heartrate2_ppg_cfg_t *ppg_cfg)
 Function for configurating ppg registers.
 
void heartrate2_ledpa_config (heartrate2_t *ctx, heartrate2_ledpa_t *ledpa)
 Function for configurating led pa registers.
 
uint8_t heartrate2_led_range_curr_config (heartrate2_t *ctx, heartrate2_led_range_curr_t *led_range)
 Function for configurating led current range registers.
 
uint8_t heartrate2_led_sequence_config (heartrate2_t *ctx, heartrate2_ledsq_cfg_t *ledsq)
 Function for configurating led sequence registers.
 
uint8_t heartrate2_int_control (heartrate2_t *ctx, heartrate2_int_t *int_ctrl)
 Function for configurating interrupt registers.
 
void heartrate2_int_status (heartrate2_t *ctx, heartrate2_int_t *int_status)
 Function for reading interrupt status.
 
uint8_t heartrate2_get_int (heartrate2_t *ctx)
 Function for reading int pin status.
 
uint8_t heartrate2_get_gp (heartrate2_t *ctx)
 Function for reading gp pin status.
 
void heartrate2_set_en (heartrate2_t *ctx, uint8_t state)
 Function for setting en pin status.
 

Detailed Description

Function Documentation

◆ heartrate2_cfg_setup()

void heartrate2_cfg_setup ( heartrate2_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.

◆ heartrate2_default_cfg()

void heartrate2_default_cfg ( heartrate2_t * ctx,
uint8_t cfg_led )

Click Default Configuration function.

Parameters
ctxClick object.
cfg_ledselect one of led macros to enable and set configuration for selected led ( HEARTRATE2_CONFIG_GREEN or HEARTRATE2_CONFIG_IR or HEARTRATE2_CONFIG_RED )

@description This function executes default configuration for HeartRate2 click.

◆ heartrate2_generic_read()

uint8_t heartrate2_generic_read ( heartrate2_t * ctx,
uint8_t reg_adr )

Generic read function.

Parameters
ctxClick object.
reg_adrRegister address.

@description This function reads data from the desired register.

◆ heartrate2_generic_write()

void heartrate2_generic_write ( heartrate2_t * ctx,
uint8_t reg_adr,
uint8_t write_data )

Generic write function.

Parameters
ctxClick object.
reg_adrRegister address.
data_bufData to be written.

@description This function writes data to the desired register.

◆ heartrate2_get_gp()

uint8_t heartrate2_get_gp ( heartrate2_t * ctx)

Function for reading gp pin status.

Parameters
ctxClick object.

@description This function reads gp pin status.

◆ heartrate2_get_int()

uint8_t heartrate2_get_int ( heartrate2_t * ctx)

Function for reading int pin status.

Parameters
ctxClick object.

@description This function reads int pin status.

◆ heartrate2_init()

HEARTRATE2_RETVAL heartrate2_init ( heartrate2_t * ctx,
heartrate2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ heartrate2_int_control()

uint8_t heartrate2_int_control ( heartrate2_t * ctx,
heartrate2_int_t * int_ctrl )

Function for configurating interrupt registers.

Parameters
ctxClick object.
int_ctrlStruct with stored configuration.

@description This function configure interrupt registars.

Note
Error can occure if you input values are wrong.

◆ heartrate2_int_status()

void heartrate2_int_status ( heartrate2_t * ctx,
heartrate2_int_t * int_status )

Function for reading interrupt status.

Parameters
ctxClick object.
int_statusStruct with stored configuration.

@description This function reads interrupt status.

◆ heartrate2_led_range_curr_config()

uint8_t heartrate2_led_range_curr_config ( heartrate2_t * ctx,
heartrate2_led_range_curr_t * led_range )

Function for configurating led current range registers.

Parameters
ctxClick object.
led_rangeStruct with stored configuration.

@description This function configure led current range registars.

Note
Error can occure if you input values are wrong.

◆ heartrate2_led_sequence_config()

uint8_t heartrate2_led_sequence_config ( heartrate2_t * ctx,
heartrate2_ledsq_cfg_t * ledsq )

Function for configurating led sequence registers.

Parameters
ctxClick object.
ledsqStruct with stored configuration.

@description This function configure led sequence registars.

Note
Error can occure if you input values are wrong.

◆ heartrate2_ledpa_config()

void heartrate2_ledpa_config ( heartrate2_t * ctx,
heartrate2_ledpa_t * ledpa )

Function for configurating led pa registers.

Parameters
ctxClick object.
ledpaStruct with stored configuration.

@description This function configure led pa registars.

◆ heartrate2_ppg_config()

uint8_t heartrate2_ppg_config ( heartrate2_t * ctx,
heartrate2_ppg_cfg_t * ppg_cfg )

Function for configurating ppg registers.

Parameters
ctxClick object.
ppg_cfgStruct with stored configuration.

@description This function configure ppg registars.

Note
Error can occure if you input values are wrong.

◆ heartrate2_read_buf()

void heartrate2_read_buf ( heartrate2_t * ctx,
uint8_t reg_adr,
uint8_t * read_buf,
uint8_t buf_size )

Function for reading data buffer from registar.

Parameters
ctxClick object.
reg_adrRegister address.
data_bufRead buffer to store data.
lenSize of read buffer.

@description This function reads data buffer from the desired register.

◆ heartrate2_read_fifo()

void heartrate2_read_fifo ( heartrate2_t * ctx,
heartrate2_fifo_data_t * fifo )

Generic function for reading data from fifo registar.

Parameters
ctxClick object.
fifoPointer to fifo register.

@description This function reads data buffer from the desired register.

◆ heartrate2_read_temp()

float heartrate2_read_temp ( heartrate2_t * ctx)

Function for reading temperature of device.

Parameters
ctxClick object.

@description This function reads temperature of device.

Note
You should enable die temperature interrupt status, and you should turn off leds to get right temperature.

◆ heartrate2_set_en()

void heartrate2_set_en ( heartrate2_t * ctx,
uint8_t state )

Function for setting en pin status.

Parameters
ctxClick object.

@description This function settings en pin status.

◆ heartrate2_soft_reset()

void heartrate2_soft_reset ( heartrate2_t * ctx)

Function for restarting device.

Parameters
ctxClick object.

@description This function restarts device.