ecg6 2.0.0.0
|
Functions | |
void | ecg6_cfg_setup (ecg6_cfg_t *cfg) |
Config Object Initialization function. | |
ECG6_RETVAL | ecg6_init (ecg6_t *ctx, ecg6_cfg_t *cfg) |
Initialization function. | |
void | ecg6_default_cfg (ecg6_t *ctx) |
Default configuration for ECG sensor. | |
void | ecg6_write_data (ecg6_t *ctx, uint8_t reg, uint8_t in_data) |
Generic Write function. | |
void | ecg6_write_data_buf (ecg6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic Write buffer function. | |
uint8_t | ecg6_read_data (ecg6_t *ctx, uint8_t reg) |
Generic Read function. | |
void | ecg6_read_data_buf (ecg6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic Read buffer function. | |
uint8_t | ecg6_check_path_id (ecg6_t *ctx) |
Function for check path ID. | |
uint8_t | ecg6_ppg_default_config (ecg6_t *ctx) |
Function for configuration sensors to element. | |
void | ecg6_get_sample_data (ecg6_t *ctx, ecg6_element_t *element, uint8_t num_sample) |
Get one sample from FIFO. | |
void | ecg6_get_all_samples (ecg6_t *ctx, ecg6_fifo_t *fifo_data) |
Get all samples from FIFO. | |
void | ecg6_get_interrupt_status (ecg6_t *ctx, ecg6_int_status_t *status) |
Get Interrupt registers status. | |
uint8_t | ecg6_int_pin_state (ecg6_t *ctx) |
Get Interrupt pin state. | |
void ecg6_cfg_setup | ( | ecg6_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t ecg6_check_path_id | ( | ecg6_t * | ctx | ) |
Function for check path ID.
ctx | Click object. |
void ecg6_default_cfg | ( | ecg6_t * | ctx | ) |
Default configuration for ECG sensor.
ctx | Click object. |
-- ECG6_REG_INTERRUPT_ENABLE_1 ---------------------------- ECG6_INTS1_A_FULL_OFF ECG6_INTS1_PPG_RDY_OFF ECG6_INTS1_ALC_OVF_OFF ECG6_INTS1_PROX_INIT_OFF ECG6_INTS1_PWR_RDY_OFF -- ECG6_REG_INTERRUPT_ENABLE_2 --------------------------- ECG6_INTS2_VDD_OOR_OFF ECG6_INTS2_DRDY_ON -- ECG6_REG_SYSTEM_CTRL --------------------- ECG6_SYSCTRL_RESET_ENABLE Delay - 100ms -- ECG6_REG_FIFO_CFG ----------------- ECG6_FCFG_A_FULL_CLR ECG6_FCFG_A_FULL_TYPE_ONCE ECG6_FCFG_FIFO_ROLLS_ON_FULL_ON 0x0F -- ---------------------------------- cfg.element_1 = ECG6_SENSOR_ECG; cfg.element_2 = ECG6_SENSOR_NONE; cfg.element_3 = ECG6_SENSOR_NONE; cfg.element_4 = ECG6_SENSOR_NONE; ecg6_cfg_element( &cfg ); ---------------------------------- -- ECG6_REG_PPG_CFG_1 ------------------- ECG6_PPGCFG1_PPG_ADC_RGE_32768nA ECG6_PPGCFG1_PPG_SR_100n1 ECG6_PPGCFG1_PPG_PW_100us -- ECG6_REG_PPG_CFG_2 ( 0x06 ) -- ECG6_REG_LED_RANGE ------------------- ECG6_LRANG_LED2_SMP_AVE_50 ECG6_LRANG_LED1_SMP_AVE_50 -- ECG6_REG_SYSTEM_CTRL ---------------------- ECG6_SYSCTRL_FIFO_ENABLE ECG6_SYSCTRL_SHUTDOWN_DISABLE ECG6_SYSCTRL_RESET_DISABLE -- ECG6_REG_CONFIG_1 -------------------- ECG6_CFG1_ADC_OSR_3200 -- ECG6_REG_CONFIG_3 ------------------ ECG6_CFG3_PGA_GAIN_4 ECG6_CFG3_IA_GAIN_5 -- ecg6_set_led_pulse( 0x00, 0x00 ); -- ECG6_REG_FIFO_WRITE ( 0x00 ) -- ECG6_REG_OVERFLOW_CNT ( 0x00 ) -- ECG6_REG_FIFO_READ ( 0x00 ) Delay - 100ms
@description This function executes default configuration for Ecg6 click.
void ecg6_get_all_samples | ( | ecg6_t * | ctx, |
ecg6_fifo_t * | fifo_data ) |
Get all samples from FIFO.
ctx | Click object. |
fifo_data | samples ( elements ) structure |
void ecg6_get_interrupt_status | ( | ecg6_t * | ctx, |
ecg6_int_status_t * | status ) |
Get Interrupt registers status.
ctx | Click object. |
status | Status strusture |
@description This function reads all interupt statuses and writes them to the structure.
void ecg6_get_sample_data | ( | ecg6_t * | ctx, |
ecg6_element_t * | element, | ||
uint8_t | num_sample ) |
Get one sample from FIFO.
ctx | Click object. |
element | sample ( elements ) structure |
num_sample | The position of the sample being read |
ECG6_RETVAL ecg6_init | ( | ecg6_t * | ctx, |
ecg6_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.
uint8_t ecg6_int_pin_state | ( | ecg6_t * | ctx | ) |
Get Interrupt pin state.
ctx | Click object. |
uint8_t ecg6_ppg_default_config | ( | ecg6_t * | ctx | ) |
Function for configuration sensors to element.
ctx | Click object. |
cfg | Config structure |
Depending on the set sensors - reading fifo, use the elements. Example: If you set the ECG to the first element, when you read the ecg it will be given to the first element.@description */ void ecg6_cfg_element( ecg6_t *ctx, ecg6_cfg_element_t *cfg ); /** Funcrion for set LED pulse
ctx | Click object. |
ir_led | IR LED pulse ( from 0x00 to 0xFF ) |
red_led | RED LED pulse ( from 0x00 to 0xFF ) |
: This function is required to read PPG. @description This functions is contains in default configuration for PPG sensor */ void ecg6_set_led_pulse( ecg6_t *ctx, uint8_t ir_led, uint8_t red_led ); /** Default configuration for PPG sensor
ctx | Click object. |
: This function contains:-- ECG6_REG_INTERRUPT_ENABLE_1 ---------------------------- ECG6_INTS1_A_FULL_OFF ECG6_INTS1_PPG_RDY_ON ECG6_INTS1_ALC_OVF_OFF ECG6_INTS1_PROX_INIT_OFF ECG6_INTS1_PWR_RDY_OFF -- ECG6_REG_INTERRUPT_ENABLE_2 --------------------------- ECG6_INTS2_VDD_OOR_OFF ECG6_INTS2_DRDY_OFF -- ECG6_REG_SYSTEM_CTRL --------------------- ECG6_SYSCTRL_RESET_ENABLE Delay - 100ms -- ECG6_REG_FIFO_CFG ----------------- ECG6_FCFG_A_FULL_CLR ECG6_FCFG_A_FULL_TYPE_ONCE ECG6_FCFG_FIFO_ROLLS_ON_FULL_ON 0x0F -- ---------------------------------- cfg.element_1 = ECG6_SENSOR_PPG_LED_1; cfg.element_2 = ECG6_SENSOR_PPG_LED_2; cfg.element_3 = ECG6_SENSOR_ECG; cfg.element_4 = ECG6_SENSOR_NONE; ecg6_cfg_element( &cfg ); ---------------------------------- -- ECG6_REG_PPG_CFG_1 ------------------- ECG6_PPGCFG1_PPG_ADC_RGE_32768nA ECG6_PPGCFG1_PPG_SR_100n1 ECG6_PPGCFG1_PPG_PW_100us -- ECG6_REG_PPG_CFG_2 ( 0x06 ) -- ECG6_REG_LED_RANGE ------------------- ECG6_LRANG_LED2_SMP_AVE_50 ECG6_LRANG_LED1_SMP_AVE_50 -- ECG6_REG_SYSTEM_CTRL ---------------------- ECG6_SYSCTRL_FIFO_ENABLE ECG6_SYSCTRL_SHUTDOWN_DISABLE ECG6_SYSCTRL_RESET_DISABLE -- ECG6_REG_CONFIG_1 -------------------- ECG6_CFG1_ADC_OSR_3200 -- ECG6_REG_CONFIG_3 ------------------ ECG6_CFG3_PGA_GAIN_4 ECG6_CFG3_IA_GAIN_5 -- ecg6_set_led_pulse( 0xFF, 0xFF ); -- ECG6_REG_FIFO_WRITE ( 0x00 ) -- ECG6_REG_OVERFLOW_CNT ( 0x00 ) -- ECG6_REG_FIFO_READ ( 0x00 ) Delay - 100ms
@description This function executes default configuration for PPG sensor.
uint8_t ecg6_read_data | ( | ecg6_t * | ctx, |
uint8_t | reg ) |
Generic Read function.
ctx | Click object. |
reg | Address which from data be read |
@description Function reads data from the register.
void ecg6_read_data_buf | ( | ecg6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic Read buffer function.
ctx | Click object. |
reg | Address which from data be read |
data_buf | Data buffer for data stored |
len | Number of the data for read |
@description Function reads data buffer from the register.
void ecg6_write_data | ( | ecg6_t * | ctx, |
uint8_t | reg, | ||
uint8_t | in_data ) |
Generic Write function.
ctx | Click object. |
reg | Address where data be written |
in_data | Data to be written |
@description Function writes data to the register.
void ecg6_write_data_buf | ( | ecg6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic Write buffer function.
ctx | Click object. |
reg | Address where data be written |
data_buf | Data buffer to be written |
len | Number of the data in buffer |
@description Function writes data buffer to the register.