YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
uart_BBB.h
1#ifndef _UART_BBB_H_
2#define _UART_BBB_H_
3
4#include "uart_interface.h"
5#include <termios.h>
6
7class uart_BBB : public uart_interface {
8 public:
9
10 uart_BBB(const char *dev);
11 ~uart_BBB();
12
13 int16_t write(uint8_t *txbuf, uint8_t len);
14
15 int16_t read (uint8_t *rxbuf, uint8_t len);
16
17 unsigned switch_baud(unsigned);
18
19 void flush();
20
21 void setBytesToRead(unsigned bytes);
22
23 void setReadTimeout(unsigned timeout);
24
25 private:
26 void setattributes();
27
28 int _fd;
29 struct termios config;
30
31};
32
33#endif