exti.ini

来自「STM32 单片机例程」· INI 代码 · 共 44 行

INI
44
字号
/*----------------------------------------------------------------------------
 * 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 = PB.11
 *----------------------------------------------------------------------------*/
PORTB |= 0x000800;                      // set PB.11 high: Key Input

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

/*----------------------------------------------------------------------------
  Simulate Push button S2 
    Pins:
      - S2 = PB.10
 *----------------------------------------------------------------------------*/
PORTB |= 0x000400;                      // set PB.10 high: Key Input

// debug function for the push button S2
signal void push_S2 (void)  {
  PORTB &= ~0x000400;                   // set PB.10 low  (Key pressed)
  swatch (0.05);                        // wait 50 msec
  PORTB |= 0x000400;                    // set PB.10 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 + -
显示快捷键?