summaryrefslogtreecommitdiff
path: root/firmware/include
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/AT91SAM7.h2
-rw-r--r--firmware/include/lib_AT91SAM7.h16
-rw-r--r--firmware/include/openpcd.h3
-rw-r--r--firmware/include/simtrace_usb.h24
4 files changed, 44 insertions, 1 deletions
diff --git a/firmware/include/AT91SAM7.h b/firmware/include/AT91SAM7.h
index 53eb072..42743f6 100644
--- a/firmware/include/AT91SAM7.h
+++ b/firmware/include/AT91SAM7.h
@@ -1942,6 +1942,6 @@ typedef struct _AT91S_UDP {
#endif
#define AT91C_IFLASH_NB_OF_PAGES (AT91C_ISRAM_SIZE>>AT91C_IFLASH_PAGE_SHIFT)
-#define AT91C_IFLASH_LOCK_REGION_SIZE (AT91C_ISRAM_SIZE/AT91C_IFLASH_NB_OF_LOCK_BITS)
+#define AT91C_IFLASH_LOCK_REGION_SIZE (AT91C_IFLASH_SIZE/AT91C_IFLASH_NB_OF_LOCK_BITS)
#endif/*__AT91SAM7_H__*/
diff --git a/firmware/include/lib_AT91SAM7.h b/firmware/include/lib_AT91SAM7.h
index f26ac54..2aa7df6 100644
--- a/firmware/include/lib_AT91SAM7.h
+++ b/firmware/include/lib_AT91SAM7.h
@@ -444,6 +444,22 @@ static inline void AT91F_PIO_CfgPullup(
pPio->PIO_PPUER = pullupEnable;
}
+static inline void AT91F_PIO_CfgPullupEn(
+ AT91PS_PIO pPio, // \arg pointer to a PIO controller
+ unsigned int pullupEnable) // \arg enable pullup on PIO
+{
+ // Connect or not Pullup
+ pPio->PIO_PPUER = pullupEnable;
+}
+
+static inline void AT91F_PIO_CfgPullupDis(
+ AT91PS_PIO pPio, // \arg pointer to a PIO controller
+ unsigned int pullupEnable) // \arg enable pullup on PIO
+{
+ // Connect or not Pullup
+ pPio->PIO_PPUDR = pullupEnable;
+}
+
//*----------------------------------------------------------------------------
//* \fn AT91F_PIO_CfgDirectDrive
//* \brief Enable direct drive on PIO
diff --git a/firmware/include/openpcd.h b/firmware/include/openpcd.h
index e5a0ac7..ea32764 100644
--- a/firmware/include/openpcd.h
+++ b/firmware/include/openpcd.h
@@ -34,6 +34,8 @@ enum openpcd_cmd_class {
OPENPCD_CMD_CLS_ADC = 0x5,
OPENPCD_CMD_CLS_LIBRFID = 0x6,
OPENPCD_CMD_CLS_PRESENCE = 0x7,
+ /* SIM SCAN */
+ OPENPCD_CMD_CLS_SIM = 0x8,
/* PICC (transponder) side */
OPENPCD_CMD_CLS_PICC = 0xe,
@@ -102,6 +104,7 @@ enum openpcd_cmd_class {
#define OPENPCD_VENDOR_ID 0x16c0
+#define SIMTRACE_PRODUCT_ID 0x0762
#define OPENPCD_PRODUCT_ID 0x076b
#define OPENPICC_PRODUCT_ID 0x076c
#define OPENPCD_OUT_EP 0x01
diff --git a/firmware/include/simtrace_usb.h b/firmware/include/simtrace_usb.h
new file mode 100644
index 0000000..c020093
--- /dev/null
+++ b/firmware/include/simtrace_usb.h
@@ -0,0 +1,24 @@
+#ifndef SIMTRACE_USB_H
+#define SIMTRACE_USB_H
+
+//#include <stdint.h>
+
+/* this is kept compatible with OpenPCD protocol */
+struct simtrace_hdr {
+ u_int8_t cmd;
+ u_int8_t flags;
+ u_int8_t res[2];
+ u_int8_t data[0];
+} __attribute__ ((packed));
+
+enum simtrace_usb_msgt {
+ SIMTRACE_MSGT_NULL,
+ SIMTRACE_MSGT_DATA,
+ SIMTRACE_MSGT_RESET, /* reset was asserted, no more data */
+};
+
+/* flags for MSGT_DATA */
+#define SIMTRACE_FLAG_ATR 0x01 /* ATR immediately after reset */
+#define SIMTRACE_FLAG_WTIME_EXP 0x04 /* work waiting time expired */
+
+#endif /* SIMTRACE_USB_H */
personal git repositories of Harald Welte. Your mileage may vary