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"
77#define HEARTRATE5_REG0H 0x00
78#define HEARTRATE5_REG1H 0x01
79#define HEARTRATE5_REG2H 0x02
80#define HEARTRATE5_REG3H 0x03
81#define HEARTRATE5_REG4H 0x04
82#define HEARTRATE5_REG5H 0x05
83#define HEARTRATE5_REG6H 0x06
84#define HEARTRATE5_REG7H 0x07
85#define HEARTRATE5_REG8H 0x08
86#define HEARTRATE5_REG9H 0x09
87#define HEARTRATE5_REGAH 0x0A
88#define HEARTRATE5_REGBH 0x0B
89#define HEARTRATE5_REGCH 0x0C
90#define HEARTRATE5_REGDH 0x0D
91#define HEARTRATE5_REGEH 0x0E
92#define HEARTRATE5_REGFH 0x0F
93#define HEARTRATE5_REG10H 0x10
94#define HEARTRATE5_REG11H 0x11
95#define HEARTRATE5_REG12H 0x12
96#define HEARTRATE5_REG13H 0x13
97#define HEARTRATE5_REG14H 0x14
98#define HEARTRATE5_REG15H 0x15
99#define HEARTRATE5_REG16H 0x16
100#define HEARTRATE5_REG17H 0x17
101#define HEARTRATE5_REG18H 0x18
102#define HEARTRATE5_REG19H 0x19
103#define HEARTRATE5_REG1AH 0x1A
104#define HEARTRATE5_REG1BH 0x1B
105#define HEARTRATE5_REG1CH 0x1C
107#define HEARTRATE5_REG1DH 0x1D
108#define HEARTRATE5_REG1EH 0x1E
109#define HEARTRATE5_REG20H 0x20
110#define HEARTRATE5_REG21H 0x21
111#define HEARTRATE5_REG22H 0x22
112#define HEARTRATE5_REG23H 0x23
113#define HEARTRATE5_REG29H 0x29
115#define HEARTRATE5_REG2AH 0x2A
116#define HEARTRATE5_REG2BH 0x2B
117#define HEARTRATE5_REG2CH 0x2C
118#define HEARTRATE5_REG2DH 0x2D
119#define HEARTRATE5_REG2EH 0x2E
120#define HEARTRATE5_REG2FH 0x2F
121#define HEARTRATE5_REG31H 0x31
128#define HEARTRATE5_REG32H 0x32
129#define HEARTRATE5_REG33H 0x33
131#define HEARTRATE5_REG34H 0x34
132#define HEARTRATE5_REG35H 0x35
139#define HEARTRATE5_REG36H 0x36
140#define HEARTRATE5_REG37H 0x37
142#define HEARTRATE5_REG39H 0x39
143#define HEARTRATE5_REG3AH 0x3A
144#define HEARTRATE5_REG3DH 0x3D
145#define HEARTRATE5_REG3FH 0x3F
146#define HEARTRATE5_REG40H 0x40
170#define HEARTRATE5_SET_DEV_ADDR 0x58
188#define HEARTRATE5_MAP_MIKROBUS( cfg, mikrobus ) \
189 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
190 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
191 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
192 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
uint32_t heartrate5_read_reg(heartrate5_t *ctx, uint8_t reg_addr)
Heart Rate 5 register reading function.
uint32_t heartrate5_get_led2_aled2_val(heartrate5_t *ctx)
Heart Rate 5 get LED2_ALED2 data function.
void heartrate5_cfg_setup(heartrate5_cfg_t *cfg)
Heart Rate 5 configuration object setup function.
void heartrate5_write_reg(heartrate5_t *ctx, uint8_t reg_addr, uint32_t write_data)
Heart Rate 5 register write function.
uint32_t heartrate5_get_led1_aled1_val(heartrate5_t *ctx)
Heart Rate 5 get LED1_ALED1 data function.
err_t heartrate5_default_cfg(heartrate5_t *ctx)
Heart Rate 5 default configuration function.
uint32_t heartrate5_get_aled2_val_led3v_al(heartrate5_t *ctx)
Heart Rate 5 get ALED2 data function.
uint32_t heartrate5_get_led2_val(heartrate5_t *ctx)
Heart Rate 5 get LED2 data function.
err_t heartrate5_init(heartrate5_t *ctx, heartrate5_cfg_t *cfg)
Heart Rate 5 initialization function.
void heartrate5_sw_reset(heartrate5_t *ctx)
Heart Rate 5 software reset function.
err_t heartrate5_generic_read(heartrate5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Heart Rate 5 I2C reading function.
uint32_t heartrate5_get_aled1_val(heartrate5_t *ctx)
Heart Rate 5 get ALED1 data function.
void heartrate5_hw_reset(heartrate5_t *ctx)
Heart Rate 5 hardware reset function.
err_t heartrate5_generic_write(heartrate5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Heart Rate 5 I2C writing function.
uint32_t heartrate5_get_led1_val(heartrate5_t *ctx)
Heart Rate 5 get LED1 data function.
heartrate5_return_value_t
Heart Rate 5 Click return value data.
Definition heartrate5.h:239
@ HEARTRATE5_ERROR
Definition heartrate5.h:241
@ HEARTRATE5_OK
Definition heartrate5.h:240
Heart Rate 5 Click configuration object.
Definition heartrate5.h:222
uint32_t i2c_speed
Definition heartrate5.h:229
pin_name_t scl
Definition heartrate5.h:223
pin_name_t int_pin
Definition heartrate5.h:227
pin_name_t sda
Definition heartrate5.h:224
pin_name_t rst
Definition heartrate5.h:226
uint8_t i2c_address
Definition heartrate5.h:230
Heart Rate 5 Click context object.
Definition heartrate5.h:202
digital_in_t int_pin
Definition heartrate5.h:207
i2c_master_t i2c
Definition heartrate5.h:210
digital_out_t rst
Definition heartrate5.h:204
uint8_t slave_address
Definition heartrate5.h:213