heartrate8 2.0.0.0
heartrate8.h File Reference

This file contains API for Heart Rate 8 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  heartrate8_t
 Click ctx object definition. More...
 
struct  heartrate8_cfg_t
 Click configuration structure definition. More...
 

Macros

#define HEARTRATE8_MAP_MIKROBUS(cfg, mikrobus)
 
#define HEARTRATE8_RETVAL   uint8_t
 
#define HEARTRATE8_OK   0x00
 
#define HEARTRATE8_INIT_ERROR   0xFF
 
#define HEARTRATE8_SLAVE_ADDR   0x5B
 
#define HEARTRATE8_MANUFACT_ID_REG   0x0F
 
#define HEARTRATE8_PART_ID_REG   0x10
 
#define HEARTRATE8_RESET_REG   0x40
 
#define HEARTRATE8_MEAS_CTRL1_REG   0x41
 
#define HEARTRATE8_MEAS_CTRL2_REG   0x42
 
#define HEARTRATE8_MEAS_CTRL3_REG   0x43
 
#define HEARTRATE8_MEAS_CTRL4_LSB_REG   0x44
 
#define HEARTRATE8_MEAS_CTRL4_MSB_REG   0x45
 
#define HEARTRATE8_MEAS_CTRL5_REG   0x46
 
#define HEARTRATE8_MEAS_START_REG   0x47
 
#define HEARTRATE8_MEAS_SYNC_REG   0x48
 
#define HEARTRATE8_FIFO_LEV_REG   0x4B
 
#define HEARTRATE8_FIFO_DATA0_LSB_REG   0x4C
 
#define HEARTRATE8_FIFO_DATA0_MSB_REG   0x4D
 
#define HEARTRATE8_FIFO_DATA1_LSB_REG   0x4E
 
#define HEARTRATE8_FIFO_DATA1_MSB_REG   0x4F
 
#define HEARTRATE8_IRDATA_LEDOFF_LSB_REG   0x50
 
#define HEARTRATE8_IRDATA_LEDOFF_MSB_REG   0x51
 
#define HEARTRATE8_IRDATA_LEDON_LSB_REG   0x52
 
#define HEARTRATE8_IRDATA_LEDON_MSB_REG   0x53
 
#define HEARTRATE8_GDATA_LEDOFF_LSB_REG   0x54
 
#define HEARTRATE8_GDATA_LEDOFF_MSB_REG   0x55
 
#define HEARTRATE8_GDATA_LEDON_LSB_REG   0x56
 
#define HEARTRATE8_GDATA_LEDON_MSB_REG   0x57
 
#define HEARTRATE8_INT_CLEAR_REG   0x58
 
#define HEARTRATE8_RESET_CMD   0x80
 
#define HEARTRATE8_OSC_ACTIVE   0x80
 
#define HEARTRATE8_GREEN_MEAS_MODE   0x00
 
#define HEARTRATE8_IR_MEAS_MODE   0x10
 
#define HEARTRATE8_32HZ_MEAS_MODE   0x00
 
#define HEARTRATE8_128HZ_MEAS_MODE   0x01
 
#define HEARTRATE8_64HZ_MEAS_MODE   0x02
 
#define HEARTRATE8_256HZ_MEAS_MODE   0x03
 
#define HEARTRATE8_1024HZ_MEAS_MODE   0x05
 
#define HEARTRATE8_NON_SYNC_MEAS_MODE   0x06
 
#define HEARTRATE8_SINGLE_MEAS_MODE   0x07
 
#define HEARTRATE8_LEDS_PULSED   0x00
 
#define HEARTRATE8_LED1_ON   0x40
 
#define HEARTRATE8_LED2_ON   0x80
 
#define HEARTRATE8_LEDS_ON   0xC0
 
#define HEARTRATE8_LED3_OFF   0x00
 
#define HEARTRATE8_LED3_ON   0x80
 
#define HEARTRATE8_STOP_EMISSION   0x00
 
#define HEARTRATE8_LED_CURR_1MA   0x01
 
#define HEARTRATE8_LED_CURR_2MA   0x02
 
#define HEARTRATE8_LED_CURR_5MA   0x05
 
#define HEARTRATE8_LED_CURR_10MA   0x0A
 
#define HEARTRATE8_LED_CURR_15MA   0x0F
 
#define HEARTRATE8_LED_CURR_20MA   0x14
 
#define HEARTRATE8_LED_CURR_25MA   0x19
 
#define HEARTRATE8_LED_CURR_30MA   0x1E
 
#define HEARTRATE8_LED_CURR_35MA   0x23
 
#define HEARTRATE8_LED_CURR_40MA   0x28
 
#define HEARTRATE8_LED_CURR_45MA   0x2D
 
#define HEARTRATE8_LED_CURR_50MA   0x32
 
#define HEARTRATE8_LED_CURR_55MA   0x37
 
#define HEARTRATE8_LED_CURR_60MA   0x3C
 
#define HEARTRATE8_LED_CURR_63MA   0x3F
 
#define HEARTRATE8_INT_DISABLE   0x00
 
#define HEARTRATE8_INT_WATER_MARK_FIFO   0x01
 
#define HEARTRATE8_INT_IR_THRESH   0x02
 
#define HEARTRATE8_INT_MEAS_COMPLET   0x03
 
#define HEARTRATE8_MEAS_START_CMD   0x01
 
#define HEARTRATE8_MEAS_SYNC_CMD   0x01
 
#define HEARTRATE8_FIFO_DATA_GET   0x00
 
#define HEARTRATE8_IR_DATA_GET   0x01
 
#define HEARTRATE8_GREEN_DATA_GET   0x02
 
#define HEARTRATE8_OK   0x00
 
#define HEARTRATE8_WRONG_ADDR   0x01
 
#define HEARTRATE8_NBYTES_RANGE_ERROR   0x02
 
#define HEARTRATE8_DATA_SEL_ERROR   0x03
 
#define HEARTRATE8_INT_ACTIVE   0x00
 
#define HEARTRATE8_INT_INACTIVE   0x01
 

Functions

void heartrate8_cfg_setup (heartrate8_cfg_t *cfg)
 Config Object Initialization function.
 
HEARTRATE8_RETVAL heartrate8_init (heartrate8_t *ctx, heartrate8_cfg_t *cfg)
 Initialization function.
 
void heartrate8_default_cfg (heartrate8_t *ctx)
 Click Default Configuration function.
 
uint8_t heartrate8_write_single_byte (heartrate8_t *ctx, uint8_t reg_addr, uint8_t data_in)
 Generic Single Byte Write function.
 
uint8_t heartrate8_write_bytes (heartrate8_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes)
 Generic Bytes Write function.
 
uint8_t heartrate8_read_bytes (heartrate8_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes)
 Generic Read function.
 
void heartrate8_start_measure (heartrate8_t *ctx)
 Measurement Start function.
 
void heartrate8_reset (heartrate8_t *ctx)
 Reset function.
 
void heartrate8_meas_sync (heartrate8_t *ctx)
 Measurement Synchronization function.
 
uint8_t heartrate8_int_clear (heartrate8_t *ctx)
 Interrupt Clear function.
 
uint8_t heartrate8_check_int (heartrate8_t *ctx)
 Interrupt Check function.
 
uint8_t heartrate8_get_data (heartrate8_t *ctx, uint8_t data_select, uint16_t *led_out_on, uint16_t *led_out_off)
 Data Get function.
 

Detailed Description

This file contains API for Heart Rate 8 Click driver.