1 /** 2 * @file lv_qrcode.h 3 * 4 */ 5 6 #ifndef LV_QRCODE_H 7 #define LV_QRCODE_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "../../lv_conf_internal.h" 17 #include "../../misc/lv_color.h" 18 #include "../../misc/lv_types.h" 19 #include "../../widgets/canvas/lv_canvas.h" 20 #include LV_STDBOOL_INCLUDE 21 #include LV_STDINT_INCLUDE 22 #if LV_USE_QRCODE 23 24 /********************* 25 * DEFINES 26 *********************/ 27 28 /********************** 29 * TYPEDEFS 30 **********************/ 31 32 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_qrcode_class; 33 34 /********************** 35 * GLOBAL PROTOTYPES 36 **********************/ 37 38 /** 39 * Create an empty QR code (an `lv_canvas`) object. 40 * @param parent point to an object where to create the QR code 41 * @return pointer to the created QR code object 42 */ 43 lv_obj_t * lv_qrcode_create(lv_obj_t * parent); 44 45 /** 46 * Set QR code size. 47 * @param obj pointer to a QR code object 48 * @param size width and height of the QR code 49 */ 50 void lv_qrcode_set_size(lv_obj_t * obj, int32_t size); 51 52 /** 53 * Set QR code dark color. 54 * @param obj pointer to a QR code object 55 * @param color dark color of the QR code 56 */ 57 void lv_qrcode_set_dark_color(lv_obj_t * obj, lv_color_t color); 58 59 /** 60 * Set QR code light color. 61 * @param obj pointer to a QR code object 62 * @param color light color of the QR code 63 */ 64 void lv_qrcode_set_light_color(lv_obj_t * obj, lv_color_t color); 65 66 /** 67 * Set the data of a QR code object 68 * @param obj pointer to a QR code object 69 * @param data data to display 70 * @param data_len length of data in bytes 71 * @return LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error 72 */ 73 lv_result_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len); 74 75 /********************** 76 * MACROS 77 **********************/ 78 79 #endif /*LV_USE_QRCODE*/ 80 81 #ifdef __cplusplus 82 } /* extern "C" */ 83 #endif 84 85 #endif /*LV_QRCODE_H*/ 86