/** * Draw a vertical bar bottom-up. * \param drvthis Pointer to driver structure. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is high at 100% * \param promille Current height level of the bar in promille. * \param options Options (currently unused). */ MODULE_EXPORT void CFontzPacket_vbar (Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; if (p->ccmode != vbar) { unsigned char vBar[p->cellheight]; int i; if (p->ccmode != standard) { /* Not supported(yet) */ report(RPT_WARNING, "%s: vbar: cannot combine two modes using user-defined characters", drvthis->name); return; } p->ccmode = vbar; memset(vBar, 0x00, sizeof(vBar)); for (i = 1; i < p->cellheight; i++) { // add pixel line per pixel line ... // NOTE: cellwidth != bar width: 0x1F = 0xFF & ((1 << (p->cellwidth - 1)) - 1) vBar[p->cellheight - i] = 0x1F; CFontzPacket_set_char(drvthis, i, vBar); } } lib_vbar_static(drvthis, x, y, len, promille, options, p->cellheight, 0); }
/** * API: Draw a vertical bar bottom-up. */ MODULE_EXPORT void parallax_vbar(Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; static unsigned char vbar_char[7][8] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F}, {0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F}, {0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, {0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, {0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F} /* Full block is done using icon */ }; if (p->ccmode != vbar) { int i; if (p->ccmode != standard) { report(RPT_WARNING, "%s: hbar: cannot combine two modes using user-defined characters", drvthis->name); return; } p->ccmode = vbar; for (i = 0; i < 7; i++) parallax_set_char(drvthis, i + 1, vbar_char[i]); } lib_vbar_static(drvthis, x, y, len, promille, options, p->cellheight, 0); }
/** * Draw a vertical bar bottom-up. * \param drvthis Pointer to driver structure. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is high at 100% * \param promille Current height level of the bar in promille. * \param options Options (currently unused). */ MODULE_EXPORT void bayrad_vbar(Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; static unsigned char bar_up[7][8] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F}, {0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F}, {0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, {0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, {0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, }; //debug(RPT_DEBUG, "Vbar at %i, length %i", x, len); if (p->ccmode != vbar) { int i; if (p->ccmode != standard) { /* Not supported (yet) */ report(RPT_WARNING, "%s: cannot combine two modes using user-defined characters", drvthis->name); return; } p->ccmode = vbar; for (i = 0; i < 7; i++) bayrad_set_char(drvthis, i + 1, bar_up[i]); } lib_vbar_static(drvthis, x, y, len, promille, options, p->cellheight, 0x98); }
///////////////////////////////////////////////////////////////// // Draws a vertical bar... // MODULE_EXPORT void MTC_S16209X_vbar (Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; MTC_S16209X_init_vbar(drvthis); lib_vbar_static(drvthis, x, y, len, promille, options, p->cellheight, 0); }
/** * API: Draw a vertical bar bottom-up. */ MODULE_EXPORT void sdeclcd_vbar(Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; int i, j; if (vbar != p->ccmode) { for (i = 0; i < SDEC_NUM_CC; i++) { for (j = 0; j < SDEC_CELL_H; j++) { /* Set Custom Char Address */ sdec_exec(SDEC_FN_CG_ADD | (i * SDEC_CELL_H + j), p->bklgt); /* Write bitmap at Address */ sdec_write(p->vbar_cg[i * SDEC_CELL_H + j], p->bklgt); } } p->ccmode = vbar; } /* see note in hbar */ lib_vbar_static(drvthis, x, y, len, promille, options, SDEC_CELL_H, 7); }
///////////////////////////////////////////////////////////////// // Draws a vertical bar, from the bottom of the screen up. // MODULE_EXPORT void lcterm_vbar (Driver *drvthis, int x, int y, int len, int promille, int options) { lcterm_init_vbar(drvthis); lib_vbar_static(drvthis, x, y, len, promille, options, LCD_DEFAULT_CELLHEIGHT, 0); }