Working PS/2 keyboard driver
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m19s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m19s
This commit is contained in:
4
libkb/.gitignore
vendored
Normal file
4
libkb/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.o
|
||||
*.json
|
||||
docs/
|
||||
.cache/
|
||||
7
libkb/Makefile
Normal file
7
libkb/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
include ../make/ufuncs.mk
|
||||
|
||||
$(eval $(call add_include,libmsl))
|
||||
|
||||
libname := libkb
|
||||
|
||||
include ../make/lib.mk
|
||||
15
libkb/kb.c
Normal file
15
libkb/kb.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdint.h>
|
||||
#include <kb.h>
|
||||
#include <m/system.h>
|
||||
#include <m/kb_device.h>
|
||||
#include <m/status.h>
|
||||
|
||||
int kb_read_key (void) {
|
||||
char ch = 0;
|
||||
int r = device_do (KB_DEVICE, KB_READ_KEY, &ch, NULL, NULL, NULL);
|
||||
|
||||
if (r == ST_OK)
|
||||
return (int)ch;
|
||||
else
|
||||
return r;
|
||||
}
|
||||
12
libkb/kb.h
Normal file
12
libkb/kb.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _LIBKB_KB_H
|
||||
#define _LIBKB_KB_H
|
||||
|
||||
#include <m/kb_device.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* \brief Read key from keyboard
|
||||
* \return < 0 status on failure; ascii key on success
|
||||
*/
|
||||
int kb_read_key (void);
|
||||
|
||||
#endif // _LIBKB_KB_H
|
||||
3
libkb/src.mk
Normal file
3
libkb/src.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
c += kb.c
|
||||
|
||||
o += kb.o
|
||||
Reference in New Issue
Block a user