Implementation of the barcode driver. More...
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "irline/ir_sensor.h"
#include "irline/barcode.h"
Functions | |
char * | barcode_buffer_to_binary_string (barcode_line_buffer_t *p_line_buffer) |
Returns a binary string representation of the barcode line buffer. More... | |
void | barcode_clear_line_buffer (barcode_line_buffer_t *p_line_buffer) |
Initialises or clears the barcode line buffer. More... | |
barcode_char_t | barcode_decode_barcode_char (barcode_line_buffer_t *p_line_buffer) |
Decodes the barcode character enum from the line buffer. More... | |
char | barcode_get_char (barcode_char_t barcode_char) |
Gets the character from the barcode character enum. More... | |
char * | barcode_line_to_string (barcode_line_type_t line_type) |
Helper function to get the barcode line type as a string. More... | |
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. More... | |
Implementation of the barcode driver.
char * barcode_buffer_to_binary_string | ( | barcode_line_buffer_t * | p_line_buffer | ) |
Returns a binary string representation of the barcode line buffer.
p_line_buffer | Pointer to the barcode line buffer. |
References BARCODE_LINE_BLACK_THICK, BARCODE_LINE_BLACK_THIN, BARCODE_LINE_WHITE_THICK, BARCODE_LINE_WHITE_THIN, DEBUG_PRINT, barcode_line_buffer::line_buffer, and barcode_line_buffer::line_buffer_index.
void barcode_clear_line_buffer | ( | barcode_line_buffer_t * | p_line_buffer | ) |
Initialises or clears the barcode line buffer.
p_line_buffer | Pointer to the barcode line buffer. |
References barcode_line_buffer::line_buffer_index.
barcode_char_t barcode_decode_barcode_char | ( | barcode_line_buffer_t * | p_line_buffer | ) |
Decodes the barcode character enum from the line buffer.
p_line_buffer | Pointer to the barcode line buffer. |
References BARCODE_LINE_BLACK_THICK, BARCODE_LINE_WHITE_THICK, barcode_line_buffer::line_buffer, and barcode_line_buffer::line_buffer_index.
char barcode_get_char | ( | barcode_char_t | barcode_char | ) |
Gets the character from the barcode character enum.
barcode_char | Barcode character enum. |
References BARCODE_CHAR_0, BARCODE_CHAR_1, BARCODE_CHAR_2, BARCODE_CHAR_3, BARCODE_CHAR_4, BARCODE_CHAR_5, BARCODE_CHAR_6, BARCODE_CHAR_7, BARCODE_CHAR_8, BARCODE_CHAR_9, BARCODE_CHAR_A, BARCODE_CHAR_ASTERISK, BARCODE_CHAR_B, BARCODE_CHAR_C, BARCODE_CHAR_D, BARCODE_CHAR_DASH, BARCODE_CHAR_DOLLAR, BARCODE_CHAR_E, BARCODE_CHAR_F, BARCODE_CHAR_G, BARCODE_CHAR_H, BARCODE_CHAR_I, BARCODE_CHAR_J, BARCODE_CHAR_K, BARCODE_CHAR_L, BARCODE_CHAR_M, BARCODE_CHAR_N, BARCODE_CHAR_O, BARCODE_CHAR_P, BARCODE_CHAR_PERCENT, BARCODE_CHAR_PERIOD, BARCODE_CHAR_PLUS, BARCODE_CHAR_Q, BARCODE_CHAR_R, BARCODE_CHAR_S, BARCODE_CHAR_SLASH, BARCODE_CHAR_SPACE, BARCODE_CHAR_T, BARCODE_CHAR_U, BARCODE_CHAR_V, BARCODE_CHAR_W, BARCODE_CHAR_X, BARCODE_CHAR_Y, and BARCODE_CHAR_Z.
char * barcode_line_to_string | ( | barcode_line_type_t | line_type | ) |
Helper function to get the barcode line type as a string.
line_type | Barcode line type. |
References BARCODE_LINE_BLACK_THICK, BARCODE_LINE_BLACK_THIN, BARCODE_LINE_WHITE_THICK, and BARCODE_LINE_WHITE_THIN.
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.
p_line_buffer | Pointer to the line type buffer. |
line_type | The line type detected. |
References BARCODE_LINE_NONE, BARCODE_LINE_WHITE_THICK, BARCODE_LINE_WHITE_THIN, BARCODE_MAX_LINES, BARCODE_READ_CONTINUE, BARCODE_READ_ERROR, BARCODE_READ_NO_OP, BARCODE_READ_SUCCESS, barcode_line_buffer::line_buffer, and barcode_line_buffer::line_buffer_index.