ESPHome
2024.12.2
esphome
esphome
components
qr_code
qr_code.h
Go to the documentation of this file.
1
#pragma once
2
#include "
esphome/core/component.h
"
3
#include "
esphome/core/color.h
"
4
5
#include <cstdint>
6
7
#include "qrcodegen.h"
8
9
namespace
esphome
{
10
// forward declare DisplayBuffer
11
namespace
display {
12
class
Display;
13
}
// namespace display
14
15
namespace
qr_code {
16
class
QrCode
:
public
Component
{
17
public
:
18
void
draw(
display::Display
*buff, uint16_t x_offset, uint16_t y_offset,
Color
color,
int
scale);
19
20
void
dump_config()
override
;
21
22
void
set_value(
const
std::string &value);
23
void
set_ecc(qrcodegen_Ecc ecc);
24
25
void
generate_qr_code();
26
27
uint8_t get_size();
28
29
protected
:
30
std::string
value_
;
31
qrcodegen_Ecc
ecc_
;
32
bool
needs_update_ =
true
;
33
uint8_t qr_[qrcodegen_BUFFER_LEN_MAX];
34
};
35
}
// namespace qr_code
36
}
// namespace esphome
esphome::qr_code::QrCode
Definition:
qr_code.h:16
esphome::Component
Definition:
component.h:68
esphome::qr_code::QrCode::value_
std::string value_
Definition:
qr_code.h:30
esphome::qr_code::QrCode::ecc_
qrcodegen_Ecc ecc_
Definition:
qr_code.h:31
esphome::Color
Definition:
color.h:10
esphome::display::Display
Definition:
display.h:208
color.h
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
Generated by
1.8.13