From ef276e336cf8e3dc2092260c8a24f498b6a1bc6d Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Thu, 2 Apr 2009 18:05:13 -0400 Subject: [PATCH] lots of code. Still doesn't work though. Thanks Jim! --- Makefile | 2 +- tests/rftest-rx.c | 67 +++++++++++++++++++++++++++++++++-------------- tests/rftest-tx.c | 55 +++++++++++++++++++++++++++++--------- 3 files changed, 92 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index c451cf962..dba449c52 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ ALL = $(TARGETS) $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis) .PRECIOUS: $(COBJS) $(TARGETS) $(TESTS:.c=.obj) -all: $(ALL) +all: $(COBJS) $(ALL) %.srec: %.obj $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ diff --git a/tests/rftest-rx.c b/tests/rftest-rx.c index 2e46f944a..9c3c4bc30 100644 --- a/tests/rftest-rx.c +++ b/tests/rftest-rx.c @@ -9,16 +9,7 @@ #define UART1_CTS 0x80005014 #define UART1_BR 0x80005018 -#define MACA_BASE 0x80004000 -#define MACA_RESET 0x80004004 -#define MACA_RANDOM 0x80004008 -#define MACA_CONTROL 0x8000400c -#define MACA_STATUS 0x80004010 -#define MACA_DMARX 0x80004080 -#define MACA_DMATX 0x80004084 -#define MACA_GETRXLVL 0x80004098 -#define MACA_PREAMBLE 0x8000411c - +#include "maca.h" #include "embedded_types.h" #define reg(x) (*(volatile uint32_t *)(x)) @@ -39,6 +30,7 @@ __attribute__ ((section ("startup"))) void main(void) { uint8_t c; volatile uint32_t i; + uint32_t tmp; volatile uint32_t *data; /* Restore UART regs. to default */ @@ -58,18 +50,27 @@ void main(void) { reg(UART1_CON) = 0x00000003; /* enable receive and transmit */ reg(GPIO_FUNC_SEL0) = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/ + reg(MACA_RESET) = 0x3; /* reset, turn on the clock */ + for(i=0; i