I have a question on the ICU module. In its documentation page there is a figure depicting its state machine which doesn't show the icuEnableNotifications() and icuDisableNotifications() functions. The documentation for these functions doesn't say much either, only that the function enables or disables notifications (which I assume are the calling of the callback functions). My question then is whether these functions changes the current state (ICU_WAITING, ICU_ACTIVE, etc) of the module or not. I guess if they don't change the state they merely suppress the calling of callback functions but continue to keep track of the width and period of the square wave on the input. But if they do change state, what is the final state?
I hope I was sufficiently clear in the question. Thanks for your replies.
Question about the ICU module
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Question about the ICU module
Hi,
Those functions don't change the driver state, it is just about enabling/disabling callbacks at runtime.
Giovanni
Those functions don't change the driver state, it is just about enabling/disabling callbacks at runtime.
Giovanni
Re: Question about the ICU module
Sorry if I'm being nitpicky but I just want to see if I understand correctly how the ICU module works.
Suppose the ICU module is configured to be in the ICU_INPUT_ACTIVE_HIGH mode. I call icuStartCapture() and two or more activation edges occur, meaning the ICU state machine is in the ICU_ACTIVE state. After some time, I call icuDisableNotifications() and let a few periods of the square wave on the capture pin pass by. I then call icuEnableNotifications() when the capture pin signal is not in the active state (i.e., it is low). I assume the ICU module is still in the ICU_ACTIVE state at this time. This means that the first activation edge (a rising edge) after I call icuEnableNotifications() triggers a call to the period callback and measures correctly the period, right?
In other words, the function icuDisableNotifications() only disables the callbacks, but it doesn't disable the width and period measurements.
Is that correct?
Thanks.
Suppose the ICU module is configured to be in the ICU_INPUT_ACTIVE_HIGH mode. I call icuStartCapture() and two or more activation edges occur, meaning the ICU state machine is in the ICU_ACTIVE state. After some time, I call icuDisableNotifications() and let a few periods of the square wave on the capture pin pass by. I then call icuEnableNotifications() when the capture pin signal is not in the active state (i.e., it is low). I assume the ICU module is still in the ICU_ACTIVE state at this time. This means that the first activation edge (a rising edge) after I call icuEnableNotifications() triggers a call to the period callback and measures correctly the period, right?
In other words, the function icuDisableNotifications() only disables the callbacks, but it doesn't disable the width and period measurements.
Is that correct?
Thanks.
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Question about the ICU module
It does not affect measurements, you can wait for edges in polled mode too.
Giovanni
Giovanni
Who is online
Users browsing this forum: No registered users and 3 guests