add reset dev i2c slave id

This commit is contained in:
Yunhorn 2023-07-11 17:24:59 +08:00
parent 635918ca35
commit 02ba2481c7
3 changed files with 14 additions and 5 deletions

View File

@ -24,7 +24,7 @@
#include "X-WL55_WLE5_53L0X.h"
#include "stm32wlxx_hal.h"
#include "main.h"
#ifndef HAL_I2C_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
@ -196,6 +196,16 @@ int XWL55_WLE5_53L0X_Init(void)
}
void XWL55_WLE5_53L0X_Reset(void)
{
HAL_GPIO_WritePin(TOF_C_XSHUT_GPIO_Port, TOF_C_XSHUT_Pin, GPIO_PIN_RESET);
HAL_Delay(30);
HAL_GPIO_WritePin(TOF_C_XSHUT_GPIO_Port, TOF_C_XSHUT_Pin, GPIO_PIN_SET);
HAL_Delay(30);
}
/**
*
* @} X-WL55_WLE5_53L0X_top

View File

@ -231,6 +231,8 @@ int XWL55_WLE5_53L0X_Init(void);
int XNUCLEO53L1A1_ResetId(int DevNo, int state );
void XWL55_WLE5_53L0X_Reset(void);
/**
* Enable Disable interrupt at MCU level (MSP)
*

View File

@ -131,10 +131,7 @@ int sts_tof_vl53l0x_DetectSensors(void)
int FinalAddress;
nDevPresent = 0;
HAL_GPIO_WritePin(TOF_C_XSHUT_GPIO_Port, TOF_C_XSHUT_Pin, GPIO_PIN_RESET);
HAL_Delay(10);
HAL_GPIO_WritePin(TOF_C_XSHUT_GPIO_Port, TOF_C_XSHUT_Pin, GPIO_PIN_SET);
HAL_Delay(10);
XWL55_WLE5_53L0X_Reset();
//HAL_GPIO_WritePin(TOF_C_XSHUT_GPIO_Port, TOF_C_XSHUT_Pin, GPIO_PIN_SET);
//HAL_Delay(100);