diff --git a/APP/bsp_wf5803.c b/APP/bsp_wf5803.c index 4d83eec..26ba86f 100644 --- a/APP/bsp_wf5803.c +++ b/APP/bsp_wf5803.c @@ -116,7 +116,7 @@ void PRESS_IO_SPI_Init(void) PRESS_SPI_CsStop(kPressOut); PRESS_SPI_CsStop(kPressAtom); - // spi初始化,模式0 + // spi鍒濆鍖栵紝妯″紡0 GPIOA_ModeCfg(GPIO_Pin_13 | GPIO_Pin_14, GPIO_ModeOut_PP_5mA); GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeIN_PU); @@ -126,14 +126,14 @@ void PRESS_IO_SPI_Init(void) void WF5803_Init(void) { PRESS_IO_SPI_Init(); - WF5803_WriteReg(0x00, 0x81, kPressIn); // 配置spi为四线模式 - WF5803_WriteReg(0x00, 0x81, kPressOut); // 配置spi为四线模式 - WF5803_WriteReg(0x00, 0x81, kPressAtom); // 配置spi为四线模式 + WF5803_WriteReg(0x00, 0x81, kPressIn); // 閰嶇疆spi涓哄洓绾挎ā寮 + WF5803_WriteReg(0x00, 0x81, kPressOut); // 閰嶇疆spi涓哄洓绾挎ā寮 + WF5803_WriteReg(0x00, 0x81, kPressAtom); // 閰嶇疆spi涓哄洓绾挎ā寮 } void PRESS_LowerIO_Init(void) { - // WF5803默认供电时,其他IO都是高电平 + // WF5803榛樿渚涚數鏃讹紝鍏朵粬IO閮芥槸楂樼數骞 // SPI GPIOA_SetBits(GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15); GPIOA_ModeCfg(GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15, GPIO_ModeIN_PU); @@ -189,8 +189,8 @@ uint8_t GetSensorData(TePressSensorIndex index) PRINT("Status = %02x\r\n", WF5803_ReadReg(0x02, index)); - // 气压数据 - // 温度数据 + // 姘斿帇鏁版嵁 + // 娓╁害鏁版嵁 for (uint8_t i = 0; i < 5; i++) { press_raw_data[index][i] = WF5803_ReadReg(0x06 + i, index); @@ -203,8 +203,8 @@ void SensorData_Process(TePressSensorIndex index) { long reading = 0; float fDat = 0; - float press = 0; - float temp = 0; + float press = 0; + float temp = 0; GetSensorData(index); @@ -222,7 +222,7 @@ void SensorData_Process(TePressSensorIndex index) fDat = reading / 8388608.0f; } - press = fDat * 125 + 17.5; // WF5803_1BAR 如果是使用10m级别的深传就使用这个 + press = fDat * 125 + 17.5; // WF5803_1BAR 濡傛灉鏄娇鐢10m绾у埆鐨勬繁浼犲氨浣跨敤杩欎釜 reading = press_raw_data[index][3]; reading = reading << 8;