AnsweredAssumed Answered

Segger UI TouchScreen problem

Question asked by karpavicius.linas on Jan 12, 2014
Hello, i made reflow oven controller by using STM32F429i mcu with amoled and capacitive touchscreen. I get it display images correctly by using original stm32f429i-disco files, but i am having troubles to make capacitive touchscreen working.

I have working touchscreen program. it consist of two functions. first is init function for i2c, gpio and registers init for tp controller, secnd is interrupt to get new info about pointer position.

so question is, how to rewrite original stm32f429i-disco program that it could run on my hardware.

volatile int xxx=0,yyy=0,zzz=0;
 
void EXTI2_IRQHandler(void)
{
  if(EXTI_GetITStatus(EXTI_Line2) != RESET)
  {
    char data[32];
    int i=0;
    I2C_start(sEEE_I2C, 0x80, I2C_Direction_Transmitter);
    spi_delay(500);
    I2C_write(sEEE_I2C,0x00);
    spi_delay(500);
    I2C_start2(sEEE_I2C, 0x80, I2C_Direction_Receiver);
    spi_delay(500);
    while(i<13)
    {
      data[i]=I2C_read_ack(sEEE_I2C);
      i++;
      spi_delay(500);
    }
    I2C_stop(sEEE_I2C);
 
    xxx = data[3] | (uint16_t)((data[2] & 0x1f) << 8);
    yyy = data[5] | (uint16_t)((data[4] & 0x1f) << 8);
    zzz = data[1];
   
    EXTI_ClearITPendingBit(EXTI_Line2);
  }
}
 
 
 
TP_STATE* IOE_TP_GetState(void)
{
   
  TP_State.TouchDetected = 1;
  TP_State.X = xxx;
     
  TP_State.Y = yyy;
 
  TP_State.Z = zzz;
   
   
 
 
  return &TP_State;
}

This is what i did, but it dosent work. note that interrupt is working, and can update xxx,yyy, and zzz inside interrupt.

So any one know how to get it working ?
More info about controller can be found in here:

Outcomes