Thermal Printer Basic Print Operations
Revision 1:8372894bfc19, committed 2018-05-21
- Comitter:
- shivanandgowdakr
- Date:
- Mon May 21 09:05:47 2018 +0000
- Parent:
- 0:ddb341bbd487
- Commit message:
- Added Function to change print Modes
Changed in this revision
APSEPM207LV.cpp | Show annotated file Show diff for this revision Revisions of this file |
APSEPM207LV.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ddb341bbd487 -r 8372894bfc19 APSEPM207LV.cpp --- a/APSEPM207LV.cpp Mon May 21 07:27:19 2018 +0000 +++ b/APSEPM207LV.cpp Mon May 21 09:05:47 2018 +0000 @@ -128,7 +128,25 @@ //0x20 Paper Absent } +void APSEPM207LV::printModes(uint8_t n) +{ + _serial.putc(0x1B); + _serial.putc(0x21); + _serial.putc(n); + + +//Possible values for n +//00 = 32 Char Normal 08 = 32 Char BOLD +//01 = 24 Char Normal 09 = 24 Char BOLD +//11 = 24 Char Double Height 19 = 24 Char Double Height & BOLD +//21 = 24 Char Double Width 29 = 24 Char Double Width & BOLD +//31 = 24 Char Double Height & Double Width 39 = 24 Char Double Height & Double Width & BOLD +//10 = 32 Char Double Height 18 = 32 Char Double Height & BOLD +//20 = 32 Char Double Width 28 = 32 Char Double Width & BOLD +//30 = 32 Char Double Height & Double Width 38 = 32 Char Double Height & Double Width & BOLD + +} void APSEPM207LV::clearBuffer(void) { @@ -282,6 +300,8 @@ _serial.putc(script); } + + void APSEPM207LV::clearScript() { _serial.printf("\x1B\x73\x30"); @@ -347,11 +367,4 @@ } -//00 = 32 Char Normal 08 = 32 Char BOLD -//01 = 24 Char Normal 09 = 24 Char BOLD -//11 = 24 Char Double Height 19 = 24 Char Double Height & BOLD -//21 = 24 Char Double Width 29 = 24 Char Double Width & BOLD -//31 = 24 Char Double Height & Double Width 39 = 24 Char Double Height & Double Width & BOLD -//10 = 32 Char Double Height 18 = 32 Char Double Height & BOLD -//20 = 32 Char Double Width 28 = 32 Char Double Width & BOLD -//30 = 32 Char Double Height & Double Width 38 = 32 Char Double Height & Double Width & BOLD +
diff -r ddb341bbd487 -r 8372894bfc19 APSEPM207LV.h --- a/APSEPM207LV.h Mon May 21 07:27:19 2018 +0000 +++ b/APSEPM207LV.h Mon May 21 09:05:47 2018 +0000 @@ -3,7 +3,7 @@ * @file APSEPM207LV.h * @author Shivanand Gowda * @version V1.0.0 - * @date 11 March 2017 + * @date 21 May 2018 * @brief This file contains the class of a APSEPM207LV thermal control component ****************************************************************************** * @attention @@ -37,53 +37,7 @@ #pragma diag_suppress 870 #endif -/** A printer interface for driving AS-289R2 thermal printer shield of NADA Electronics, Ltd. - * - * @code - * #include "mbed.h" - * #include "AS829R2.h" - * - * Serial pc(USBTX, USBRX); - * AS829R2 tp(D1); // tx, 9600bps - * - * int main() - * { - * tp.initialize(); - * tp.putLineFeed(2); - * - * tp.printf("** Thermal Printer Shield **\r\r"); - * - * tp.setDoubleSizeWidth(); - * tp.printf(" AS-289R2\r\r"); - * tp.clearDoubleSizeWidth(); - * - * tp.printf("日本語文字列の印字テスト:24x24\r"); - * tp.setKanjiFont(APSEPM207LV::KANJI_16x16); - * tp.setANKFont(APSEPM207LV::ANK_8x16); - * tp.printf("日本語文字列の印字テスト:16x16\r\r"); - * - * tp.setKanjiFont(APSEPM207LV::KANJI_DEFAULT); - * tp.setANKFont(APSEPM207LV::ANK_DEFAULT); - * tp.setDoubleSizeWidth(); - * tp.printf("ABCDEFG 0123456789\r"); - * tp.clearDoubleSizeWidth(); - * - * tp.setDoubleSizeHeight(); - * tp.printf("ABCDEFG 0123456789\r"); - * tp.clearDoubleSizeHeight(); - * - * pc.printf("AS-289R2 thermal printer shield test\n\n"); - * while(1) { - * if (pc.readable()) { - * int c = pc.getc(); - * pc.putc(c); - * tp.putc(c); - * } - * } - * } - * - * @endcode - */ + class APSEPM207LV : public Stream { public: @@ -209,6 +163,7 @@ void whiteblack(uint8_t n1); void papersensorstatus(void); void carriageReturn(void); + void printModes(uint8_t n); /** pur Horizontal Tab * */