From 948f16ee2071b267646f92861208811b3e8e9853 Mon Sep 17 00:00:00 2001 From: henryk Date: Sun, 11 Nov 2007 04:31:13 +0000 Subject: Add da_get_value to return the last written value Add commands to increase and decrease comparator threshold git-svn-id: https://svn.openpcd.org:2342/trunk@320 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/da.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'openpicc/application/da.c') diff --git a/openpicc/application/da.c b/openpicc/application/da.c index 64cee5b..e645053 100644 --- a/openpicc/application/da.c +++ b/openpicc/application/da.c @@ -26,6 +26,7 @@ #include static const AT91PS_SPI spi = AT91C_BASE_SPI; +static u_int8_t last_value; void da_comp_carr(u_int8_t position) { @@ -43,6 +44,12 @@ void da_comp_carr(u_int8_t position) while (!(spi->SPI_SR & AT91C_SPI_TDRE)) { } for (i = 0; i < 0xff; i++) { } AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH); + last_value = position; +} + +u_int8_t da_get_value(void) +{ + return last_value; } void da_init(void) -- cgit v1.2.3