Cheetah Software  1.0
rt_serial.c
Go to the documentation of this file.
1 // * @file rt_imu.c
3 // * @brief Hardware interface for serial IMU
4 // */
5 //#include <stdlib.h>
6 //#include <stdio.h>
7 //#include <unistd.h>
8 //#include <errno.h>
9 //#include <fcntl.h>
10 //#include <string.h>
11 //
12 //#define termios asmtermios
13 //
14 //#include <asm/termios.h>
15 //
16 //#undef termios
17 //
18 //#include <termios.h>
19 //
20 //#include <errno.h>
21 //#include <math.h>
22 //#include <pthread.h>
23 //
24 //#include <stropts.h>
25 //
26 //#include <endian.h>
27 //
28 //
29 //#include <stdint.h>
30 //
31 //#include <rt/rt_serial.h>
32 //
34 // * @brief Configure serial port
35 // *
36 // * @param fd Serial port FD
37 // * @param speed Baud rate
38 // * @param parity Parity
39 // * @param port Port number
40 // */
41 // int set_interface_attribs_custom_baud(int fd, int speed, int parity, int
42 // port) {
43 // printf("\t[RT SERIAL] Configuring serial device...\n");
44 // struct termios2 tty;
45 //
46 // ioctl(fd, TCGETS2, &tty);
47 // tty.c_cflag &= ~CBAUD;
48 // tty.c_cflag |= BOTHER;
49 // tty.c_ispeed = speed;
50 // tty.c_ospeed = speed;
51 //
52 //
53 // tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; // 8-bit chars
54 // // disable IGNBRK for mismatched speed tests; otherwise receive break
55 // // as \000 chars
56 // tty.c_iflag &= ~IGNBRK; // disable break processing
57 // tty.c_lflag = 0; // no signaling chars, no echo,
58 // // no canonical processing
59 // tty.c_oflag = 0; // no remapping, no delays
60 // tty.c_cc[VMIN] = 0; // read doesn't block
61 // tty.c_cc[VTIME] = 1; // 0.5 seconds read timeout
62 //
63 // tty.c_iflag &= ~(IXON | IXOFF | IXANY); // shut off xon/xoff ctrl
64 //
65 // tty.c_cflag |= (CLOCAL | CREAD);// ignore modem controls,
66 // // enable reading
67 // //tty.c_cflag &= ~(PARENB | PARODD); // shut off parity
68 // tty.c_cflag |= PARENB;
69 // tty.c_cflag &= ~CSTOPB;
70 // tty.c_cflag &= ~CRTSCTS;
71 // //cfmakeraw(&tty);
72 //
73 // ioctl(fd, TCSETS2, &tty);
74 // return 0;
75 //
76 //}
77 //
78 //