Mikroelektronika MIKROE-350 データシート
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
Ps2_Config
303
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub 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
dim PS2_Data as sbit at PINC.B0
dim PS2_In_Clock as sbit at PINC.B1
dim PS2_Out_Clock as sbit at PORTC.B1
dim PS2_Data_Direction as sbit at DDRC.B0
dim PS2_Clock_Direction as sbit at DDRC.B1
// End of PS2 pinout definition
dim PS2_Data as sbit at PINC.B0
dim PS2_In_Clock as sbit at PINC.B1
dim PS2_Out_Clock as sbit at PORTC.B1
dim PS2_Data_Direction as sbit at DDRC.B0
dim PS2_Clock_Direction as sbit at DDRC.B1
// End of PS2 pinout definition
...
Ps2_Config() ' Init PS/2 Keyboard
Ps2_Config() ' Init PS/2 Keyboard