added a makefile and a VERY VERY minimalistic not working fx2 fw
[my-code/fpga.git] / fx2 / fx2.c
diff --git a/fx2/fx2.c b/fx2/fx2.c
new file mode 100644 (file)
index 0000000..ddea734
--- /dev/null
+++ b/fx2/fx2.c
@@ -0,0 +1,40 @@
+/*
+ * fx2 firmware 
+ *
+ * author: hackbard@hackdaworld.org
+ *
+ * number of priorities:
+ * - switch on board power
+ * - allow high speed usb transfer
+ * - do jtag
+ * 
+ */
+
+/* constant definitions */
+#define TRUE   1
+#define FALSE  0
+#define POWER_ON       1;
+#define POWER_OFF      0;
+
+/* type definitions */
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+
+/* fx2 register */
+xdata at 0xb5 volatile u8 OED;
+xdata at 0xb0 volatile u8 IOD;
+
+void power_on() {
+
+       OED|=(1<<7);
+       IOD|=(1<<7);
+}
+
+void main() {
+
+       power_on;
+}
+
+
+