/* Set the the LCD entry mode. 
The parameter of ucCursorMoveDirection can be: */
void HD44780EntryModeSet(unsigned char ucCursorMoveDirection, xtBoolean bDisplayShift)
/* Set the the LCD entry mode. 
The parameter of ucCursorMoveDirection can be: */
void HD44780EntryModeSet(unsigned char ucCursorMoveDirection, xtBoolean bDisplayShift)
{
    unsigned char ucDisplayShiftCmd;
    xASSERT((ucCursorMoveDirection == HD44780_MOVE_DIRECTION_INC) || 
            (ucCursorMoveDirection == HD44780_MOVE_DIRECTION_DEC));
    ucDisplayShiftCmd = (bDisplayShift ? HD44780_ENTRY_MODE_SET_S : 0);
    while(HD44780Busy());
    HD44780WriteCmd(HD44780_CMD_ENTRY_MODE_SET(ucCursorMoveDirection | 
                                               ucDisplayShiftCmd));    
}