/*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的,通用,只是改了部分读写的内容;