TizenRT Public API  v2.0 M2
iotbus_uart.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  ****************************************************************************/
18 
31 #ifndef IOTBUS_UART_H_
32 #define IOTBUS_UART_H_
33 
34 #include <stdint.h>
35 
44 typedef enum {
45  IOTBUS_UART_PARITY_NONE = 0,
46  IOTBUS_UART_PARITY_EVEN,
47  IOTBUS_UART_PARITY_ODD,
49 
50 struct _iotbus_uart_s;
51 
55 typedef struct _iotbus_uart_wrapper_s *iotbus_uart_context_h;
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
69 iotbus_uart_context_h iotbus_uart_init(const char *path);
70 
80 
81 #ifdef CONFIG_SERIAL_TERMIOS
82 
90 int iotbus_uart_flush(iotbus_uart_context_h hnd);
91 
101 int iotbus_uart_set_baudrate(iotbus_uart_context_h hnd, unsigned int baud);
102 
114 int iotbus_uart_set_mode(iotbus_uart_context_h hnd, int bytesize, iotbus_uart_parity_e parity, int stopbits);
115 
126 int iotbus_uart_set_flowcontrol(iotbus_uart_context_h hnd, int xonxoff, int rtscts);
127 #endif /* CONFIG_SERIAL_TERMIOS */
128 
139 int iotbus_uart_read(iotbus_uart_context_h hnd, char *buf, unsigned int length);
140 
151 int iotbus_uart_write(iotbus_uart_context_h hnd, const char *buf, unsigned int length);
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* IOTBUS_UART_H_ */
158  // end of UART group
int iotbus_uart_stop(iotbus_uart_context_h hnd)
closes uart_context.
struct _iotbus_uart_wrapper_s * iotbus_uart_context_h
Pointer definition to the internal struct _iotbus_uart_wrapper_s.
Definition: iotbus_uart.h:55
iotbus_uart_parity_e
Enumeration of UART parity type.
Definition: iotbus_uart.h:44
int iotbus_uart_write(iotbus_uart_context_h hnd, const char *buf, unsigned int length)
writes data over uart bus.
int iotbus_uart_read(iotbus_uart_context_h hnd, char *buf, unsigned int length)
reads data over uart bus.
iotbus_uart_context_h iotbus_uart_init(const char *path)
initializes uart_context.