mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 07:04:14 +03:00 
			
		
		
		
	Jhd1313m1: add basic scroll functionality
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
		| @@ -55,6 +55,11 @@ namespace upm { | ||||
| #define LCD_BLINKON 0x01 | ||||
| #define LCD_BLINKOFF 0x00 | ||||
|  | ||||
| // flags for display/cursor shift | ||||
| #define LCD_DISPLAYMOVE 0x08 | ||||
| #define LCD_MOVERIGHT 0x04 | ||||
| #define LCD_MOVELEFT 0x00 | ||||
|  | ||||
| // flags for function set | ||||
| #define LCD_8BITMODE 0x10 | ||||
| #define LCD_4BITMODE 0x00 | ||||
|   | ||||
| @@ -84,6 +84,14 @@ Jhd1313m1::setColor(uint8_t r, uint8_t g, uint8_t b) | ||||
|     return MRAA_SUCCESS; | ||||
| } | ||||
|  | ||||
| mraa_result_t | ||||
| Jhd1313m1::scroll(bool direction) | ||||
| { | ||||
|     if (direction) | ||||
|         return i2Cmd (m_i2c_lcd_control, (LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT)); | ||||
|     return i2Cmd (m_i2c_lcd_control, (LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT)); | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * ************** | ||||
|  *  virtual area | ||||
|   | ||||
| @@ -37,6 +37,7 @@ class Jhd1313m1 : public I2CLcd { | ||||
|         mraa_result_t setCursor (int row, int column); | ||||
|         mraa_result_t clear (); | ||||
|         mraa_result_t home (); | ||||
|         mraa_result_t scroll (bool direction); | ||||
|  | ||||
|     private: | ||||
|         int m_rgb_address; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Brendan Le Foll
					Brendan Le Foll