43 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			43 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/****************************************************************************
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
							 | 
						||
| 
								 | 
							
								be copied by any method or incorporated into another program without
							 | 
						||
| 
								 | 
							
								the express written consent of Aerospace C.Power. This Information or any portion
							 | 
						||
| 
								 | 
							
								thereof remains the property of Aerospace C.Power. The Information contained herein
							 | 
						||
| 
								 | 
							
								is believed to be accurate and Aerospace C.Power assumes no responsibility or
							 | 
						||
| 
								 | 
							
								liability for its use in any way and conveys no license or title under
							 | 
						||
| 
								 | 
							
								any patent or copyright and makes no representation or warranty that this
							 | 
						||
| 
								 | 
							
								Information is free from patent or copyright infringement.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								****************************************************************************/
							 | 
						||
| 
								 | 
							
								#ifndef IOT_UART_H
							 | 
						||
| 
								 | 
							
								#define IOT_UART_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int uart_open(const char* dev, int flags, void* priv);
							 | 
						||
| 
								 | 
							
								int uart_enable_rs485(int fd, int dir_gpio);
							 | 
						||
| 
								 | 
							
								int uart_disable_rs485(int fd);
							 | 
						||
| 
								 | 
							
								int uart_select(int fd, int max_len, uint32_t millisec);
							 | 
						||
| 
								 | 
							
								int uart_read(int fd, void* buf, size_t count);
							 | 
						||
| 
								 | 
							
								int uart_write(int fd, const void* buf, size_t count);
							 | 
						||
| 
								 | 
							
								int uart_config(int fd, int baud, int data, int stop, int parity);
							 | 
						||
| 
								 | 
							
								int uart_undo_all_interrupts(int fd);
							 | 
						||
| 
								 | 
							
								int uart_close(int fd);
							 | 
						||
| 
								 | 
							
								int uart_threshold_set(int fd, int type, int thr);
							 | 
						||
| 
								 | 
							
								int uart_flow_ctrl_set(int fd, int type, int thr);
							 | 
						||
| 
								 | 
							
								int uart_brk_set(int fd, int value);
							 | 
						||
| 
								 | 
							
								int system_uart_init();
							 | 
						||
| 
								 | 
							
								void uart_ext_handler_uart_task(void);
							 | 
						||
| 
								 | 
							
								void uart_set_ir_loopback(uint8_t port, bool_t en);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif //IOT_UART_H
							 |