Serial class med valgfri baudrate

Dependents:   Fancy-Terminal-Menu Fancy-Terminal

SerialTerminal.h

Committer:
madmonkeyman82
Date:
2015-10-16
Revision:
0:f7f6e3220ea0
Child:
2:64e7d86dbac1

File content as of revision 0:f7f6e3220ea0:

#include "mbed.h"

#ifndef MBED_TERMINAL_H
#define MBED_TERMINAL_H

/** Control and display on an ANSI/VT100 Terminal
 *
 * This allows you to control an ANSI serial terminal
 */ 
class SerialTerminal : public Serial {
public:
    /** Create the Terminal interface 
     * 
     * @param tx Serial transmit
     * @param rx Serial recieve
     * @param baud Serial baudreate speed
     */    
    SerialTerminal(PinName tx, PinName rx, int baudrate);

#if DOXYGEN_ONLY
    /** Write a character to the terminal
     *
     * @param c The character to write to the display
     */
    int putc(int c);

    /** Write a formated string to the terminal
     *
     * @param format A printf-style format string, followed by the
     *               variables to use in formating the string.
     */
    int printf(const char* format, ...);
    
    // also baud etc
#endif

    /** Locate to a screen column and row
     *
     * @param column  The horizontal position from the left, indexed from 0
     * @param row     The vertical position from the top, indexed from 0
     */
    void locate(int column, int row);

    /** Clear the screen and locate to 0,0 */
    void cls();

    /** Set the foreground colour */
    void foreground(int colour);

    /** Set the background colour */
    void background(int colour);
    
    /** Hide Cursor from terminal*/
    void hideCursor();
    
    /** Hide Cursor from terminal*/
    void showCursor();
};

#endif