lv_barcode.h

Enums

enum lv_barcode_encoding_t

Values:

enumerator LV_BARCODE_ENCODING_CODE128_GS1

Code 128 with GS1 encoding. Strips [FCN1] and spaces.

enumerator LV_BARCODE_ENCODING_CODE128_RAW

Code 128 with raw encoding.

Functions

lv_obj_t *lv_barcode_create(lv_obj_t *parent)

Create an empty barcode (an lv_canvas) object.

Parameters:

parent – point to an object where to create the barcode

Returns:

pointer to the created barcode object

void lv_barcode_set_dark_color(lv_obj_t *obj, lv_color_t color)

Set the dark color of a barcode object

Parameters:
  • obj – pointer to barcode object

  • color – dark color of the barcode

void lv_barcode_set_light_color(lv_obj_t *obj, lv_color_t color)

Set the light color of a barcode object

Parameters:
  • obj – pointer to barcode object

  • color – light color of the barcode

void lv_barcode_set_scale(lv_obj_t *obj, uint16_t scale)

Set the scale of a barcode object

Parameters:
  • obj – pointer to barcode object

  • scale – scale factor

void lv_barcode_set_direction(lv_obj_t *obj, lv_dir_t direction)

Set the direction of a barcode object

Parameters:
  • obj – pointer to barcode object

  • direction – draw direction (LV_DIR_HOR or LB_DIR_VER)

void lv_barcode_set_tiled(lv_obj_t *obj, bool tiled)

Set the tiled mode of a barcode object

Parameters:
  • obj – pointer to barcode object

  • tiled – true: tiled mode, false: normal mode (default)

void lv_barcode_set_encoding(lv_obj_t *obj, lv_barcode_encoding_t encoding)

Set the encoding of a barcode object

Parameters:
  • obj – pointer to barcode object

  • encoding – encoding (default is LV_BARCODE_CODE128_GS1)

lv_result_t lv_barcode_update(lv_obj_t *obj, const char *data)

Set the data of a barcode object

Parameters:
  • obj – pointer to barcode object

  • data – data to display

Returns:

LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error

lv_color_t lv_barcode_get_dark_color(lv_obj_t *obj)

Get the dark color of a barcode object

Parameters:

obj – pointer to barcode object

Returns:

dark color of the barcode

lv_color_t lv_barcode_get_light_color(lv_obj_t *obj)

Get the light color of a barcode object

Parameters:

obj – pointer to barcode object

Returns:

light color of the barcode

uint16_t lv_barcode_get_scale(lv_obj_t *obj)

Get the scale of a barcode object

Parameters:

obj – pointer to barcode object

Returns:

scale factor

lv_barcode_encoding_t lv_barcode_get_encoding(const lv_obj_t *obj)

Get the encoding of a barcode object

Parameters:

obj – pointer to barcode object

Returns:

encoding

Variables

const lv_obj_class_t lv_barcode_class