iic速率调整到400k
This commit is contained in:
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
#define TCFG_HW_I2C0_PORTS 'B'
|
#define TCFG_HW_I2C0_PORTS 'B'
|
||||||
#define TCFG_HW_I2C0_CLK 1000000 //硬件IIC波特率:100k
|
#define TCFG_HW_I2C0_CLK 400000 //硬件IIC波特率:400k
|
||||||
|
|
||||||
//*********************************************************************************//
|
//*********************************************************************************//
|
||||||
// 硬件SPI 配置 //
|
// 硬件SPI 配置 //
|
||||||
|
|||||||
@ -441,19 +441,12 @@ void bmp280_test(void){
|
|||||||
|
|
||||||
void gsensor_test(void){
|
void gsensor_test(void){
|
||||||
#if 1
|
#if 1
|
||||||
if(count >= 5){
|
signed short acc_data_buf[3];
|
||||||
xlog("==============time============\n");
|
signed short gyr_data_buf[3];
|
||||||
|
SL_SC7U22_RawData_Read(acc_data_buf,gyr_data_buf);
|
||||||
u32 current_time = get_ms_timer();
|
|
||||||
xlog("Time since last reset: %u ms\n", current_time);
|
|
||||||
|
|
||||||
// 为了演示,我们在这里调用重置
|
|
||||||
if (current_time > 5000) { // 比如超过5秒就重置一次
|
|
||||||
reset_ms_timer();
|
|
||||||
}
|
|
||||||
|
|
||||||
count = 0;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
static u16 gtest_id = 0;
|
||||||
|
void test_func(void){
|
||||||
|
create_process(>est_id,"gtest_id",NULL,gsensor_test,1000);
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ Copyright (c) 2022 Silan MEMS. All Rights Reserved.
|
|||||||
/***使用前请根据实际情况配置以下参数******/
|
/***使用前请根据实际情况配置以下参数******/
|
||||||
/**SC7U22的SDO 接地: 0****************/
|
/**SC7U22的SDO 接地: 0****************/
|
||||||
/**SC7U22的SDO 接电源:1****************/
|
/**SC7U22的SDO 接电源:1****************/
|
||||||
#define SL_SC7U22_SDO_VDD_GND 0
|
#define SL_SC7U22_SDO_VDD_GND 1
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
/***使用前请根据实际IIC地址配置参数***/
|
/***使用前请根据实际IIC地址配置参数***/
|
||||||
/**SC7U22的IIC 接口地址为 7bits: 0****/
|
/**SC7U22的IIC 接口地址为 7bits: 0****/
|
||||||
|
|||||||
@ -234,6 +234,10 @@ void le_user_app_event_handler(struct sys_event* event){
|
|||||||
send_data_to_ble_client(&device_buff,founds);
|
send_data_to_ble_client(&device_buff,founds);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 0x02:
|
||||||
|
extern void test_func(void);
|
||||||
|
// test_func();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -5751,6 +5751,7 @@ objs/apps/earphone/xtell_Sensor/xtell_handler.c.o
|
|||||||
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,printf,l
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,printf,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,i2c_scanner_probe,l
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,i2c_scanner_probe,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,send_data_to_ble_client,l
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,send_data_to_ble_client,l
|
||||||
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,test_func,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,stop_calibration,l
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,stop_calibration,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,SL_SC7U22_Config,l
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,SL_SC7U22_Config,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,start_calibration,l
|
-r=objs/apps/earphone/xtell_Sensor/xtell_handler.c.o,start_calibration,l
|
||||||
@ -5839,6 +5840,7 @@ objs/apps/earphone/xtell_Sensor/send_data.c.o
|
|||||||
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,circle_buffer_init,l
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,circle_buffer_init,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,bmp280_test,pl
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,bmp280_test,pl
|
||||||
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,gsensor_test,pl
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,gsensor_test,pl
|
||||||
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,test_func,pl
|
||||||
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,SC7U22_init,l
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,SC7U22_init,l
|
||||||
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,SC7U22_calibration_id,pl
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,SC7U22_calibration_id,pl
|
||||||
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,foot_init,l
|
-r=objs/apps/earphone/xtell_Sensor/send_data.c.o,foot_init,l
|
||||||
|
|||||||
Reference in New Issue
Block a user