heartrate10 2.0.0.0
Heart Rate 10 Click Driver

API for configuring and manipulating Heart Rate 10 Click driver. More...

Topics

 Heart Rate 10 Registers List
 List of registers of Heart Rate 10 Click driver.
 
 Heart Rate 10 Registers Settings
 Settings for registers of Heart Rate 10 Click driver.
 
 Heart Rate 10 MikroBUS Map
 MikroBUS pin mapping of Heart Rate 10 Click driver.
 

Functions

void heartrate10_cfg_setup (heartrate10_cfg_t *cfg)
 Heart Rate 10 configuration object setup function.
 
err_t heartrate10_init (heartrate10_t *ctx, heartrate10_cfg_t *cfg)
 Heart Rate 10 initialization function.
 
err_t heartrate10_default_cfg (heartrate10_t *ctx)
 Heart Rate 10 default configuration function.
 
err_t heartrate10_generic_write (heartrate10_t *ctx, uint8_t reg, uint8_t tx_data)
 Writing function.
 
err_t heartrate10_generic_read (heartrate10_t *ctx, uint8_t reg, uint8_t *rx_data)
 Reading function.
 
uint8_t heartrate10_get_int_pin (heartrate10_t *ctx)
 Get interrupt pin state.
 
void heartrate10_reset (heartrate10_t *ctx)
 Reset device.
 
err_t heartrate10_fifo_read (heartrate10_t *ctx, uint8_t *rx_buf, uint8_t rx_len)
 Read fifo register data.
 
uint32_t heartrate10_read_fifo_sample (heartrate10_t *ctx)
 Read single sample of FIFO data.
 
err_t heartrate10_read_complete_fifo_data (heartrate10_t *ctx, uint32_t *led1, uint32_t *led2, uint32_t *led3, uint32_t *led4)
 Read all led samples.
 

Detailed Description

API for configuring and manipulating Heart Rate 10 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

◆ heartrate10_cfg_setup()

void heartrate10_cfg_setup ( heartrate10_cfg_t * cfg)

Heart Rate 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ heartrate10_default_cfg()

err_t heartrate10_default_cfg ( heartrate10_t * ctx)

Heart Rate 10 default configuration function.

This function executes a default configuration of Heart Rate 10 click board.

Parameters
[in]ctx: Click context object. See heartrate10_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.

◆ heartrate10_fifo_read()

err_t heartrate10_fifo_read ( heartrate10_t * ctx,
uint8_t * rx_buf,
uint8_t rx_len )

Read fifo register data.

This function reads a data from the HEARTRATE10_REG_FIFO_DATA.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
[out]rx_buf: Output read data.
[in]rx_len: Length of data to read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ heartrate10_generic_read()

err_t heartrate10_generic_read ( heartrate10_t * ctx,
uint8_t reg,
uint8_t * rx_data )

Reading function.

This function reads a data from the selected register.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
[in]reg: Register address.
[out]rx_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ heartrate10_generic_write()

err_t heartrate10_generic_write ( heartrate10_t * ctx,
uint8_t reg,
uint8_t tx_data )

Writing function.

This function writes a data to the selected register.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_data: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ heartrate10_get_int_pin()

uint8_t heartrate10_get_int_pin ( heartrate10_t * ctx)

Get interrupt pin state.

Read and return int_pin state.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
Returns
Pin state

See #err_t definition for detailed explanation.

◆ heartrate10_init()

err_t heartrate10_init ( heartrate10_t * ctx,
heartrate10_cfg_t * cfg )

Heart Rate 10 initialization function.

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

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

◆ heartrate10_read_complete_fifo_data()

err_t heartrate10_read_complete_fifo_data ( heartrate10_t * ctx,
uint32_t * led1,
uint32_t * led2,
uint32_t * led3,
uint32_t * led4 )

Read all led samples.

This function reads a 12 bytes from FIFO data register and concatenates data into 4 x 19bit led data.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
[out]led1: Led1 output read data.
[out]led2: Led2 output read data.
[out]led3: Led3 output read data.
[out]led4: Led4 output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function will read four samples of data for four led diodes it assumes that there are 4 leds enabled and set in sequence register.

◆ heartrate10_read_fifo_sample()

uint32_t heartrate10_read_fifo_sample ( heartrate10_t * ctx)

Read single sample of FIFO data.

This function reads a 3 bytes from FIFO data register and concatenates data into 19bit led data.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
Returns
Led data.
Note
This function will read sample of data for four led diod it assumes that there is at least one led enabled and set in sequence register.

◆ heartrate10_reset()

void heartrate10_reset ( heartrate10_t * ctx)

Reset device.

Set bit for reseting device and waits untill bit is cleared.

Parameters
[in]ctx: Click context object. See heartrate10_t object definition for detailed explanation.
Returns
Nothing.