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