esc_pos_lib/
constants.rs

1///This is the list of all constants which are used.
2///They are derived from the list of specifications given from
3///[this](https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=2) page.
4
5///Horizontal tab. <https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=52>
6pub const HT: u8 = 0x09;
7///Print and line feed. <https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=10>
8pub const LF: u8 = 0x0A;
9///Print and return to standard mode. <https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=12>
10pub const FF: u8 = 0x0C; 
11///Print and carriage return. <https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=13>
12pub const CR: u8 = 0x0D;
13///Cancel print data in Page mode.
14///<https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=21>
15pub const CAN: u8 = 0x18;
16///ESC character 
17pub const ESC: u8 = 0x1B;
18///DLE character    
19pub const DLE: u8 = 0x10;
20///GS character
21pub const GS: u8 = 0x1D;
22///FS character
23pub const FS: u8 = 0x1C;
24
25///Used for setting different values
26pub const ON: u8 = 0x01;
27pub const OFF: u8 = 0x00;
28
29///Used for setting underline
30pub const SINGLE: u8 = 49;
31pub const DOUBLE: u8 = 50;
32
33
34///Other basic characters
35///At symbol '@'
36pub const AT: u8 = 0x40;
37
38
39///Different modes
40pub const MODE_A: u8 = 0x01;
41pub const MODE_B: u8 = 0x00;
42
43
44///Different barcode types
45pub const UPC_A: u8 = 0x00;
46pub const UPC_E: u8 = 0x01;
47pub const JAN13: u8 = 0x02;
48pub const JAN8: u8 = 0x03;
49pub const CODE39: u8 = 0x04;
50pub const ITF: u8 = 0x05;
51pub const CODABAR: u8 = 0x06;
52pub const CODE93: u8 = 0x07;
53pub const CODE128: u8 = 0x08;
54pub const GS1_128: u8 = 0x09;
55pub const DATABAR_OMNIDIRECTIONAL: u8 = 0x0A;
56pub const DATABAR_TRUNCATED: u8 = 0x0B;
57pub const DATABAR_LIMITED: u8 = 0x0C;
58pub const DATABAR_EXPANDED: u8 = 0x0D;
59pub const CODE128_AUTO: u8 = 0x0E;
60
61
62///QR related constants
63pub const QR_MODEL_1: u8 = 49;
64pub const QR_MODEL_2: u8 = 50;
65///Micro QR only works on TM-L90 4** models
66pub const QR_MODEL_MICRO: u8 = 51;
67///Different percentage of error correction
68///L: 7% M: 15% Q: 25% H: 30%
69pub const ERROR_L: u8 = 48;
70pub const ERROR_M: u8 = 49;
71pub const ERROR_Q: u8 = 50;
72pub const ERROR_H: u8 = 51;
73
74
75pub const MAX_X_WIDTH: u32 = 1024;