テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8468a4403fea 1 /**************************************************************************/
jksoft 0:8468a4403fea 2 /*!
jksoft 0:8468a4403fea 3 @file ansi_esc_code.h
jksoft 0:8468a4403fea 4 @author hathach (tinyusb.org)
jksoft 0:8468a4403fea 5
jksoft 0:8468a4403fea 6 @section LICENSE
jksoft 0:8468a4403fea 7
jksoft 0:8468a4403fea 8 Software License Agreement (BSD License)
jksoft 0:8468a4403fea 9
jksoft 0:8468a4403fea 10 Copyright (c) 2013, hathach (tinyusb.org)
jksoft 0:8468a4403fea 11 All rights reserved.
jksoft 0:8468a4403fea 12
jksoft 0:8468a4403fea 13 Redistribution and use in source and binary forms, with or without
jksoft 0:8468a4403fea 14 modification, are permitted provided that the following conditions are met:
jksoft 0:8468a4403fea 15 1. Redistributions of source code must retain the above copyright
jksoft 0:8468a4403fea 16 notice, this list of conditions and the following disclaimer.
jksoft 0:8468a4403fea 17 2. Redistributions in binary form must reproduce the above copyright
jksoft 0:8468a4403fea 18 notice, this list of conditions and the following disclaimer in the
jksoft 0:8468a4403fea 19 documentation and/or other materials provided with the distribution.
jksoft 0:8468a4403fea 20 3. Neither the name of the copyright holders nor the
jksoft 0:8468a4403fea 21 names of its contributors may be used to endorse or promote products
jksoft 0:8468a4403fea 22 derived from this software without specific prior written permission.
jksoft 0:8468a4403fea 23
jksoft 0:8468a4403fea 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
jksoft 0:8468a4403fea 25 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
jksoft 0:8468a4403fea 26 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
jksoft 0:8468a4403fea 27 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
jksoft 0:8468a4403fea 28 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
jksoft 0:8468a4403fea 29 INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
jksoft 0:8468a4403fea 30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
jksoft 0:8468a4403fea 31 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
jksoft 0:8468a4403fea 32 INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
jksoft 0:8468a4403fea 33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
jksoft 0:8468a4403fea 34
jksoft 0:8468a4403fea 35 This file is part of the tinyusb stack.
jksoft 0:8468a4403fea 36 */
jksoft 0:8468a4403fea 37 /**************************************************************************/
jksoft 0:8468a4403fea 38
jksoft 0:8468a4403fea 39 /** \file
jksoft 0:8468a4403fea 40 * \brief TBD
jksoft 0:8468a4403fea 41 *
jksoft 0:8468a4403fea 42 * \note TBD
jksoft 0:8468a4403fea 43 */
jksoft 0:8468a4403fea 44
jksoft 0:8468a4403fea 45 /** \ingroup TBD
jksoft 0:8468a4403fea 46 * \defgroup TBD
jksoft 0:8468a4403fea 47 * \brief TBD
jksoft 0:8468a4403fea 48 *
jksoft 0:8468a4403fea 49 * @{
jksoft 0:8468a4403fea 50 */
jksoft 0:8468a4403fea 51
jksoft 0:8468a4403fea 52 #ifndef _ANSI_ESC_CODE_H_
jksoft 0:8468a4403fea 53 #define _ANSI_ESC_CODE_H_
jksoft 0:8468a4403fea 54
jksoft 0:8468a4403fea 55
jksoft 0:8468a4403fea 56 #ifdef __cplusplus
jksoft 0:8468a4403fea 57 extern "C" {
jksoft 0:8468a4403fea 58 #endif
jksoft 0:8468a4403fea 59
jksoft 0:8468a4403fea 60 #define CSI_CODE(seq) "\33[" seq
jksoft 0:8468a4403fea 61 #define CSI_SGR(x) CSI_CODE(#x) "m"
jksoft 0:8468a4403fea 62
jksoft 0:8468a4403fea 63 //------------- Cursor movement -------------//
jksoft 0:8468a4403fea 64 #define ANSI_CURSOR_UP(n) CSI_CODE(#n "A")
jksoft 0:8468a4403fea 65 #define ANSI_CURSOR_DOWN(n) CSI_CODE(#n "B")
jksoft 0:8468a4403fea 66 #define ANSI_CURSOR_FORWARD(n) CSI_CODE(#n "C")
jksoft 0:8468a4403fea 67 #define ANSI_CURSOR_BACKWARD(n) CSI_CODE(#n "D")
jksoft 0:8468a4403fea 68 #define ANSI_CURSOR_LINE_DOWN(n) CSI_CODE(#n "E")
jksoft 0:8468a4403fea 69 #define ANSI_CURSOR_LINE_UP(n) CSI_CODE(#n "F")
jksoft 0:8468a4403fea 70 #define ANSI_CURSOR_POSITION(n, m) CSI_CODE(#n ";" #m "H")
jksoft 0:8468a4403fea 71
jksoft 0:8468a4403fea 72 #define ANSI_ERASE_SCREEN(n) CSI_CODE(#n "J")
jksoft 0:8468a4403fea 73 #define ANSI_ERASE_LINE(n) CSI_CODE(#n "K")
jksoft 0:8468a4403fea 74
jksoft 0:8468a4403fea 75 /** text color */
jksoft 0:8468a4403fea 76 #define ANSI_TEXT_BLACK CSI_SGR(30)
jksoft 0:8468a4403fea 77 #define ANSI_TEXT_RED CSI_SGR(31)
jksoft 0:8468a4403fea 78 #define ANSI_TEXT_GREEN CSI_SGR(32)
jksoft 0:8468a4403fea 79 #define ANSI_TEXT_YELLOW CSI_SGR(33)
jksoft 0:8468a4403fea 80 #define ANSI_TEXT_BLUE CSI_SGR(34)
jksoft 0:8468a4403fea 81 #define ANSI_TEXT_MAGENTA CSI_SGR(35)
jksoft 0:8468a4403fea 82 #define ANSI_TEXT_CYAN CSI_SGR(36)
jksoft 0:8468a4403fea 83 #define ANSI_TEXT_WHITE CSI_SGR(37)
jksoft 0:8468a4403fea 84 #define ANSI_TEXT_DEFAULT CSI_SGR(39)
jksoft 0:8468a4403fea 85
jksoft 0:8468a4403fea 86 /** background color */
jksoft 0:8468a4403fea 87 #define ANSI_BG_BLACK CSI_SGR(40)
jksoft 0:8468a4403fea 88 #define ANSI_BG_RED CSI_SGR(41)
jksoft 0:8468a4403fea 89 #define ANSI_BG_GREEN CSI_SGR(42)
jksoft 0:8468a4403fea 90 #define ANSI_BG_YELLOW CSI_SGR(43)
jksoft 0:8468a4403fea 91 #define ANSI_BG_BLUE CSI_SGR(44)
jksoft 0:8468a4403fea 92 #define ANSI_BG_MAGENTA CSI_SGR(45)
jksoft 0:8468a4403fea 93 #define ANSI_BG_CYAN CSI_SGR(46)
jksoft 0:8468a4403fea 94 #define ANSI_BG_WHITE CSI_SGR(47)
jksoft 0:8468a4403fea 95 #define ANSI_BG_DEFAULT CSI_SGR(49)
jksoft 0:8468a4403fea 96
jksoft 0:8468a4403fea 97 #ifdef __cplusplus
jksoft 0:8468a4403fea 98 }
jksoft 0:8468a4403fea 99 #endif
jksoft 0:8468a4403fea 100
jksoft 0:8468a4403fea 101 #endif /* _TUSB_ANSI_ESC_CODE_H_ */
jksoft 0:8468a4403fea 102
jksoft 0:8468a4403fea 103 /** @} */