dc550_keypad.h

来自「一款经典的数字电话设计资料」· C头文件 代码 · 共 70 行

H
70
字号
/*****************************************************************************/
/*  CONFIDENTIAL                                                             */
/*  Sigpro Copyright 2003, All rights reserved                               */
/*****************************************************************************/
/*  CLIENT:  Telematrix                                                      */
/*  PROJECT: DC550 Digital Centrex Phone                                     */
/*  FILE:    dc550_keypad.h                                                  */
/*****************************************************************************/
/*  This is the header file for dc550_keypad.c.                              */
/*****************************************************************************/

#ifndef __DC550_KEYPAD_HEADER__
#define __DC550_KEYPAD_HEADER__

#include "dc550_local.h"

/******************************************************************************
 *  CONSTANTS AND DATA TYPES
 *****************************************************************************/
/* Keypad Constants */
#define KP_NUMROWS              5
#define KP_NUMCOLS              8
#define KP_NUMBTNS              (KP_NUMROWS*KP_NUMCOLS)

/* Port Mappings */
#define KP_ROW_PDIR             P5DIR
#define KP_ROW_POUT             P5OUT
#define KP_COL_PIN              P1IN

/*
 * Bit Mask for Row 0 on the Port Register
 * Note: It is assumed that subsequent rows are
 *       located bitwise to the left of this bit
 */
#define KP_FIRSTROW_MSK         0x01

/* Bit Mask for All Rows on the Port Register */
#define KP_ALLROWS_MSK          0x1F

/*
 * Bit Mask for Column 0 on the Port Register
 * Note: It is assumed that subsequent columns are
 *       located bitwise to the left of this bit
 */
#define KP_FIRSTCOL_MSK         0x01

/* Bit Mask for All Columns on the Port Register */
#define KP_ALLCOLS_MSK          0xFF

/* Number of iterations a key must be read
 * as constantly up/down in order to be
 * considered fully debounced.
 */
#define KP_DOWN_MAXCNT          2
#define KP_UP_MAXCNT            2

/******************************************************************************
 *  GLOBAL VARIABLES
 *****************************************************************************/

/******************************************************************************
 *  FUNCTION PROTOTYPES
 *****************************************************************************/

extern void keypad_init(void);
extern void keypad_exec(void);


#endif /* __DC550_KEYPAD_HEADER__ */

⌨️ 快捷键说明

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