/******************************************************************************************************************* *File Name : keyPort.h *Description : the file is cpu privatie key port *Date : 2008/06/13 *Author : yuanguiyou --History: ------------------------------------------------------------------------------------------------------------------ *change info: *******************************************************************************************************************/ #ifndef KEYPORT_H #define KEYPORT_H #define KEY_PORT_ROW PORTB /* The port address of the keyboard matrix ROWs */ #define KEY_PORT_COL PINB /* The port address of the keyboard matrix COLUMNs */ #define KEY_PORT_CW DDRB /* The port address of the I/O ports control word */ /*call by key task*/ void KeyInitPort(void); /* Initialize I/O ports */ uint8_t KeyGetCol(void); /* Read COLUMNs */ void KeySelRow(uint8_t ucRow); /* Select a ROW */ #define KeyUpHook() PORTD &= 0xF7 #define KeyDownHook() PORTD |= 0x08 #endif