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// NOT ERICK GRANT's CODE
38#ifndef __QRCODE_H_
39#define __QRCODE_H_
40
41//#define bool int
42#define false 0
43#define true 1
44
45#include <stdint.h>
46
47
48// QR Code Format Encoding
49#define MODE_NUMERIC 0
50#define MODE_ALPHANUMERIC 1
51#define MODE_BYTE 2
52
53
54// Error Correction Code Levels
55#define ECC_LOW 0
56#define ECC_MEDIUM 1
57#define ECC_QUARTILE 2
58#define ECC_HIGH 3
59
60
61// If set to non-zero, this library can ONLY produce QR codes at that version
62// This saves a lot of dynamic memory, as the codeword tables are skipped
63#ifndef LOCK_VERSION
64#define LOCK_VERSION 0
65#endif
66
67
68typedef struct QRCode {
69 uint8_t version;
70 uint8_t size;
71 uint8_t ecc;
72 uint8_t mode;
73 uint8_t mask;
74 uint8_t *modules;
76
77
78#ifdef __cplusplus
79extern "C"{
80#endif /* __cplusplus */
81
82
83
84uint16_t qrcode_getBufferSize(uint8_t version);
85
86int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, const char *data);
87int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, uint8_t *data, uint16_t length);
88
89bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y);
90
91
92
93#ifdef __cplusplus
94}
95#endif /* __cplusplus */
96
97
98#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
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