42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define HEARTRATE6_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define HEARTRATE6_RETVAL uint8_t
77#define HEARTRATE6_OK 0x00
78#define HEARTRATE6_INIT_ERROR 0xFF
85#define HEARTRATE6_SLAVE_ADDR 0x5B
92#define HEARTRATE6_MANUFACT_ID_REG1 0x0F
93#define HEARTRATE6_MANUFACT_ID_REG2 0x92
94#define HEARTRATE6_PART_ID_REG 0x10
95#define HEARTRATE6_RESET_REG 0x40
96#define HEARTRATE6_MEAS_CTRL1_REG 0x41
97#define HEARTRATE6_MEAS_CTRL2_REG 0x42
98#define HEARTRATE6_MEAS_START_REG 0x43
99#define HEARTRATE6_DATA_LEDOFF_LSB_REG 0x54
100#define HEARTRATE6_DATA_LEDOFF_MSB_REG 0x55
101#define HEARTRATE6_DATA_LEDON_LSB_REG 0x56
102#define HEARTRATE6_DATA_LEDON_MSB_REG 0x57
109#define HEARTRATE6_RESET_CMD 0x80
110#define HEARTRATE6_OSC_ACTIVE 0x80
111#define HEARTRATE6_LED_FREQ_128HZ 0x00
112#define HEARTRATE6_LED_FREQ_64HZ 0x04
113#define HEARTRATE6_DATAREAD_FREQ_64HZ 0x01
114#define HEARTRATE6_DATAREAD_FREQ_32HZ 0x02
115#define HEARTRATE6_LEDS_PULSED 0x00
116#define HEARTRATE6_LED1_CONST_LED2_PULSED 0x40
117#define HEARTRATE6_LED1_PULSED_LED2_CONST 0x80
118#define HEARTRATE6_LEDS_CONST 0xC0
119#define HEARTRATE6_LED_TIME_300MICROSEC 0x00
120#define HEARTRATE6_LED_TIME_600MICROSEC 0x20
121#define HEARTRATE6_LED_CURR_0MA 0x00
122#define HEARTRATE6_LED_CURR_1MA 0x08
123#define HEARTRATE6_LED_CURR_2MA 0x09
124#define HEARTRATE6_LED_CURR_3MA 0x0A
125#define HEARTRATE6_LED_CURR_6MA 0x0B
126#define HEARTRATE6_LED_CURR_10MA 0x0C
127#define HEARTRATE6_LED_CURR_20MA 0x0D
128#define HEARTRATE6_LED_CURR_30MA 0x0E
129#define HEARTRATE6_LED_CURR_60MA 0x0F
130#define HEARTRATE6_START_MEAS 0x01
137#define HEARTRATE6_OK 0x00
138#define HEARTRATE6_WRONG_ADDR 0x01
139#define HEARTRATE6_NBYTES_RANGE_ERROR 0x02
#define HEARTRATE6_RETVAL
Definition heartrate6.h:75
void heartrate6_start_measure(heartrate6_t *ctx)
Measurement Start function.
void heartrate6_get_data(heartrate6_t *ctx, uint16_t *led_off_data, uint16_t *led_on_data)
Data Get function.
HEARTRATE6_RETVAL heartrate6_init(heartrate6_t *ctx, heartrate6_cfg_t *cfg)
Initialization function.
void heartrate6_cfg_setup(heartrate6_cfg_t *cfg)
Config Object Initialization function.
void heartrate6_reset(heartrate6_t *ctx)
Reset function.
void heartrate6_set_freq(heartrate6_t *ctx, uint8_t freq_data)
Frequency Set function.
void heartrate6_default_cfg(heartrate6_t *ctx)
Click Default Configuration function.
uint8_t heartrate6_write_bytes(heartrate6_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes)
Bytes Write function.
uint8_t heartrate6_write_single_byte(heartrate6_t *ctx, uint8_t reg_addr, uint8_t data_in)
Single Byte Write function.
void heartrate6_wait_measure(heartrate6_t *ctx)
Wait measurement function.
uint8_t heartrate6_read_bytes(heartrate6_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes)
Generic Read function.
Click configuration structure definition.
Definition heartrate6.h:172
uint32_t i2c_speed
Definition heartrate6.h:180
pin_name_t scl
Definition heartrate6.h:175
pin_name_t sda
Definition heartrate6.h:176
uint8_t i2c_address
Definition heartrate6.h:181
Click ctx object definition.
Definition heartrate6.h:153
float res
Definition heartrate6.h:163
i2c_master_t i2c
Definition heartrate6.h:157
uint8_t slave_address
Definition heartrate6.h:161
uint8_t wait_time
Definition heartrate6.h:164