diff options
Diffstat (limited to 'spi-uart.c')
-rw-r--r-- | spi-uart.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -43,7 +43,7 @@ static void spi_init() /* set a default baud rate, 115200 */ /* feng, need make sure SPIC and MAXIM3110 match */ //spi_enable_clk(32); - pspi->baudr = 2; + pspi->baudr = 0xd8; /* need set the transmit threshhol? */ /* pspi->txftlr = 0x3; */ @@ -70,20 +70,13 @@ static void max3110_write_config(void) pspi->dr[0] = config; } -static void spi_uart_delay(volatile unsigned int loops) -{ - while (loops--); -} - /* transfer char to a eligibal word and send to max3110 */ static void max3110_write_data(char c) { u16 data; - spi_uart_delay(0x8000); data = 0x8000 | c; pspi->dr[0] = data; - spi_uart_delay(0x8000); } /* slave select should be called in the read/write function */ @@ -107,10 +100,10 @@ static int spi_max3110_putc(char c) } timeout = MRST_SPI_TIMEOUT; - /* early putc need make sure the TX FIFO is empty */ + /* early putc need make sure the TX FIFO is not full*/ while (timeout--) { sr = pspi->sr; - if ( (sr & SR_BUSY) || !(sr & SR_TF_EMPT)) + if ( (sr & SR_BUSY) || !(sr & SR_TF_NOT_FULL)) continue; else break; |