⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm8_tsl_conf.h

📁 STM8s
💻 H
📖 第 1 页 / 共 2 页
字号:
/**
  ******************************************************************************
  * @file    stm8_tsl_conf_RC_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
  *          RC 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 STM8L10X (1)  /**< Select this line if the STM8L10X MCU is used */
//#define STM8L15X (1)  /**< Select this line if the STM8L15X MCU is used */
#define STM8S (1)       /**< Select this line if the STM8S MCU is used */


//==============================================================================
//
// 2) ACQUISITION TIMER SELECTION (TIMACQ)
//
// Set the acquisition timer name and its counter high register address.
// The timer you select must be a 16-bit timer, have a 8-bit prescaler and
// must be different of the TIMTICK timer described below.
// This table summarizes the values for some products (consult the datasheet
// if your product is not in the list):
// Product                TIMACQ        TIMACQ_CNTR_ADD
// STM8S20x               TIM2          0x530A
//     "                  TIM3          0x5328
// STM8S105               TIM2          0x530A
//     "                  TIM3          0x5328
// STM8S103               TIM2          0x530C
// STM8L10x               TIM2          0x525B
//     "                  TIM3          0x528B
// STM8L15x               TIM2          0x525C
//     "                  TIM3          0x528C
//
//==============================================================================

#define TIMACQ           (TIM3)
#define TIMACQ_CNTR_ADD  (0x5328)


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

#define TIMTICK         (TIM4)


//==============================================================================
//
// 4) REFERENCE LOAD I/O DEFINITION
//
// Set the port
// Set the pin mask
//
//==============================================================================

#define LOADREF_PORT_ADDR  (GPIOA_BaseAddress)  /**< LOADREF pin GPIO base address */

#define LOADREF_BIT        (0x40)               /**< LOADREF pin mask */


//==============================================================================
//
// 5) SINGLE CHANNEL KEYS DEFINITION - PORT 1
//
// Set the number of keys
// Set the port
// Set the pins mask
//
// Warning: This port is mandatory and one key at least must be defined.
//
//==============================================================================

#define SCKEY_P1_KEY_COUNT  (2)  /**< Single channel key Port 1: Number of keys used (value from 1 to 8) */

#define SCKEY_P1_PORT_ADDR  (GPIOB_BaseAddress)  /**< Single channel key Port 1: GPIO base address */

#define SCKEY_P1_A  (0x80)  /**< Single channel key Port 1: 1st key mask */
#define SCKEY_P1_B  (0x01)  /**< Single channel key Port 1: 2nd key mask */
#define SCKEY_P1_C  (0)  /**< Single channel key Port 1: 3rd key mask */
#define SCKEY_P1_D  (0)  /**< Single channel key Port 1: 4th key mask */
#define SCKEY_P1_E  (0)     /**< Single channel key Port 1: 5th key mask */
#define SCKEY_P1_F  (0)     /**< Single channel key Port 1: 6th key mask */
#define SCKEY_P1_G  (0)     /**< Single channel key Port 1: 7th key mask */
#define SCKEY_P1_H  (0)     /**< Single channel key Port 1: 8th key mask */

#define SCKEY_P1_DRIVEN_SHIELD_MASK (0x02)


//==============================================================================
//
// 6) SINGLE CHANNEL KEYS DEFINITION - PORT 2
//
// Set the number of keys
// Set the port
// Set the pins mask
//
// Note: This port is optional. Set SCKEY_P2_KEY_COUNT to 0 to not use this port.
//
//==============================================================================

#define SCKEY_P2_KEY_COUNT  (0)  /**< Single channel key Port 2: Number of keys used (value from 0 to 8) */

#define SCKEY_P2_PORT_ADDR  (GPIOD_BaseAddress)  /**< Single channel key Port 2: GPIO base address */

#define SCKEY_P2_A  (0)  /**< Single channel key Port 2: 1st key mask */
#define SCKEY_P2_B  (0)     /**< Single channel key Port 2: 2nd key mask */
#define SCKEY_P2_C  (0)     /**< Single channel key Port 2: 3rd key mask */
#define SCKEY_P2_D  (0)     /**< Single channel key Port 2: 4th key mask */
#define SCKEY_P2_E  (0)     /**< Single channel key Port 2: 5th key mask */
#define SCKEY_P2_F  (0)     /**< Single channel key Port 2: 6th key mask */
#define SCKEY_P2_G  (0)     /**< Single channel key Port 2: 7th key mask */
#define SCKEY_P2_H  (0)     /**< Single channel key Port 2: 8th key mask */

#define SCKEY_P2_DRIVEN_SHIELD_MASK (0x00)


//==============================================================================
//
// 7) SINGLE CHANNEL KEYS DEFINITION - PORT 3
//
// Set the number of keys
// Set the port
// Set the pins mask
//
// Note: This port is optional. Set SCKEY_P3_KEY_COUNT to 0 to not use this port.
//
//==============================================================================

#define SCKEY_P3_KEY_COUNT  (0)  /**< Single channel key Port 3: Number of keys used (value from 0 to 8) */

#define SCKEY_P3_PORT_ADDR  (GPIOE_BaseAddress)  /**< Single channel key Port 3: GPIO base address */

#define SCKEY_P3_A  (0)  /**< Single channel key Port 3: 1st key mask */
#define SCKEY_P3_B  (0)     /**< Single channel key Port 3: 2nd key mask */
#define SCKEY_P3_C  (0)     /**< Single channel key Port 3: 3rd key mask */
#define SCKEY_P3_D  (0)     /**< Single channel key Port 3: 4th key mask */
#define SCKEY_P3_E  (0)     /**< Single channel key Port 3: 5th key mask */
#define SCKEY_P3_F  (0)     /**< Single channel key Port 3: 6th key mask */
#define SCKEY_P3_G  (0)     /**< Single channel key Port 3: 7th key mask */
#define SCKEY_P3_H  (0)     /**< Single channel key Port 3: 8th key mask */

#define SCKEY_P3_DRIVEN_SHIELD_MASK (0x00)


//==============================================================================
//
// 8) NUMBER OF MULTI CHANNEL KEYS AND NUMBER OF CHANNELS USED
//
// Set the total number of multi channel keys used (0, 1 or 2)
// Set the number of channels (5 or 8)
//
//==============================================================================

#define NUMBER_OF_MULTI_CHANNEL_KEYS  (1)  /**< Number of multi channel keys (value from 0 to 2) */
#define CHANNEL_PER_MCKEY             (5)  /**< Number of channels per key (possible values are 5 or 8 only) */


//==============================================================================
//
// 9) MULTI CHANNEL KEY 1 DEFINITION
//
// Set the port used

⌨️ 快捷键说明

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