Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Ps2_Config
315
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure Ps2_Config();
Returns
Nothing.
Description
Initializes the MCU for work with the PS/2 keyboard.
Requires
Global variables : 
PS2_Data
: Data signal line 
PS2_In_Clock
: Clock signal line in 
PS2_Out_Clock
: Clock signal line out 
PS2_Data_Direction
: Direction of the Data pin 
PS2_Clock_Direction
: Direction of the Clock pin 
must be defined before using this function.
Example
// PS2 pinout definition                                       
var PS2_Data : sbit at PINC.B0;           
var PS2_In_Clock : sbit at PINC.B1;     
var PS2_Out_Clock : sbit at PORTC.B1;   
var PS2_Data_Direction : sbit at DDRC.B0; 
var PS2_Clock_Direction : sbit at DDRC.B1;
// End of PS2 pinout definition
...
Ps2_Config();         // Init PS/2 Keyboard