summaryrefslogtreecommitdiff
path: root/openpicc/application
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-11 11:38:02 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-11 11:38:02 +0000
commitf0c0bc64efe337d28955bf0f0cc05871606e9ea6 (patch)
tree8ee8e667eed6bc47d700453b0b904c2608f4a94b /openpicc/application
parent50a134ace94344d1ff083778f1a91fe0851731e4 (diff)
Add command to toggle PLL inhibition
git-svn-id: https://svn.openpcd.org:2342/trunk@410 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application')
-rw-r--r--openpicc/application/cmd.c8
-rw-r--r--openpicc/application/pll.c5
-rw-r--r--openpicc/application/pll.h1
3 files changed, 13 insertions, 1 deletions
diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c
index 7fa6196..7995947 100644
--- a/openpicc/application/cmd.c
+++ b/openpicc/application/cmd.c
@@ -14,6 +14,7 @@
#include "led.h"
#include "da.h"
#include "adc.h"
+#include "pll.h"
#include "tc_cdiv.h"
#include "tc_cdiv_sync.h"
#include "pio_irq.h"
@@ -44,7 +45,7 @@ static const portBASE_TYPE USE_COLON_FOR_LONG_COMMANDS = 0;
/* When not USE_COLON_FOR_LONG_COMMANDS then short commands will be recognized by including
* their character in the string SHORT_COMMANDS
* */
-static const char *SHORT_COMMANDS = "!pc+-l?hq9fjka";
+static const char *SHORT_COMMANDS = "!pc+-l?hq9fjkai";
/* Note that the long/short command distinction only applies to the USB serial console
* */
@@ -356,6 +357,10 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) {
case 'F':
startstop_field_meter();
break;
+ case 'I':
+ pll_inhibit(!pll_is_inhibited());
+ if(pll_is_inhibited()) DumpStringToUSB(" * PLL is now inhibited\n\r");
+ else DumpStringToUSB(" * PLL is now running\n\r");
#if ( configUSE_TRACE_FACILITY == 1 )
case 'T':
memset(pcWriteBuffer, 0, sizeof(pcWriteBuffer));
@@ -397,6 +402,7 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) {
" * l - cycle LEDs\n\r"
" * p - print PIO pins\n\r"
" * z 0/1- enable or disable tc_cdiv_sync\n\r"
+ " * i - inhibit/uninhibit PLL\n\r"
" * ! - reset tc_cdiv_sync\n\r"
" * q - start rx\n\r"
" * f - start/stop field meter\n\r"
diff --git a/openpicc/application/pll.c b/openpicc/application/pll.c
index 62236ae..c40718a 100644
--- a/openpicc/application/pll.c
+++ b/openpicc/application/pll.c
@@ -33,6 +33,11 @@ void pll_inhibit(int inhibit)
AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_INHIBIT);
}
+int pll_is_inhibited(void)
+{
+ return AT91F_PIO_IsInputSet(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_INHIBIT);
+}
+
int pll_is_locked(void)
{
return AT91F_PIO_IsInputSet(AT91C_BASE_PIOA, OPENPICC_PIO_PLL_LOCK);
diff --git a/openpicc/application/pll.h b/openpicc/application/pll.h
index fc00105..e660e79 100644
--- a/openpicc/application/pll.h
+++ b/openpicc/application/pll.h
@@ -2,6 +2,7 @@
#define _PLL_H
extern int pll_is_locked(void);
+extern int pll_is_inhibited(void);
extern void pll_inhibit(int inhibit);
extern void pll_init(void);
personal git repositories of Harald Welte. Your mileage may vary