📄 pdd_keyp.h
字号:
#ifndef PDD_KEYP_H #define PDD_KEYP_H/** @file *//* -----------------------------------------------------------------------------Copyright (C) Siemens AG 1994-2001 * ALL RIGHTS RESERVED This software is protected by the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred. The information contained in this document is considered the CONFIDENTIAL and PROPRIETARY information of Siemens AG and may not be disclosed or discussed with anyone who is not employed by Siemens AG, unless the individual / company (i) has an express need to know such information, and (ii) disclosure of information is subject to the terms of a duly executed Confidentiality and Non-Disclosure Agreement between Siemens AG and the individual / company.Created using template RCSfile: templ_h.h,v, Revision: 1.5, genxfile V1.9.AUTHOR Holger Hollenberg.FILENAME pdd_keyp.h.TODO .VERSION 01.00.04.DATE 2004-02-12.SHORT_DESCR Low level keypad interface..SW_COMPONENT PerDD keypad device driver..SW_TYPE DEVICE_DRIVER, INTERFACE.CHANGE_CONTROL Version Date Changed by Reason of change--------------------------------------------------------------------------------01.00.00 2003-05-02 H. Hollenberg (KLF) Initial Version01.00.01 2003-05-12 H. Hollenberg (KLF) move scancode defines from ADD driver part (keypad.h) to perdd driver part.01.00.02 2003-06-24 H. Hollenberg (KLF) scancode defines for S-GOLDlite Viper Testboard01.00.03 2003-06-27 H. Hollenberg (KLF) Move scancode defines to special directory for project dependency in C_devhigh.01.00.04 2004-02-12 H. Hollenberg (KLF) Provide new function for keypad interrupts. PddKpd_EnableKeypadInt0_3(), PddKpd_DisableKeypadInt0_3(), PddKpd_InterruptIsDisabled().G F B step up: Generation / Feature / Bugfix------------------------------------------------------------------------------*//* ----------------------------------------------------------------------------- INCLUDES------------------------------------------------------------------------------*//* ----------------------------------------------------------------------------- DEFINES------------------------------------------------------------------------------*//** For released SW use this static define. */#define STATIC static // release/** For debugging use this static define. *///#define STATIC // debugging/** Defines for used keypad interrups */#define KEYPAD_INTERRUPT_0 (0x00)#define KEYPAD_INTERRUPT_3 (0x03)#define KEYPAD_INTERRUPT_INIT (0xFF)/* ----------------------------------------------------------------------------- TYPES------------------------------------------------------------------------------*//* ----------------------------------------------------------------------------- CONSTANTS------------------------------------------------------------------------------*//* ----------------------------------------------------------------------------- PROTOTYPES------------------------------------------------------------------------------*/#ifdef __cplusplusextern "C" {#endif/*-----------------------------------------------------------------------*//** This function initialize the low level keypad device driver. The function is called from Keyp_0Init(). This is the low level init function of the keypad driver. The following initializations are done: - Port configuration, - Keypad Kernel: debounce time, - LISR, - Create HISR, - Keypad Interrups: INT0 and INT3, - global variables \param pointer to keypad HISR handler \return none*//*------------------------------------------------------------------------*/void PddKpd_Init(void (*ptrHisrHandler) (void));/*-----------------------------------------------------------------------*//** This function deactivate the low level keypad device driver. The function is called from Keyp_0Exit(). This is the high level deactivation function of the keypad driver. The following deactivations are done: - disable all keypad interrups \param none \return none*//*------------------------------------------------------------------------*/void PddKpd_Deact(void);/*-----------------------------------------------------------------------*//** Give Scancode from KEYNUM1 register to ADD. This function is called from HISR. After the scancode is given to ADD an invalide value is written into mg_u32scancode1 variable. This is to detect if a new interrupt occurred bevore the old scancode was read. \param none \return Scancode for standard keys. \retval UINT32*//*----------------------------------------------------------------------- */UINT32 PddKpd_GetScancodeKeynum1 (void);/*-----------------------------------------------------------------------*//** Give Scancode from KEYNUM3 register to ADD. This function is called from HISR. After the scancode is given to ADD an invalide value is written into mg_u32scancode3 variable. This is to detect if a new interrupt occurred bevore the old scancode was read. \param none \return Scancode for special keys. \retval UINT32*//*----------------------------------------------------------------------- */UINT32 PddKpd_GetScancodeKeynum3 (void);/*-----------------------------------------------------------------------*//** This function reads the value from the port where the End-Key is connected. The function is called during start up to test if the End-Key was pressed. \note This function should only used during start up, for End-Key detection. \param none \return Scancode for special keys. \retval 0x0000A001: End-Key pressed \retval 0x0000A201: End-Key not pressed*//*----------------------------------------------------------------------- */UINT32 PddKpd_ReadEndKey (void);/*-----------------------------------------------------------------------*//** With this function the Keypad HISR gets the information which interrrupt occurred. \param none \return Value for occurred interrupt. \retval 0x00: INT0 occurred, new key pressed, number of keys changed \retval 0x03: INT3 occurred, long key released*//*----------------------------------------------------------------------- */UINT8 PddKpd_WhichIntOccurred(void);/*-----------------------------------------------------------------------*//** This function enable Keypad interrups 0 and 1. The keypad interrupts are disabled in the Keypad LISRs. They will be enabled in the keypad HISR after reading the Scancode from the keypad peripheral. \param none \return *//*----------------------------------------------------------------------- */void PddKpd_EnableKeypadInt0_3(void);/*-----------------------------------------------------------------------*//** This function disable Keypad interrups 0 and 1. \param none \return *//*----------------------------------------------------------------------- */void PddKpd_DisableKeypadInt0_3(void);/*-----------------------------------------------------------------------*//** This function tests if the keypad interrups are disabled. Test only the enabled Keypad interrupts 0 and 3. \param none \retval TRUE : All keypad interrups are disabled. \retval FALSE: One or more keypad interrups are enabled.*//*----------------------------------------------------------------------- */UINT8 PddKpd_InterruptIsDisabled(void); /* --------------------------------------------------------------------------- */#ifdef __cplusplus}#endif /* __cplusplus */#endif /* PDD_KEYP_H *//* ----------------------------------------------------------------------------- END OF FILE %name%----------------------------------------------------------------------------- */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -