LCD functions for MIOS32
Sets the background colour
Only relevant for colour GLCDs
[in] | rgb | red/green/blue value, each colour with 8bit resolution:
u32 colour = (r << 16) | (g << 8) | (b << 0); |
mios32_lcd_bitmap_t MIOS32_LCD_BitmapInit | ( | u8 * | memory, | |
u16 | width, | |||
u16 | height, | |||
u16 | line_offset, | |||
u8 | colour_depth | |||
) |
Only supported for graphical LCDs: initializes a bitmap type and clears it with the background colour.
Example:
// global array (!) u8 bitmap_array[APP_LCD_BITMAP_SIZE]; // Initialisation: mios32_lcd_bitmap_t bitmap = MIOS32_LCD_BitmapClear(bitmap_array, APP_LCD_NUM_X*APP_LCD_WIDTH, APP_LCD_NUM_Y*APP_LCD_HEIGHT, APP_LCD_NUM_X*APP_LCD_WIDTH. APP_LCD_COLOUR_DEPTH);
[in] | memory | pointer to the bitmap array |
[in] | width | width of the bitmap (usually APP_LCD_NUM_X*APP_LCD_WIDTH) |
[in] | height | height of the bitmap (usually APP_LCD_NUM_Y*APP_LCD_HEIGHT) |
[in] | line_offset | byte offset between each line (usually same value as width) |
[in] | colour_depth | how many bits are allocated by each pixel (usually APP_LCD_COLOUR_DEPTH) |
s32 MIOS32_LCD_BitmapPixelSet | ( | mios32_lcd_bitmap_t | bitmap, | |
u16 | x, | |||
u16 | y, | |||
u32 | colour | |||
) |
Inserts a pixel at the given x/y position into the bitmap with the given colour.
Example:
[in] | bitmap | the bitmap where the pixel should be inserted |
[in] | x | the X position of the pixel |
[in] | y | the Y position of the pixel |
[in] | colour | the colour of the pixel (value range depends on APP_LCD_COLOUR_DEPTH, mono GLCDs should use 0 or 1) |
s32 MIOS32_LCD_BitmapPrint | ( | mios32_lcd_bitmap_t | bitmap | ) |
Only supported for graphical LCDs: transfers a bitmap to the LCD at the current graphical cursor position.
Example:
MIOS32_LCD_CursorSet(0, 0); MIOS32_LCD_BitmapPrint(bitmap);
[in] | bitmap | the bitmap which should be print |
s32 MIOS32_LCD_Clear | ( | void | ) |
Clear Screen
Sends command byte to LCD
[in] | cmd | command byte which should be sent to LCD |
Set the cursor map for character displays
By default the positions are configured for 2x16, 2x20, 4x20 and 2x40 displays:
u8 cursor_map[] = {0x00, 0x40, 0x14, 0x54}; // offset line 0/1/2/3 MIOS32_LCD_CursorMapSet(cursor_map);
For 4x16 displays, the configuration has to be changed:
u8 cursor_map[] = {0x00, 0x40, 0x10, 0x50}; // offset line 0/1/2/3 MIOS32_LCD_CursorMapSet(cursor_map);
For 3x16 DOG displays use:
u8 cursor_map[] = {0x00, 0x10, 0x20, 0x30}; // offset line 0/1/2/3 MIOS32_LCD_CursorMapSet(cursor_map);
[in] | map_table | the cursor map |
Sets cursor to given position
[in] | column | number |
[in] | line | number |
Sends data byte to LCD
[in] | data | byte which should be sent to LCD |
u8 MIOS32_LCD_DeviceGet | ( | void | ) |
Returns LCD device
Selects LCD device
[in] | device | LCD device number |
Sets the foreground colour
Only relevant for colour GLCDs
[in] | rgb | red/green/blue value, each colour with 8bit resolution:
u32 colour = (r << 16) | (g << 8) | (b << 0); |
Initializes the graphical font
Only relevant for GLCDs
[in] | *font | pointer to font |
Sets graphical cursor to given position
Only relevant for GLCDs
[in] | x | position |
[in] | y | position |
Initializes LCD driver
[in] | mode | currently only mode 0 supported |
const char* MIOS32_LCD_LcdTypeName | ( | mios32_lcd_type_t | lcd_type | ) |
s32 MIOS32_LCD_ParametersFetchFromBslInfoRange | ( | void | ) |
Fetches the LCD Parameters from Bootloader Info range.
Note that this function is alreay called during startup. It can be used if the original type and dimensions should be restored after another LCD type has been selected during runtime.
mios32_lcd_parameters_t* MIOS32_LCD_ParametersGet | ( | void | ) |
Returns the current LCD parameters
s32 MIOS32_LCD_ParametersSet | ( | mios32_lcd_parameters_t | lcd_parameters | ) |
Sets LCD Parameters during runtime.
Note that the default parameters are stored in Bootloader Info range, and fetched during startup via MIOS32_LCD_ParametersFetchFromBslInfoRange
But it's possible to change them during runtime, and it's also possible that an alternative LCD driver (!= MIOS32_LCD=universal) overrides them!
[in] | the | new lcd_parameters |
s32 MIOS32_LCD_PrintBootMessage | ( | void | ) |
Used during startup to print the boot message, which consists of two lines specified with MIOS32_LCD_BOOT_MSG_LINE1 and MIOS32_LCD_BOOT_MSG_LINE2.
Both lines should be adapted in the mios32_config.h file of an application.
The message is automatically print by the programming model after each reset.
It will also be returned on a SysEx query.
s32 MIOS32_LCD_PrintChar | ( | char | c | ) |
Prints a single character
[in] | c | character to be print |
s32 MIOS32_LCD_PrintFormattedString | ( | const char * | format, | |
... | ||||
) |
Prints a \0 (zero) terminated formatted string (like printf)
[in] | *format | zero-terminated format string - 64 characters supported maximum! |
... | additional arguments |
s32 MIOS32_LCD_PrintString | ( | const char * | str | ) |
Prints a \0 (zero) terminated string
[in] | str | pointer to string |
Initializes a single special character
[in] | num | character number (0-7) |
[in] | table | 8 byte pattern |
Initializes all 8 special characters
[in] | table | 8 * 8 (=64) bytes which contain the pixel lines |
s32 MIOS32_LCD_TypeIsGLCD | ( | void | ) |
Returns 1 if the currently selected LCD type is a GLCD, otherwise 0
Note: GLCDs are determined by checking the mios32_lcd_parameters.lcd_type setting - if bit #7 is set (>= 0x80), the LCD is a GLCD
u8 mios32_lcd_cursor_map[MIOS32_LCD_MAX_MAP_LINES] |
u8 mios32_lcd_device = 0 |