大家好,最近想用电容触摸库做样品。
看到大家有很多成功的案例,也下了触摸库例程,看来看去也不知道怎么用?
有谁可以指教一下,不胜感激。
我下的资料是STM8S_TouchSensing_Lib_V2.50
F:\我的资料\stm8 touch\STM8S_TouchSensing_Lib_Vme\Projects\Examples\STM8S207K6_Ex01\src
6) Getting started
This section detailed the steps to follow in order to build a touch-sensing application using the STM8S Touch-Sensing Driver:
•Copy the stm8_tsl_conf_RC_TOADAPT.h file to y**elopment folder.
•Rename this file in stm8_tsl_conf.h.
•Modify the stm8_tsl_conf.h file in order to adapt it to your application. See the Configuration file section for more details on the different settings.
•Include the stm8_tsl_api.h file to the main file.
#include "stm8_tsl_api.h"
•Add to your project, all the STM8S Touch-Sensing Driver files.
•Add the path to the STM8S Touch-Sensing Driver header files in the preprocessor section of your project.
•In the init section of the application, call the TSL_Init() function to initialize the TSL state machine.
/* Init TSL RC */TSL_Init();/* Init Application Keys */Init_keys(); •In the same init section, initialize the keys to be used by the application (i.e. IMPLEMENTED, ENABLED, DxSGroup).
sSCKeyInfo[0].Setting.b.IMPLEMENTED = 1;sSCKeyInfo[0].Setting.b.ENABLED = 1;sSCKeyInfo[0].DxSGroup = 0x01; •Call the TSL_Action() function in a continuous loop of the application.
for (;;) { /* Run TSL RC state machine */ TSL_Action(); /* Run Application */ Application_Action(); |