exti.ini

来自「stm32初级例程」· INI 代码 · 共 46 行

INI
46
字号
/*----------------------------------------------------------------------------
 * Name:    Exti.ini
 * Purpose: Functions used for simulating peripherals
 * Version: V1.01
 *----------------------------------------------------------------------------
 * This file is part of the uVision/ARM development tools.
 * This software may only be used under the terms of a valid, current,
 * end user licence from KEIL for a compatible version of KEIL software
 * development tools. Nothing else gives you the right to use this software.
 *
 * Copyright (c) 2005-2007 Keil Software. All rights reserved.
 *----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
  Simulate Push button S3 
    Pins:
      - S3 = PC.13
 *----------------------------------------------------------------------------*/
PORTC |= 0x002000;                      // set PC.13 high: Key Input

// debug function for the push button S3
signal void push_S3 (void)  {
  PORTC &= ~0x002000;                   // set PC.13 low  (Key pressed)
  swatch (0.05);                        // wait 50 msec
  PORTC |= 0x002000;                    // set PC.13 high (Key released)
}

/*----------------------------------------------------------------------------
  Simulate Push button S2 
    Pins:
      - S2 = PA.0
 *----------------------------------------------------------------------------*/
PORTA |= 0x000001;                      // set PC.13 high: Key Input

// debug function for the push button S2
signal void push_S2 (void)  {
  PORTA &= ~0x000001;                   // set PA.0 low  (Key pressed)
  swatch (0.05);                        // wait 50 msec
  PORTA |= 0x000001;                    // set PA.0 high (Key released)
}

/* define a toolbar button to call push_key */
define button "Button S2", "push_S2 ()"
define button "Button S3", "push_S3 ()"

⌨️ 快捷键说明

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