MAX30102 高灵敏度脉搏血氧仪和心率传感器 【硅天下备货信息】 MAX30102EFD+T -40°C to +85°C 14-Lead OESIP (0.8mm Pin Pitch) 【产品说明】 MAX30102是一个集成的脉搏血氧仪和心率监测仪生物传感器的模块。它集成了多个LED、光电检测器、光器件,以及带环境光抑制的低噪声电子电路。采用一个1.8V电源和一个独立的3.3V用于内部LED的电源,标准的I2C兼容的通信接口。 【MAX30102典型电路图】 【关键特性】 LED反射方案中提供心率监测仪和脉搏血氧仪生物传感器 微小、5.6mm x 3.3mm x 1.55mm、14引脚光模块 集成玻璃盖,实现最优、可靠的性能 使移动设备以极低功耗工作 可编程采样率和LED电流,节省功耗 低功耗心率监测仪(< 1mW) 超低关断电流(0.7μA,典型值) 快速数据输出 高采样率 可靠的运动伪影抑制 高SNR -40°C至+85°C工作温度范围 【应用场景】 一、STM32F103C8T6+MLX90614+MAX30102 二、nrf52832+ADXL362+max30102心率心电智能 【程序代码】 #include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <math.h> #include "nordic_common.h"
#include "nrf.h" #include "app_util_platform.h"
#include "nrf_delay.h"
#include "nrf_drv_rtc.h"
#include "nrf_drv_clock.h"
#include "nrf_drv_saadc.h"
#include "app_error.h" //if define SOFTWARE_TWI in project parameter ,then use soft iic
#ifdef SOFTWARE_TWI
#include "twi_master.h"
#else
#include "nrf_drv_twi.h"
#endif
#include "nrf_ppi.h"
#include "device.h"
#include "nrf_gpio.h"
#include "nrf_drv_timer.h"
#include "nrf_drv_spi.h"
/************************************************
data of flash
1S data length:481bytes
1sector length:4096bytes
1sector store:8s data
sector total:8192
8192*8=65536s = 18hours
if ble speed is 2KB/s then need 4.37hours to send all the data
************************************************/ /***********************************/
//W25Q256FV: 256M-bit / 32M-byte #define W25P_WRITEENABLE 0x06
#define W25P_WRITEDISABLE 0x04
#define W25P_READSTATUSREG 0x05
#define W25P_WRITESTATUSREG 0x01
#define W25P_READDATA 0x03
#define W25P_FASTREADDATA 0x0B
#define W25P_PAGEPROGRAM 0x02
#define W25P_SECTORERASE 0xD8 // 64KB
#define W25P_CHIPERASE 0xC7
#define W25P_POWERDOWN 0xB9
#define W25P_RELEASEPOWERDOWN 0xAB
#define W25P_DEVICEID 0xAB
#define W25P_MANUFACTDEVICEID 0x90 //
#define ADXL362_READ_REG 0x0B
#define ADXL362_WRITE_REG 0x0A
#define ADXL362_REG_FILTER_CTL 0x0A//错误
#define ADXL362_REG_INTMAP2 0x0A
#define ADXL362_REG_POWER_CTL 0x0A #define SAMPLES_IN_BUFFER 4 #define max30102_WR_address 0xAE
#define INTERRUPT_REG 0X00 /* TWI instance ID. */
#define TWI_INSTANCE_ID 0
#define SPI_INSTANCE 1 /**< SPI instance index. */
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */
static volatile bool spi_xfer_done; /**< Flag used to indicate that SPI instance completed the transfer. */
static nrf_saadc_value_t m_buffer_pool[2][SAMPLES_IN_BUFFER]; static uint32_t timestamp; const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(2); /**< Declaring an instance of nrf_drv_rtc for RTC1. */
|