Add uOLED-96-G1 C Sample Code.
[frickel.git] / projects / geeknamensschilder_c / hardware / cores / arduino / HardwareSerial.h
blobf975ccdeca228c6b73dac13da5adf95c216f65dd
1 /*
2 HardwareSerial.h - Hardware serial library for Wiring
3 Copyright (c) 2006 Nicholas Zambetti. All right reserved.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef HardwareSerial_h
21 #define HardwareSerial_h
23 #include <inttypes.h>
25 #include "Print.h"
27 struct ring_buffer;
29 class HardwareSerial : public Print
31 private:
32 ring_buffer *_rx_buffer;
33 volatile uint8_t *_ubrrh;
34 volatile uint8_t *_ubrrl;
35 volatile uint8_t *_ucsra;
36 volatile uint8_t *_ucsrb;
37 volatile uint8_t *_udr;
38 uint8_t _rxen;
39 uint8_t _txen;
40 uint8_t _rxcie;
41 uint8_t _udre;
42 uint8_t _u2x;
43 public:
44 HardwareSerial(ring_buffer *rx_buffer,
45 volatile uint8_t *ubrrh, volatile uint8_t *ubrrl,
46 volatile uint8_t *ucsra, volatile uint8_t *ucsrb,
47 volatile uint8_t *udr,
48 uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x);
49 void begin(long);
50 uint8_t available(void);
51 int read(void);
52 void flush(void);
53 virtual void write(uint8_t);
54 using Print::write; // pull in write(str) and write(buf, size) from Print
57 extern HardwareSerial Serial;
59 #if defined(__AVR_ATmega1280__)
60 extern HardwareSerial Serial1;
61 extern HardwareSerial Serial2;
62 extern HardwareSerial Serial3;
63 #endif
65 #endif