First cut at lm3s6918 serial driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1772 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
0e835cd897
commit
fafdb07d67
@ -46,7 +46,7 @@ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
|
||||
up_undefinedinsn.c up_usestack.c
|
||||
|
||||
CHIP_ASRCS =
|
||||
CHIP_CSRCS = lm3s_start.c lm3s_syscontrol.c lm3s_irq.c lm3s_lowputc.c
|
||||
CHIP_CSRCS = lm3s_start.c lm3s_syscontrol.c lm3s_irq.c lm3s_lowputc.c lm3s_serial.c
|
||||
|
||||
ifdef CONFIG_NET
|
||||
CHIP_CSRCS += lm3s_ethernet.c
|
||||
|
@ -115,7 +115,7 @@
|
||||
|
||||
#define UART_LCRH_VALUE (UART_LCRH_NBITS|UART_LCRH_PARITY|UART_LCRH_NSTOP|UART_LCRH_FEN)
|
||||
|
||||
/* Calculate BAUD rate from PCLK1:
|
||||
/* Calculate BAUD rate from the SYS clock:
|
||||
*
|
||||
* "The baud-rate divisor is a 22-bit number consisting of a 16-bit integer and a 6-bit
|
||||
* fractional part. The number formed by these two values is used by the baud-rate generator
|
||||
@ -220,7 +220,7 @@ void up_lowputc(char ch)
|
||||
void up_lowsetup(void)
|
||||
{
|
||||
uint32 rcgc1;
|
||||
#ifdef HAVE_CONSOLE
|
||||
#if defined(HAVE_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG)
|
||||
uint32 ctl;
|
||||
|
||||
/* Enable the selected console device */
|
||||
@ -244,7 +244,7 @@ void up_lowsetup(void)
|
||||
|
||||
/* 5. Enable the UART by setting the UARTEN bit in the UART CTL register */
|
||||
|
||||
ctl |= UART_CTL_UARTEN;
|
||||
ctl |= (UART_CTL_UARTEN|UART_CTL_TXE|UART_CTL_RXE);
|
||||
putreg32(ctl, LM3S_CONSOLE_BASE+LM3S_UART_CTL_OFFSET);
|
||||
#endif
|
||||
|
||||
|
@ -271,7 +271,8 @@ void up_lowputc(char ch)
|
||||
|
||||
void up_lowsetup(void)
|
||||
{
|
||||
#ifdef HAVE_CONSOLE
|
||||
#if defined(HAVE_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG)
|
||||
|
||||
uint16 reg16;
|
||||
|
||||
/* Enable the selected console device */
|
||||
|
@ -458,7 +458,7 @@ static inline void up_waittxnotfull(struct up_dev_s *priv)
|
||||
|
||||
static int up_setup(struct uart_dev_s *dev)
|
||||
{
|
||||
#ifndef CONFIG_SUPPRESS_STR71X_UART_CONFIG
|
||||
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
uint32 divisor;
|
||||
uint32 baud;
|
||||
@ -668,6 +668,7 @@ static int up_interrupt(int irq, void *context)
|
||||
/* Rx buffer not empty ... process incoming bytes */
|
||||
|
||||
uart_recvchars(dev);
|
||||
handled = TRUE;
|
||||
}
|
||||
|
||||
/* Handle outgoing, transmit bytes */
|
||||
@ -677,6 +678,7 @@ static int up_interrupt(int irq, void *context)
|
||||
/* Tx FIFO not full ... process outgoing bytes */
|
||||
|
||||
uart_xmitchars(dev);
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
@ -756,7 +758,7 @@ static void up_rxint(struct uart_dev_s *dev, boolean enable)
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
if (enable)
|
||||
{
|
||||
/* Receive an interrupt when the Rx FIFO is half full (or and IDLE
|
||||
/* Receive an interrupt when the Rx FIFO is half full (or an IDLE
|
||||
* timeout occurs.
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user