Author: matt
Date: 2007-04-30 16:39:23 -0600 (Mon, 30 Apr 2007)
New Revision: 5198
Modified:
gnuradio/branches/developers/matt/u2f/firmware/bootstrap.c
Log:
control gpios and serial dac
Modified: gnuradio/branches/developers/matt/u2f/firmware/bootstrap.c
===================================================================
--- gnuradio/branches/developers/matt/u2f/firmware/bootstrap.c 2007-04-30
22:38:54 UTC (rev 5197)
+++ gnuradio/branches/developers/matt/u2f/firmware/bootstrap.c 2007-04-30
22:39:23 UTC (rev 5198)
@@ -6,10 +6,10 @@
// Set up AD9510
spi_init();
- spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00004500, 24); // CLK2 drives
distribution
- spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00003D80, 24); // Turn on output
1, normal levels
- spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00004B80, 24); // Bypass divider
- spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00005A01, 24); // Update Regs
+ spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00004500, 24, 0); // CLK2 drives
distribution
+ spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00003D80, 24, 0); // Turn on
output 1, normal levels
+ spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00004B80, 24, 0); // Bypass divider
+ spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00005A01, 24, 0); // Update Regs
spi_wait();
@@ -18,8 +18,28 @@
volatile char *p = (char *) OUTPUTS_BASE + OUTPUTS_CLK;
*p = clock_controls;
+ // Set GPIOs to outputs
+ volatile unsigned short *gpio_ddr_rx = (unsigned short *)(GPIO_BASE +
GPIO_DDR + GPIO_RX);
+ volatile unsigned short *gpio_ddr_tx = (unsigned short *)(GPIO_BASE +
GPIO_DDR + GPIO_TX);
+ volatile unsigned short *gpio_io_rx = (unsigned short *)(GPIO_BASE + GPIO_IO
+ GPIO_RX);
+ volatile unsigned short *gpio_io_tx = (unsigned short *)(GPIO_BASE + GPIO_IO
+ GPIO_TX);
+
+ *gpio_ddr_rx = 0xffff;
+ *gpio_ddr_tx = 0xffff;
+
+ *gpio_io_rx = (short) 0xDEAD;
+ *gpio_io_tx = (short) 0xBEEF;
+
+ // Set up DAC
+ int i = 0;
+ while(1) {
+ int command = (3 << 19) | (0 << 16) | (i & 0xffff);
+ spi_transact(SPI_TXONLY, SPI_SS_TX_DAC, command, 24, 1); // negate TX phase
+ i++;
+
+ }
+
// Control LEDs
-
volatile char *leds = (char *) OUTPUTS_BASE + OUTPUTS_MISC;
while(1) {
*leds = (char) 0x00;
_______________________________________________
Commit-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnuradio