summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443_layer2a.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-05 05:03:36 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-05 05:03:36 +0000
commit6304718e371e590b09e176c05df21fc5fb631cec (patch)
tree49004ef275322a779594d8ebd5d69c9da8ba1d4e /openpicc/application/iso14443_layer2a.c
parent3ee3c4a649545d1f132bca61cc7484f0d5c92638 (diff)
Port over the differential miller decoder from the sniffonly host tool
Move clock switch to its own header file Specify default (and for non-clock switching capable hardware: single) clock source in hardware definitions git-svn-id: https://svn.openpcd.org:2342/trunk@443 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443_layer2a.c')
-rw-r--r--openpicc/application/iso14443_layer2a.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/openpicc/application/iso14443_layer2a.c b/openpicc/application/iso14443_layer2a.c
index 65ca91e..3c55967 100644
--- a/openpicc/application/iso14443_layer2a.c
+++ b/openpicc/application/iso14443_layer2a.c
@@ -45,6 +45,7 @@
#include "tc_cdiv.h"
#include "tc_cdiv_sync.h"
#include "load_modulation.h"
+#include "clock_switch.h"
#include "pio_irq.h"
#include "usb_print.h"
@@ -129,7 +130,7 @@ int iso14443_transmit(ssc_dma_tx_buffer_t *buffer, unsigned int fdt, u_int8_t as
tx_pending = 1;
/* Immediately set up FDT and clock */
- ssc_select_clock(CLOCK_SELECT_CARRIER);
+ clock_switch(CLOCK_SELECT_CARRIER);
ssc_set_gate(0);
tc_fdt_set(fdt);
tc_cdiv_set_divider(8); // FIXME Magic hardcoded number
@@ -191,7 +192,7 @@ static void iso14443_ssc_callback(ssc_callback_reason reason, void *data)
}
if( reason == CALLBACK_RX_FRAME_ENDED && fast_receive ) {
- ssc_select_clock(CLOCK_SELECT_CARRIER); /* A Tx might be coming up */
+ clock_switch(CLOCK_SELECT_CARRIER); /* A Tx might be coming up */
ssc_dma_rx_buffer_t *buffer = data;
if(callback != NULL)
@@ -201,10 +202,10 @@ static void iso14443_ssc_callback(ssc_callback_reason reason, void *data)
if( (reason == CALLBACK_RX_FRAME_ENDED && !tx_pending) || reason == CALLBACK_RX_STARTING
|| reason == CALLBACK_TX_FRAME_ENDED ) {
/* For regular SSC Rx we'd set the clock to
- // ssc_select_clock(CLOCK_SELECT_PLL);
+ // clock_switch(CLOCK_SELECT_PLL);
* however, the SSC Rx code is going to go away (at least for 14443-A)
* and switching clocks messes up the Tx timing, so we do a */
- ssc_select_clock(CLOCK_SELECT_CARRIER);
+ clock_switch(CLOCK_SELECT_CARRIER);
ssc_set_gate(1);
tc_fdt_set(0xff00);
tc_cdiv_set_divider(RX_DIVIDER);
@@ -233,6 +234,7 @@ int iso14443_layer2a_init(u_int8_t enable_fast_receive)
tc_cdiv_init();
tc_fdt_init();
+ clock_switch_init();
load_mod_init();
iso14443_set_fast_receive(enable_fast_receive);
personal git repositories of Harald Welte. Your mileage may vary