summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc_buffer.h
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-29 08:53:20 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-29 08:53:20 +0000
commitad5b96d584fc9962a9d8504067cd59697fb9a580 (patch)
treea79230629a87dfbb65603d806467499ec632e4e8 /openpicc/application/ssc_buffer.h
parent4b03b310ffda11b017ce5166012a7139b09eee90 (diff)
New cleaned-up (and then messed up again) SSC code
Better layering separation git-svn-id: https://svn.openpcd.org:2342/trunk@434 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/ssc_buffer.h')
-rw-r--r--openpicc/application/ssc_buffer.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/openpicc/application/ssc_buffer.h b/openpicc/application/ssc_buffer.h
new file mode 100644
index 0000000..fdb977f
--- /dev/null
+++ b/openpicc/application/ssc_buffer.h
@@ -0,0 +1,46 @@
+#ifndef SSC_BUFFER_H_
+#define SSC_BUFFER_H_
+
+#define SSC_RX_BUFFER_SIZE_AS_UINT8 2048
+#define SSC_DMA_BUFFER_COUNT 4
+
+#if SSC_RX_BUFFER_SIZE_AS_UINT8 < DIV_ROUND_UP((ISO14443A_MAX_RX_FRAME_SIZE_IN_BITS*ISO14443A_SAMPLE_LEN),8)
+#undef SSC_RX_BUFFER_SIZE_AS_UINT8
+#define SSC_RX_BUFFER_SIZE_AS_UINT8 DIV_ROUND_UP((ISO14443A_MAX_RX_FRAME_SIZE_IN_BITS*ISO14443A_SAMPLE_LEN),8)
+#endif
+
+typedef enum {
+ FREE=0, /* Buffer is free */
+ PENDING, /* Buffer has been given to the DMA controller and is currently being filled */
+ FULL, /* DMA controller signalled that the buffer is full */
+ PROCESSING,/* The buffer is currently processed by the consumer (e.g. decoder) */
+ PREFILLED, /* The buffer has been prefilled for later usage (only used for TX) */
+} ssc_dma_buffer_state_t;
+
+enum ssc_mode {
+ SSC_MODE_NONE,
+ SSC_MODE_14443A,
+};
+
+typedef struct {
+ enum ssc_mode mode;
+ u_int16_t transfersize_ssc;
+ u_int16_t transfersize_pdc;
+ u_int16_t transfers;
+} ssc_mode_def;
+
+typedef struct {
+ volatile ssc_dma_buffer_state_t state;
+ u_int32_t len_transfers; /* Length of the content, in transfers */
+ struct {
+ int overflow:1;
+ } flags;
+ const ssc_mode_def *reception_mode; /* Pointer to the SSC mode definition that the buffer has been loaded for (affects element size and count) */
+ u_int8_t data[SSC_RX_BUFFER_SIZE_AS_UINT8];
+} ssc_dma_rx_buffer_t;
+
+
+typedef struct {
+} ssc_dma_tx_buffer_t;
+
+#endif /*SSC_BUFFER_H_*/
personal git repositories of Harald Welte. Your mileage may vary