upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | Protected Member Functions

API for the JHD1313M1 I2C controller for HD44780-based displays with an RGB backlight, such as a Grove RGB I2C LCD display. More...

Detailed Description

JHD1313M1 has two I2C addreses: one belongs to a controller, very similar to the upm::Lcm1602 LCD driver, that controls the HD44780-based display, and the other controls only the backlight. This module was tested with the Seeed Grove LCD RGB Backlight v2.0 display that requires 5V to operate.

grovergblcd.jpg
// 0x62 RGB_ADDRESS, 0x3E LCD_ADDRESS
upm::Jhd1313m1 *lcd = new upm::Jhd1313m1(0, 0x3E, 0x62);
lcd->setCursor(0,0);
lcd->write("Hello World");
lcd->setCursor(1,2);
lcd->write("Hello World");
printf("Sleeping for 5 seconds\n");
sleep(5);
delete lcd;

Public Member Functions

 Jhd1313m1 (int bus, int lcdAddress=0x3E, int rgbAddress=0x62)
 
 ~Jhd1313m1 ()
 
mraa::Result scroll (bool direction)
 
mraa::Result setColor (uint8_t r, uint8_t g, uint8_t b)
 
- Public Member Functions inherited from Lcm1602
 Lcm1602 (int bus, int address, bool isExpander=true, uint8_t numColumns=16, uint8_t numRows=4)
 
 Lcm1602 (uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t numColumns=16, uint8_t numRows=4)
 
 ~Lcm1602 ()
 
mraa::Result write (std::string msg)
 
mraa::Result setCursor (int row, int column)
 
mraa::Result clear ()
 
mraa::Result home ()
 
mraa::Result createChar (uint8_t charSlot, uint8_t charData[])
 
mraa::Result displayOn ()
 
mraa::Result displayOff ()
 
mraa::Result cursorOn ()
 
mraa::Result cursorOff ()
 
mraa::Result cursorBlinkOn ()
 
mraa::Result cursorBlinkOff ()
 
mraa::Result scrollDisplayLeft ()
 
mraa::Result scrollDisplayRight ()
 
mraa::Result entryLeftToRight ()
 
mraa::Result entryRightToLeft ()
 
mraa::Result autoscrollOn ()
 
mraa::Result autoscrollOff ()
 
- Public Member Functions inherited from LCD
mraa::Result write (int x, int y, std::string msg)
 
std::string name ()
 

Protected Member Functions

virtual mraa::Result command (uint8_t cmd)
 
virtual mraa::Result data (uint8_t data)
 
- Protected Member Functions inherited from Lcm1602
mraa::Result send (uint8_t value, int mode)
 
mraa::Result write4bits (uint8_t value)
 
mraa::Result expandWrite (uint8_t value)
 
mraa::Result pulseEnable (uint8_t value)
 

Additional Inherited Members

- Protected Attributes inherited from Lcm1602
uint8_t m_displayControl
 
uint8_t m_entryDisplayMode
 
uint8_t m_numColumns
 
uint8_t m_numRows
 
int m_lcd_control_address
 
mraa::I2c * m_i2c_lcd_control
 
- Protected Attributes inherited from LCD
std::string m_name
 

Constructor & Destructor Documentation

Jhd1313m1 ( int  bus,
int  lcdAddress = 0x3E,
int  rgbAddress = 0x62 
)

Jhd1313m1 constructor

Parameters
busI2C bus to use
addressSlave address the LCD is registered on
addressSlave address the RGB backlight is registered on

Here is the call graph for this function:

~Jhd1313m1 ( )

Jhd1313m1 destructor

Here is the call graph for this function:

Member Function Documentation

mraa::Result scroll ( bool  direction)

Makes the LCD scroll text

Parameters
directionTrue if scrolling to the right
Returns
Result of the operation

Here is the call graph for this function:

mraa::Result setColor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets the color of the backlight

Parameters
r0-255 value for red
g0-255 value for green
b0-255 value for blue
Returns
Result of the operation

Here is the caller graph for this function:

Inheritance diagram for Jhd1313m1:
Inheritance graph
[legend]
Collaboration diagram for Jhd1313m1:
Collaboration graph
[legend]

The documentation for this class was generated from the following files: