Atlas - escpos_commands.h

Home / toolkits / ESCPOS / src Lines: 1 | Size: 2168 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* SPDX-License-Identifier: GPL-3.0 2 * ESCPOS X42 Print Standard 3 * 4 * ESC / POS Command Definitions 5 * 6 * COPYRIGHT NOTICE 7 * Copyright (C) 2026 0x4248, Sparky and contributors 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the license is not changed. 10 * 11 * This software is free and open source. Licensed under the GNU general 12 * public license version 3.0 as published by the Free Software Foundation. 13*/ 14 15 16#ifndef ESCPOS_COMMANDS_H 17#define ESCPOS_COMMANDS_H 18 19/* ASCII control chars */ 20#define CHR_NUL 0x00 21#define CHR_LF 0x0A 22 23/* ESC/POS prefixes */ 24#define CHR_ESC 0x1B 25#define CHR_GS 0x1D 26 27/* ---- Printer control ---- */ 28 29/* Initialize */ 30#define CMD_INIT CHR_ESC, '@' 31 32/* Line feed */ 33#define CMD_LF CHR_LF 34 35/* ---- Text formatting ---- */ 36 37/* Bold */ 38#define CMD_BOLD_ON CHR_ESC, 'E', 0x01 39#define CMD_BOLD_OFF CHR_ESC, 'E', 0x00 40 41/* Underline */ 42#define CMD_UNDERLINE_ON CHR_ESC, '-', 0x01 43#define CMD_UNDERLINE_OFF CHR_ESC, '-', 0x00 44 45/* Alignment */ 46#define CMD_ALIGN_LEFT CHR_ESC, 'a', 0x00 47#define CMD_ALIGN_CENTER CHR_ESC, 'a', 0x01 48#define CMD_ALIGN_RIGHT CHR_ESC, 'a', 0x02 49 50/* Character size (GS ! n) */ 51#define CMD_SIZE_NORMAL CHR_GS, '!', 0x00 52#define CMD_SIZE_WIDE CHR_GS, '!', 0x11 /* 2x width + height */ 53 54/* ---- Font selection ---- */ 55#define CMD_FONT_A CHR_ESC, 'M', 0x00 56#define CMD_FONT_B CHR_ESC, 'M', 0x01 57#define CMD_FONT_C CHR_ESC, 'M', 0x02 58 59#define CMD_INVERT_ON CHR_GS, 'B', 0x01 60#define CMD_INVERT_OFF CHR_GS, 'B', 0x00 61 62#define CMD_EMPHASIS_ON CHR_ESC, 'G', 0x01 63#define CMD_EMPHASIS_OFF CHR_ESC, 'G', 0x00 64 65#define CMD_VERTICAL_ON CHR_ESC, 'V', 0x01 66#define CMD_VERTICAL_OFF CHR_ESC, 'V', 0x00 67 68/* ---- Paper handling ---- */ 69 70/* Feed n lines */ 71#define CMD_FEED(n) CHR_ESC, 'd', (n) 72 73/* Cut paper */ 74#define CMD_CUT_FULL CHR_GS, 'V', 0x00 75#define CMD_CUT_PARTIAL CHR_GS, 'V', 0x01 76#define CMD_CUT_SAFE CHR_GS, 'V', 'B', 0x00 77 78/* ---- Beeper ---- */ 79#define CMD_BEEP(n, t) CHR_ESC, 'B', (n), (t) 80 81 82 83#endif /* ESCPOS_COMMANDS_H */ 84
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.