从模块读取了数据,还需要一系列算法才能利用这些数据
This commit is contained in:
@@ -70,6 +70,12 @@ void Error_Handler(void);
|
||||
#define TCLK_GPIO_Port GPIOB
|
||||
#define TCS_Pin GPIO_PIN_2
|
||||
#define TCS_GPIO_Port GPIOB
|
||||
#define MAX_IRD_Pin GPIO_PIN_12
|
||||
#define MAX_IRD_GPIO_Port GPIOB
|
||||
#define MAX_INT_Pin GPIO_PIN_13
|
||||
#define MAX_INT_GPIO_Port GPIOB
|
||||
#define MAX_RD_Pin GPIO_PIN_14
|
||||
#define MAX_RD_GPIO_Port GPIOB
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
+14
-1
@@ -202,7 +202,7 @@ static void MX_GPIO_Init(void)
|
||||
HAL_GPIO_WritePin(LCD_BL_GPIO_Port, LCD_BL_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOB, TCLK_Pin|TCS_Pin, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOB, TCLK_Pin|TCS_Pin|MAX_IRD_Pin|MAX_RD_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin : TDOUT_Pin */
|
||||
GPIO_InitStruct.Pin = TDOUT_Pin;
|
||||
@@ -237,6 +237,19 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : MAX_IRD_Pin MAX_RD_Pin */
|
||||
GPIO_InitStruct.Pin = MAX_IRD_Pin|MAX_RD_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : MAX_INT_Pin */
|
||||
GPIO_InitStruct.Pin = MAX_INT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MAX_INT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
/* FSMC initialization function */
|
||||
|
||||
@@ -2,5 +2,5 @@ main.c:69:5:main 8 static
|
||||
main.c:114:6:SystemClock_Config 72 static
|
||||
main.c:153:13:MX_I2C2_Init 8 static
|
||||
main.c:187:13:MX_GPIO_Init 48 static
|
||||
main.c:243:13:MX_FSMC_Init 40 static
|
||||
main.c:307:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
main.c:256:13:MX_FSMC_Init 40 static
|
||||
main.c:320:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
|
||||
@@ -23,7 +23,8 @@ HW_Devices/eeprom.o: ../HW_Devices/eeprom.c ../HW_Devices/eeprom.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
../HW_Devices/iic.h
|
||||
|
||||
../HW_Devices/eeprom.h:
|
||||
|
||||
@@ -78,3 +79,5 @@ HW_Devices/eeprom.o: ../HW_Devices/eeprom.c ../HW_Devices/eeprom.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../HW_Devices/iic.h:
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
eeprom.c:14:6:IIC_SAND_DATE 40 static
|
||||
eeprom.c:19:6:IIC_READ_DATE 40 static
|
||||
eeprom.c:27:6:EPPROM_SLOWWRITE_INIT 4 static
|
||||
eeprom.c:37:6:EEPROM_SLOWWRITE_SERVER 16 static
|
||||
eeprom.c:64:6:EEPROM_READ_BATY 16 static
|
||||
eeprom.c:69:6:EEPROM_WRITE_BATY 32 static
|
||||
eeprom.c:17:6:EPPROM_SLOWWRITE_INIT 4 static
|
||||
eeprom.c:27:6:EEPROM_SLOWWRITE_SERVER 16 static
|
||||
eeprom.c:54:6:EEPROM_READ_BATY 16 static
|
||||
eeprom.c:59:6:EEPROM_WRITE_BATY 32 static
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
HW_Devices/iic.o: ../HW_Devices/iic.c ../HW_Devices/iic.h \
|
||||
../Core/Inc/main.h ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h \
|
||||
../Core/Inc/stm32f1xx_hal_conf.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h \
|
||||
../Drivers/CMSIS/Include/core_cm3.h \
|
||||
../Drivers/CMSIS/Include/cmsis_version.h \
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h \
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h \
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||
|
||||
../HW_Devices/iic.h:
|
||||
|
||||
../Core/Inc/main.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:
|
||||
|
||||
../Core/Inc/stm32f1xx_hal_conf.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h:
|
||||
|
||||
../Drivers/CMSIS/Include/core_cm3.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_version.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_compiler.h:
|
||||
|
||||
../Drivers/CMSIS/Include/cmsis_gcc.h:
|
||||
|
||||
../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_sram.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_fsmc.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h:
|
||||
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h:
|
||||
@@ -0,0 +1,2 @@
|
||||
iic.c:13:6:IIC_SAND_DATE 40 static
|
||||
iic.c:18:6:IIC_READ_DATE 40 static
|
||||
@@ -7,16 +7,19 @@
|
||||
C_SRCS += \
|
||||
../HW_Devices/LCD.c \
|
||||
../HW_Devices/eeprom.c \
|
||||
../HW_Devices/iic.c \
|
||||
../HW_Devices/touch.c
|
||||
|
||||
OBJS += \
|
||||
./HW_Devices/LCD.o \
|
||||
./HW_Devices/eeprom.o \
|
||||
./HW_Devices/iic.o \
|
||||
./HW_Devices/touch.o
|
||||
|
||||
C_DEPS += \
|
||||
./HW_Devices/LCD.d \
|
||||
./HW_Devices/eeprom.d \
|
||||
./HW_Devices/iic.d \
|
||||
./HW_Devices/touch.d
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ SW_APPs/APP_blood.o: ../SW_APPs/APP_blood.c ../SW_APPs/APP_blood.h \
|
||||
../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h \
|
||||
../SW_APPs/windows.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/lcd.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/LCD.h
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/LCD.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/iic.h
|
||||
|
||||
../SW_APPs/APP_blood.h:
|
||||
|
||||
@@ -87,3 +88,5 @@ SW_APPs/APP_blood.o: ../SW_APPs/APP_blood.c ../SW_APPs/APP_blood.h \
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/lcd.h:
|
||||
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/LCD.h:
|
||||
|
||||
/Users/wuwenfeng/STM32CubeIDE/workspace_1.7.0/m3s/HW_Devices/iic.h:
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
APP_blood.c:12:6:APP_blood_init 16 static
|
||||
APP_blood.c:17:6:APP_blood_loop 4 static
|
||||
APP_blood.c:14:9:Max30102_reset 16 static
|
||||
APP_blood.c:20:6:MAX30102_Config 16 static
|
||||
APP_blood.c:43:6:max30102_read_fifo 16 static
|
||||
APP_blood.c:89:6:APP_blood_init 16 static
|
||||
APP_blood.c:98:6:APP_blood_loop 16 static
|
||||
|
||||
Binary file not shown.
+13064
-12649
File diff suppressed because it is too large
Load Diff
+967
-853
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@
|
||||
"./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.o"
|
||||
"./HW_Devices/LCD.o"
|
||||
"./HW_Devices/eeprom.o"
|
||||
"./HW_Devices/iic.o"
|
||||
"./HW_Devices/touch.o"
|
||||
"./SW_APPs/APP_blood.o"
|
||||
"./SW_APPs/Main_APP.o"
|
||||
|
||||
+1
-11
@@ -7,19 +7,9 @@
|
||||
|
||||
#include "eeprom.h"
|
||||
|
||||
#include "iic.h"
|
||||
|
||||
//iic硬件接口
|
||||
extern I2C_HandleTypeDef hi2c2;
|
||||
|
||||
void IIC_SAND_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
HAL_I2C_Mem_Write(&hi2c2,DEVICE_ADD,IN_DEVICE_ADD,I2C_MEMADD_SIZE_8BIT,DATAS,LONG,100);
|
||||
}
|
||||
|
||||
void IIC_READ_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
HAL_I2C_Mem_Read(&hi2c2,DEVICE_ADD,IN_DEVICE_ADD,I2C_MEMADD_SIZE_8BIT,DATAS,LONG,100);
|
||||
}
|
||||
//因为eeprom芯片的写入速度有限,每写入一个字符都需要等待一段时间才能完成写入
|
||||
//整个系统不可能等它一个的,传统的解决方法可以使用定时器中断或者多线程开辟子任务在后台保存,
|
||||
//这里的解决方法是使用状态机,通过一个链表将要保存的数据串起来,再通过状态循环一个个保存,保存延时等于循环用时。
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* iic.c
|
||||
*
|
||||
* Created on: Aug 21, 2021
|
||||
* Author: wuwenfeng
|
||||
*/
|
||||
|
||||
#include "iic.h"
|
||||
|
||||
//iicÓ²¼þ½Ó¿Ú
|
||||
extern I2C_HandleTypeDef hi2c2;
|
||||
|
||||
void IIC_SAND_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
HAL_I2C_Mem_Write(&hi2c2,DEVICE_ADD,IN_DEVICE_ADD,I2C_MEMADD_SIZE_8BIT,DATAS,LONG,100);
|
||||
}
|
||||
|
||||
void IIC_READ_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
|
||||
{
|
||||
HAL_I2C_Mem_Read(&hi2c2,DEVICE_ADD,IN_DEVICE_ADD,I2C_MEMADD_SIZE_8BIT,DATAS,LONG,100);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* iic.h
|
||||
*
|
||||
* Created on: Aug 21, 2021
|
||||
* Author: wuwenfeng
|
||||
*/
|
||||
|
||||
#ifndef IIC_H_
|
||||
#define IIC_H_
|
||||
#include "main.h"
|
||||
|
||||
void IIC_SAND_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
|
||||
void IIC_READ_DATE(uint16_t DEVICE_ADD,uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
|
||||
|
||||
#endif /* IIC_H_ */
|
||||
+90
-1
@@ -6,15 +6,104 @@
|
||||
*/
|
||||
|
||||
#include "APP_blood.h"
|
||||
|
||||
#include "iic.h"
|
||||
window *blood_win;
|
||||
uint16_t fifo_red;
|
||||
uint16_t fifo_ir;
|
||||
char blood_str[64];
|
||||
uint8_t Max30102_reset(void)
|
||||
{
|
||||
char a=0x40;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_MODE_CONFIG, &a,1);
|
||||
|
||||
}
|
||||
void MAX30102_Config(void)
|
||||
{
|
||||
char a;
|
||||
a=0xc0;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_INTR_ENABLE_1,&a,1);//// INTR setting
|
||||
a=0;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_INTR_ENABLE_2,&a,1);//
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_FIFO_WR_PTR,&a,1);//FIFO_WR_PTR[4:0]
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_OVF_COUNTER,&a,1);//OVF_COUNTER[4:0]
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_FIFO_RD_PTR,&a,1);//FIFO_RD_PTR[4:0]
|
||||
|
||||
a=0x0f;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_FIFO_CONFIG,&a,1);//sample avg = 1, fifo rollover=false, fifo almost full = 17
|
||||
a=0x03;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_MODE_CONFIG,&a,1);//0x02 for Red only, 0x03 for SpO2 mode 0x07 multimode LED
|
||||
a=0x27;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_SPO2_CONFIG,&a,1); // SPO2_ADC range = 4096nA, SPO2 sample rate (50 Hz), LED pulseWidth (400uS)
|
||||
a=0x32;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_LED1_PA,&a,1);//Choose value for ~ 10mA for LED1
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_LED2_PA,&a,1);// Choose value for ~ 10mA for LED2
|
||||
a=0x7f;
|
||||
IIC_SAND_DATE(MAX30102_Device_address,REG_PILOT_PA,&a,1);// Choose value for ~ 25mA for Pilot LED
|
||||
}
|
||||
void max30102_read_fifo(void)
|
||||
{
|
||||
uint16_t un_temp;
|
||||
fifo_red=0;
|
||||
fifo_ir=0;
|
||||
uint8_t ach_i2c_data[6];
|
||||
|
||||
//read and clear status register
|
||||
IIC_READ_DATE(MAX30102_Device_address,REG_INTR_STATUS_1,&ach_i2c_data,1);
|
||||
IIC_READ_DATE(MAX30102_Device_address,REG_INTR_STATUS_2,&ach_i2c_data,1);
|
||||
|
||||
ach_i2c_data[0]=REG_FIFO_DATA;
|
||||
|
||||
IIC_READ_DATE(MAX30102_Device_address,REG_FIFO_DATA,&ach_i2c_data,6);
|
||||
|
||||
un_temp=ach_i2c_data[0];
|
||||
un_temp<<=14;
|
||||
fifo_red+=un_temp;
|
||||
un_temp=ach_i2c_data[1];
|
||||
un_temp<<=6;
|
||||
fifo_red+=un_temp;
|
||||
un_temp=ach_i2c_data[2];
|
||||
un_temp>>=2;
|
||||
fifo_red+=un_temp;
|
||||
|
||||
un_temp=ach_i2c_data[3];
|
||||
un_temp<<=14;
|
||||
fifo_ir+=un_temp;
|
||||
un_temp=ach_i2c_data[4];
|
||||
un_temp<<=6;
|
||||
fifo_ir+=un_temp;
|
||||
un_temp=ach_i2c_data[5];
|
||||
un_temp>>=2;
|
||||
fifo_ir+=un_temp;
|
||||
|
||||
if(fifo_ir<=10000)
|
||||
{
|
||||
fifo_ir=0;
|
||||
}
|
||||
if(fifo_red<=10000)
|
||||
{
|
||||
fifo_red=0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void APP_blood_init(window *a_window)
|
||||
{
|
||||
blood_win=a_window;
|
||||
Max30102_reset();
|
||||
MAX30102_Config();
|
||||
|
||||
//HAL_GPIO_WritePin(MAX_RD_GPIO_Port, MAX_RD_Pin, 0);
|
||||
}
|
||||
|
||||
void APP_blood_loop()
|
||||
{
|
||||
max30102_read_fifo();
|
||||
sprintf(blood_str,"fifo_red:%d",fifo_red);
|
||||
LCD_ShowString(blood_win->x, blood_win->y+16, &blood_str, 16, WHITE, RED);
|
||||
sprintf(blood_str,"fifo_ir:%d",fifo_ir);
|
||||
LCD_ShowString(blood_win->x, blood_win->y+32, &blood_str, 16, WHITE, RED);
|
||||
sprintf(blood_str,"INT:%d",HAL_GPIO_ReadPin(MAX_INT_GPIO_Port, MAX_INT_Pin));
|
||||
LCD_ShowString(blood_win->x, blood_win->y+48, &blood_str, 16, WHITE, RED);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,33 @@
|
||||
#include "windows.h"
|
||||
#include "LCD.h"
|
||||
|
||||
#define MAX30102_Device_address 0xAE
|
||||
//register addresses
|
||||
#define REG_INTR_STATUS_1 0x00
|
||||
#define REG_INTR_STATUS_2 0x01
|
||||
#define REG_INTR_ENABLE_1 0x02
|
||||
#define REG_INTR_ENABLE_2 0x03
|
||||
#define REG_FIFO_WR_PTR 0x04
|
||||
#define REG_OVF_COUNTER 0x05
|
||||
#define REG_FIFO_RD_PTR 0x06
|
||||
#define REG_FIFO_DATA 0x07
|
||||
#define REG_FIFO_CONFIG 0x08
|
||||
#define REG_MODE_CONFIG 0x09
|
||||
#define REG_SPO2_CONFIG 0x0A
|
||||
#define REG_LED1_PA 0x0C
|
||||
#define REG_LED2_PA 0x0D
|
||||
#define REG_PILOT_PA 0x10
|
||||
#define REG_MULTI_LED_CTRL1 0x11
|
||||
#define REG_MULTI_LED_CTRL2 0x12
|
||||
#define REG_TEMP_INTR 0x1F
|
||||
#define REG_TEMP_FRAC 0x20
|
||||
#define REG_TEMP_CONFIG 0x21
|
||||
#define REG_PROX_INT_THRESH 0x30
|
||||
#define REG_REV_ID 0xFE
|
||||
#define REG_PART_ID 0xFF
|
||||
|
||||
#define SAMPLES_PER_SECOND 100 //¼ì²âƵÂÊ
|
||||
|
||||
void APP_blood_init(window *a_window);
|
||||
void APP_blood_loop();
|
||||
|
||||
|
||||
@@ -27,26 +27,29 @@ Mcu.Pin17=PE15
|
||||
Mcu.Pin18=PB10
|
||||
Mcu.Pin19=PB11
|
||||
Mcu.Pin2=PF10
|
||||
Mcu.Pin20=PD8
|
||||
Mcu.Pin21=PD9
|
||||
Mcu.Pin22=PD10
|
||||
Mcu.Pin23=PD14
|
||||
Mcu.Pin24=PD15
|
||||
Mcu.Pin25=PD0
|
||||
Mcu.Pin26=PD1
|
||||
Mcu.Pin27=PD4
|
||||
Mcu.Pin28=PD5
|
||||
Mcu.Pin29=PG12
|
||||
Mcu.Pin20=PB12
|
||||
Mcu.Pin21=PB13
|
||||
Mcu.Pin22=PB14
|
||||
Mcu.Pin23=PD8
|
||||
Mcu.Pin24=PD9
|
||||
Mcu.Pin25=PD10
|
||||
Mcu.Pin26=PD14
|
||||
Mcu.Pin27=PD15
|
||||
Mcu.Pin28=PD0
|
||||
Mcu.Pin29=PD1
|
||||
Mcu.Pin3=OSC_IN
|
||||
Mcu.Pin30=VP_SYS_VS_ND
|
||||
Mcu.Pin31=VP_SYS_VS_Systick
|
||||
Mcu.Pin30=PD4
|
||||
Mcu.Pin31=PD5
|
||||
Mcu.Pin32=PG12
|
||||
Mcu.Pin33=VP_SYS_VS_ND
|
||||
Mcu.Pin34=VP_SYS_VS_Systick
|
||||
Mcu.Pin4=OSC_OUT
|
||||
Mcu.Pin5=PB0
|
||||
Mcu.Pin6=PB1
|
||||
Mcu.Pin7=PB2
|
||||
Mcu.Pin8=PG0
|
||||
Mcu.Pin9=PE7
|
||||
Mcu.PinsNb=32
|
||||
Mcu.PinsNb=35
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F103ZETx
|
||||
@@ -81,6 +84,24 @@ PB10.Mode=I2C
|
||||
PB10.Signal=I2C2_SCL
|
||||
PB11.Mode=I2C
|
||||
PB11.Signal=I2C2_SDA
|
||||
PB12.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label
|
||||
PB12.GPIO_Label=MAX_IRD
|
||||
PB12.GPIO_PuPd=GPIO_PULLUP
|
||||
PB12.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
PB12.Locked=true
|
||||
PB12.PinState=GPIO_PIN_SET
|
||||
PB12.Signal=GPIO_Output
|
||||
PB13.GPIOParameters=GPIO_Label
|
||||
PB13.GPIO_Label=MAX_INT
|
||||
PB13.Locked=true
|
||||
PB13.Signal=GPIO_Input
|
||||
PB14.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label
|
||||
PB14.GPIO_Label=MAX_RD
|
||||
PB14.GPIO_PuPd=GPIO_PULLUP
|
||||
PB14.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
PB14.Locked=true
|
||||
PB14.PinState=GPIO_PIN_SET
|
||||
PB14.Signal=GPIO_Output
|
||||
PB2.GPIOParameters=GPIO_Speed,PinState,GPIO_Label
|
||||
PB2.GPIO_Label=TCS
|
||||
PB2.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
|
||||
Reference in New Issue
Block a user