stm8_tsl_conf_ct_toadapt.h

来自「STM8s」· C头文件 代码 · 共 428 行 · 第 1/2 页

H
428
字号
/**
  ******************************************************************************
  * @file    stm8_tsl_conf_CT_TOADAPT.h
  * @author  MCD Application Team
  * @version V2.3.1
  * @date    14-February-2011
  * @brief   STM8 Touch Sensing Library - This file is a template for the
  *          Charge-Transfer acquisition and must be adapted to your requirements.
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __TSL_CONF_H
#define __TSL_CONF_H


//==============================================================================
//
// 1) MCU FAMILY SELECTION
//
// Uncomment only one line to select the device used.
//
//==============================================================================

//#define STM8L15X (1)  /**< Select this line if the STM8L15X MCU is used */
#define STM8L10X (1)    /**< Select this line if the STM8L10X MCU is used */


//==============================================================================
//
// 2) GENERIC TIMEBASE TIMER SELECTION (TIMTICK)
//
// Set the generic timebase timer.
// The timer you select must be a basic 8-bit timer.
// This table summarizes the values for some products (consult the datasheet
// if your product is not in the list):
// Product                TIMTICK
// STM8L15x               TIM4
// STM8L10x               TIM4
// Warning: The selected timer update/overflow interrupt vector must point to
// the TSL_Timer_ISR() interrupt routine.
//
//==============================================================================

#define TIMTICK         (TIM4)


//==============================================================================
//
//  *** GROUP AND CHANNEL DESCRIPTION ***
//
//   CHARGE_TRANSFER group and channel description for STM8L10x
//       For more details please refer to the Comparator
//       section in the reference manual
//
// Group 1  CH1   PB0  __/____
//          CH2   PB1  __/__|
//          CH3   PD0  __/__|
//          CH4   PD1  __/__|
//
// Group 2  CH1   PB2  __/____
//          CH2   PB3  __/__|
//          CH3   PD2  __/__|
//          CH4   PD3  __/__|
//
//
//   CHARGE_TRANSFER group and channel description for STM8L15x
//       For more details please refer to the Routing Interface
//       section in the reference manual
//
// Group 1  CH1   PA6  __/____
//          CH2   PA5  __/__|
//          CH3   PA4  __/__|
//
// Group 2  CH1   PC7  __/____
//          CH2   PC4  __/__|
//          CH3   PC3  __/__|
//
// Group 3  CH1   PC2  __/____
//          CH2   PD7  __/__|
//          CH3   PD6  __/__|
//
// Group 4  CH1   PD5  __/____
//          CH2   PD4  __/__|
//          CH3   PB7  __/__|
//
// Group 5  CH1   PB6  __/____
//          CH2   PB5  __/__|
//          CH3   PB4  __/__|
//
// Group 6  CH1   PB3  __/____
//          CH2   PB2  __/__|
//          CH3   PB1  __/__|
//
// Group 7  CH1   PB0  __/____
//          CH2   PD3  __/__|
//          CH3   PD2  __/__|
//
// Group 8  CH1   PD1  __/____
//          CH2   PD0  __/__|
//          CH3   PE5  __/__|
//
// The below values are only used for the groups and channels settings.
// DO NOT change the values.
#define GROUP1 (0x01)
#define GROUP2 (0x02)
#define GROUP3 (0x04)
#define GROUP4 (0x08)
#define GROUP5 (0x10)
#define GROUP6 (0x20)
#define GROUP7 (0x40)
#define GROUP8 (0x80)
#define CH1    (1)
#define CH2    (2)
#define CH3    (3)
#define CH4    (4)
//==============================================================================


//==============================================================================
//
// 3) SAMPLING CAPACITOR CHANNEL SELECTION
//
// Set the sampling capacitors channel.
//
// The hardware for CHARGE_TRANSFER is done in such way that all the sampling
// capacitors have to be connected to the same channel of each group.
// For example, the sampling capacitors are connected to CH2 of each group.
//
//==============================================================================

#define SAMP_CAP_CH   (CH3)  /**< Possible values are CH1, CH2, CH3 and CH4 */


//==============================================================================
//
// 4) SINGLE CHANNEL KEYS DEFINITION FOR CHARGE_TRANSFER - 1st Channel
//
// Set the number of keys
// Set the Channel (cannot be the channel defined for the sampling capacitor)
// set the group for each key
//
//==============================================================================

#define SCKEY_P1_KEY_COUNT  (1)

#define SCKEY_P1_CH   (CH1) /**< Possible values are CH1, CH2, CH3 and CH4 */
/**< Even if SCKEY_P1_KEY_COUNT is null          */
/**< SCKEY_P1_CH must contain the channel number */
/**< used by a multi-key*/

#define SCKEY_P1_A  (GROUP2)
#define SCKEY_P1_B  (0)
#define SCKEY_P1_C  (0)
#define SCKEY_P1_D  (0)
#define SCKEY_P1_E  (0)
#define SCKEY_P1_F  (0)
#define SCKEY_P1_G  (0)
#define SCKEY_P1_H  (0)


//==============================================================================
//
// 5) SINGLE CHANNEL KEYS DEFINITION FOR CHARGE_TRANSFER - 2nd Channel
//
// Set the number of keys
// Set the Channel (cannot be the channel defined for the sampling capacitor)
// set the group for each key
//
//==============================================================================

#define SCKEY_P2_KEY_COUNT  (1)

#define SCKEY_P2_CH   (CH2) /**< Possible values are CH1, CH2, CH3 and CH4 */
/**< Even if SCKEY_P2_KEY_COUNT is null                */
/**< SCKEY_P2_CH must contain the channel number       */
/**< used by a multi-key if different from SCKEY_P1_CH */

#define SCKEY_P2_A  (GROUP2)
#define SCKEY_P2_B  (0)
#define SCKEY_P2_C  (0)
#define SCKEY_P2_D  (0)
#define SCKEY_P2_E  (0)
#define SCKEY_P2_F  (0)
#define SCKEY_P2_G  (0)
#define SCKEY_P2_H  (0)


/*==============================================================================
//                         *** ONLY FOR STM8L10x ***
//
// 6) SINGLE CHANNEL KEYS DEFINITION FOR CHARGE_TRANSFER - 3nd Channel
//
// Set the number of keys
// Set the Channel (cannot be the channel defined for the sampling capacitor)
// set the group for each key
//
//==============================================================================*/

#if defined(STM8L10X)

#define SCKEY_P3_KEY_COUNT  (1)

#define SCKEY_P3_CH   (CH4) /**< Possible values are CH1, CH2, CH3 and CH4 */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?