diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-12-20 04:02:47 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-12-20 04:02:47 +0000 |
commit | 021f73634e525901dd38b206dac35b747c8dd8d2 (patch) | |
tree | 2888437eb10689aa049fda2ea8869027a94046bc /openpicc/application | |
parent | 5ec39e9732ba29d641c37b7739fbc97643ac1b9d (diff) |
Add SSC_DATA_GATE support
git-svn-id: https://svn.openpcd.org:2342/trunk@399 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application')
-rw-r--r-- | openpicc/application/cmd.c | 14 | ||||
-rw-r--r-- | openpicc/application/ssc_picc.c | 15 | ||||
-rw-r--r-- | openpicc/application/ssc_picc.h | 4 |
3 files changed, 33 insertions, 0 deletions
diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c index b66c6c8..ac1d605 100644 --- a/openpicc/application/cmd.c +++ b/openpicc/application/cmd.c @@ -212,6 +212,17 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { DumpStringToUSB("cdiv_sync enabled \n\r"); } break; +#ifdef OPENPICC_MODIFIED_BOARD + case 'G': + i=atoiEx(args, &args); + ssc_set_data_gate(i); + if(i==0) { + DumpStringToUSB("SSC_DATA disabled \n\r"); + } else { + DumpStringToUSB("SSC_DATA enabled \n\r"); + } + break; +#endif case 'D': i=atoiEx(args, &args); tc_cdiv_set_divider(i); @@ -404,6 +415,9 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { " * d div- set tc_cdiv divider value 16, 32, 64, ...\n\r" " * j,k - increase, decrease fdt_offset\n\r" " * a - change load modulation level\n\r" +#ifdef OPENPICC_MODIFIED_BOARD + " * g 0/1- disable or enable SSC_DATA through gate\n\r" +#endif " * 9 - reset CPU\n\r" " * ?,h - display this help screen\n\r" " *\n\r" diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c index 79df04e..ab3f2e9 100644 --- a/openpicc/application/ssc_picc.c +++ b/openpicc/application/ssc_picc.c @@ -668,6 +668,16 @@ void ssc_tx_init(void) tx_pdc = (AT91PS_PDC) &(ssc->SSC_RPR); } +#ifdef OPENPICC_MODIFIED_BOARD +void ssc_set_data_gate(int enable) +{ + if(enable) + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE); + else + AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE); +} +#endif + void ssc_rx_init(void) { tc_cdiv_sync_init(); @@ -687,6 +697,11 @@ void ssc_rx_init(void) AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL); AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL); + +#ifdef OPENPICC_MODIFIED_BOARD + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE); + AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE); +#endif AT91F_AIC_ConfigureIt(AT91C_ID_SSC, OPENPICC_IRQ_PRIO_SSC, diff --git a/openpicc/application/ssc_picc.h b/openpicc/application/ssc_picc.h index b769fe7..650a09e 100644 --- a/openpicc/application/ssc_picc.h +++ b/openpicc/application/ssc_picc.h @@ -100,4 +100,8 @@ extern void ssc_tx_start(ssc_dma_tx_buffer_t *buf); extern volatile u_int32_t ssc_tx_fiq_fdt_cdiv; extern volatile u_int32_t ssc_tx_fiq_fdt_ssc; +#ifdef OPENPICC_MODIFIED_BOARD +extern void ssc_set_data_gate(int enable); +#endif + #endif |