character display functions More...
#include "config.h"#include <avr/pgmspace.h>#include "display.h"#include "lh155.h"#include "../../font/font.h"Data Structures | |
| struct | font_priv_s |
Defines | |
| #define | DRAWSTR_MEM_SHIFT (0) |
| #define | DRAWSTR_MEM_MASK (1<<DRAWSTR_MEM_SHIFT) |
| #define | DRAWSTR_MEM_RAM (0*1<<DRAWSTR_MEM_SHIFT) |
| #define | DRAWSTR_MEM_FLASH (1*1<<DRAWSTR_MEM_SHIFT) |
| #define | DRAWSTR_STOP0_SHIFT (1) |
| #define | DRAWSTR_STOP0_MASK (1<<DRAWSTR_STOP0_SHIFT) |
| #define | DRAWSTR_STOP0_SKIP (0*1<<DRAWSTR_STOP0_SHIFT) |
| #define | DRAWSTR_STOP0_STOP (1*1<<DRAWSTR_STOP0_SHIFT) |
Typedefs | |
| typedef struct font_priv_s | font_priv_t |
Functions | |
| void | hl_lcd_set_font (const font_t *f) |
| select font to use for text operations | |
| void | hl_lcd_get_current_font (font_t *f) |
| get data of current font | |
| void | hl_lcd_set_current_font (const font_t *f) |
| restore font saved with hl_lcd_get_current_font() | |
| uint8_t | hl_lcd_get_charwidth (void) |
| get width (in pixels) of currently selected font | |
| uint8_t | hl_lcd_get_charheight (void) |
| get height (in pixels) of currently selected font | |
| void | hl_lcd_drawchar (uint8_t x, uint8_t y, char c) |
| draw a character at pixel position (x,y) using font set by hl_lcd_set_font() | |
| void | hl_lcd_drawchar_font (uint8_t x, uint8_t y, char c, const font_t *f) |
| draw a character at pixel position (x,y) using specified font | |
| void | hl_lcd_drawstr (uint8_t x, uint8_t y, const char *s) |
| draw a character string beginning at pixel position (x,y) | |
| void | hl_lcd_drawstrn (uint8_t x, uint8_t y, const char *s, size_t len) |
| like hl_lcd_drawstr(), but draws at most LEN characters | |
| void | hl_lcd_drawstr_P (uint8_t x, uint8_t y, PGM_P s) |
| like hl_lcd_drawstr(), but for strings stored in Flash memory | |
| void | hl_lcd_drawstrn_P (uint8_t x, uint8_t y, PGM_P s, size_t len) |
| like hl_lcd_drawstrn(), but for strings stored in Flash memory | |
character display functions
| void hl_lcd_drawchar | ( | uint8_t | x, | |
| uint8_t | y, | |||
| char | c | |||
| ) |
draw a character at pixel position (x,y) using font set by hl_lcd_set_font()
hl_lcd_drawchar() draws a character at an arbitrary position
| x | X coordinate of upper left character box corner | |
| y | Y coordinate of upper left character box corner | |
| c | character to draw (pattern and size is defined by previous call to hl_lcd_set_font()) |
{
hl_lcd_drawchar_priv (x, y, c, ¤t_font);
}
| void hl_lcd_drawchar_font | ( | uint8_t | x, | |
| uint8_t | y, | |||
| char | c, | |||
| const font_t * | f | |||
| ) |
draw a character at pixel position (x,y) using specified font
hl_lcd_drawchar_font() draws a character at an arbitrary position
| x | X coordinate of upper left character box corner | |
| y | Y coordinate of upper left character box corner | |
| c | character to draw (pattern and size is defined by the next parameter) | |
| f | font to use for that character |
{
font_priv_t p;
hl_lcd_set_font_priv (&p, f);
hl_lcd_drawchar_priv (x, y, c, &p);
}
| void hl_lcd_drawstr | ( | uint8_t | x, | |
| uint8_t | y, | |||
| const char * | s | |||
| ) |
draw a character string beginning at pixel position (x,y)
hl_lcd_drawstr() may be implemented in a more efficient way than calling hl_lcd_drawchar multiple times, especially for char_width != 8 pixel or x8 != 0
{
hl_lcd_drawstr_internal (x, y, s, -1,
DRAWSTR_MEM_RAM | DRAWSTR_STOP0_STOP);
}
| void hl_lcd_set_current_font | ( | const font_t * | f | ) |
restore font saved with hl_lcd_get_current_font()
The difference to hl_lcd_set_font() is that here we expect *f to be in RAM instead of in FLASH.
{
current_font.font = *f;
hl_lcd_set_font_calc (¤t_font);
}
1.7.1