Functions and constants for controlling EV3 LCD. More...
#include <stdio.h>#include <fcntl.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <signal.h>#include <sys/mman.h>#include <sys/stat.h>#include <stdbool.h>#include <limits.h>#include <errno.h>#include <libgen.h>#include "../include/ev3_constants.h"Go to the source code of this file.
Data Structures | |
| struct | LocationType |
Macros | |
| #define | ev3_lcd_h |
| #define | LCD_BYTE_WIDTH ((LCD_WIDTH + 7) / 8) |
| #define | LCD_BUFFER_SIZE (LCD_BYTE_WIDTH * LCD_HEIGHT) |
| #define | LCD_COLOR_BLACK 1 |
| #define | LCD_COLOR_WHITE 0 |
Typedefs | |
| typedef uint8_t | IMGDATA |
| Image base type. More... | |
| typedef IMGDATA * | IP |
| Instruction pointer type. More... | |
| typedef LocationType * | PLocationType |
Enumerations | |
| enum | ImageFormat { ifRAW_FB0, ifRAW_BUF, ifXBM, ifP1, ifP4, ifBMP, ifPNG } |
Functions | |
| bool | LcdInit () |
| bool | LcdExit () |
| bool | LcdInitialized () |
| void | LcdSetAutoRefresh (bool bOn) |
| bool | LcdUpdate () |
| bool | LcdClean () |
| bool | LcdScroll (short Y) |
| bool | LcdSelectFont (uint8_t FontType) |
| uint8_t * | LcdGetDisplay () |
| bool | LcdText (char Color, short X, short Y, char *Text) |
| bool | LcdIcon (char Color, short X, short Y, char IconType, char IconNum) |
| bool | LcdBmpFile (char Color, short X, short Y, char *Name) |
| bool | LcdPicture (char Color, short X, short Y, IP pBitmap) |
| bool | LcdFillWindow (char Color, short Y, short Y1) |
| uint8_t * | LcdGetFrameBuffer () |
| void | LcdWriteDisplayToFile (char *filename, ImageFormat fmt) |
| void | LcdWriteFrameBufferToFile (char *filename, ImageFormat fmt) |
| char | CircleOutEx (int x, int y, uint8_t radius, unsigned long options) |
| char | LineOutEx (int x1, int y1, int x2, int y2, unsigned long options) |
| char | PointOutEx (int x, int y, unsigned long options) |
| char | RectOutEx (int x, int y, int width, int height, unsigned long options) |
| char | EllipseOutEx (int x, int y, uint8_t radiusX, uint8_t radiusY, unsigned long options) |
| bool | LcdTextf (char Color, short X, short Y, const char *fmt,...) |
| int | LcdPrintf (char color, const char *fmt,...) |
| int | LcdPrintln (char color, const char *fmt,...) |
| short | LcdRowToY (int row) |
| void | SetCursorX (short x) |
| void | SetCursorY (short y) |
Functions and constants for controlling EV3 LCD.
ev3_lcd.h contains declarations for the EV3 C API LCD functions.
License:
The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Initial Developer of this code is John Hansen. Portions created by John Hansen are Copyright (C) 2009-2013 John Hansen. All Rights Reserved.
| #define ev3_lcd_h |
| #define LCD_BUFFER_SIZE (LCD_BYTE_WIDTH * LCD_HEIGHT) |
| #define LCD_BYTE_WIDTH ((LCD_WIDTH + 7) / 8) |
| #define LCD_COLOR_BLACK 1 |
| #define LCD_COLOR_WHITE 0 |
| typedef uint8_t IMGDATA |
Image base type.
| typedef LocationType* PLocationType |
| enum ImageFormat |
| char CircleOutEx | ( | int | x, |
| int | y, | ||
| uint8_t | radius, | ||
| unsigned long | options | ||
| ) |
Draw a circle. This function lets you draw a circle on the screen with its center at the specified x and y location, using the specified radius. Optionally specify drawing options. If this argument is not specified it defaults to DRAW_OPT_NORMAL. Valid display option constants are listed in the Drawing option constants group.
| x | The x value for the center of the circle. |
| y | The y value for the center of the circle. |
| radius | The radius of the circle. |
| options | The drawing options. |
| char EllipseOutEx | ( | int | x, |
| int | y, | ||
| uint8_t | radiusX, | ||
| uint8_t | radiusY, | ||
| unsigned long | options | ||
| ) |
Draw an ellipse. This function lets you draw an ellipse on the screen with its center at the specified x and y location, using the specified radii. Optionally specify drawing options. If this argument is not specified it defaults to DRAW_OPT_NORMAL. Valid display option constants are listed in the Drawing option constants group.
| x | The x value for the center of the ellipse. |
| y | The y value for the center of the ellipse. |
| radiusX | The x axis radius. |
| radiusY | The y axis radius. |
| options | The drawing options. |
| bool LcdBmpFile | ( | char | Color, |
| short | X, | ||
| short | Y, | ||
| char * | Name | ||
| ) |
| bool LcdClean | ( | ) |
| bool LcdExit | ( | ) |
| bool LcdFillWindow | ( | char | Color, |
| short | Y, | ||
| short | Y1 | ||
| ) |
| uint8_t* LcdGetDisplay | ( | ) |
| uint8_t* LcdGetFrameBuffer | ( | ) |
| bool LcdIcon | ( | char | Color, |
| short | X, | ||
| short | Y, | ||
| char | IconType, | ||
| char | IconNum | ||
| ) |
| bool LcdInit | ( | ) |
| bool LcdInitialized | ( | ) |
| bool LcdPicture | ( | char | Color, |
| short | X, | ||
| short | Y, | ||
| IP | pBitmap | ||
| ) |
| int LcdPrintf | ( | char | color, |
| const char * | fmt, | ||
| ... | |||
| ) |
Prints the formatted text on the next line of the previous wrote by this function.
| color | |
| fmt | |
| ... |
| int LcdPrintln | ( | char | color, |
| const char * | fmt, | ||
| ... | |||
| ) |
Same as LcdPrintf, but automatically adds a new at the end of the string
| color | |
| fmt | |
| ... |
| short LcdRowToY | ( | int | row | ) |
Computes the y coordinate from which the specified row starts (using the current font)
| row |
| bool LcdScroll | ( | short | Y | ) |
| bool LcdSelectFont | ( | uint8_t | FontType | ) |
| void LcdSetAutoRefresh | ( | bool | bOn | ) |
| bool LcdText | ( | char | Color, |
| short | X, | ||
| short | Y, | ||
| char * | Text | ||
| ) |
| bool LcdTextf | ( | char | Color, |
| short | X, | ||
| short | Y, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Prints the formatted text on the screen at the specified position
| Color | |
| X | |
| Y | |
| fmt | |
| ... |
| bool LcdUpdate | ( | ) |
| void LcdWriteDisplayToFile | ( | char * | filename, |
| ImageFormat | fmt | ||
| ) |
| void LcdWriteFrameBufferToFile | ( | char * | filename, |
| ImageFormat | fmt | ||
| ) |
| char LineOutEx | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| unsigned long | options | ||
| ) |
Draw a line. This function lets you draw a line on the screen from x1, y1 to x2, y2. Optionally specify drawing options. If this argument is not specified it defaults to DRAW_OPT_NORMAL. Valid display option constants are listed in the Drawing option constants group.
| x1 | The x value for the start of the line. |
| y1 | The y value for the start of the line. |
| x2 | The x value for the end of the line. |
| y2 | The y value for the end of the line. |
| options | The drawing options. |
| char PointOutEx | ( | int | x, |
| int | y, | ||
| unsigned long | options | ||
| ) |
Draw a point. This function lets you draw a point on the screen at x, y. Optionally specify drawing options. If this argument is not specified it defaults to DRAW_OPT_NORMAL. Valid display option constants are listed in the Drawing option constants group.
| x | The x value for the point. |
| y | The y value for the point. |
| options | The drawing options. |
| char RectOutEx | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height, | ||
| unsigned long | options | ||
| ) |
Draw a rectangle. This function lets you draw a rectangle on the screen at x, y with the specified width and height. Optionally specify drawing options. If this argument is not specified it defaults to DRAW_OPT_NORMAL. Valid display option constants are listed in the Drawing option constants group.
| x | The x value for the top left corner of the rectangle. |
| y | The y value for the top left corner of the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| options | The drawing options. |
| void SetCursorX | ( | short | x | ) |
Set cursor position for TermPrint*, LcdPrint* and Ev3Print*
| x |
| void SetCursorY | ( | short | y | ) |
Set cursor position for TermPrint*, LcdPrint* and Ev3Print*
| y |
1.8.6