|
|
/*
|
|
|
******************************************************************************
|
|
|
* @file driver_ST7735S.c
|
|
|
* @author <20>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD><EFBFBD>
|
|
|
* @version V1.0.0
|
|
|
* @date 2023
|
|
|
* @brief ST7735S driver.
|
|
|
* This file provides firmware functions to manage gc9c01
|
|
|
* with SPI and DMA. User should set GPIO, dma channel, spi
|
|
|
* channel according actual resource allocation.
|
|
|
******************************************************************************
|
|
|
* @attention
|
|
|
*
|
|
|
* Copyright (c) 2023 Bixdo.
|
|
|
* All rights reserved.
|
|
|
******************************************************************************
|
|
|
*/
|
|
|
#include "ALLinclude.h"
|
|
|
|
|
|
uint32_t DataPressure ;
|
|
|
uint32_t DataPressure_BK=331449;
|
|
|
#define DataPressureOverload 332042
|
|
|
|
|
|
void FunctionReadPressure(void)
|
|
|
{
|
|
|
static uint32_t TimerOverLoad;
|
|
|
|
|
|
#if CSU18M68 == 1
|
|
|
|
|
|
static uint8_t Data_E1[2];
|
|
|
static uint8_t Data_E2[2];
|
|
|
static uint8_t Data_ID[2];
|
|
|
VL53L0X_read_multi(DeviceAddress,Index_JustData,&Data_E1[0],2);
|
|
|
VL53L0X_read_multi(DeviceAddress,Index_Status,&Data_E2[0],2);
|
|
|
VL53L0X_read_multi(DeviceAddress,Index_ID,&Data_ID[0],2);
|
|
|
#endif
|
|
|
|
|
|
#if PMDS_F2 == 1
|
|
|
|
|
|
PMDS_Read_Result( _RES0_ADDR, //要读取的测量通道结果寄存器地址
|
|
|
PMDS_Fx.RESx.buff, //存储结果寄存器数据的缓存
|
|
|
32);
|
|
|
DataPressure=PMDS_Fx.RESx.buff[30]<<16 | PMDS_Fx.RESx.buff[29]<<8 | PMDS_Fx.RESx.buff[28];
|
|
|
if(DataPressure>DataPressureOverload && DataPressure<0xF0F0F0)
|
|
|
{
|
|
|
if(TimerOverLoad<0xffffffff)TimerOverLoad++;
|
|
|
if(TimerOverLoad = 5)
|
|
|
{
|
|
|
SendCmd(eCmdPressureOverload);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
TimerOverLoad =0;
|
|
|
}
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
void FunctionAdjustPressure(void)
|
|
|
{
|
|
|
static uint8_t Data_E2[2];
|
|
|
uint8_t CmdAdjust = 0x01;
|
|
|
#if CSU18M68 == 1
|
|
|
VL53L0X_write_multi(DeviceAddress,Index_Adjust,&CmdAdjust,1);
|
|
|
vTaskDelay(2);
|
|
|
VL53L0X_read_multi(DeviceAddress,Index_Status,&Data_E2[0],2);
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/*********************************************END OF FILE*********************************************/ |