mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add tty line configuration script API
On some platforms calling high()/low() to switch line states result in costly system calls whick makes it impossible to swith two or more tty lines simultaneously. To help solve this timing issue we introduce a tty line state configuration API which can be used instead of using high()/low(). Using config_low(line) and config_high(line) one can set up a new line state configuration for multiple lines and then use config_apply() to finally apply the configuration. This will result in only one system call to instruct the serial port drive to switch all the configured line states which should help ensure that the lines are switched simultaneously. Example: script = config_high(DTR); config_low(RTS); config_apply()
This commit is contained in:
parent
4369d5b66f
commit
3e50191107
4 changed files with 167 additions and 77 deletions
|
|
@ -39,5 +39,7 @@ void tty_wait_for_device(void);
|
|||
void list_serial_devices(void);
|
||||
void tty_input_thread_create(void);
|
||||
void tty_input_thread_wait_ready(void);
|
||||
void tty_line_set(int fd, const char *name, int mask, bool value);
|
||||
void tty_line_toggle(int fd, const char *name, int mask);
|
||||
void tty_line_set(int fd, int mask, bool value);
|
||||
void tty_line_toggle(int fd, int mask);
|
||||
void tty_line_config(int mask, bool value);
|
||||
void tty_line_config_apply(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue