A class for managing SSD1306 controlled LCD´s (cheap 128x64 models, 0.96'') with more scroll features
Diff: ssd1306.h
- Revision:
- 10:e5341e7eb825
- Parent:
- 9:57209a7e9cba
--- a/ssd1306.h Mon Nov 06 18:35:22 2017 +0000 +++ b/ssd1306.h Mon Oct 07 18:10:07 2019 +0000 @@ -259,6 +259,44 @@ */ void fill (char x, char y, bool refresh=false); + /** Set up and start a continuous horizontal scroll. + * Once you have set up the scrolling, you can deactivate it with stop_scroll(). + * @param direction 0 for right, 1 for left. + * @param start Start page address, 0 - 5. + * @param end End page address, 0 - 5. + * @param interval Interval in frame frequency. Valid values are: 2, 3, 4, 5, 25, 64, 128, 256. + * @see stop_scrol + */ + void start_horizontal_scroll(unsigned char direction, unsigned char start, unsigned char end, unsigned char interval); + + /** Set up and start a continuous horizontal and vertical scroll. + * NOTE: No continuous vertical scroll is available. + * Once you have set up the scrolling, you can deactivate it with stop_scroll(). + * @param direction 0 for vertical and right horizontal scroll, 1 for vertical and left horizontal scroll. + * @param start Start page address, 0 - 5. + * @param end End page address, 0 - 5. + * @param interval Interval in frame frequency. Valid values are: 2, 3, 4, 5, 25, 64, 128, 256. + * @param vertical_offset Offset of vertical scroll, 1 - 63. + * @see stop_scroll + */ + void start_vertical_and_horizontal_scroll(unsigned char direction, unsigned char start, unsigned char end, unsigned char interval, unsigned char vertical_offset); + + /** Deactivate the continuous scroll set up with start_horizontal_scroll() or + * start_vertical_and_horizontal_scroll(). + * @see set_horizontal_scroll, set_vertical_and_horizontal_scroll + */ + void stop_scroll(); + + /** Turn the whole display off. This will reset all configuration settings on the controller to their defaults. */ + void off(); + + /** Turn the whole display on. Used during initialisation. */ + void on(); + + void sleep(); + + void wake(); + virtual ~SSD1306 () { if (!do_not_delete_bus) delete bus;