inital verison
This commit is contained in:
		
							parent
							
								
									e3b40bfc73
								
							
						
					
					
						commit
						4a686bb4c3
					
				
					 4 changed files with 324 additions and 0 deletions
				
			
		
							
								
								
									
										26
									
								
								serial_io.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								serial_io.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,26 @@
 | 
			
		|||
#ifndef SERIAL_H
 | 
			
		||||
#define SERIAL_H
 | 
			
		||||
#include <termios.h>
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
#include <iostream>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define BAUDRATE B38400
 | 
			
		||||
 | 
			
		||||
void sWrite(int port, char string[], size_t length);
 | 
			
		||||
 | 
			
		||||
void sWrite(int port, const char string[], size_t length);
 | 
			
		||||
 | 
			
		||||
ssize_t sRead(int port, void *buf, size_t count);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
void printRates();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int serialport_init(const char* device, int baud = BAUDRATE);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif // SERIAL_H
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue