ATMEL MCU用于MP3播放系统的控制源代码程序

源代码在线查看: kbd_drv.h

软件大小: 70 K
上传用户: youwei15
关键词: ATMEL nbsp MCU MP3
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*H**************************************************************************
				* NAME:         kbd_drv.h         
				*----------------------------------------------------------------------------
				* Copyright (c) 2003 Atmel.
				*----------------------------------------------------------------------------
				* RELEASE:      snd1c-refd-nf-4_0_3      
				* REVISION:     1.8     
				*----------------------------------------------------------------------------
				* PURPOSE:
				* This file contains the keyboard driver definition
				*****************************************************************************/
				
				#ifndef _KBD_DRV_H_
				#define _KBD_DRV_H_
				
				/*_____ I N C L U D E S ____________________________________________________*/
				
				
				/*_____ M A C R O S ________________________________________________________*/
				
				/*----- Hardware Definition -----*/
				//#define P_KBD           P1              /* keyboard port P1 */
				
				
				
				/*----- Key Definition -----*/
				#define KEY_3  0x08
				#define KEY_2  0x04
				#define KEY_1  0x02
				#define KEY_0  0x01
				
				#define NO_KEY  0x00
				
				/*----- Macro-command -----*/
				#define KEY_PLAY   0x10
				#define KEY_NEXT   0x11
				#define KEY_PREV   0x12
				#define KEY_INC    0x13
				#define KEY_DEC    0x14
				#define KEY_SOUND  0x15
				#define KEY_PARENT 0x16
				
				
				/*_____ D E F I N I T I O N ________________________________________________*/
				
				
				/*_____ D E C L A R A T I O N ______________________________________________*/
				
				void    kbd_init (void);
				Byte    kbd_decode (void);
				
				#define Kbd_enable_int()        (IEN1 |= MSK_EKB)
				#define Kbd_disable_int()       (IEN1 &= ~MSK_EKB)
				#define Kbd_mask_int()          (KBCON |= 0x0f)
				#define Kbd_unmask_int()        (KBCON &= 0xf0)
				#define Kbd_low_int()           (KBCON &= 0x0f)
				#define Kbd_high_int()          (KBCON |= 0xf0) 
				#define Kbd_enable_pd_exit()    (KBSTA |= MSK_KPDE)
				#define Kbd_disable_pd_exit()   (KBSTA &= ~MSK_KPDE)
				#define Kbd_key_pressed()       ((KBSTA & 0x0f) != 0)
				#define Kbd_key_locked()        1//(LOCK_ROW == 0)
				
				void    kbd_task_init (void);
				
				#endif  /* _KBD_DRV_H_ */
							

相关资源