lcd_enable( DB7_pin, DB6_pin, DB5_pin, DB4_pin, EN_pin, RS_pin,)

Use: lcd_enable( data_pin, clock_pin )
Description: Defines the pins to be used for the 6 wire LCD interface, and resets the LCD
Parameters: DB7_pin Name of the pinname used for the LCD DB7 connection. This can be a variable name or a name in the form Px_y. Where x is the port number, which can be 1 or 2, and y is the bit number which is between 0 and 7. (e.g. P2_3)
DB6_pin Name of the pinname used for the LCD DB6 connection.
DB5_pin Name of the pinname used for the LCD DB5 connection.
DB4_pin Name of the pinname used for the LCD DB4 connection.
EN_pin Name of the pinname used for the LCD EN connection.
RS_pin Name of the pinname used for the LCD RS connection.
Returns: None
Related:  lcd_print, lcd2w_enable, print

The lcd_enable function defines the pins to control an LCD using the 6 wire interface. The LCD is an external component that must be connected to the pins of the microcontroller, see details here.

The command resets the LCD display so that it is ready to print text using  the lcd_print command. The lcd_enable command must be run before the lcd_print command,  and is needed only once in the program. 

There are two different LCD interface connections in mpy, a 6 wire and a 2 wire interface.  The lcd_enable command is only used for the 6 wire interface. It uses parallel interface signals DB7,DB6,DB5,DB4,EN,RS and output signals from the microcontroller. These signals are used to to connect directly to the LCD. See here for details of how to connect the 6 wire interface to the LCD.

Note that it is important to specify the pins in the correct order.

Example using the lcd_enable and the lcd_print commands to display text onto the 6 wire LCD interface.

lcd_enable(P1_7, P1_2, P1_5, P1_4, P1_3, P1_0)   # DB7,DB6,DB5,DB4,EN,RS
y = -123
lcd_print( 'y is', y )

This will  display the following on the LCD

y is    -123

The lcd_enable command defines microcontroller pins P1_7, P1_2, P1_5, P1_4, P1_3, P1_0 to be used to connected directly to the DB7, DB6, DB5, DB4, EN, RS pins of the LCD.  

The 6 wire interface uses most of the available pins on the microcontroller. If this is a problem then consider using the 2 wire interface with the lcd2w_enable command. This does require the use  an external shift-register circuit, details here.