Depot Pertamina / TMU220
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TMU220.h Source File

TMU220.h

00001 #ifndef TM220U_H
00002 #define TM220U_H
00003 
00004 //#include "mbed.h"
00005 #if defined(__CC_ARM)
00006 // To avoid "invalid multibyte character sequence" warning
00007 #pragma diag_suppress 870
00008 #endif
00009 
00010 #define DefaultDotSpacing 24
00011 #define MaxLineSpacing 10
00012 
00013 class TMU220 : public Stream
00014 {
00015 public :
00016     enum line_mode{single_line=1, double_line, triple_line};
00017 
00018     TMU220(PinName tx_, PinName rx_, uint32_t baud_=9600);
00019     TMU220(Serial &serial_obj, uint32_t baud_=9600);
00020     virtual ~TMU220();
00021     
00022     void initialize(void);
00023     void printModes(uint8_t n=1);
00024     void selectFontMode(bool imbang);
00025     void printTest(void);
00026     void lineFeed(void);
00027     void carriageReturn(void);
00028     void putLineFeed(uint8_t lines);
00029     void printnputLineFeed(uint8_t lines);
00030     void setDefaultLineSpacing();
00031     void setLinespacing(uint8_t lines=24);
00032 //    void setLinespacing(line_mode mode);
00033     void papersensorstatus(void);
00034     void putHorizontaltab(void);
00035     void putPaperFeed(uint8_t space);
00036     void setInterCharacterSpace(uint8_t space);
00037     void defaultInterCharacterSpace();
00038     void cutPaper();
00039     void feednCut(uint8_t lines = 1);
00040     void clearQuadrupleSize();
00041     void setQuadrupleSize();
00042     void setEnlargement(uint32_t width, uint32_t height);
00043     void clearEnlargement();
00044     
00045 private :
00046     Serial *Com_p;
00047     Serial &Com;
00048     
00049 protected:
00050     // Stream implementation functions
00051     virtual int _putc(int value);
00052     virtual int _getc();
00053 };
00054 
00055 #endif //TM220U_H