kbi1.c

来自「用freescale 8bitMCU做的触摸屏软件」· C语言 代码 · 共 124 行

C
124
字号
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : KBI1.C
**     Project   : touchpanal
**     Processor : MC9S08QG8CDT
**     Beantype  : Init_KBI
**     Version   : Bean 01.020, Driver 01.06, CPU db: 2.87.115
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 2007-10-11, 12:42
**     Abstract  :
**          This file implements the KBI (KBI) module initialization
**          according to the Peripheral Initialization Bean settings, and defines
**          interrupt service routines prototypes.
**          The KBI module is the serial peripheral interface module,which allows 
**          full-duplex, synchronous, serial communications with peripheral devices.
**          The keyboard interrupt module (KBI) provides a few independently maskable 
**          external interrupts. When a port pin is enabled for keyboard interrupt 
**          function, an internal pullup/pulldown device is also enabled on the pin.

**     Settings  :
**          Bean name                                      : KBI1
**          Device                                         : KBI
**          Settings 
**            Triggering sensitivity                       : edge
**          Pins 
**            Pin0                                         : Disabled
**            Pin1                                         : Disabled
**            Pin2                                         : Enabled
**              Pin                                        : PTA2_KBIP2_SDA_ADP2
**              Pin signal                                 : 
**            Pin3                                         : Disabled
**            Pin4                                         : Disabled
**            Pin5                                         : Disabled
**            Pin6                                         : Disabled
**            Pin7                                         : Disabled
**          Interrupts 
**            Keyboard request 
**              Interrupt                                  : Vkeyboard
**              Keyboard request interrupt                 : Disabled
**              ISR name                                   : PENIRQ
**          Initialization 
**            Call Init method                             : no
**     Contents  :
**         Init - void KBI1_Init(void);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2006
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE KBI1. */

#include "KBI1.h"

/*
** ###################################################################
**
**  The interrupt service routine(s) must be implemented
**  by user in one of the following user modules.
**
**  If the "Generate ISR" option is enabled, Processor Expert generates
**  ISR templates in the CPU event module.
**
**  User modules:
**      touchpanal.c
**      Events.c
**
** ###################################################################
ISR(PENIRQ)
{
  // NOTE: The routine should include the following actions to obtain
  //       correct functionality of the hardware.
  //
  //  Keyboard Interrupt Flag is cleared by writing a 1 to the
  //  KBACK control bit.
  // Example:   KBISC_KBACK = 0x01
}
*/

/*
** ===================================================================
**     Method      :  KBI1_Init (bean Init_KBI)
**
**     Description :
**         This method initializes registers of the KBI module
**         according to this Peripheral Initialization Bean settings.
**         Call this method in user code to initialize the module.
**         By default, the method is called by PE automatically; see
**         "Call Init method" property of the bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void KBI1_Init(void)
{
  /* KBISC: KBIE=0 */
  clrReg8Bits(KBISC, 0x02);             
  /* KBIES: KBEDG7=0,KBEDG6=0,KBEDG5=0,KBEDG4=0,KBEDG3=0,KBEDG2=0,KBEDG1=0,KBEDG0=0 */
  setReg8(KBIES, 0x00);                 
  /* KBISC: KBIMOD=0 */
  clrReg8Bits(KBISC, 0x01);             
  /* KBIPE: KBIPE7=0,KBIPE6=0,KBIPE5=0,KBIPE4=0,KBIPE3=0,KBIPE2=1,KBIPE1=0,KBIPE0=0 */
  setReg8(KBIPE, 0x04);                 
  /* KBISC: KBACK=1 */
  setReg8Bits(KBISC, 0x04);             
  /* KBISC: KBIE=0 */
  clrReg8Bits(KBISC, 0x02);             
}

/* END KBI1. */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 3.00 [03.89]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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