RTEMS CPU Kit with SuperCore
4.11.3
|
TERMIOS serial line support. More...
#include <rtems.h>
#include <rtems/libio.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
#include <sys/ttycom.h>
#include <rtems/termiostypes.h>
Macros | |
#define | CBUFSIZE (rtems_termios_cbufsize) |
#define | RAW_INPUT_BUFFER_SIZE (rtems_termios_raw_input_size) |
#define | RAW_OUTPUT_BUFFER_SIZE (rtems_termios_raw_output_size) |
#define | FL_IREQXOF 1U /* input queue requests stop of incoming data */ |
#define | FL_ISNTXOF 2U /* XOFF has been sent to other side of line */ |
#define | FL_IRTSOFF 4U /* RTS has been turned off for other side.. */ |
#define | FL_ORCVXOF 0x10U /* XOFF has been received */ |
#define | FL_OSTOP 0x20U /* output has been stopped due to XOFF */ |
#define | FL_MDRTS 0x100U /* input controlled with RTS/CTS handshake */ |
#define | FL_MDXON 0x200U /* input controlled with XON/XOFF protocol */ |
#define | FL_MDXOF 0x400U /* output controlled with XON/XOFF protocol */ |
#define | NODISC(n) |
#define | TERMIOS_TXTASK_PRIO 10 |
#define | TERMIOS_RXTASK_PRIO 9 |
#define | TERMIOS_TXTASK_STACKSIZE 1024 |
#define | TERMIOS_RXTASK_STACKSIZE 1024 |
#define | TERMIOS_TX_START_EVENT RTEMS_EVENT_1 |
#define | TERMIOS_TX_TERMINATE_EVENT RTEMS_EVENT_0 |
#define | TERMIOS_RX_PROC_EVENT RTEMS_EVENT_1 |
#define | TERMIOS_RX_TERMINATE_EVENT RTEMS_EVENT_0 |
Functions | |
rtems_status_code | rtems_termios_device_install (const char *device_file, rtems_device_major_number major, rtems_device_minor_number minor, const rtems_termios_device_handler *handler, const rtems_termios_device_flow *flow, rtems_termios_device_context *context) |
Installs a Termios device. More... | |
rtems_status_code | rtems_termios_device_remove (const char *device_file, rtems_device_major_number major, rtems_device_minor_number minor) |
Removes a Termios device. More... | |
rtems_status_code | rtems_termios_device_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) |
Opens an installed Termios device. More... | |
rtems_status_code | rtems_termios_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg, const rtems_termios_callbacks *callbacks) |
rtems_status_code | rtems_termios_close (void *arg) |
rtems_status_code | rtems_termios_device_close (void *arg) |
Closes an installed Termios device. More... | |
rtems_status_code | rtems_termios_bufsize (size_t cbufsize, size_t raw_input, size_t raw_output) |
rtems_status_code | rtems_termios_ioctl (void *arg) |
void | rtems_termios_puts (const void *_buf, size_t len, struct rtems_termios_tty *tty) |
rtems_status_code | rtems_termios_write (void *arg) |
rtems_status_code | rtems_termios_read (void *arg) |
void | rtems_termios_rxirq_occured (struct rtems_termios_tty *tty) |
int | rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len) |
int | rtems_termios_dequeue_characters (void *ttyp, int len) |
Variables | |
struct rtems_termios_linesw | rtems_termios_linesw [MAXLDISC] |
int | rtems_termios_nlinesw |
rtems_id | rtems_termios_ttyMutex |
TERMIOS serial line support.
#define NODISC | ( | n | ) |
rtems_status_code rtems_termios_device_close | ( | void * | arg | ) |
Closes an installed Termios device.
RTEMS_SUCCESSFUL | Successful operation. |
References rtems_fatal_error_occurred(), RTEMS_NO_TIMEOUT, rtems_semaphore_obtain(), RTEMS_SUCCESSFUL, and RTEMS_WAIT.
rtems_status_code rtems_termios_device_install | ( | const char * | device_file, |
rtems_device_major_number | major, | ||
rtems_device_minor_number | minor, | ||
const rtems_termios_device_handler * | handler, | ||
const rtems_termios_device_flow * | flow, | ||
rtems_termios_device_context * | context | ||
) |
Installs a Termios device.
[in] | device_file | If not NULL , then a device file for the specified major and minor number will be created. |
[in] | major | The device major number of the corresponding device driver. |
[in] | minor | The device minor number of the corresponding device driver. |
[in] | handler | The device handler. It must be persistent throughout the installed time of the device. |
[in] | flow | The device flow control handler. The device flow control handler are optional and may be NULL . If present must be persistent throughout the installed time of the device. |
[in] | context | The device context. It must be persistent throughout the installed time of the device. |
RTEMS_SUCCESSFUL | Successful operation. |
RTEMS_NO_MEMORY | Not enough memory to create a device node. |
RTEMS_UNSATISFIED | Creation of the device file failed. |
RTEMS_RESOURCE_IN_USE | There exists a device node for this major and minor number pair. |
RTEMS_INCORRECT_STATE | Termios is not initialized. |
rtems_status_code rtems_termios_device_open | ( | rtems_device_major_number | major, |
rtems_device_minor_number | minor, | ||
void * | arg | ||
) |
Opens an installed Termios device.
References rtems_termios_tty::device_node, RTEMS_NO_TIMEOUT, rtems_semaphore_obtain(), RTEMS_SUCCESSFUL, and RTEMS_WAIT.
rtems_status_code rtems_termios_device_remove | ( | const char * | device_file, |
rtems_device_major_number | major, | ||
rtems_device_minor_number | minor | ||
) |
Removes a Termios device.
[in] | device_file | If not NULL , then the device file to remove. |
[in] | major | The device major number of the corresponding device driver. |
[in] | minor | The device minor number of the corresponding device driver. |
RTEMS_SUCCESSFUL | Successful operation. |
RTEMS_INVALID_ID | There is no device installed with this major and minor number pair. |
RTEMS_RESOURCE_IN_USE | This device is currently in use. |
RTEMS_UNSATISFIED | Removal of the device file failed. |
RTEMS_INCORRECT_STATE | Termios is not initialized. |
References rtems_termios_tty::device_node, RTEMS_INCORRECT_STATE, RTEMS_NO_TIMEOUT, rtems_semaphore_obtain(), RTEMS_SUCCESSFUL, and RTEMS_WAIT.
struct rtems_termios_linesw rtems_termios_linesw[MAXLDISC] |
int rtems_termios_nlinesw |