AnsweredAssumed Answered

STM32L15 Touch Sensor and RI

Question asked by turtle.charles on Apr 29, 2015
I am trying to write my own driver for the touch sensor and right now, am learning how to use RI. I thought I understood what to so I tried to connect pins PA.0 and PA.1 together. And measure the resistance between them to make sure I was doing it correct. However it never seems to work, there is always pretty large resistance. Here the section of code:

     GPIOA->MODER &= ~((0x03)<<(2*1)); //Mode mask
     GPIOA->MODER |= 0x03<<(2*1);     // Set as analog
     GPIOA->MODER &= ~((0x03)<<(2*0)); //Mode mask
     GPIOA->MODER |= 0x03<<(2*0);     // Set as analog
     RI->ASCR1 &= ~RI_ASCR1_CH_1;
     RI->ASCR1 &= ~RI_ASCR1_CH_0;
     RI->ASCR1 |= RI_ASCR1_CH_0;
     RI->ASCR1 |= RI_ASCR1_CH_1;
Am I doing something blatantly wrong here?