The STM8TL5x_STMTouch_Lib_V2.1.0, sensing long touches and the touch lib state machine
Hello. I've built a sensor similar to that pictured in 'Figure 3. H sensor (single layer)' from the AN4313 Projected sensor design document. I'm using it in conjunction with the Touch Driver library as part of the STM8TL5x_STMTouch_Lib_V2.1.0 touch library.
When I touch the sensor, I reliably get TSL_STATEMASK_DETECT states (normally preceded by DEB_DETECT states). When I stop touching the sensor after a moment, I reliably get RELEASE states (usually preceded by a few DEB_RELEASE_DETECT states). But NOT when the touch is long (greater than a second or so). In that case, I always get intervening CALIBRATION states that precede subsequent RELEASE states and those RELEASE states are often transmitted while the sensor is still being touched. And that is complicating the ability to determine the moment when the sensor is no longer touched. My goal is to determine the moment when the sensor is touched and the moment when it is no longer touched with equal reliability no matter how long the touch. Is this even possible to do for long touches? Is there any software option I can choose to prevent those intervening CALIBRATION states? Or might there be another kind of work-around?
It's curious that I never see a TOUCH state at all. I'm also noticing that the state machine does NOT necessarily follow the flow chart illustrated in 'Figure 12. Simplified sensors state machine' in the document 'UM1606 STMTouch driver user manual'. Am I not querying the state machine fast enough? Thanks for any help or suggestions.
