XBee Firmware Library  1.6.0
Functions
LCD Display (SPI)

Functions

void lcd_graphic_cmd_write (uint8_t cmd)
 Sends the given command to the LCD. More...
 
void lcd_graphic_data_write (uint8_t data)
 Sends a byte of data to be written in the LCD. More...
 
void lcd_graphic_goto_xy (uint8_t x, uint8_t y)
 Sets the pointer of the LCD at the specified coordinates. More...
 
void lcd_graphic_init (void)
 Initializes graphic display with default params. More...
 
void lcd_graphic_set_clear_screen (uint8_t data)
 Fills all the display with the specified byte mask. More...
 
void lcd_graphic_write_box (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
 Draws a filled rectangle in the LCD defined by two points. More...
 
void lcd_graphic_write_circle (uint8_t x0, uint8_t y0, uint8_t r, bool_t color)
 Draws a circle in the LCD defined by its center point and the radius. More...
 
void lcd_graphic_write_line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
 Draws a line in the LCD defined by two points. More...
 
void lcd_graphic_write_pixel (uint8_t x, uint8_t y, bool_t color)
 Draws a pixel in the LCD given position (point). More...
 
void lcd_graphic_write_rectangle (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
 Draws a rectangle in the LCD defined by two points. More...
 
void lcd_graphic_write_text (uint8_t x0, uint8_t y0, uint8_t *textplot, bool_t color)
 Writes the given text in the graphic display. More...
 
void lcd_graphic_write_tile (uint8_t x, uint8_t y, uint8_t *buf)
 Writes a tile (square of 8x8 pixels/bits) at the given point. More...
 

Detailed Description

Platform-specific layer provides a consistent API to upper layers of the driver.

Graphic display (SPI) Overview

This API contains some functions to configure and control a graphic display based on the ST7565R controller, with a programmable XBee programmable device.

Graphic Display Macros

The character LCD API needs to have defined which XBee pin is used for the data select functionality. For that purpose you have to define a macro before initialize the graphic display.

    - Macros to configure the data select pin:
            - \b DATA_SELECT0                       : Indicates which XBee pin is used
                                                                      for the data select line of the
                                                                      display. Depending on the number of
                                                                      displays you are going to use, you
                                                                      will declare the macro with a 0 at
                                                                      the end or with a 1.

Usage example:
#define DATA_SELECT0 XPIN_7
Warning
It is recommended not to use these macros, they are used by the XBee Project Smart Editor of the XBee extensions.

Apart from the previous macro, there are other macros that configures different settings of the display.

- Macro to configure the display contrast:
        - \b LCD_DISPLAY_CONTRAST       : Hexadecimal value for the contrast.

Usage example:

#define LCD_DISPLAY_CONTRAST 0x1f
Warning
It is recommended not to use these macros, they are used by the XBee Project Smart Editor of the XBee extensions.

Usage example:

#define ENABLE_TEXT_LIBRARY0 1
Warning
It is recommended not to use these macros, they are used by the XBee Project Smart Editor of the XBee extensions.

Remember that the display uses the SPI port for the data transfer and a GPIO for the data select line, so you will need to initialize those components before initializing the display itself. The their documentation for more information about the macros and how to initialize them.

Function Documentation

void lcd_graphic_cmd_write ( uint8_t  cmd)

Sends the given command to the LCD.

Parameters
[in]cmdthe command to send to the LCD.
Return values
None
void lcd_graphic_data_write ( uint8_t  data)

Sends a byte of data to be written in the LCD.

Parameters
[in]dataThe data (byte) to draw in the display.
Return values
Nothing
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_goto_xy ( uint8_t  x,
uint8_t  y 
)

Sets the pointer of the LCD at the specified coordinates.

Parameters
[in]xx coordinate of the pointer.
[in]yy coordinate of the pointer.
Return values
None
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_init ( void  )

Initializes graphic display with default params.

Return values
None.
Note
Some functions of graphic display cannot be used until the the LCD is initialized.
void lcd_graphic_set_clear_screen ( uint8_t  data)

Fills all the display with the specified byte mask.

Parameters
[in]dataThe data to be written into the display.
Return values
Nothing
Warning
This function can not be used until the LCD is initialized
void lcd_graphic_write_box ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
bool_t  color 
)

Draws a filled rectangle in the LCD defined by two points.

Parameters
[in]x0x value of the starting point. 0 <= x < 128.
[in]y0y value of the starting point. 0 <= y < 64.
[in]x1x value of the end point. 0 <= x < 128.
[in]y1y value of the end point. 0 <= y < 64.
[in]color1 for black / 0 for white
Return values
None
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_write_circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  r,
bool_t  color 
)

Draws a circle in the LCD defined by its center point and the radius.

Parameters
[in]x0x value of the center point. 0 <= x < 128.
[in]y0y value of the center point. 0 <= y < 64.
[in]rradius value (in pixels) of the circle.
[in]color1 for black / 0 for white.
Return values
None
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_write_line ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
bool_t  color 
)

Draws a line in the LCD defined by two points.

Parameters
[in]x0x value of the starting point. 0 <= x < 128.
[in]y0y value of the starting point. 0 <= y < 64.
[in]x1x value of the end point. 0 <= x < 128.
[in]y1y value of the end point. 0 <= y < 64.
[in]color1 for black / 0 for white.
Return values
None
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_write_pixel ( uint8_t  x,
uint8_t  y,
bool_t  color 
)

Draws a pixel in the LCD given position (point).

Parameters
[in]xx value of the pixel. 0 <= x < 128.
[in]yy value of the pixel. 0 <= y < 64.
[in]color1 for black / 0 for white.
Return values
None
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_write_rectangle ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
bool_t  color 
)

Draws a rectangle in the LCD defined by two points.

Parameters
[in]x0x value of the starting point. 0 <= x < 128.
[in]y0y value of the starting point. 0 <= y < 64.
[in]x1x value of the end point. 0 <= x < 128.
[in]y1y value of the end point. 0 <= y < 64.
[in]color1 for black / 0 for white.
Return values
None
Warning
This function can not be used until the LCD is initialized.
void lcd_graphic_write_text ( uint8_t  x0,
uint8_t  y0,
uint8_t textplot,
bool_t  color 
)

Writes the given text in the graphic display.

Parameters
[in]x0x value of the point where the text will start to be written. 0 <= x < 128.
[in]y0y value of the point where the text will start to be written. 0 <= y < 64.
[in]textplotbuffer containing the text to write.
[in]color1 for black / 0 for white.
Return values
None
Warning
This function cannot be used until the LCD is initialized.
void lcd_graphic_write_tile ( uint8_t  x,
uint8_t  y,
uint8_t buf 
)

Writes a tile (square of 8x8 pixels/bits) at the given point.

Parameters
[in]xx position of the tile. 0 <= x < 16.
[in]yy position of the tile. 0 <= y < 8.
[in]bufbuffer with the data of the tile (8 bytes).
Return values
None
Warning
This function can not be used until the LCD is initialized.