31 lines
638 B
C++
31 lines
638 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
#include <Adafruit_Thermal.h>
|
|
#include "config.h"
|
|
|
|
class PrinterService
|
|
{
|
|
private:
|
|
HardwareSerial *printerSerial;
|
|
Adafruit_Thermal *printer;
|
|
|
|
static PrinterService *instance;
|
|
|
|
PrinterService();
|
|
|
|
public:
|
|
PrinterService(const PrinterService &) = delete;
|
|
PrinterService &operator=(const PrinterService &) = delete;
|
|
|
|
static void init();
|
|
static PrinterService &getInstance();
|
|
|
|
void wake();
|
|
void sleep();
|
|
void feed(int lines);
|
|
|
|
void setHeat(uint8_t heatTime);
|
|
|
|
void printBitmap(int w, int h, const uint8_t *bitmap);
|
|
void printText(const String &text);
|
|
}; |