feat: 增加IMU初始化时重新上电功能

This commit is contained in:
bmy
2024-04-16 09:49:38 +08:00
parent a9b0fe1a18
commit c5edd57aa8
2 changed files with 11 additions and 3 deletions

View File

@@ -223,6 +223,13 @@ void imu660ra_get_temperature(void)
uint8 imu660ra_init(void)
{
uint8 return_state = 0;
// 先给 IMU660RA 断电重启
gpio_init(IMU660RA_PE_PIN, GPO, 0, GPO_PUSH_PULL); // 配置 IMU660RA 的 PE 端口
gpio_low(IMU660RA_PE_PIN);
system_delay_ms(100);
gpio_high(IMU660RA_PE_PIN);
system_delay_ms(20); // 等待设备上电成功
#if IMU660RA_USE_SOFT_IIC

View File

@@ -64,6 +64,7 @@
#define IMU660RA_SOFT_IIC_DELAY (10) // 软件 IIC 的时钟延时周期 数值越小 IIC 通信速率越快
#define IMU660RA_SCL_PIN (E5) // 软件 IIC SCL 引脚 连接 IMU660RA 的 SCL 引脚
#define IMU660RA_SDA_PIN (E4) // 软件 IIC SDA 引脚 连接 IMU660RA 的 SDA 引脚
#define IMU660RA_PE_PIN (E6) // 软件 IIC SDO 引脚 连接 IMU660RA 的 SDO 引脚
//====================================================软件 IIC 驱动====================================================
#else