|
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...
|
|
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.
- Macro to enable/disable the text library:
- ENABLE_TEXT_LIBRARY0 : 1 to enable, 0 to disable it. 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 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.
void lcd_graphic_cmd_write |
( |
uint8_t |
cmd | ) |
|
Sends the given command to the LCD.
- Parameters
-
[in] | cmd | the command to send to the LCD. |
- Return values
-
void lcd_graphic_data_write |
( |
uint8_t |
data | ) |
|
Sends a byte of data to be written in the LCD.
- Parameters
-
[in] | data | The data (byte) to draw in the display. |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.
Sets the pointer of the LCD at the specified coordinates.
- Parameters
-
[in] | x | x coordinate of the pointer. |
[in] | y | y coordinate of the pointer. |
- Return values
-
- 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
-
- 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] | data | The data to be written into the display. |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized
Draws a filled rectangle in the LCD defined by two points.
- Parameters
-
[in] | x0 | x value of the starting point. 0 <= x < 128. |
[in] | y0 | y value of the starting point. 0 <= y < 64. |
[in] | x1 | x value of the end point. 0 <= x < 128. |
[in] | y1 | y value of the end point. 0 <= y < 64. |
[in] | color | 1 for black / 0 for white |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.
Draws a circle in the LCD defined by its center point and the radius.
- Parameters
-
[in] | x0 | x value of the center point. 0 <= x < 128. |
[in] | y0 | y value of the center point. 0 <= y < 64. |
[in] | r | radius value (in pixels) of the circle. |
[in] | color | 1 for black / 0 for white. |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.
Draws a line in the LCD defined by two points.
- Parameters
-
[in] | x0 | x value of the starting point. 0 <= x < 128. |
[in] | y0 | y value of the starting point. 0 <= y < 64. |
[in] | x1 | x value of the end point. 0 <= x < 128. |
[in] | y1 | y value of the end point. 0 <= y < 64. |
[in] | color | 1 for black / 0 for white. |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.
Draws a pixel in the LCD given position (point).
- Parameters
-
[in] | x | x value of the pixel. 0 <= x < 128. |
[in] | y | y value of the pixel. 0 <= y < 64. |
[in] | color | 1 for black / 0 for white. |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.
Draws a rectangle in the LCD defined by two points.
- Parameters
-
[in] | x0 | x value of the starting point. 0 <= x < 128. |
[in] | y0 | y value of the starting point. 0 <= y < 64. |
[in] | x1 | x value of the end point. 0 <= x < 128. |
[in] | y1 | y value of the end point. 0 <= y < 64. |
[in] | color | 1 for black / 0 for white. |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.
Writes the given text in the graphic display.
- Parameters
-
[in] | x0 | x value of the point where the text will start to be written. 0 <= x < 128. |
[in] | y0 | y value of the point where the text will start to be written. 0 <= y < 64. |
[in] | textplot | buffer containing the text to write. |
[in] | color | 1 for black / 0 for white. |
- Return values
-
- Warning
- This function cannot be used until the LCD is initialized.
Writes a tile (square of 8x8 pixels/bits) at the given point.
- Parameters
-
[in] | x | x position of the tile. 0 <= x < 16. |
[in] | y | y position of the tile. 0 <= y < 8. |
[in] | buf | buffer with the data of the tile (8 bytes). |
- Return values
-
- Warning
- This function can not be used until the LCD is initialized.