Universal synchronous / asynchronous receiver / transmitter registers. More...
![]() |
Defines | |
#define | ASCII_XON 0x11 |
#define | ASCII_XOFF 0x13 |
#define | XON_PENDING 0x10 |
#define | XOFF_PENDING 0x20 |
#define | XOFF_SENT 0x40 |
#define | XOFF_RCVD 0x80 |
#define | US_OVRE 0x00000020 |
Overrun error. | |
#define | ASCII_XON 0x11 |
#define | ASCII_XOFF 0x13 |
#define | XON_PENDING 0x10 |
#define | XOFF_PENDING 0x20 |
#define | XOFF_SENT 0x40 |
#define | XOFF_RCVD 0x80 |
Functions | |
int | Sc16is752RegWrite (uint8_t dev, uint8_t ch, uint8_t reg, uint8_t val) |
int | Sc16is752RegRead (uint8_t dev, uint8_t ch, uint8_t reg, uint8_t *val) |
int | selectRegisterSet (uint8_t dev, uint8_t ch, uint8_t reg) |
void | Sc16is752UsartProcessChannelInterrupt (uint8_t dev, uint8_t ch, uint8_t iir) |
void | Sc16is752UsartInterruptProcessing (void *arg) |
void | Sc16is752UsartEnable (uint8_t dev, uint8_t ch) |
Carefully enable USART hardware functions. | |
void | Sc16is752UsartDisable (uint8_t dev, uint8_t ch) |
Carefully disable USART hardware functions. | |
uint32_t | Sc16is752UsartGetSpeed (uint8_t dev, uint8_t ch) |
Query the USART hardware for the selected speed. | |
int | Sc16is752UsartSetSpeed (uint32_t rate, uint8_t dev, uint8_t ch) |
Set the USART hardware bit rate. | |
uint8_t | Sc16is752UsartGetDataBits (uint8_t dev, uint8_t ch) |
Query the USART hardware for the number of data bits. | |
int | Sc16is752UsartSetDataBits (uint8_t bits, uint8_t dev, uint8_t ch) |
Set the USART hardware to the number of data bits. | |
uint8_t | Sc16is752UsartGetParity (uint8_t dev, uint8_t ch) |
Query the USART hardware for the parity mode. | |
int | Sc16is752UsartSetParity (uint8_t mode, uint8_t dev, uint8_t ch) |
Set the USART hardware to the specified parity mode. | |
uint8_t | Sc16is752UsartGetStopBits (uint8_t dev, uint8_t ch) |
Query the USART hardware for the number of stop bits. | |
int | Sc16is752UsartSetStopBits (uint8_t bits, uint8_t dev, uint8_t ch) |
Set the USART hardware to the number of stop bits. | |
uint32_t | Sc16is752UsartGetStatus (uint8_t dev, uint8_t ch) |
Query the USART hardware status. | |
int | Sc16is752UsartSetStatus (uint32_t flags, uint8_t dev, uint8_t ch) |
Set the USART hardware status. | |
uint8_t | Sc16is752UsartGetClockMode (uint8_t dev, uint8_t ch) |
Query the USART hardware for synchronous mode. | |
int | Sc16is752UsartSetClockMode (uint8_t mode, uint8_t dev, uint8_t ch) |
Set asynchronous or synchronous mode. | |
uint32_t | Sc16is752UsartGetFlowControl (uint8_t dev, uint8_t ch) |
Query flow control mode. | |
int | Sc16is752UsartSetFlowControl (uint32_t flags, uint8_t dev, uint8_t ch) |
Set flow control mode. | |
void | Sc16is752UsartTxStart (uint8_t dev, uint8_t ch) |
Start the USART transmitter hardware. | |
void | Sc16is752UsartRxStart (uint8_t dev, uint8_t ch) |
Start the USART receiver hardware. | |
int | Sc16is752UsartInit (uint8_t dev, uint8_t ch, NUTDEVICE *nutDev, IRQ_HANDLER *irq) |
Initialize the USART hardware driver. | |
int | Sc16is752UsartDeinit (uint8_t dev, uint8_t ch, IRQ_HANDLER *irq) |
Deinitialize the USART hardware driver. | |
USART Control Register | |
#define | US_CR_OFF 0x00000000 |
USART control register offset. | |
#define | US0_CR (USART0_BASE + US_CR_OFF) |
Channel 0 control register address. | |
#define | US1_CR (USART1_BASE + US_CR_OFF) |
Channel 1 control register address. | |
#define | US_RSTRX 0x00000004 |
Reset receiver. | |
#define | US_RSTTX 0x00000008 |
Reset transmitter. | |
#define | US_RXEN 0x00000010 |
Receiver enable. | |
#define | US_RXDIS 0x00000020 |
Receiver disable. | |
#define | US_TXEN 0x00000040 |
Transmitter enable. | |
#define | US_TXDIS 0x00000080 |
Transmitter disable. | |
#define | US_RSTSTA 0x00000100 |
Reset status bits. | |
#define | US_STTBRK 0x00000200 |
Start break. | |
#define | US_STPBRK 0x00000400 |
Stop break. | |
#define | US_STTTO 0x00000800 |
Start timeout. | |
#define | US_SENDA 0x00001000 |
Send next byte with address bit set. | |
Mode Register | |
#define | US_MR_OFF 0x00000004 |
USART mode register offset. | |
#define | US0_MR (USART0_BASE + US_MR_OFF) |
Channel 0 mode register address. | |
#define | US1_MR (USART1_BASE + US_MR_OFF) |
Channel 1 mode register address. | |
#define | US_CLKS 0x00000030 |
Clock selection mask. | |
#define | US_CLKS_MCK 0x00000000 |
Master clock. | |
#define | US_CLKS_MCK8 0x00000010 |
Master clock divided by 8. | |
#define | US_CLKS_SCK 0x00000020 |
External clock. | |
#define | US_CLKS_SLCK 0x00000030 |
Slow clock. | |
#define | US_CHRL 0x000000C0 |
Masks data length. | |
#define | US_CHRL_5 0x00000000 |
5 data bits. | |
#define | US_CHRL_6 0x00000040 |
6 data bits. | |
#define | US_CHRL_7 0x00000080 |
7 data bits. | |
#define | US_CHRL_8 0x000000C0 |
8 data bits. | |
#define | US_SYNC 0x00000100 |
Synchronous mode enable. | |
#define | US_PAR 0x00000E00 |
Parity mode mask. | |
#define | US_PAR_EVEN 0x00000000 |
Even parity. | |
#define | US_PAR_ODD 0x00000200 |
Odd parity. | |
#define | US_PAR_SPACE 0x00000400 |
Space parity. | |
#define | US_PAR_MARK 0x00000600 |
Marked parity. | |
#define | US_PAR_NO 0x00000800 |
No parity. | |
#define | US_PAR_MULTIDROP 0x00000C00 |
Multi-drop mode. | |
#define | US_NBSTOP 0x00003000 |
Masks stop bit length. | |
#define | US_NBSTOP_1 0x00000000 |
1 stop bit. | |
#define | US_NBSTOP_1_5 0x00001000 |
1.5 stop bits. | |
#define | US_NBSTOP_2 0x00002000 |
2 stop bits. | |
#define | US_CHMODE 0x0000C000 |
Channel mode mask. | |
#define | US_CHMODE_NORMAL 0x00000000 |
Normal mode. | |
#define | US_CHMODE_AUTOMATIC_ECHO 0x00004000 |
Automatic echo. | |
#define | US_CHMODE_LOCAL_LOOPBACK 0x00008000 |
Local loopback. | |
#define | US_CHMODE_REMOTE_LOOPBACK 0x0000C000 |
Remote loopback. | |
#define | US_MODE9 0x00020000 |
9 bit mode. | |
#define | US_CLKO 0x00040000 |
Baud rate output enable. | |
Status and Interrupt Register | |
#define | US_CSR_OFF 0x00000014 |
USART status register offset. | |
#define | US0_CSR (USART0_BASE + US_CSR_OFF) |
Channel 0 status register address. | |
#define | US1_CSR (USART1_BASE + US_CSR_OFF) |
Channel 1 status register address. | |
#define | US_IER_OFF 0x00000008 |
USART interrupt enable register offset. | |
#define | US0_IER (USART0_BASE + US_IER_OFF) |
Channel 0 interrupt enable register address. | |
#define | US1_IER (USART1_BASE + US_IER_OFF) |
Channel 1 interrupt enable register address. | |
#define | US_IDR_OFF 0x0000000C |
USART interrupt disable register offset. | |
#define | US0_IDR (USART0_BASE + US_IDR_OFF) |
Channel 0 interrupt disable register address. | |
#define | US1_IDR (USART1_BASE + US_IDR_OFF) |
Channel 1 interrupt disable register address. | |
#define | US_IMR_OFF 0x00000010 |
USART interrupt mask register offset. | |
#define | US0_IMR (USART0_BASE + US_IMR_OFF) |
Channel 0 interrupt mask register address. | |
#define | US1_IMR (USART1_BASE + US_IMR_OFF) |
Channel 1 interrupt mask register address. | |
#define | US_RXRDY 0x00000001 |
Receiver ready. | |
#define | US_TXRDY 0x00000002 |
Transmitter ready. | |
#define | US_RXBRK 0x00000004 |
Receiver break. | |
#define | US_ENDRX 0x00000008 |
End of receiver PDC transfer. | |
#define | US_ENDTX 0x00000010 |
End of transmitter PDC transfer. | |
#define | US_OVRE 0x00000020 |
Overrun error. | |
#define | US_FRAME 0x00000040 |
Framing error. | |
#define | US_PARE 0x00000080 |
Parity error. | |
#define | US_TIMEOUT 0x00000100 |
Receiver timeout. | |
#define | US_TXEMPTY 0x00000200 |
Transmitter empty. | |
#define | US_RXBUFF 0x00001000 |
Receive buffer full. | |
#define | AT91_US_BAUD(baud) ((NUT_CPU_FREQ / (8 * (baud)) + 1) / 2) |
Baud rate calculation helper macro. | |
Receiver Holding Register | |
#define | US_RHR_OFF 0x00000018 |
USART receiver holding register offset. | |
#define | US0_RHR (USART0_BASE + US_RHR_OFF) |
Channel 0 receiver holding register address. | |
#define | US1_RHR (USART1_BASE + US_RHR_OFF) |
Channel 1 receiver holding register address. | |
Transmitter Holding Register | |
#define | US_THR_OFF 0x0000001C |
USART transmitter holding register offset. | |
#define | US0_THR (USART0_BASE + US_THR_OFF) |
Channel 0 transmitter holding register address. | |
#define | US1_THR (USART1_BASE + US_THR_OFF) |
Channel 1 transmitter holding register address. | |
Baud Rate Generator Register | |
#define | US_BRGR_OFF 0x00000020 |
USART baud rate register offset. | |
#define | US0_BRGR (USART0_BASE + US_BRGR_OFF) |
Channel 0 baud rate register address. | |
#define | US1_BRGR (USART1_BASE + US_BRGR_OFF) |
Channel 1 baud rate register address. | |
Receiver Timeout Register | |
#define | US_RTOR_OFF 0x00000024 |
USART receiver timeout register offset. | |
#define | US0_RTOR (USART0_BASE + US_RTOR_OFF) |
Channel 0 receiver timeout register address. | |
#define | US1_RTOR (USART1_BASE + US_RTOR_OFF) |
Channel 1 receiver timeout register address. | |
Transmitter Time Guard Register | |
#define | US_TTGR_OFF 0x00000028 |
USART transmitter time guard register offset. | |
#define | US0_TTGR (USART0_BASE + US_TTGR_OFF) |
Channel 0 transmitter time guard register address. | |
#define | US1_TTGR (USART1_BASE + US_TTGR_OFF) |
Channel 1 transmitter time guard register address. | |
FI DI Ratio Register | |
#define | US_FIDI_OFF 0x00000040 |
USART FI DI ratio register offset. | |
#define | US0_FIDI (USART0_BASE + US_FIDI_OFF) |
Channel 0 FI DI ratio register address. | |
#define | US1_FIDI (USART1_BASE + US_FIDI_OFF) |
Channel 1 FI DI ratio register address. | |
Error Counter Register | |
#define | US_NER_OFF 0x00000044 |
USART error counter register offset. | |
#define | US0_NER (USART0_BASE + US_NER_OFF) |
Channel 0 error counter register address. | |
#define | US1_NER (USART1_BASE + US_NER_OFF) |
Channel 1 error counter register address. | |
IrDA Filter Register | |
#define | US_IF_OFF 0x0000004C |
USART IrDA filter register offset. | |
#define | US0_IF (USART0_BASE + US_IF_OFF) |
Channel 0 IrDA filter register address. | |
#define | US1_IF (USART1_BASE + US_IF_OFF) |
Channel 1 IrDA filter register address. | |
AT91 USART0 Device | |
NUTDEVICE | devUsartAt910 |
USART0 device information structure. | |
AT91 USART1 Device | |
NUTDEVICE | devUsartAt911 |
USART1 device information structure. | |
AT91 DBGU Device | |
NUTDEVICE | devDbguAt91 |
USART0 device information structure. | |
SC16IS752 USARTa Device | |
NUTDEVICE | devUsartsc16is752a |
USART0 device information structure. | |
SC16IS752 USARTa Device | |
NUTDEVICE | devUsartsc16is752b |
USART0 device information structure. | |
SC16IS752 USARTc Device | |
NUTDEVICE | devUsartsc16is752c |
USART2 device information structure. | |
SC16IS752 USARTd Device | |
NUTDEVICE | devUsartsc16is752d |
USART3 device information structure. |
Universal synchronous / asynchronous receiver / transmitter registers.
#define US_CR_OFF 0x00000000 |
#define US0_CR (USART0_BASE + US_CR_OFF) |
#define US1_CR (USART1_BASE + US_CR_OFF) |
Channel 1 control register address.
Definition at line 71 of file at91_us.h.
Referenced by AhdlcAt91Init(), and AhdlcAt91Open().
#define US_RSTRX 0x00000004 |
#define US_RSTTX 0x00000008 |
#define US_RXEN 0x00000010 |
#define US_RXDIS 0x00000020 |
#define US_TXEN 0x00000040 |
#define US_TXDIS 0x00000080 |
#define US_STTTO 0x00000800 |
#define US_SENDA 0x00001000 |
#define US_MR_OFF 0x00000004 |
USART mode register offset.
Definition at line 97 of file at91_us.h.
Referenced by AhdlcAt91IOCtl().
#define US0_MR (USART0_BASE + US_MR_OFF) |
#define US1_MR (USART1_BASE + US_MR_OFF) |
Channel 1 mode register address.
Definition at line 99 of file at91_us.h.
Referenced by AhdlcAt91Init().
#define US_CLKS 0x00000030 |
#define US_CLKS_MCK 0x00000000 |
#define US_CLKS_MCK8 0x00000010 |
Master clock divided by 8.
Definition at line 113 of file at91_us.h.
Referenced by AhdlcAt91IOCtl().
#define US_CHRL_8 0x000000C0 |
#define US_PAR_NO 0x00000800 |
#define US_NBSTOP_1 0x00000000 |
#define US_CHMODE_NORMAL 0x00000000 |
#define US_CHMODE_AUTOMATIC_ECHO 0x00004000 |
#define US_CHMODE_LOCAL_LOOPBACK 0x00008000 |
#define US_CHMODE_REMOTE_LOOPBACK 0x0000C000 |
#define US_CSR_OFF 0x00000014 |
#define US0_CSR (USART0_BASE + US_CSR_OFF) |
#define US1_CSR (USART1_BASE + US_CSR_OFF) |
#define US_IER_OFF 0x00000008 |
#define US0_IER (USART0_BASE + US_IER_OFF) |
#define US1_IER (USART1_BASE + US_IER_OFF) |
Channel 1 interrupt enable register address.
Definition at line 157 of file at91_us.h.
Referenced by AhdlcAt91Open(), and AhdlcAt91Put().
#define US_IDR_OFF 0x0000000C |
#define US0_IDR (USART0_BASE + US_IDR_OFF) |
#define US1_IDR (USART1_BASE + US_IDR_OFF) |
Channel 1 interrupt disable register address.
Definition at line 161 of file at91_us.h.
Referenced by AhdlcAt91Init().
#define US_IMR_OFF 0x00000010 |
#define US0_IMR (USART0_BASE + US_IMR_OFF) |
#define US1_IMR (USART1_BASE + US_IMR_OFF) |
#define US_TXRDY 0x00000002 |
#define US_ENDRX 0x00000008 |
End of receiver PDC transfer.
Definition at line 170 of file at91_us.h.
Referenced by AhdlcAt91Open().
#define US_ENDTX 0x00000010 |
#define US_TIMEOUT 0x00000100 |
#define US_RXBUFF 0x00001000 |
#define AT91_US_BAUD | ( | baud | ) | ((NUT_CPU_FREQ / (8 * (baud)) + 1) / 2) |
Baud rate calculation helper macro.
#define US_RHR_OFF 0x00000018 |
#define US0_RHR (USART0_BASE + US_RHR_OFF) |
#define US1_RHR (USART1_BASE + US_RHR_OFF) |
#define US_THR_OFF 0x0000001C |
#define US0_THR (USART0_BASE + US_THR_OFF) |
#define US1_THR (USART1_BASE + US_THR_OFF) |
#define US_BRGR_OFF 0x00000020 |
USART baud rate register offset.
Definition at line 215 of file at91_us.h.
Referenced by AhdlcAt91IOCtl(), and At91DevDebugIOCtl().
#define US0_BRGR (USART0_BASE + US_BRGR_OFF) |
#define US1_BRGR (USART1_BASE + US_BRGR_OFF) |
Channel 1 baud rate register address.
Definition at line 217 of file at91_us.h.
Referenced by AhdlcAt91Init().
#define US_RTOR_OFF 0x00000024 |
#define US0_RTOR (USART0_BASE + US_RTOR_OFF) |
#define US1_RTOR (USART1_BASE + US_RTOR_OFF) |
Channel 1 receiver timeout register address.
Definition at line 224 of file at91_us.h.
Referenced by AhdlcAt91Open().
#define US_TTGR_OFF 0x00000028 |
#define US0_TTGR (USART0_BASE + US_TTGR_OFF) |
#define US1_TTGR (USART1_BASE + US_TTGR_OFF) |
#define US_FIDI_OFF 0x00000040 |
#define US0_FIDI (USART0_BASE + US_FIDI_OFF) |
#define US1_FIDI (USART1_BASE + US_FIDI_OFF) |
#define US_NER_OFF 0x00000044 |
#define US0_NER (USART0_BASE + US_NER_OFF) |
#define US1_NER (USART1_BASE + US_NER_OFF) |
#define US_IF_OFF 0x0000004C |
#define US0_IF (USART0_BASE + US_IF_OFF) |
#define US1_IF (USART1_BASE + US_IF_OFF) |
#define ASCII_XON 0x11 |
Definition at line 254 of file usartat91.c.
#define ASCII_XOFF 0x13 |
Definition at line 256 of file usartat91.c.
#define XON_PENDING 0x10 |
Definition at line 259 of file usartat91.c.
#define XOFF_PENDING 0x20 |
Definition at line 261 of file usartat91.c.
#define XOFF_SENT 0x40 |
Definition at line 263 of file usartat91.c.
#define XOFF_RCVD 0x80 |
Definition at line 265 of file usartat91.c.
#define US_OVRE 0x00000020 |
Overrun error.
Definition at line 83 of file usartsc16is752.c.
#define ASCII_XON 0x11 |
Definition at line 87 of file usartsc16is752.c.
#define ASCII_XOFF 0x13 |
Definition at line 89 of file usartsc16is752.c.
#define XON_PENDING 0x10 |
Definition at line 92 of file usartsc16is752.c.
#define XOFF_PENDING 0x20 |
Definition at line 94 of file usartsc16is752.c.
#define XOFF_SENT 0x40 |
Definition at line 96 of file usartsc16is752.c.
#define XOFF_RCVD 0x80 |
Definition at line 98 of file usartsc16is752.c.
Definition at line 1222 of file usartsc16is752.c.
Referenced by Sc16is752UsartInit(), and Sc16is752UsartTxStart().
Definition at line 1233 of file usartsc16is752.c.
Referenced by Sc16is752UsartInit(), Sc16is752UsartInterruptProcessing(), and Sc16is752UsartTxStart().
Definition at line 341 of file usartsc16is752.c.
References _USARTDCB::dcb_rx_rbf, _USARTDCB::dcb_tx_rbf, and _NUTDEVICE::dev_dcb.
Referenced by Sc16is752UsartInterruptProcessing().
void Sc16is752UsartInterruptProcessing | ( | void * | arg | ) |
UART Interrupt Processing Thread
Definition at line 374 of file usartsc16is752.c.
References IIR, MYPRINT, NUT_WAIT_INFINITE, NutEventWait(), NutThreadSetPriority(), Sc16is752RegRead(), and Sc16is752UsartProcessChannelInterrupt().
Referenced by Sc16is752UsartInit().
Carefully enable USART hardware functions.
Always enabale transmitter and receiver, even on read-only or write-only mode. So we can support software flow control.
Definition at line 424 of file usartsc16is752.c.
References printf.
Referenced by Sc16is752UsartSetSpeed().
Carefully disable USART hardware functions.
Definition at line 445 of file usartsc16is752.c.
References printf.
Referenced by Sc16is752UsartSetSpeed().
Query the USART hardware for the selected speed.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 476 of file usartsc16is752.c.
References printf.
Set the USART hardware bit rate.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
rate | Number of bits per second. |
Definition at line 505 of file usartsc16is752.c.
References printf, Sc16is752UsartDisable(), and Sc16is752UsartEnable().
Query the USART hardware for the number of data bits.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 525 of file usartsc16is752.c.
References printf.
Set the USART hardware to the number of data bits.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 562 of file usartsc16is752.c.
References printf.
Query the USART hardware for the parity mode.
This routine is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 610 of file usartsc16is752.c.
References printf.
Set the USART hardware to the specified parity mode.
This routine is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
mode | 0 (disabled), 1 (odd) or 2 (even) |
Definition at line 645 of file usartsc16is752.c.
References printf.
Query the USART hardware for the number of stop bits.
This routine is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 684 of file usartsc16is752.c.
References printf.
Set the USART hardware to the number of stop bits.
This routine is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 711 of file usartsc16is752.c.
References printf.
Query the USART hardware status.
Definition at line 747 of file usartsc16is752.c.
References printf.
Set the USART hardware status.
flags | Status flags. |
Definition at line 820 of file usartsc16is752.c.
References printf.
Query the USART hardware for synchronous mode.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 898 of file usartsc16is752.c.
References printf.
Referenced by Sc16is752UsartSetClockMode().
Set asynchronous or synchronous mode.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
mode | Must be an or-ed combination of USART_SYNC, USART_MASTER, USART_NCLOCK and USART_HIGHSPEED. |
Definition at line 919 of file usartsc16is752.c.
References printf, and Sc16is752UsartGetClockMode().
Query flow control mode.
This routine is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
Definition at line 941 of file usartsc16is752.c.
References printf, and USART_MF_XONXOFF.
Referenced by Sc16is752UsartSetFlowControl().
Set flow control mode.
This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.
flags | See UsartIOCtl(). |
Definition at line 968 of file usartsc16is752.c.
References printf, and Sc16is752UsartGetFlowControl().
Start the USART transmitter hardware.
The upper level USART driver will call this function through the USARTDCB jump table each time it added one or more bytes to the transmit buffer.
TODO Check if Tx interrupt is generated immediately or if a first char needs to sent
Definition at line 999 of file usartsc16is752.c.
References IER, printf, Sc16is752RegRead(), and Sc16is752RegWrite().
Start the USART receiver hardware.
The upper level USART driver will call this function through the USARTDCB jump table each time it removed enough bytes from the receive buffer. Enough means, that the number of bytes left in the buffer is below the low watermark.
Definition at line 1021 of file usartsc16is752.c.
References printf.
int Sc16is752UsartInit | ( | uint8_t | dev, |
uint8_t | ch, | ||
NUTDEVICE * | nutDev, | ||
IRQ_HANDLER * | irq | ||
) |
Initialize the USART hardware driver.
This function is called during device registration by the upper level USART driver through the USARTDCB jump table.
TODO Check if Rx interrupt is generated immediately or if a first char needs to sent
Definition at line 1052 of file usartsc16is752.c.
References DLH, DLL, FCR, IER, INIT_BAUDRATE, LCR, MYPRINT, NUT_IRQMODE_FALLINGEDGE, NutIrqEnable(), NutIrqSetMode(), NutRegisterIrqHandler(), NutThreadCreate(), printf, Sc16is752RegRead(), Sc16is752RegWrite(), and Sc16is752UsartInterruptProcessing().
int Sc16is752UsartDeinit | ( | uint8_t | dev, |
uint8_t | ch, | ||
IRQ_HANDLER * | irq | ||
) |
Deinitialize the USART hardware driver.
This function is called during device deregistration by the upper level USART driver through the USARTDCB jump table.
Definition at line 1160 of file usartsc16is752.c.
References NutRegisterIrqHandler(), and printf.
{ 0, {'u', 'a', 'r', 't', '0', 0, 0, 0, 0}, IFTYP_CHAR, 0, 0, 0, &dcb_usart0, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartOpen, UsartClose, UsartSize }
USART0 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART0.
The device is named uart0.
Definition at line 137 of file usart0at91.c.
Referenced by AhdlcAt91IOCtl().
{ 0, {'u', 'a', 'r', 't', '1', 0, 0, 0, 0}, IFTYP_CHAR, 1, 0, 0, &dcb_usart1, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartOpen, UsartClose, UsartSize }
USART1 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART1.
The device is named uart1.
Definition at line 137 of file usart1at91.c.
{ 0, {'u', 'a', 'r', 't', 'd', 0, 0, 0, 0}, IFTYP_CHAR, DBGU_BASE, 0, 0, &dcb_dbgu, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartOpen, UsartClose, UsartSize }
USART0 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART0.
The device is named uart0.
Definition at line 144 of file usartDat91.c.
{ 0, {'u', 'a', 'r', 't', '_', 'a', 0, 0, 0}, IFTYP_CHAR, (SCDEV<<8)|CH_, 0, 0, &dcb_usarta, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartWrite_P, UsartOpen, UsartClose, UsartSize }
USART0 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART0.
The device is named uarta.
Definition at line 226 of file usart0sc16is752.c.
{ 0, {'u', 'a', 'r', 't', '_', 'b', 0, 0, 0}, IFTYP_CHAR, 0, 0, 0, &dcb_usartb, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartWrite_P, UsartOpen, UsartClose, UsartSize }
USART0 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART0.
The device is named uarta.
Definition at line 234 of file usart1sc16is752.c.
{ 0, {'u', 'a', 'r', 't', '_', 'c', 0, 0, 0}, IFTYP_CHAR, (SCDEV<<8)|CH_, 0, 0, &dcb_usartc, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartWrite_P, UsartOpen, UsartClose, UsartSize }
USART2 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART2.
The device is named uartc.
Definition at line 234 of file usart2sc16is752.c.
{ 0, {'u', 'a', 'r', 't', '_', 'd', 0, 0, 0}, IFTYP_CHAR, (SCDEV<<8)|CH_, 0, 0, &dcb_usartd, UsartInit, UsartIOCtl, UsartRead, UsartWrite, UsartWrite_P, UsartOpen, UsartClose, UsartSize }
USART3 device information structure.
An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART3.
The device is named uartd.
Definition at line 80 of file usart3sc16is752.c.