code clean up!
[my-code/arm.git] / betty / display.c
diff --git a/betty/display.c b/betty/display.c
new file mode 100644 (file)
index 0000000..a5db338
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * display.c - handling the display
+ *
+ * author: hackbard@hackdaworld.org
+ *
+ */
+
+#include "display.h"
+
+/*
+ * functions
+ */
+
+void bl_init(void) {
+
+       PINSEL0&=~(1<<9|(1<<8));
+       IODIR0|=(1<<4);
+}
+
+void bl_toggle(void) {
+
+       if(IOPIN0&(1<<4))
+               IOCLR0=(1<<4);
+       else
+               IOSET0=(1<<4);
+}
+
+void bl_on(void) {
+
+       IOCLR0=(1<<4);
+}
+
+void bl_off(void) {
+
+       IOSET0=(1<<4);
+}
+