summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openpcd/firmware/Makefile16
-rw-r--r--openpcd/firmware/src/openpcd.h28
2 files changed, 35 insertions, 9 deletions
diff --git a/openpcd/firmware/Makefile b/openpcd/firmware/Makefile
index fc62dbe..1a83d4d 100644
--- a/openpcd/firmware/Makefile
+++ b/openpcd/firmware/Makefile
@@ -87,15 +87,17 @@ SRCARM += src/os/pcd_enumerate.c src/os/fifo.c src/os/dbgu.c \
src/os/led.c src/os/req_ctx.c src/os/trigger.c \
src/os/main.c src/os/syscalls.c src/os/usb_handler.c \
src/os/usb_benchmark.c src/os/dfu.c src/start/Cstartup_SAM7.c \
- src/os/tc_cdiv.c src/os/pit.c src/os/pwm.c
+ src/os/tc_cdiv.c src/os/pit.c src/os/pwm.c src/os/pio_irq.c
-ifdef PCD
+ifeq ($(BOARD), PCD)
# PCD support code
SRCARM += src/pcd/rc632.c src/pcd/rc632_highlevel.c \
src/pcd/rfid_layer2_iso14443a.c
# finally, the actual main application
SRCARM += src/pcd/$(TARGET).c
-else
+endif
+
+ifeq ($(BOARD), PICC)
# PICC support code
SRCARM += src/picc/tc_fdt.c src/picc/ssc_picc.c src/picc/adc.c \
src/picc/decoder.c src/picc/decoder_miller.c \
@@ -185,6 +187,14 @@ ifdef OLIMEX
CDEFS += -DOLIMEX
endif
+ifeq ($(BOARD),PICC)
+CDEFS += -DPICC
+endif
+
+ifeq ($(BOARD),PCD)
+CDEFS += -DPCD
+endif
+
# Place -I options here
CINCS = -Iinclude -Isrc
diff --git a/openpcd/firmware/src/openpcd.h b/openpcd/firmware/src/openpcd.h
index 0fdf9a1..bd3cfb4 100644
--- a/openpcd/firmware/src/openpcd.h
+++ b/openpcd/firmware/src/openpcd.h
@@ -15,10 +15,19 @@
#define OPENPCD_PIO_UDP_CNX AT91C_PIO_PA24
#define OPENPCD_PIO_UDP_PUP AT91C_PIO_PA16
#else
+#if defined(PCD)
#define OPENPCD_PIO_UDP_CNX AT91C_PIO_PA15
#define OPENPCD_PIO_UDP_PUP AT91C_PIO_PA22
#define OPENPCD_PIO_LED1 AT91C_PIO_PA25
#define OPENPCD_PIO_LED2 AT91C_PIO_PA26
+#elif defined(PICC)
+#define OPENPCD_PIO_UDP_CNX NO_UDP_CNX
+#define OPENPCD_PIO_UDP_PUP AT91C_PIO_PA22
+#define OPENPCD_PIO_LED1 AT91C_PIO_PA25
+#define OPENPCD_PIO_LED2 AT91C_PIO_PA12
+#else
+#error "unknown PCB"
+#endif
#endif
#define OPENPCD_IRQ_RC632 AT91C_ID_IRQ1
@@ -85,36 +94,43 @@
#define OPENPCD_PIO_CARRIER_IN AT91C_PA28_TCLK1
-/* PIO Definition PICCSIM v0.3
+/* PIO Definition PICCSIM v0.3 (modified)
*
* PA0 TIOA0 B O CARRIER_DIV_HELP
* PA1 TIOB1 B O SSC_CLOCK
* PA2 PA2 P O LOAD1
* PA3 PA3 P O LOAD2
- * PA4 PA4 P I N/C
+ *
+ * PA4 PA4 P I PLL_LOCK
* PA5 PA5 P O nSLAVE_RESET
* PA6 PA6 P I BOOTLOADER_SW
* PA7 PA7 P I N/C
+ *
* PA8 PA8 P O SPI_SS2 (Comparator)
* PA9 DRXD A I Debug
* PA10 DTXD A O Debug
* PA11 NPCS0 A O SPI_SS1 (Gain)
- * PA12 PA12 P I N/C
+ *
+ * PA12 PA12 P O LED2 red
* PA13 MOSI A O SPI Master Out
* PA14 SPCK A O SPI Clock
- * PA15 PA15 P I PLL_LOCK
+ * PA15 TF A I SSC Tx Frame
+ *
* PA16 PA16 P O UDP_PUP (old)
* PA17 TD A O SSC Tx Data (MOD) *
* PA18 RD A I SSC Rx Data (SSC_DATA)
* PA19 RK A I SSC Rx Clock (SSC_CLOCK)
+ *
* PA20 PA20 P I AB_DETECT
* PA21 PA21 P I N/C
* PA22 PA22 P I N/C
* PA23 PWM0 B O PWM Output (MOD) *
+ *
* PA24 PA24 P O PLL_INHIBIT
* PA25 PA25 P O LED1 green
- * PA26 PA26 P O LED2 red
+ * PA26 TIOA2 B O TC FDT output (-> SPI Tx Frame)
* PA27 TIOB2 B I DATA
+ *
* PA28 TCLK1 B I CARRIER
* PA29 TCLK2 B I CARRIER_DIV_HELP
* PA30 PA30 P I N/C
@@ -128,7 +144,7 @@
#define OPENPICC_PIO_BOOTLDR AT91C_PIO_PA6
#define OPENPICC_PIO_SS2_DT_THRESH AT91C_PIO_PA8
#define OPENPICC_PIO_SS1_GAIN AT91C_PIO_PA11
-#define OPENPICC_PIO_PLL_LOCK AT91C_PIO_PA15
+#define OPENPICC_PIO_PLL_LOCK AT91C_PIO_PA4
#define OPENPICC_PIO_AB_DETECT AT91C_PIO_PA20
#define OPENPICC_PIO_PLL_INHIBIT AT91C_PIO_PA24
personal git repositories of Harald Welte. Your mileage may vary