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

📄 stm8_tsl_rc_configuration.h

📁 STM8全部资料
💻 H
📖 第 1 页 / 共 2 页
字号:
/**
  ******************************************************************************
  * @file STM8_TSL_RC_Configuration_TOADAPT.h
  * @brief RC Touch Sensing Library for STM8 CPU family.
  * Static configuration of the Library. This file is a template and must be
  * adapted to your requirements.
  * @author STMicroelectronics - MCD Application Team
  * @version V1.2.0
  * @date 24-MAR-2009
  ******************************************************************************
  *
  * 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 2009 STMicroelectronics</center></h2>
  * @image html logo.bmp
  ******************************************************************************
  */

#ifndef __TSL_CONFIGURATION__
#define __TSL_CONFIGURATION__


//==============================================================================
//
// 1) MCU FAMILY SELECTION
//
// Uncomment only one line.
//==============================================================================

//#define STM8L (1)  /**< Select it if the STM8L MCU is used (value not used) */
#define STM8S (1)  /**< Select it if the STM8S MCU is used (value not 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          0x530B
//     "                  TIM3          0x5328
// STM8S105               TIM2          0x530B
//     "                  TIM3          0x5328
// STM8S103               TIM2          0x530B
// STM8L101               TIM2          0x525B
//     "                  TIM3          0x528B
//==============================================================================
#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
// STM8L101               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  (GPIOB_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  (3)  /**< 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  (0x02)  /**< Single channel key Port 1: 1st key mask */
#define SCKEY_P1_B  (0x04)  /**< Single channel key Port 1: 2nd key mask */
#define SCKEY_P1_C  (0x08)  /**< 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 (0x80)


//==============================================================================
//
// 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  (0)  /**< 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  (0)  /**< 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  (0)  /**< 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
// Set the pins mask
//

⌨️ 快捷键说明

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