AS-289R2 Thermal Printer shield control library
Dependents: AS-289R2_Hello-World AS-289R2_Hello-World-mbed-OS hybrid_image_as289r2 microbit_AS-289R2 ... more
Diff: AS289R2.h
- Revision:
- 4:a2e0373a9cd1
- Parent:
- 3:f3dfeb7ccb22
- Child:
- 5:fa3d63a975d9
--- a/AS289R2.h Mon Sep 19 13:52:42 2016 +0000 +++ b/AS289R2.h Fri Feb 03 09:28:48 2017 +0000 @@ -1,5 +1,5 @@ /* AS289R2 Library, for a Thermal Printer Shield AS-289R2 - * Copyright (c) 2016, Toyomasa Watarai + * Copyright (c) 2016, Toyomasa Watarai * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - + #ifndef MBED_AS289R2_H #define MBED_AS289R2_H @@ -35,9 +35,9 @@ * @code * #include "mbed.h" * #include "AS829R2.h" - * + * * AS829R2 tp(D1); // tx, 9600bps - * + * * int main() { * tp.printf("Hello World!\r"); * } @@ -116,7 +116,7 @@ * */ void clearBuffer(void); - + /** Set double height size font * */ @@ -181,6 +181,102 @@ */ void printBitmapImage(uint32_t cmd, uint16_t lines, const char * image); + /** Set Line Spaceing + * + * @param space line spacing + */ + void setLineSpaceing(uint32_t space); + + /** Set as default Line Spaceing + * + */ + void defaultLineSpaceing(void); + + /** Set Print Direction + * + * @param direction Print direction + */ + void setPrintDirection(uint32_t direction); + + /** Send feed code + * + * @param space Paper feed + */ + void putPaperFeed(uint32_t space); + + /** Set Inter Character Space + * + * @param space inter-character space + */ + void setInterCharacterSpace(uint32_t space); + + /** Set as default Inter Character Space + * + */ + void defaultInterCharacterSpace(void); + + /** Send Print Position + * + * @param position Print position + */ + void putPrintPosition(uint32_t position); + + /** Set Script + * + * @param script Superscript and Subsprict + */ + void setScript(uint32_t script); + + /** Clear Script + * + */ + void clearScript(void); + + /** Set Quadruple size + * + */ + void setQuadrupleSize(void); + + /** Clear Quadruple size + * + */ + void clearQuadrupleSize(void); + + /** Set Enlargement size + * + * @param width enlargement + * @param height enlargement + */ + void setEnlargement(uint32_t width, uint32_t height); + + /** Clear Enlargement size + * + */ + void clearEnlargement(void); + + /** Set BarCode Height size + * + * @param height Bar height + */ + void setBarCodeHeight(uint32_t height); + + /** Set as default BarCode Height size + * + */ + void defaultBarCodeHeight(void); + + /** Set BarCode Bar size + * + * @param narrowbar narrow bars size + * @param widebar wide bars size + */ + void setBarCodeBarSize(uint32_t narrowbar, uint32_t widebar); + + /** Set as default BarCode Bar size + * + */ + void defaultBarCodeBarSize(void); + private: Serial *_serial_p; Serial &_serial;