大家好再次来求助论坛了
这次想要用WAKE_UP功能输出中断,设置WAKE_UP_SRC寄存器,发现不成功读出的值一直是0
设置其他寄存器都OK,想请教下设置这个寄存器有特殊的流程吗?比如设置这个寄存器必须先设置另一个寄存器之类的
设置MD2_CFG和WAKE_UP_DUR这两个寄存器都是成功的。感谢啊!
lsm6dsl_write_reg(&lsm6dsl_ctx, LSM6DSL_MD2_CFG, &num4, 1);
lsm6dsl_read_reg(&lsm6dsl_ctx, LSM6DSL_MD2_CFG, &buffer, 1);
LOG_I(LSM6,"Read LSM6DSL_MD2_CFG:%d\r\n",buffer); /* set wakeup interrupt */
lsm6dsl_write_reg(&lsm6dsl_ctx, LSM6DSL_WAKE_UP_DUR, &num5, 1);
lsm6dsl_read_reg(&lsm6dsl_ctx, LSM6DSL_WAKE_UP_DUR, &buffer, 1);
LOG_I(LSM6,"Read LSM6DSL_WAKE_UP_DUR:%d\r\n",buffer); /* set wakeup interrupt DUR */
lsm6dsl_write_reg(&lsm6dsl_ctx, LSM6DSL_WAKE_UP_SRC, &num6, 1);
lsm6dsl_read_reg(&lsm6dsl_ctx, LSM6DSL_WAKE_UP_SRC, &buffer, 1);
LOG_I(LSM6,"Read LSM6DSL_WAKE_UP_SRC:%d\r\n",buffer); /* set wakeup event interrupt */
明白,那我要用到WAKE_UP这个功能,将传感器网上抬希望INT2有中断输出,是不是设置MD2_CFG为00100000就是INT2_WU这个位吗
我设置了MD2_CFG这个寄存器,开启wakeup中断使能,但是示波器就输出不了中断,而且读这个WAKE_UP_SRC也一直是0。
问题解决了,参考如图这两种配置就可以解决问题。解答留给遇到同样问题的童鞋们,不要感谢我,感谢版主!