EV3RT C API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
 All Data Structures Functions Variables Enumerations Enumerator Groups

Definitions of API for LCD. More...

Data Structures

struct  image_t
 Structure of the image object. More...
 

Macros

#define EV3_LCD_WIDTH   (178)
 Width of LCD screen.
 
#define EV3_LCD_HEIGHT   (128)
 Height of LCD screen.
 

Enumerations

enum  lcdfont_t {
  EV3_FONT_SMALL,
  EV3_FONT_MEDIUM
}
 Enumeration type for font size. More...
 
enum  lcdcolor_t {
  EV3_LCD_WHITE = 0,
  EV3_LCD_BLACK = 1
}
 Enumeration type for LCD color. More...
 

Functions

ER ev3_lcd_set_font (lcdfont_t font)
 Set the default font. More...
 
ER ev3_font_get_size (lcdfont_t font, int32_t *p_width, int32_t *p_height)
 Get font size. More...
 
ER ev3_image_load (const memfile_t *p_memfile, image_t *p_image)
 Load images from memory file. More...
 
ER ev3_image_free (image_t *p_image)
 Release the image object. More...
 
ER ev3_lcd_draw_string (const char *str, int32_t x, int32_t y)
 Draws a character string at the specified position. More...
 
ER ev3_lcd_draw_line (int32_t x0, int32_t y0, int32_t x1, int32_t y1)
 Draw a line at specified coordinates. More...
 
ER ev3_lcd_fill_rect (int32_t x, int32_t y, int32_t w, int32_t h, lcdcolor_t color)
 Draw a rectangle. More...
 
ER ev3_lcd_draw_image (const image_t *p_image, int32_t x, int32_t y)
 Display the image at specified coordinates. More...
 

Detailed Description

Definitions of API for LCD.

Enumeration Type Documentation

enum lcdcolor_t

Enumeration type for LCD color.

Enumerator
EV3_LCD_WHITE 

White.

EV3_LCD_BLACK 

Black.

enum lcdfont_t

Enumeration type for font size.

Enumerator
EV3_FONT_SMALL 

Font in small size.

EV3_FONT_MEDIUM 

Font in medium size.

Function Documentation

ER ev3_font_get_size ( lcdfont_t  font,
int32_t *  p_width,
int32_t *  p_height 
)

Get font size.

Parameters
fontFont number
p_widthPointer to a place to store the acquired font width. If it is NULL, it is not stored.
p_heightPointer to the place to store the height of the acquired font. If it is NULL, it is not stored.
Return values
E_OKSuccessful completion
E_IDInvalid fomt number
ER ev3_image_free ( image_t p_image)

Release the image object.

Free resources (memory area) secured by the object of the image. In case of normal termination , data of p_image is cleared to NULL.

Parameters
p_imagePointer to released object
Return values
E_OKSuccessful completion
E_PARp_image is NULL
ER ev3_image_load ( const memfile_t p_memfile,
image_t p_image 
)

Load images from memory file.

Create an image object from the specified memory file. Currently, it only supports monochrome image files in BMP format. If an error occurs , clear the data of p_image to NULL.

Parameters
p_memfileObject of memory file where image file is stored
p_imagePointer to the place to store the object of the generated image
Return values
E_OKSuccessful completion
E_NOMEMInsufficient memory
E_NOSPTImage file format is not supported
E_OBJImage file is damaged
E_PARInvalid memory file
ER ev3_lcd_draw_image ( const image_t p_image,
int32_t  x,
int32_t  y 
)

Display the image at specified coordinates.

Parameters
p_imageImage object
xHorizontal position of upper left corner
yVertical position of upper left corner
Return values
E_OKSuccessful completion
E_PARImage object invalid
ER ev3_lcd_draw_line ( int32_t  x0,
int32_t  y0,
int32_t  x1,
int32_t  y1 
)

Draw a line at specified coordinates.

Parameters
x0Horizontal position of start point
y0Vertical position of start point
x1Horizontal position of the end point
y1Vertical position of the end point
Return values
E_OKSuccessful completion
ER ev3_lcd_draw_string ( const char *  str,
int32_t  x,
int32_t  y 
)

Draws a character string at the specified position.

Parameters
xHorizontal position of upper left corner
yVertical position of upper left corner
strString (pointer to array of characters)
Return values
E_OKSuccessful completion
ER ev3_lcd_fill_rect ( int32_t  x,
int32_t  y,
int32_t  w,
int32_t  h,
lcdcolor_t  color 
)

Draw a rectangle.

Parameters
xHorizontal position of upper left corner
yVertical position of upper left corner
wWidth of the rectangle
hHeight of the rectangle
colorColor [TODO: color of filling?]
Return values
E_OKSuccessful completion
ER ev3_lcd_set_font ( lcdfont_t  font)

Set the default font.

Parameters
fontFont number
Return values
E_OKSuccessful completion
E_IDInvalid font number