|
Data Structures |
struct | _UARTDCB |
| UART device control block structure. More...
|
struct | _UARTDCB |
| UART device control block structure. More...
|
Defines |
#define | UART_MF_RTSSENSE 0x00000001UL |
#define | UART_MF_CTSCONTROL 0x00000002UL |
#define | UART_MF_DTRSENSE 0x00000004UL |
#define | UART_MF_DSRCONTROL 0x00000008UL |
#define | UART_MF_DCDCONTROL 0x00000010UL |
#define | UART_MF_RTSCONTROL 0x00000020UL |
#define | UART_MF_CTSSENSE 0x00000040UL |
#define | UART_MF_DTRCONTROL 0x00000080UL |
#define | UART_MF_DSRSENSE 0x00000100UL |
#define | UART_MF_DCDSENSE 0x00000200UL |
#define | UART_MF_SENSEMASK 0x0345 |
#define | UART_MF_CONTROLMASK 0x00BC |
#define | UART_MF_XONXOFF 0x00000400UL |
#define | UART_MF_LOCALECHO 0x00010000UL |
#define | UART_MF_COOKEDMODE 0x00020000UL |
#define | UART_MF_NOBUFFER 0x00100000UL |
#define | UART_MF_LINEBUFFER 0x00200000UL |
#define | UART_MF_BUFFERMASK 0x00300000UL |
#define | UART_SF_RTSOFF 0x00000001UL |
#define | UART_SF_CTSOFF 0x00000002UL |
#define | UART_SF_DTROFF 0x00000004UL |
#define | UART_SF_DSROFF 0x00000008UL |
#define | UART_SF_DCDOFF 0x00000010UL |
#define | HDLC_SF_FLUSH 0x00001000UL |
#define | HDLC_SF_ESCAPED 0x00002000UL |
#define | UART_SF_TXDISABLED 0x00000040UL |
#define | UART_SF_RXDISABLED 0x00000080UL |
#define | UART_HS_DCERTSCTS 0x00000003UL |
#define | UART_HS_DCEFULL 0x0000001FUL |
#define | UART_HS_DTERTSCTS 0x00000060UL |
#define | UART_HS_DTEFULL 0x000003E0UL |
#define | UART_HS_XONXOFF 0x00000400UL |
#define | BR_150 150UL |
#define | BR_300 300UL |
#define | BR_600 600UL |
#define | BR_1200 1200UL |
#define | BR_2400 2400UL |
#define | BR_4800 4800UL |
#define | BR_9600 9600UL |
#define | BR_19200 19200UL |
#define | BR_38400 38400UL |
#define | BR_57600 57600UL |
#define | BR_115200 115200UL |
#define | BR_230400 230400UL |
#define | TXI_ENABLE 0x80 |
#define | RXI_ENABLE 0x40 |
#define | TX_ENABLE 0x20 |
#define | RX_ENABLE 0x10 |
#define | MPI_ENABLE 0x08 |
#define | TXEI_ENABLE 0x04 |
#define | RXEI_ENABLE 0x02 |
#define | CK0_ENABLE 0x01 |
#define | TDRE 0x80 |
#define | RDRF 0x40 |
#define | ORER 0x20 |
#define | FER 0x10 |
#define | PER 0x08 |
#define | TEND 0x04 |
#define | DATABITS_8 0 |
#define | DATABITS_7 0x40 |
#define | NOPARITY 0 |
#define | EVENPARITY 0x20 |
#define | ODDPARITY 0x30 |
#define | STOP1BIT 0 |
#define | STOP2BITS 0x08 |
#define | NODIVIDE 0 |
#define | DIVIDEBY4 1 |
#define | DIVIDEBY16 2 |
#define | DIVIDEBY64 3 |
#define | GET_SCI(p) |
Typedefs |
typedef _UARTDCB | UARTDCB |
Functions |
int | SciH8Input (NUTDEVICE *dev) |
| Wait for input.
|
int | SciH8Output (NUTDEVICE *dev) |
| Initiate output.
|
int | SciH8Flush (NUTDEVICE *dev) |
| Wait for output buffer empty.
|
int | SciH8IOCtl (NUTDEVICE *dev, int req, void *conf) |
| Perform on-chip UART control functions.
|
int | SciH8Init (NUTDEVICE *dev) |
| Initialize on chip uart device.
|
int | SciH8Read (NUTFILE *fp, void *buffer, int size) |
| Read from device.
|
int | SciH8Put (NUTDEVICE *dev, CONST void *buffer, int len, int pflg) |
| Write to device.
|
int | SciH8Write (NUTFILE *fp, CONST void *buffer, int len) |
NUTFILE * | SciH8Open (NUTDEVICE *dev, CONST char *name, int mode, int acc) |
| Open a device or file.
|
int | SciH8Close (NUTFILE *fp) |
| Close a device or file.
|
|
Perform on-chip UART control functions.
- Parameters:
-
| dev | Identifies the device that receives the device-control function. |
| req | Requested control function. May be set to one of the following constants:
- UART_SETSPEED, conf points to an u_long value containing the baudrate.
- UART_GETSPEED, conf points to an u_long value receiving the current baudrate.
- UART_SETDATABITS, conf points to an u_long value containing the number of data bits, 5, 6, 7 or 8.
- UART_GETDATABITS, conf points to an u_long value receiving the number of data bits, 5, 6, 7 or 8.
- UART_SETPARITY, conf points to an u_long value containing the parity, 0 (no), 1 (odd) or 2 (even).
- UART_GETPARITY, conf points to an u_long value receiving the parity, 0 (no), 1 (odd) or 2 (even).
- UART_SETSTOPBITS, conf points to an u_long value containing the number of stop bits 1 or 2.
- UART_GETSTOPBITS, conf points to an u_long value receiving the number of stop bits 1 or 2.
- UART_SETSTATUS
- UART_GETSTATUS
- UART_SETREADTIMEOUT, conf points to an u_long value containing the read timeout.
- UART_GETREADTIMEOUT, conf points to an u_long value receiving the read timeout.
- UART_SETWRITETIMEOUT, conf points to an u_long value containing the write timeout.
- UART_GETWRITETIMEOUT, conf points to an u_long value receiving the write timeout.
- UART_SETLOCALECHO, conf points to an u_long value containing 0 (off) or 1 (on).
- UART_GETLOCALECHO, conf points to an u_long value receiving 0 (off) or 1 (on).
- UART_SETFLOWCONTROL, conf points to an u_long value containing combined UART_FCTL_ values.
- UART_GETFLOWCONTROL, conf points to an u_long value containing receiving UART_FCTL_ values.
- UART_SETCOOKEDMODE, conf points to an u_long value containing 0 (off) or 1 (on).
- UART_GETCOOKEDMODE, conf points to an u_long value receiving 0 (off) or 1 (on).
|
| conf | Points to a buffer that contains any data required for the given control function or receives data from that function. |
- Returns:
- 0 on success, -1 otherwise.
- Warning:
- Timeout values are given in milliseconds and are limited to the granularity of the system timer.
- Bug:
- For ATmega103, only 8 data bits, 1 stop bit and no parity are allowed.
|