freescale
来自「Freescale 系列单片机常用模块与综合系统设计」· 代码 · 共 149 行
TXT
149 行
/** ###################################################################
** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : KEY.H
** Project : digital_timer
** Processor : MC9S08JM60CLHE
** Component : KBI
** Version : Component 01.095, Driver 01.20, CPU db: 3.00.046
** Compiler : CodeWarrior HCS08 C Compiler
** Date/Time : 2010-1-11, 19:48
** Abstract :
** This bean "KBI" implements the Freescale Keyboard
** Interrupt Module (KBI/KBD) which allows to catch events
** on choiced external pins. These pins share one KBI/KBD
** interrupt which can be caused by an events on the pins.
** Settings :
** Keyboard : KBI
** Used pins
** Pin 0 : PTG0_KBIP0
** Pin 1 : PTG1_KBIP1
** Pin 2 : PTG2_KBIP6
** Pin 3 : PTG3_KBIP7
** Pull resistor : up
** Generate interrupt on : falling
** Interrupt service : Enabled
** Interrupt : Vkeyboard
** Interrupt Priority :
** Enable in init. code : Yes
** Events enabled in init. : Yes
** Contents :
** GetVal - byte KEY_GetVal(void);
** SetEdge - byte KEY_SetEdge(byte edge);
**
** Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**
** http : www.freescale.com
** mail : support@freescale.com
** ###################################################################*/
#ifndef __KEY
#define __KEY
/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
/* MODULE KEY. */
#include "Cpu.h"
/* PUBLISHED CONSTANTS for using together with GetVal method */
#define KEY_NUM_PIN0 0x01 /* Mask of Pin0 */
#define KEY_NUM_PIN1 0x02 /* Mask of Pin1 */
#define KEY_NUM_PIN2 0x04 /* Mask of Pin2 */
#define KEY_NUM_PIN3 0x08 /* Mask of Pin3 */
/* PUBLISHED CONSTANTS for enabled pins */
#define KEY_PIN_SIGNAL0 0x01 /* Mask of Pin0*/
#define KEY_PIN_SIGNAL1 0x02 /* Mask of Pin1*/
#define KEY_PIN_SIGNAL2 0x04 /* Mask of Pin2*/
#define KEY_PIN_SIGNAL3 0x08 /* Mask of Pin3*/
/* Deprecated */
#define PinSignal0 0x01
#define PinSignal1 0x02
#define PinSignal2 0x04
#define PinSignal3 0x08
void KEY_Init(void);
/*
** ===================================================================
** Method : KEY_Init (component KBI)
**
** Description :
** Initializes the associated peripheral(s) and the bean internal
** variables. The method is called automatically as a part of the
** application initialization code.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
__interrupt void KEY_Interrupt(void);
/*
** ===================================================================
** Method : KEY_Interrupt (component KBI)
**
** Description :
** The method services the interrupt of the selected peripheral(s)
** and eventually invokes event(s) of the bean.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
#define KEY_GetVal() \
((byte)(PTGD & 0x0F))
/*
** ===================================================================
** Method : KEY_GetVal (component KBI)
**
** Description :
** Returns the value of pins
** Parameters : None
** Returns :
** --- - The value of associated pins (bits ordered
** according to the bean list of pins)
** ===================================================================
*/
byte KEY_SetEdge(byte edge);
/*
** ===================================================================
** Method : KEY_SetEdge (component KBI)
**
** Description :
** Sets the sensitive edge. If all selected pins don't have the
** same edge setting possibility, the method allows to set only
** those edges that are common (possible to set for all
** selected pins).
** Parameters :
** NAME - DESCRIPTION
** edge - Edge type:
** 0 - falling edge
** 1 - rising edge
** 2 - both edges
** 3 - low level
** 4 - high level
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_RANGE - Value is out of range
** ===================================================================
*/
/* END KEY. */
#endif /* ifndef __KEY */
/*
** ###################################################################
**
** This file was created by Processor Expert 3.07 [04.34]
** for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?