コード例 #1
0
ファイル: lcd.c プロジェクト: Eclo/FreeRTOS
static void prvSetupLCD(void)
{
	/* Wait for proper power up. */
	vTaskDelay( lcdLONG_DELAY );
	
	/* Open the PMP port */
	mPMPOpen((PMP_ON | PMP_READ_WRITE_EN | PMP_CS2_CS1_EN |
			  PMP_LATCH_POL_HI | PMP_CS2_POL_HI | PMP_CS1_POL_HI |
			  PMP_WRITE_POL_HI | PMP_READ_POL_HI),
			 (PMP_MODE_MASTER1 | PMP_WAIT_BEG_4 | PMP_WAIT_MID_15 |
			  PMP_WAIT_END_4),
			  PMP_PEN_0, 0);
			 
	/* Wait for the LCD to power up correctly. */
	vTaskDelay( lcdLONG_DELAY );
	vTaskDelay( lcdLONG_DELAY );
	vTaskDelay( lcdLONG_DELAY );

	/* Set up the LCD function. */
	prvLCDCommand( LCD_FUNCTION_SET_CMD | LCD_FUNCTION_SET_8_BITS | LCD_FUNCTION_SET_2_LINES | LCD_FUNCTION_SET_LRG_FONT );
	
	/* Turn the display on. */
	prvLCDCommand( LCD_DISPLAY_CTRL_CMD | LCD_DISPLAY_CTRL_DISPLAY_ON );
	
	/* Clear the display. */
	prvLCDCommand( LCD_CLEAR_DISPLAY_CMD );
	vTaskDelay( lcdLONG_DELAY );	
	
	/* Increase the cursor. */
	prvLCDCommand( LCD_ENTRY_MODE_CMD | LCD_ENTRY_MODE_INCREASE );
	vTaskDelay( lcdLONG_DELAY );		  	
	vTaskDelay( lcdLONG_DELAY );		  	
	vTaskDelay( lcdLONG_DELAY );
}
コード例 #2
0
ファイル: lcd.c プロジェクト: granthuu/fsm_software
static void prvLCDGotoRow( unsigned short usRow )
{
	if( usRow == 0 )
	{
		prvLCDCommand( lcdHOME );
	}
	else
	{
		prvLCDCommand( lcdLINE2 );
	}
}
コード例 #3
0
ファイル: lcd.c プロジェクト: Eclo/FreeRTOS
static void prvLCDGotoRow( unsigned short usRow )
{
	if(usRow == 0) 
	{
		prvLCDCommand( LCD_CURSOR_HOME_CMD );
	} 
	else 
	{
		prvLCDCommand( LCD_NEW_LINE );
	}
}
コード例 #4
0
ファイル: lcd.c プロジェクト: granthuu/fsm_software
static void prvSetupLCD( void )
{
	/* Wait for proper power up. */
	vTaskDelay( lcdLONG_DELAY );

	/* Set initial states for the data and control pins */
	LATE &= 0xFF00;

	/* R/W state set low. */
    lcdRW = 0;

	/* lcdRS state set low. */
	lcdRS = 0;

	/* lcdE state set low. */
	lcdE = 0;

	/* Set data and control pins to outputs */
	TRISE &= 0xFF00;

	/* lcdRW pin set as output. */
 	RW_TRIS = 0;

	/* lcdRS pin set as output. */
	RS_TRIS = 0;

	/* lcdE pin set as output. */
	E_TRIS = 0;

	/* 1st LCD initialization sequence */
	lcdDATA &= 0xFF00;
    lcdDATA |= 0x0038;
    lcdE = 1;
    Nop();
    Nop();
    Nop();

	/* Toggle lcdE signal. */
    lcdE = 0;

	vTaskDelay( lcdSHORT_DELAY );
	vTaskDelay( lcdSHORT_DELAY );
	vTaskDelay( lcdSHORT_DELAY );

	/* 2nd LCD initialization sequence */
	lcdDATA &= 0xFF00;
    lcdDATA |= 0x0038;
    lcdE = 1;
    Nop();
    Nop();
    Nop();

	/* Toggle lcdE signal. */
    lcdE = 0;

    vTaskDelay( lcdSHORT_DELAY );

	/* 3rd LCD initialization sequence */
	lcdDATA &= 0xFF00;
    lcdDATA |= 0x0038;
    lcdE = 1;
    Nop();
    Nop();
    Nop();

	/* Toggle lcdE signal. */
    lcdE = 0;

	vTaskDelay( lcdSHORT_DELAY );


	/* Function set. */
    prvLCDCommand( 0x38 );

	/* Display on/off control, cursor blink off (0x0C). */
    prvLCDCommand( 0x0C );

	/* Entry mode set (0x06). */
    prvLCDCommand( 0x06 );

	prvLCDCommand( lcdCLEAR );
}
コード例 #5
0
ファイル: lcd.c プロジェクト: granthuu/fsm_software
static void prvLCDClear( void )
{
	prvLCDCommand( lcdCLEAR );
}
コード例 #6
0
ファイル: lcd.c プロジェクト: Eclo/FreeRTOS
static void prvLCDClear(void)
{
	prvLCDCommand(LCD_CLEAR_DISPLAY_CMD);
}