heartrate4 2.0.0.0
|
Functions | |
void | heartrate4_cfg_setup (heartrate4_cfg_t *cfg) |
Config Object Initialization function. | |
HEARTRATE4_RETVAL | heartrate4_init (heartrate4_t *ctx, heartrate4_cfg_t *cfg) |
Initialization function. | |
void | heartrate4_default_cfg (heartrate4_t *ctx) |
Click Default Configuration function. | |
void | heartrate4_write_data (heartrate4_t *ctx, uint8_t wr_addr, uint8_t wr_data) |
Generic write function. | |
uint8_t | heartrate4_read_data (heartrate4_t *ctx, uint8_t rd_addr) |
Generic read function. | |
void | heartrate4_multi_read (heartrate4_t *ctx, uint8_t rd_addr, uint8_t *buffer, uint8_t cnt) |
Multi read function. | |
void | heartrate4_set_new_value (heartrate4_t *ctx, uint8_t reg, uint8_t mask, uint8_t value) |
Set new value function. | |
uint8_t | heartrate4_get_intrrupt (heartrate4_t *ctx, uint8_t flag) |
Get desired interrupt function. | |
void | heartrate4_enable_disable_interrupts (heartrate4_t *ctx, uint8_t interrupt_flag, uint8_t enable_flag) |
Enable or disable interrupt function. | |
void | heartrate4_setting_function (heartrate4_t *ctx, uint8_t flag, uint8_t mode) |
Set corresponding configuration register function. | |
void | heartrate4_setting_prox_and_amp (heartrate4_t *ctx, uint8_t flag, uint8_t write_data) |
Set corresponding amplitude or proximity threshold function. | |
void | heartrate4_enable_slot (heartrate4_t *ctx, uint8_t slot_num, uint8_t dev) |
Define slots in MultiLED mode function. | |
void | heartrate4_disable_slots (heartrate4_t *ctx) |
Disable slots in MultiLED mode function. | |
void | heartrate4_clear_fifo (heartrate4_t *ctx) |
Clearing FIFO pointers function. | |
void | heartrate4_fifo_setting (heartrate4_t *ctx, uint8_t flag, uint8_t samp_num) |
Set FIFO configuration register function. | |
uint8_t | heartrate4_get_write_ptr (heartrate4_t *ctx) |
Read the FIFO Write Pointer function. | |
uint8_t | heartrate4_get_read_ptr (heartrate4_t *ctx) |
Read the FIFO Read Pointer function. | |
float | heartrate4_read_temp_c (heartrate4_t *ctx) |
Read temperature in Centigrade function. | |
float | heartrate4_read_temp_f (heartrate4_t *ctx) |
Read temperature in Fahrenheit function. | |
void | heartrate4_reset (heartrate4_t *ctx) |
Reset device function. | |
uint8_t | heartrate4_check_int (heartrate4_t *ctx) |
Get Interrupt state function. | |
uint32_t | heartrate4_read_fifo_oldest_sample (heartrate4_t *ctx) |
Read oldest FIFO sample function. | |
uint8_t | heartrate4_check_int_pow_and_temp (heartrate4_t *ctx, uint8_t flag) |
Check interrupt, power ready or internal temperature ready flag function. | |
uint16_t | heartrate4_read_fifo_all_samples (heartrate4_t *ctx, uint8_t *buff) |
Read all FIFO samples function. | |
uint32_t | heartrate4_get_red_val (heartrate4_t *ctx) |
Get Red value function. | |
void | heartrate4_set_registers (heartrate4_t *ctx, heartrate4_set_registers_t *registers) |
Set registers values function. | |
void heartrate4_cfg_setup | ( | heartrate4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t heartrate4_check_int | ( | heartrate4_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
@description Function is used to check the state of INT pin.
uint8_t heartrate4_check_int_pow_and_temp | ( | heartrate4_t * | ctx, |
uint8_t | flag ) |
Check interrupt, power ready or internal temperature ready flag function.
ctx | Click object. |
flag | Flag that specifie interrupt, power ready or internal temperature |
@description Function is used to check if desired interrupt, power ready or internal temperature ready flag has occured
flag state: 0 - Check FIFO full interrupt 1 - Check FIFO data readdy interrupt 2 - Check ambient light cancellation overflow interrupt 3 - Check proximity threshold triggered interrupt 4 - Check power ready flag 5 - Check internal temperature ready flag
void heartrate4_clear_fifo | ( | heartrate4_t * | ctx | ) |
Clearing FIFO pointers function.
ctx | Click object. |
@description Function is used to clear FIFO pointers.
void heartrate4_default_cfg | ( | heartrate4_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for HeartRate4 click.
void heartrate4_disable_slots | ( | heartrate4_t * | ctx | ) |
Disable slots in MultiLED mode function.
ctx | Click object. |
@description Function is used to disable all LED-s in each time slot.
void heartrate4_enable_disable_interrupts | ( | heartrate4_t * | ctx, |
uint8_t | interrupt_flag, | ||
uint8_t | enable_flag ) |
Enable or disable interrupt function.
ctx | Click object. |
interrupt_flag | Flag that specifie interrupt |
enable_flag | 1 - enable; 0 - disable |
@description Function is used to enable or disable specified interupt.
interrupt_flag state: 0 - A full 1 - FIFO data ready interrupt 2 - Ambient Light Cancellation Overflow 3 - Proximity Threshold 4 - Temperature conversion interrupt enable_flag state: 1 - enable; 0 - disable; One may consult datasheet in order to discern what to write into register or use predefined values.Consult datasheet in order to discern what to write into register or use predefined values.
void heartrate4_enable_slot | ( | heartrate4_t * | ctx, |
uint8_t | slot_num, | ||
uint8_t | dev ) |
Define slots in MultiLED mode function.
ctx | Click object. |
slot_num | 8-bit data representing the slot number |
dev | 8-bit data representing the device(LED) |
@description Function is used to determine which LED is active in each time slot.
void heartrate4_fifo_setting | ( | heartrate4_t * | ctx, |
uint8_t | flag, | ||
uint8_t | samp_num ) |
Set FIFO configuration register function.
ctx | Click object. |
flag | Flag that specifie amplitude or proximity threshold |
samp_num | 8-bit data representing the number of samples |
@description Function is used to set number of samples by writning into FIFO configuration register. Or to enable or disable FIFO Rolls on Full
flag state: 0 - Disable roll over 1 - Enable roll over 2 - Set sample average 3 - Set number of trigger samples One may consult datasheet in order to discern what to write into register or use predefined values.
uint8_t heartrate4_get_intrrupt | ( | heartrate4_t * | ctx, |
uint8_t | flag ) |
Get desired interrupt function.
ctx | Click object. |
flag | 1 - Get the main interrupt group; 2 - Get the temporary ready interrupt |
@description Function is used to read desired interrupt specified by flag.
uint8_t heartrate4_get_read_ptr | ( | heartrate4_t * | ctx | ) |
Read the FIFO Read Pointer function.
ctx | Click object. |
@description Function is used to check read pointer.
uint32_t heartrate4_get_red_val | ( | heartrate4_t * | ctx | ) |
Get Red value function.
ctx | Click object. |
@description Function is used to read the oldest RED value.
uint8_t heartrate4_get_write_ptr | ( | heartrate4_t * | ctx | ) |
Read the FIFO Write Pointer function.
ctx | Click object. |
@description Function is used to check write pointer.
HEARTRATE4_RETVAL heartrate4_init | ( | heartrate4_t * | ctx, |
heartrate4_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void heartrate4_multi_read | ( | heartrate4_t * | ctx, |
uint8_t | rd_addr, | ||
uint8_t * | buffer, | ||
uint8_t | cnt ) |
Multi read function.
ctx | Click object. |
rd_addr | Register address. |
buffer | Data buf to read. |
cnt | Number of bytes to read. |
@description This function reads user defined number byte of data .
uint8_t heartrate4_read_data | ( | heartrate4_t * | ctx, |
uint8_t | rd_addr ) |
Generic read function.
ctx | Click object. |
rd_addr | Register address. |
@description This function reads single byte of data from specified register.
uint16_t heartrate4_read_fifo_all_samples | ( | heartrate4_t * | ctx, |
uint8_t * | buff ) |
Read all FIFO samples function.
ctx | Click object. |
buff | output buffer |
@description Function is used to read all FIFO data samples and returns average value.
uint32_t heartrate4_read_fifo_oldest_sample | ( | heartrate4_t * | ctx | ) |
Read oldest FIFO sample function.
ctx | Click object. |
@description Function is used to read the oldest RED value from FIFO.
float heartrate4_read_temp_c | ( | heartrate4_t * | ctx | ) |
Read temperature in Centigrade function.
ctx | Click object. |
@description Function is used to read current IC�s internal temperature.
float heartrate4_read_temp_f | ( | heartrate4_t * | ctx | ) |
Read temperature in Fahrenheit function.
ctx | Click object. |
@description Function is used to read current IC�s internal temperature.
void heartrate4_reset | ( | heartrate4_t * | ctx | ) |
Reset device function.
ctx | Click object. @description Function is used to apply software reset. |
void heartrate4_set_new_value | ( | heartrate4_t * | ctx, |
uint8_t | reg, | ||
uint8_t | mask, | ||
uint8_t | value ) |
Set new value function.
ctx | Click object. |
reg | 8-bit register address |
mask | 8-bit value used as a mask |
value | 8-bit data to be written into register |
@description Function is used to apply new values.
void heartrate4_set_registers | ( | heartrate4_t * | ctx, |
heartrate4_set_registers_t * | registers ) |
Set registers values function.
ctx | Click object. |
registers | Click registers object. Registers structure fields avg_samp - 8-bit data representing the number of samples mode - 8-bit data representing led mode adc_range - 8-bit data representing ADC range samp_rate - 8-bit data representing sample rate pulse_width - 8-bit data representing the puls width led_pow_lvl - 8-bit data representing the power level@description Function is used to apply device settings. |
void heartrate4_setting_function | ( | heartrate4_t * | ctx, |
uint8_t | flag, | ||
uint8_t | mode ) |
Set corresponding configuration register function.
ctx | Click object. |
flag | Flag that specifie interrupt |
mode | 8-bit data representing desired mode |
@description Function is used to write specified mode into corresponding configuration register.
flag state: 0 - Soft shut down 1 - Soft wake up 2 - Set LED Mode For Sampling 3 - Set ADC Range 4 - Set sample rate 5 - Set pulse width One may consult datasheet in order to discern what to write into register or use predefined values.
void heartrate4_setting_prox_and_amp | ( | heartrate4_t * | ctx, |
uint8_t | flag, | ||
uint8_t | write_data ) |
Set corresponding amplitude or proximity threshold function.
ctx | Click object. |
flag | Flag that specifie amplitude or proximity threshold |
write_data | 8-bit data representing amplitude or the proximity mode interrupt threshold |
@description Function is used to set specified amplitude or proximity threshold.
flag state: 0 - Set RED LED Pulse Amplitude 1 - Set IR LED Pulse Amplitude 2 - Set GREEN LED Pulse Amplitude 3 - Set Proximity Pulse Amplitude 4 - Set Proximity Threshold One may consult datasheet in order to discern what to write into register or use predefined values.
void heartrate4_write_data | ( | heartrate4_t * | ctx, |
uint8_t | wr_addr, | ||
uint8_t | wr_data ) |
Generic write function.
ctx | Click object. |
wr_addr | Register address. |
wr_data | 8-bit data to be written into register. |
@description This function writes single byte of data into specified register.