In the mma8452.c driver code provided in linux they have mentioned one note i.e.
/* * Although we enable the interrupt sources once and for * all here the event detection itself is not enabled until * userspace asks for it by mma8452_write_event_config() */
I am trying to interface mma8653 with imx8-mini I could not able to understand how I would get interrupt on INT1 or INT2 pin by using this driver code. Is anyone could provide some details or any documentation
已解决! 转到解答。
Hello Madhuri,
Unfortunately I am not familiar with this driver and do not know who is the author, but I think what this note is trying to say is that in order to enable any of the four available interrupt functions, not only the corresponding INT_EN_x (CTRL_REG4) and INT_CFG_x (CTRL_REG5) bits need to be configured, but also the function itself need to enabled and configured.
Let’s assume for example the motion function. If you want a motion event to generate an interrupt, the motion detection needs to be enabled by setting the OAE bit in the FF_MT_CFG register. Then it is necessary to configure the motion threshold and debounce time using FF_MT_THS and FF_MT_COUNT registers. Finally you need to set the INT_EN_FF_MT bit in the CTRL_REG4 register and set/clear the INT_CFG_FF_MT bit in the CTRL_REG5 register depending on which interrupt pin you want to use for this function.
Best regards,
Tomas
Hello Madhuri,
Unfortunately I am not familiar with this driver and do not know who is the author, but I think what this note is trying to say is that in order to enable any of the four available interrupt functions, not only the corresponding INT_EN_x (CTRL_REG4) and INT_CFG_x (CTRL_REG5) bits need to be configured, but also the function itself need to enabled and configured.
Let’s assume for example the motion function. If you want a motion event to generate an interrupt, the motion detection needs to be enabled by setting the OAE bit in the FF_MT_CFG register. Then it is necessary to configure the motion threshold and debounce time using FF_MT_THS and FF_MT_COUNT registers. Finally you need to set the INT_EN_FF_MT bit in the CTRL_REG4 register and set/clear the INT_CFG_FF_MT bit in the CTRL_REG5 register depending on which interrupt pin you want to use for this function.
Best regards,
Tomas
Hi, I do have one more doubt I want to generate interrupt only once after change in orientation but it seems like it occurs more than three four times.
Is this debounce issue if so how to resolve this because I am not getting how to use PL_COUNT register to handle this issue.