27#define BARCODE_MAX_LINES 9
31#ifndef BARCODE_DEBUG_VERBOSE
36#define BARCODE_DEBUG_VERBOSE 0
44#define PICO_DEBUG_MALLOC 1
50#define BARCODE_DEBUG_VERBOSE 0
57#define DEBUG_PRINT(...) printf(__VA_ARGS__)
60#define DEBUG_PRINT(...)
barcode_char_t barcode_decode_barcode_char(barcode_line_buffer_t *p_line_buffer)
Decodes the barcode character enum from the line buffer.
Definition: barcode.c:256
char * barcode_buffer_to_binary_string(barcode_line_buffer_t *p_line_buffer)
Returns a binary string representation of the barcode line buffer.
Definition: barcode.c:287
void barcode_clear_line_buffer(barcode_line_buffer_t *p_line_buffer)
Initialises or clears the barcode line buffer.
Definition: barcode.c:238
char barcode_get_char(barcode_char_t barcode_char)
Gets the character from the barcode character enum.
Definition: barcode.c:31
barcode_read_response_t
Enum for the barcode read response. Success or error.
Definition: barcode.h:148
@ BARCODE_READ_SUCCESS
Successfully read barcode.
Definition: barcode.h:150
@ BARCODE_READ_ERROR
Error reading barcode.
Definition: barcode.h:149
@ BARCODE_READ_CONTINUE
Definition: barcode.h:151
@ BARCODE_READ_NO_OP
No operation performed.
Definition: barcode.h:153
struct barcode_line_buffer barcode_line_buffer_t
Struct that holds the 9 most recent barcode lines.
int8_t barcode_update_line_buffer(barcode_line_buffer_t *p_line_buffer, barcode_line_type_t line_type)
Updates the line buffer with the line type detected.
Definition: barcode.c:161
barcode_line_type_t
Enum for the barcode line types (black or white, thin or thick). None for error handling.
Definition: barcode.h:125
@ BARCODE_LINE_BLACK_THIN
Black thin barcode line.
Definition: barcode.h:127
@ BARCODE_LINE_BLACK_THICK
Black thick barcode line.
Definition: barcode.h:128
@ BARCODE_LINE_WHITE_THIN
White thin barcode line.
Definition: barcode.h:129
@ BARCODE_LINE_WHITE_THICK
White thick barcode line.
Definition: barcode.h:130
@ BARCODE_LINE_NONE
No barcode line detected.
Definition: barcode.h:126
barcode_char_t
Enum for the barcode characters. A 0 bit represents a thin line (white or black), while a 1 bit repre...
Definition: barcode.h:72
@ BARCODE_CHAR_V
'V' character.
Definition: barcode.h:104
@ BARCODE_CHAR_K
'K' character.
Definition: barcode.h:93
@ BARCODE_CHAR_M
'M' character.
Definition: barcode.h:95
@ BARCODE_CHAR_7
'7' character.
Definition: barcode.h:80
@ BARCODE_CHAR_W
'W' character.
Definition: barcode.h:105
@ BARCODE_CHAR_U
'U' character.
Definition: barcode.h:103
@ BARCODE_CHAR_9
'9' character.
Definition: barcode.h:82
@ BARCODE_CHAR_DOLLAR
'$' character.
Definition: barcode.h:112
@ BARCODE_CHAR_N
'N' character.
Definition: barcode.h:96
@ BARCODE_CHAR_SLASH
'/' character.
Definition: barcode.h:113
@ BARCODE_CHAR_P
'P' character.
Definition: barcode.h:98
@ BARCODE_CHAR_DASH
'-' character.
Definition: barcode.h:109
@ BARCODE_CHAR_D
'D' character.
Definition: barcode.h:86
@ BARCODE_CHAR_ASTERISK
'*' character (used as a delimiter).
Definition: barcode.h:116
@ BARCODE_CHAR_6
'6' character.
Definition: barcode.h:79
@ BARCODE_CHAR_S
'S' character.
Definition: barcode.h:101
@ BARCODE_CHAR_I
'I' character.
Definition: barcode.h:91
@ BARCODE_CHAR_2
'2' character.
Definition: barcode.h:75
@ BARCODE_CHAR_G
'G' character.
Definition: barcode.h:89
@ BARCODE_CHAR_SPACE
' ' (space) character.
Definition: barcode.h:111
@ BARCODE_CHAR_Q
'Q' character.
Definition: barcode.h:99
@ BARCODE_CHAR_T
'T' character.
Definition: barcode.h:102
@ BARCODE_CHAR_H
'H' character.
Definition: barcode.h:90
@ BARCODE_CHAR_PLUS
'+' character.
Definition: barcode.h:114
@ BARCODE_CHAR_E
'E' character.
Definition: barcode.h:87
@ BARCODE_CHAR_Y
'Y' character.
Definition: barcode.h:107
@ BARCODE_CHAR_PERCENT
'' character.
Definition: barcode.h:115
@ BARCODE_CHAR_3
'3' character.
Definition: barcode.h:76
@ BARCODE_CHAR_C
'C' character.
Definition: barcode.h:85
@ BARCODE_CHAR_4
'4' character.
Definition: barcode.h:77
@ BARCODE_CHAR_F
'F' character.
Definition: barcode.h:88
@ BARCODE_CHAR_1
'1' character.
Definition: barcode.h:74
@ BARCODE_CHAR_0
'0' character.
Definition: barcode.h:73
@ BARCODE_CHAR_O
'O' character.
Definition: barcode.h:97
@ BARCODE_CHAR_PERIOD
'.' character.
Definition: barcode.h:110
@ BARCODE_CHAR_J
'J' character.
Definition: barcode.h:92
@ BARCODE_CHAR_A
'A' character.
Definition: barcode.h:83
@ BARCODE_CHAR_L
'L' character.
Definition: barcode.h:94
@ BARCODE_CHAR_Z
'Z' character.
Definition: barcode.h:108
@ BARCODE_CHAR_R
'R' character.
Definition: barcode.h:100
@ BARCODE_CHAR_X
'X' character.
Definition: barcode.h:106
@ BARCODE_CHAR_5
'5' character.
Definition: barcode.h:78
@ BARCODE_CHAR_B
'B' character.
Definition: barcode.h:84
@ BARCODE_CHAR_8
'8' character.
Definition: barcode.h:81
char * barcode_line_to_string(barcode_line_type_t line_type)
Helper function to get the barcode line type as a string.
Definition: barcode.c:135
Struct that holds the 9 most recent barcode lines.
Definition: barcode.h:137
uint16_t line_buffer_index
Index of the line buffer.
Definition: barcode.h:140
barcode_line_type_t line_buffer[9]
Definition: barcode.h:138