AnsweredAssumed Answered

Stm8 touch library

Question asked by dobhal.puneet on May 7, 2014
I intend to implement a single touch key using stm8 touch library. I am having few issues regarding this.

I haven't used the shield concept for noise immunity, so what does a need to define for : SCKEY_P2_DRIVEN_SHIELD_MASK in the configuration file.


#define LED1_GPIO_PORT             (GPIOB)
#define LED1_GPIO_PIN             (GPIO_PIN_4)

void main()
  LED1_GPIO_PORT->ODR |= (uint8_t)(LED1_GPIO_PIN);
  LED1_GPIO_PORT->DDR |= (uint8_t)(LED1_GPIO_PIN);
  LED1_GPIO_PORT->CR1 |= (uint8_t)(LED1_GPIO_PIN);
  LED1_GPIO_PORT->CR2 &= (uint8_t)(~(LED1_GPIO_PIN));
  sSCKeyInfo[0].Setting.b.IMPLEMENTED = 1;
  sSCKeyInfo[0].Setting.b.ENABLED = 1;
  sSCKeyInfo[0].DxSGroup = 0x01;
    if (sSCKeyInfo[0].Setting.b.DETECTED)
    LED1_GPIO_PORT->ODR &= ~(uint8_t)(LED1_GPIO_PIN);  
    LED1_GPIO_PORT->ODR |= (uint8_t)(LED1_GPIO_PIN);  

Also here is the main file code , I am not too clear about the validity of this code too. Please provide me help on this issue.

Thank you.