SWE-350 TOTP Generator Milestone 5
The DE-10 board has six 7-segment displays, this can be used to display and generate a time based one-time pin (TOTP).
Loading...
Searching...
No Matches
qrcode.h
Go to the documentation of this file.
1
37#ifndef __QRCODE_H_
38#define __QRCODE_H_
39
40#ifndef __cplusplus
41typedef unsigned char bool;
42static const bool false = 0;
43static const bool true = 1;
44#endif
45
46#include <stdint.h>
47
48
49// QR Code Format Encoding
50#define MODE_NUMERIC 0
51#define MODE_ALPHANUMERIC 1
52#define MODE_BYTE 2
53
54
55// Error Correction Code Levels
56#define ECC_LOW 0
57#define ECC_MEDIUM 1
58#define ECC_QUARTILE 2
59#define ECC_HIGH 3
60
61
62// If set to non-zero, this library can ONLY produce QR codes at that version
63// This saves a lot of dynamic memory, as the codeword tables are skipped
64#ifndef LOCK_VERSION
65#define LOCK_VERSION 0
66#endif
67
68
69typedef struct QRCode {
70 uint8_t version;
71 uint8_t size;
72 uint8_t ecc;
73 uint8_t mode;
74 uint8_t mask;
75 uint8_t *modules;
77
78
79#ifdef __cplusplus
80extern "C"{
81#endif /* __cplusplus */
82
83
84
85uint16_t qrcode_getBufferSize(uint8_t version);
86
87int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, const char *data);
88int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, uint8_t *data, uint16_t length);
89
90bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y);
91
92
93
94#ifdef __cplusplus
95}
96#endif /* __cplusplus */
97
98
99#endif /* __QRCODE_H_ */
QRCode qrcode
Creates a QRCode object.
Definition main.c:190
bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y)
Definition qrcode.c:860
struct QRCode QRCode
int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, uint8_t *data, uint16_t length)
Definition qrcode.c:780
uint16_t qrcode_getBufferSize(uint8_t version)
Definition qrcode.c:775
int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, const char *data)
Definition qrcode.c:856
unsigned char bool
Definition qrcode.h:41
uint8_t mode
Definition qrcode.h:72
uint8_t * modules
Definition qrcode.h:74
uint8_t mask
Definition qrcode.h:73
uint8_t version
Definition qrcode.h:69
uint8_t ecc
Definition qrcode.h:71
uint8_t size
Definition qrcode.h:70