removed most mbed.h includes
[clinton/Smoothieware.git] / src / modules / communication / SerialConsole.h
1 /*
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8 #ifndef SERIALCONSOLE_H
9 #define SERIALCONSOLE_H
10
11 #include "libs/Module.h"
12 #include "libs/Kernel.h"
13 #include <vector>
14 #include <string>
15 using std::string;
16 #include "SerialConsole.h"
17 #include "libs/RingBuffer.h"
18
19 #define baud_rate_setting_ckeckusm 10922
20
21 class SerialConsole : public Module, public Serial {
22 public:
23 SerialConsole( PinName rx_pin, PinName tx_pin, int baud_rate );
24
25 virtual void on_module_loaded();
26 void on_serial_char_received();
27 void line_received();
28 virtual void on_main_loop(void * argument);
29 bool has_char(char letter);
30
31 //string receive_buffer; // Received chars are stored here until a newline character is received
32 //vector<std::string> received_lines; // Received lines are stored here until they are requested
33 RingBuffer<char,256> buffer; // Receive buffer
34
35 };
36
37 #endif