Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PS2ASCII.h
00001 #ifndef MBED_PS2ASCII_H 00002 #define MBED_PS2ASCII_H 00003 00004 #include "PS2Kbd.h" 00005 #include "mbed.h" 00006 00007 class PS2ASCII { 00008 00009 public: 00010 00011 PS2ASCII(PinName data, PinName clk); 00012 unsigned char getChar(); 00013 bool caps(); 00014 bool shift(); 00015 bool E0flag(); 00016 bool numlock(); 00017 00018 private: 00019 00020 PS2Kbd kbd; 00021 bool _caps; 00022 bool _shift; 00023 bool _E0flag; 00024 bool _numlock; 00025 }; 00026 00027 static const unsigned char shift_on[] = { 00028 // 0 1 2 3 4 5 6 7 8 9 A B C D E F 00029 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '`', ' ', // 00-0F 00030 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 10-1F 00031 ' ', 0x21, 0x22, '~', 0x24, 0x25, 0x26, '@', 0x28, 0x29, 0x30, 0x31, '<', '_', '>', '?', // 20-2F 00032 ')', '!', '\"', 0x9C, '$', '%', '^', '&', '*', '(', ' ', ':', ' ', '+', ' ', ' ', // 30-3F 00033 0xAA, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', // 40-6F 00034 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', ' ', ' ', // 50-7F 00035 ' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', // 60-4F 00036 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, // 70-5F 00037 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 80-8F 00038 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 90-9F 00039 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // A0-AF 00040 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // B0-BF 00041 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // C0-CF 00042 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // D0-DF 00043 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // E0-EF 00044 NULL, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // F0-FF 00045 }; 00046 00047 #endif
Generated on Fri Jul 15 2022 08:05:20 by
1.7.2