串口驱动API ## 1、uart_register_driver 1 2 3 4 5 6
|
int uart_register_driver(struct uart_driver *drv)
|
##
2、uart_unregister_driver 1 2 3 4 5 6
|
void uart_unregister_driver(struct uart_driver *drv)
|
3、uart_add_one_port
1 2 3 4 5 6 7
|
int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
|
4、uart_remove_one_port
1 2 3 4 5 6
|
int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port)
|
5、uart_write_wakeup
1 2 3 4
|
void uart_write_wakeup(struct uart_port *port)
|
6、uart_suspend_port
1 2 3 4 5 6
|
int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
|
7、uart_resume_port
1 2 3 4 5 6
|
int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
|
8、uart_get_baud_rate
1 2 3 4 5 6 7 8 9 10 11
|
unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, struct ktermios *old, unsigned int min, unsigned int max)
|
9、uart_get_divisor
1 2 3 4 5 6
|
unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud)
|
10、uart_update_timeout
1 2 3 4 5 6
|
void uart_update_timeout(struct uart_port *port, unsigned int cflag, unsigned int baud)
|
11、uart_match_port
1 2 3 4 5
|
int uart_match_port(struct uart_port *port1, struct uart_port *port2)
|
12、uart_console_write
1 2 3 4 5 6 7 8 9 10
|
void uart_console_write(struct uart_port *port, const char *s, unsigned int count, void (*putchar)(struct uart_port *, int))
|
13、uart_insert_char
1 2 3 4 5 6 7 8 9 10
|
void uart_insert_char(struct uart_port *port, unsigned int status, unsigned int overrun, unsigned int ch, unsigned int flag)
|
14、uart_parse_earlycon
1 2
| int uart_parse_earlycon(char *p, unsigned char *iotype, resource_size_t *addr, char **options)
|
15、uart_parse_options
1 2
| void uart_parse_options(const char *options, int *baud, int *parity, int *bits, int *flow)
|
16、uart_set_options
1 2
| int uart_set_options(struct uart_port *port, struct console *co, int baud, int parity, int bits, int flow)
|
17、uart_handle_dcd_change
1
| void uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
|
18、uart_handle_cts_change
1
| void uart_handle_cts_change(struct uart_port *uport, unsigned int status)
|
19、uart_get_rs485_mode
1
| void uart_get_rs485_mode(struct device *dev, struct serial_rs485 *rs485conf)
|
20、circ的函数
1 2 3 4 5 6 7 8 9 10
| #define uart_circ_empty(circ) ((circ)->head == (circ)->tail)
#define uart_circ_clear(circ) ((circ)->head = (circ)->tail = 0)
#define uart_circ_chars_pending(circ) \ (CIRC_CNT((circ)->head, (circ)->tail, UART_XMIT_SIZE))
#define uart_circ_chars_free(circ) \ (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE))
|