From 6304718e371e590b09e176c05df21fc5fb631cec Mon Sep 17 00:00:00 2001 From: henryk Date: Wed, 5 Mar 2008 05:03:36 +0000 Subject: 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 --- openpicc/application/ssc.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'openpicc/application/ssc.c') diff --git a/openpicc/application/ssc.c b/openpicc/application/ssc.c index a490d42..7c63104 100644 --- a/openpicc/application/ssc.c +++ b/openpicc/application/ssc.c @@ -34,6 +34,7 @@ #include "ssc.h" #include "iso14443.h" +#include "clock_switch.h" #include "tc_cdiv_sync.h" #include "tc_fdt.h" #include "led.h" @@ -331,20 +332,6 @@ static __ramfunc ssc_dma_rx_buffer_t* _unload_rx(ssc_handle_t *sh) return buffer; } -void ssc_select_clock(enum ssc_clock_source clock) -{ - if(!OPENPICC->features.clock_switching) return; - switch(clock) { - case CLOCK_SELECT_PLL: - AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC->CLOCK_SWITCH); - break; - case CLOCK_SELECT_CARRIER: - AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC->CLOCK_SWITCH); - break; - default: break; - } -} - void ssc_set_gate(int data_enabled) { if(OPENPICC->features.data_gating) { if(data_enabled) { @@ -478,7 +465,7 @@ static inline int _init_ssc_rx(ssc_handle_t *sh) if(OPENPICC->features.clock_switching) { AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC->CLOCK_SWITCH); - ssc_select_clock(CLOCK_SELECT_PLL); + clock_switch(CLOCK_SELECT_PLL); } /* Disable all interrupts */ @@ -512,8 +499,8 @@ static inline int _init_ssc_tx(ssc_handle_t *sh) OPENPICC_SSC_CLOCK | OPENPICC_SSC_TF, 0); if(OPENPICC->features.clock_switching) { - AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC->CLOCK_SWITCH); - /* Users: remember to ssc_select_clock(CLOCK_SELECT_CARRIER) as + clock_switch_init(); + /* Users: remember to clock_switch(CLOCK_SELECT_CARRIER) as * early as possible, e.g. right after receive end */ } -- cgit v1.2.3