OSDN Git Service

svn rev.329より移動。
[chnosproject/CHNOSProject.git] / CHNOSProject / chnos / tolset_chn_000 / chnos_009 / chnos / io.c
diff --git a/CHNOSProject/chnos/tolset_chn_000/chnos_009/chnos/io.c b/CHNOSProject/chnos/tolset_chn_000/chnos_009/chnos/io.c
new file mode 100644 (file)
index 0000000..7b93a6b
--- /dev/null
@@ -0,0 +1,33 @@
+\r
+#include "core.h"\r
+\r
+uchar IO_Read_CMOS(uchar addr)\r
+{\r
+       IO_Out8(0x70, addr);\r
+       return IO_In8(0x71);\r
+}\r
+\r
+void IO_Beep(uint fq, uint microsec)\r
+{\r
+       uint timebase;\r
+\r
+       PIT_Beep_Off();\r
+       PIT_Beep_Set(fq);\r
+       PIT_Beep_On();\r
+       timebase = Timer_Get_Tick();    //1sec = 100\r
+       IO_Wait(microsec);\r
+       return;\r
+}\r
+\r
+void IO_Wait(uint microsec)\r
+{\r
+       uint timebase;\r
+\r
+       timebase = Timer_Get_Tick();    //1sec = 100\r
+       for(;;){\r
+               if(microsec < (Timer_Get_Tick() - timebase) * 10000){\r
+                       break;\r
+               }\r
+       }\r
+       return;\r
+}\r