summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/keyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/keyboard.h')
-rw-r--r--source/Concept/Framework/keyboard.h87
1 files changed, 0 insertions, 87 deletions
diff --git a/source/Concept/Framework/keyboard.h b/source/Concept/Framework/keyboard.h
deleted file mode 100644
index d984586..0000000
--- a/source/Concept/Framework/keyboard.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef _KEYBOARD_H
-#define _KEYBOARD_H
-
-#include "stdafx.h"
-
-class Keyboard : public IO_Module
-{
-public:
- Keyboard()
- {
- this->parent = NULL;
- this->moduleId = 0;
- this->commandSetting = 0;
- this->settingClearBuffer = 0;
- }
-
- Keyboard(uint32 keyboardId)
- {
- this->parent = NULL;
- this->moduleId = keyboardId;
-
- switch(keyboardId)
- {
- case IO_KEYBOARD_MAIN:
- this->commandSetting = 27;
- this->settingClearBuffer = 123;
- break;
- default:
- this->commandSetting = 0;
- this->settingClearBuffer = 0;
- break;
- }
- }
-
-protected:
- //Commands
- uint8 commandSetting;
- //Settings
- uint8 settingClearBuffer;
-
- void SendCommand(uint8 newCommand)
- {
- switch(moduleId)
- {
- case IO_KEYBOARD_MAIN:
- uart1_putc(newCommand);
- break;
- default:
- break;
- }
- }
-
-public:
- uint8 GetInput()
- {
- uint16 input = uart1_getc();
-
- if(input == 0x100)//no data
- {
- return 0xEE;//empty
- }
- else if(input >= '0' && input <= '9')
- {
- return (uint8)(input - '0');
- }
- else if(input == '*')
- {
- return 10;
- }
- else if(input == '#')
- {
- return 11;
- }
- else
- {
- return 0xFF;//unknown
- }
- }
-
- void ClearKeyBuffer()
- {
- SendCommand(commandSetting);
- SendCommand(settingClearBuffer);
- }
-};
-
-#endif