悬赏
8
分 芯积分未解决
筒子们,help,MCUCC3200 + LIS3DH实现记步算法,现在需要配置LIS3DH的INT1中断,使其能够唤醒MCUCC3200的某个PIN,
具体表现为拉高其电平,然后触发中断函数(GPIO中断),中断函数就是开始进行计步算法,下面是我LIS3DH的一些配置,求大神
指教,这个duration和threshold该怎么配置,LIS3DH的中断控制寄存器该如何配置呢?
/*1.set gsensor XYZ data enable */
LIS3DH_SetAxis(LIS3DH_X_ENABLE|LIS3DH_Y_ENABLE|LIS3DH_Z_ENABLE); //do
/*2.set gsensor normal mode*/
LIS3DH_SetMode(LIS3DH_NORMAL); //do
/*3.set gsensor samping HZ*/
LIS3DH_SetODR(LIS3DH_ODR_200Hz); // do
/*4.set gsensor sampling rang*/
LIS3DH_SetFullScale(LIS3DH_FULLSCALE_2); //do
/*5.set gSensor duration and threshold*/
gSensor_set_duration_and_threshold(0,2);
#ifdef LIS3DH_FIFO_ENABLE
/*6.set fifo mode and enable */
LIS3DH_FIFOModeEnable(LIS3DH_FIFO_STREAM_MODE);//(LIS3DH_FIFO_MODE);
#if 0
gSensor_FWM_Interrupt_Enable(0);
#endif
/*7.set fifo interrupt mode*/
LIS3DH_SetTriggerInt(LIS3DH_TRIG_INT1);
LIS3DH_SetWaterMark(31);//buff full will have a inter
#endif
/*8.enable intr pin*/
LIS3DH_HPFAOI1Enable(MEMS_ENABLE);// enable INT
/*9. map intr pin to intr1 */
gSensor_Slope_Intr_config();// SET which direction
/*10.set intr mode */
LIS3DH_SetIntMode(LIS3DH_INT_MODE_6D_MOVEMENT);// XYZ 6 个方向有效
/*11.enable slop intr */
gSensor_Slope_Intr_Enable(1);// LIS3DH_SetInt1Pin(0x40,1)
注:驱动文件是网上download的,通用,只是改了部分读写的内容;