AStar32U4 library
|
Main class for interfacing with the A-Star 32U4 LCD. More...
#include <AStar32U4LCD.h>
Public Member Functions | |
virtual void | initPins () |
virtual void | send (uint8_t data, bool rsValue, bool only4bits) |
void | init () |
void | reinitialize () |
void | clear () |
void | loadCustomCharacter (const uint8_t *picture, uint8_t number) |
void | loadCustomCharacter (const char *picture, uint8_t number) |
void | loadCustomCharacterFromRam (const uint8_t *picture, uint8_t number) |
void | createChar (uint8_t number, uint8_t picture[]) |
void | gotoXY (uint8_t x, uint8_t y) |
void | setCursor (uint8_t col, uint8_t row) |
void | noDisplay () |
void | display () |
void | noCursor () |
void | cursor () |
void | noBlink () |
void | blink () |
void | cursorSolid () |
void | cursorBlinking () |
void | hideCursor () |
void | scrollDisplayLeft () |
void | scrollDisplayRight () |
void | home () |
void | leftToRight () |
void | rightToLeft () |
void | autoscroll () |
void | noAutoscroll () |
void | command (uint8_t cmd) |
virtual size_t | write (uint8_t c) |
virtual size_t | write (const uint8_t *buffer, size_t size) |
Main class for interfacing with the A-Star 32U4 LCD.
This class interfaces with an HD44780-compatible LCD connected to the LCD connector on the A-Star 32U4 Prime.
This library is similar to the Arduino LiquidCrystal library, but it has some extra features needed on the A-Star 32U4 Prime:
This class assumes that you are using the default pin mapping that you would get by simply connecting an LCD to the 2x7 LCD connector on the A-Star 32U4 Prime:
If you want to control your LCD with different pins, you can edit the line labeled "Pin assignments" in AStar32U4PrimeLCD.h or you can make your own new LCD class in your sketch by copying the code for the AStar32U4PrimeLCD class, which is not very long.
This class inherits from the Arduino Print class, so you can call the print()
function on it with a variety of arguments. See the Arduino print() documentation for more information.
For detailed information about HD44780 LCD interface, including what characters can be displayed, see the HD44780 datasheet.
Definition at line 55 of file AStar32U4LCD.h.
|
inherited |
Turns on auto-scrolling.
When auto-scrolling is enabled, every time a character is written, the screen will automatically scroll by one column in the appropriate direction.
Definition at line 214 of file PololuHD44780.cpp.
|
inherited |
Shows the blinking cursor.
This function sets the LCD's "B" configuration bit without changing the other bits.
The cursor will normally be a blinking rectangle, but there could also be a row of solid black pixels at the bottom if previous commands have enabled the solid cursor. For this reason, it is usually better to call cursorSolid() or cursorBlinking() instead. This function is only provided for compatibilty with the LiquidCrystal library.
Definition at line 177 of file PololuHD44780.cpp.
|
inherited |
Clear the contents of the LCDs, resets the cursor position to the upper left, and resets the scroll position.
Definition at line 78 of file PololuHD44780.cpp.
|
inlineinherited |
Send an arbitrary command to the LCD. This is here for compatibility with the LiquidCrystal library.
Definition at line 294 of file PololuHD44780.h.
|
inlineinherited |
Defines a custom character. This is provided for compatibility with the LiquidCrystal library.
Definition at line 152 of file PololuHD44780.h.
|
inherited |
Shows the solid cursor.
This function sets the LCD's "C" configuration bit without changing the other bits.
The cursor will normally be a solid line in the bottom row, but there could be a blinking rectangle superimposed on it if previous commands have enabled the blinking cursor. For this reason, it is usually better to call cursorSolid() or cursorBlinking() instead. This function is only provided for compatibility with the LiquidCrystal library.
Definition at line 167 of file PololuHD44780.cpp.
|
inherited |
Enables a cursor that appears as a blinking black rectangle.
This sets the LCD's "C" and "B" configuration bits.
Note that the cursor will not be shown if the display is currently off (due to a call to noDisplay()), or if the cursor position is not within the bounds of the screen.
Definition at line 142 of file PololuHD44780.cpp.
|
inherited |
Enables a cursor that appears as a solid line in the bottom row.
This sets the LCD's "C" configuration bit and clears its "B" bit.
Note that the cursor will not be shown if the display is currently off (due to a call to noDisplay()), or if the cursor position is not within the bounds of the screen.
Definition at line 137 of file PololuHD44780.cpp.
|
inherited |
Turns the display on. This should only be needed if noDisplay() was previously called.
Definition at line 157 of file PololuHD44780.cpp.
|
inherited |
Change the location of the cursor. The cursor (whether visible or invisible), is the place where the next character written to the LCD will be displayed.
Note that the scrolling features of the LCD change the correspondence between the x
parameter and the physical column that the data is displayed on. See the "LCD scrolling" section above for more information.
x | The number of the column to go to, with 0 being the leftmost column. |
y | The number of the row to go to, with 0 being the top row. |
Definition at line 88 of file PololuHD44780.cpp.
|
inherited |
Hides the solid and blinking cursors.
This clears the LCD's "C" and "B" configuration bits.
Definition at line 147 of file PololuHD44780.cpp.
|
inherited |
Resets the screen scrolling position back to the default and moves the cursor to the upper left corner of the screen.
This command takes about 1600 microseconds, so it would be faster to instead call scrollDisplayLeft() or scrollDisplayRight() the appropriate number of times and then call gotoXY(0, 0).
Definition at line 192 of file PololuHD44780.cpp.
|
inlineinherited |
Initialize the LCD if it has not already been initialized.
Definition at line 67 of file PololuHD44780.h.
|
inlinevirtual |
Initializes the pins so that the send() function can be called successfully. This is the first step of initializing the LCD.
Implements PololuHD44780Base.
Definition at line 62 of file AStar32U4LCD.h.
|
inherited |
Puts the LCD into left-to-right mode: the cursor will shift to the right after any character is written. This is the default behavior.
Definition at line 204 of file PololuHD44780.cpp.
|
inherited |
Defines a custom character.
picture | A pointer to the character dot pattern, in program space. |
number | A number between 0 and 7. |
Definition at line 103 of file PololuHD44780.cpp.
|
inlineinherited |
This overload of loadCustomCharacter is only provided for compatibility with OrangutanLCD; a lot of Orangutan code defines an array of chars for custom character pictures.
Definition at line 145 of file PololuHD44780.h.
|
inherited |
Defines a custom character from RAM.
picture | A pointer to the character dot pattern, in RAM. |
number | A number between 0 and 7. |
Definition at line 117 of file PololuHD44780.cpp.
|
inherited |
Turns off auto-scrolling. Auto-scrolling is off by default.
Definition at line 219 of file PololuHD44780.cpp.
|
inherited |
Hides the blinking cursor.
This functions clears the LCD's "B" configuration bit without changing the other bits.
Calling this function does not enable or disable the solid cursor (a solid line in the bottom row) so it is usually better to call hideCursor() or cursorSolid() instead. This function is only provided for compatibilty with the LiquidCrystal library.
Definition at line 172 of file PololuHD44780.cpp.
|
inherited |
Hides the solid cursor.
This function clears the LCD's "C" configuration bit without changing the other bits.
If the "B" bit is set to 1, a blinking cursor will still be displayed even after calling this function. For that reason, it is usually better to call hideCursor() instead. This function is only provided for compatibility with the LiquidCrystal library.
Definition at line 162 of file PololuHD44780.cpp.
|
inherited |
Turns off the display while preserving its state.
You can turn the display on again by calling display().
Definition at line 152 of file PololuHD44780.cpp.
|
inlineinherited |
Reinitialize the LCD. This performs the same initialization that is done automatically the first time any function is called that writes to the LCD. This is useful if you want to get it back to a totally clean state.
Definition at line 80 of file PololuHD44780.h.
|
inherited |
Puts the LCD into right-to-left mode: the cursor will shift to the left after any character is written.
Definition at line 209 of file PololuHD44780.cpp.
|
inherited |
Scrolls everything on the screen one position to the left.
This command takes about 37 microseconds.
Definition at line 182 of file PololuHD44780.cpp.
|
inherited |
Scrolls everything on the screen one position to the right.
This command takes about 37 microseconds.
Definition at line 187 of file PololuHD44780.cpp.
|
inlinevirtual |
Sends data or commands to the LCD.
The initPins() function will always be called before the first time this function is called. This function does not need to worry about the delays necessary to make sure the previous command has finished; that is taken care of by PololuHD44780Base.
This function, along with initPins(), comprise the hardware abstraction layer for the LCD, and must be defined in a subclass of PololuHD44780Base. All other functions use these two functions to communicate with the LCD.
data | The data to send to the LCD. |
rsValue | True to drive the RS pin high, false to drive it low. |
only4bits | If true, and the LCD is using a 4-bit interface, only sends the lower 4 bits of the data. |
Implements PololuHD44780Base.
Definition at line 67 of file AStar32U4LCD.h.
|
inlineinherited |
Changes the location of the cursor. This is just a wrapper around gotoXY provided for compaitibility with the LiquidCrystal library.
Definition at line 170 of file PololuHD44780.h.
|
virtualinherited |
Writes a single character to the LCD.
Definition at line 62 of file PololuHD44780.cpp.
|
virtualinherited |
Writes multiple characters to the LCD.
buffer | Pointer to a string of characters in RAM, not necessarily null-terminated. |
size | The number of characters to write to the LCD, excluding any null termination character. |
Definition at line 68 of file PololuHD44780.cpp.