39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define HEARTRATE10_REG_INT_STATUS 0x00
74#define HEARTRATE10_REG_INT_ENABLE 0x02
75#define HEARTRATE10_REG_FIFO_WR_PTR 0x04
76#define HEARTRATE10_REG_FIFO_OVF_CNT 0x05
77#define HEARTRATE10_REG_FIFO_RD_PTR 0x06
78#define HEARTRATE10_REG_FIFO_DATA 0x07
79#define HEARTRATE10_REG_FIFO_CFG 0x08
80#define HEARTRATE10_REG_MODE_CFG1 0x09
81#define HEARTRATE10_REG_MODE_CFG2 0x0A
82#define HEARTRATE10_REG_LED1_PA 0x0C
83#define HEARTRATE10_REG_LED2_PA 0x0D
84#define HEARTRATE10_REG_LED3_PA 0x0E
85#define HEARTRATE10_REG_LED4_PA 0x0F
86#define HEARTRATE10_REG_LED_RANGE 0x11
87#define HEARTRATE10_REG_PILOT_PA 0x12
88#define HEARTRATE10_REG_LED_SEQ1 0x13
89#define HEARTRATE10_REG_LED_SEQ2 0x14
90#define HEARTRATE10_REG_DAC1_CROSSTALK_CODE 0x26
91#define HEARTRATE10_REG_DAC2_CROSSTALK_CODE 0x27
92#define HEARTRATE10_REG_DAC3_CROSSTALK_CODE 0x28
93#define HEARTRATE10_REG_DAC4_CROSSTALK_CODE 0x29
94#define HEARTRATE10_REG_PROX_INT_THRESHOLD 0x30
95#define HEARTRATE10_REG_LED_COMPARATOR_EN 0x31
96#define HEARTRATE10_REG_LED_COMPARATOR_STATUS 0x32
97#define HEARTRATE10_REG_REV_ID 0xFE
98#define HEARTRATE10_REG_PART_ID 0xFF
116#define HEARTRATE10_PART_ID 0x2B
123#define HEARTRATE10_SET_DEV_ADDR 0x57
141#define HEARTRATE10_MAP_MIKROBUS( cfg, mikrobus ) \
142 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
143 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
144 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
uint32_t heartrate10_read_fifo_sample(heartrate10_t *ctx)
Read single sample of FIFO data.
err_t heartrate10_fifo_read(heartrate10_t *ctx, uint8_t *rx_buf, uint8_t rx_len)
Read fifo register data.
err_t heartrate10_init(heartrate10_t *ctx, heartrate10_cfg_t *cfg)
Heart Rate 10 initialization function.
err_t heartrate10_generic_read(heartrate10_t *ctx, uint8_t reg, uint8_t *rx_data)
Reading function.
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.
err_t heartrate10_default_cfg(heartrate10_t *ctx)
Heart Rate 10 default configuration function.
void heartrate10_reset(heartrate10_t *ctx)
Reset device.
void heartrate10_cfg_setup(heartrate10_cfg_t *cfg)
Heart Rate 10 configuration object setup function.
uint8_t heartrate10_get_int_pin(heartrate10_t *ctx)
Get interrupt pin state.
err_t heartrate10_generic_write(heartrate10_t *ctx, uint8_t reg, uint8_t tx_data)
Writing function.
heartrate10_return_value_t
Heart Rate 10 Click return value data.
Definition heartrate10.h:187
@ HEARTRATE10_OK
Definition heartrate10.h:188
@ HEARTRATE10_ERROR
Definition heartrate10.h:189
Heart Rate 10 Click configuration object.
Definition heartrate10.h:171
uint32_t i2c_speed
Definition heartrate10.h:177
pin_name_t scl
Definition heartrate10.h:172
pin_name_t int_pin
Definition heartrate10.h:175
pin_name_t sda
Definition heartrate10.h:173
uint8_t i2c_address
Definition heartrate10.h:178
Heart Rate 10 Click context object.
Definition heartrate10.h:154
digital_in_t int_pin
Definition heartrate10.h:156
i2c_master_t i2c
Definition heartrate10.h:159
uint8_t slave_address
Definition heartrate10.h:162