summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc_picc.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 17:13:26 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 17:13:26 +0000
commit40bf6fbf1a821fdb0891ed7c0989d1a3548d503a (patch)
treecd9bca4a88562ea7449e01e2cbd4ef10b4d7b318 /openpicc/application/ssc_picc.c
parent91d960e6945a1bb8e70e41d62fbb3be93b16f989 (diff)
Further the distinction between SSC and PDC transfersize
Add convenient access to the last data bit from the miller decoder for type a frames git-svn-id: https://svn.openpcd.org:2342/trunk@391 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/ssc_picc.c')
-rw-r--r--openpicc/application/ssc_picc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c
index 09be1e5..520098d 100644
--- a/openpicc/application/ssc_picc.c
+++ b/openpicc/application/ssc_picc.c
@@ -72,16 +72,16 @@ static struct ssc_state ssc_state;
* the SSC supports different sizes, all PDC tranfers will be either 8, 16 or 32, rounding up.) */
static const ssc_mode_def ssc_sizes[] = {
/* Undefined, no size set */
- [SSC_MODE_NONE] = {SSC_MODE_NONE, 0, 0},
+ [SSC_MODE_NONE] = {SSC_MODE_NONE, 0, 0, 0},
/* 14443A Short Frame: 1 transfer of ISO14443A_SHORT_LEN bits */
- [SSC_MODE_14443A_SHORT] = {SSC_MODE_14443A_SHORT, ISO14443A_SHORT_TRANSFER_SIZE, 1},
+ [SSC_MODE_14443A_SHORT] = {SSC_MODE_14443A_SHORT, ISO14443A_SHORT_LEN, ISO14443A_SHORT_TRANSFER_SIZE, 1},
/* 14443A Standard Frame: FIXME 16 transfers of 32 bits (maximum number), resulting in 512 samples */
- [SSC_MODE_14443A_STANDARD] = {SSC_MODE_14443A_STANDARD, 32, 16},
+ [SSC_MODE_14443A_STANDARD] = {SSC_MODE_14443A_STANDARD, 32, 32, 16},
/* 14443A Frame, don't care if standard or short */
- [SSC_MODE_14443A] = {SSC_MODE_14443A, ISO14443A_SAMPLE_LEN, ISO14443A_MAX_RX_FRAME_SIZE_IN_BITS},
- [SSC_MODE_14443B] = {SSC_MODE_14443B, 32, 16}, /* 64 bytes */
- [SSC_MODE_EDGE_ONE_SHOT] = {SSC_MODE_EDGE_ONE_SHOT, 32, 16}, /* 64 bytes */
- [SSC_MODE_CONTINUOUS] = {SSC_MODE_CONTINUOUS, 32, 511}, /* 2044 bytes */
+ [SSC_MODE_14443A] = {SSC_MODE_14443A, ISO14443A_SAMPLE_LEN, 8, ISO14443A_MAX_RX_FRAME_SIZE_IN_BITS},
+ [SSC_MODE_14443B] = {SSC_MODE_14443B, 32, 32, 16}, /* 64 bytes */
+ [SSC_MODE_EDGE_ONE_SHOT] = {SSC_MODE_EDGE_ONE_SHOT, 32, 32, 16}, /* 64 bytes */
+ [SSC_MODE_CONTINUOUS] = {SSC_MODE_CONTINUOUS, 32, 32, 511}, /* 2044 bytes */
};
/* ************** SSC BUFFER HANDLING *********************** */
@@ -154,7 +154,7 @@ static int __ramfunc __ssc_rx_load(int secondary)
}
DEBUGR("filling SSC RX%u dma ctx: %u (len=%u) ", secondary,
req_ctx_num(buffer), buffer->size);
- buffer->len = ssc_sizes[ssc_state.mode].transfersize * ssc_sizes[ssc_state.mode].transfers;
+ buffer->len = ssc_sizes[ssc_state.mode].transfersize_ssc * ssc_sizes[ssc_state.mode].transfers;
buffer->reception_mode = &ssc_sizes[ssc_state.mode];
if(ssc_state.buffer[secondary] != NULL) {
@@ -202,7 +202,7 @@ static ssc_dma_rx_buffer_t* __ramfunc __ssc_rx_unload(int secondary)
u_int16_t remaining_transfers = (secondary ? rx_pdc->PDC_RNCR : rx_pdc->PDC_RCR);
u_int8_t* next_transfer_location = (u_int8_t*)(secondary ? rx_pdc->PDC_RNPR : rx_pdc->PDC_RPR);
u_int16_t elapsed_transfers = buffer->reception_mode->transfers - remaining_transfers;
- u_int32_t elapsed_size = buffer->reception_mode->transfersize/8 * elapsed_transfers;
+ u_int32_t elapsed_size = buffer->reception_mode->transfersize_pdc/8 * elapsed_transfers;
/* Consistency check */
if( next_transfer_location - elapsed_size != buffer->data ) {
personal git repositories of Harald Welte. Your mileage may vary