I am currently working on AM335x skEVM using Starterware. In Starterware, there is a sample example call "touchSreen" (tscCalibrate.c).
I have done some modification to try to enable the interrupt event for "TSCADC_PEN_UP_EVENT_INT" for testing. Just by looking at the definition, this interrupt event should be generated when user's finger is withdrawn from the touchscreen.
Below is the related modification in "tscCalibrate.c" (code in red are the actual modification) .
...
/******************************************************************************
** GLOBAL VARIABLE DEFINITIONS
******************************************************************************/
volatile unsigned int x_val[2];
volatile unsigned int y_val[2];
volatile unsigned int error;
volatile unsigned int IsTSPress;
volatile unsigned int numOfInt = 0;
volatile unsigned int Index =0;
volatile unsigned int TSPenUpInt = 0, TSPenUpInt_Show = 0;
....
static void TouchScreenInit(void)
{
…..
TSCADCEventInterruptEnable(TSC_ADC_INSTANCE, TSCADC_FIFO1_THRESHOLD_INT|TSCADC_PEN_UP_EVENT_INT);
…..
}
static void TouchScreenIsr()
{
…..
if(status & TSCADC_PEN_UP_EVENT_INT)
{
TSPenUpInt++;
TSCADCIntStatusClear(TSC_ADC_INSTANCE, TSCADC_PEN_UP_EVENT_INT);
}
…..
}
static void ReadTouchScreenPress(void)
{
…..
if(TSPenUpInt_Show != TSPenUpInt)
{
TSPenUpInt_Show = TSPenUpInt;
UARTPuts("TSPenUpInt_Show=",-1);
UARTPutNum(TSPenUpInt_Show);
UARTPuts("\r\n", -1);
}
…..
}
Base on the testing, it was found that the "TSCADC_PEN_UP_EVENT_INT" event is not generated with user withdraw his finger from the touchscreen.
However, it was found that "TSCADC_PEN_UP_EVENT_INT" event is generated continuously if the users finger is remained press down on the touchscreen.
Is this normal behavior?