Beispiel #1
0
static int __init mipi_sony_lcd_init(void)
{
    ENTER_FUNC2();

    lcd_gpio_init(lcd_gpio_init_table, ARRAY_SIZE(lcd_gpio_init_table), 1);

#ifdef FEATURE_SKY_BACLIGHT_MAX8831
    led_i2c_api_Init();
#endif

	gpio_set_value_cansleep(LCD_DET, GPIO_LOW_VALUE);
    sony_state.disp_powered_up = true;

    mipi_dsi_buf_alloc(&sony_tx_buf, DSI_BUF_SIZE);
    mipi_dsi_buf_alloc(&sony_rx_buf, DSI_BUF_SIZE);

#if 1//def CONFIG_SW_RESET
	if (msm_reset_reason_read_only()) {
		first_enable = 0;
		prev_bl_level = 0;
	}
#endif

    EXIT_FUNC2();

    return platform_driver_register(&this_driver);
}
Beispiel #2
0
void s3cfb_init_hw(void)
{
	
	s3cfb_set_fimd_info();

	s3cfb_set_gpio();

	lcd_gpio_init();
	mdelay(100); 
	lcd_power_ctrl();
}
/**
 * @brief Initialize the LCD display
 *        enables LCD using 2-line display and 8-bit interface
 *        cursor auto-right-move without showing
          Clear the LCD screen
 * @param None
 * @retval None
 */
void lcd_display_init(void)
{
  lcd_gpio_init();
  
  //function set 2 lines, 8-bit interface
  lcd_send_command(0x38);
  //enable display(0x0c) and cursor display(0x0e)
  lcd_send_command(0x0c);
  //clear
  lcd_send_command(0x01);
}
Beispiel #4
0
/* RT-Thread Device Interface */
static rt_err_t rt_lcd_init(rt_device_t dev)
{

    /* Route Main clock to LCD. */
    CLOCK_AttachClk(kMCLK_to_LCD_CLK);

    CLOCK_SetClkDiv(kCLOCK_DivLcdClk, 1, true);

    /*LCD管脚配置*/
    lcd_gpio_init();

    /* Set the back light PWM. */
    {
        sctimer_config_t config;
        sctimer_pwm_signal_param_t pwmParam;
        uint32_t event;

        CLOCK_AttachClk(kMCLK_to_SCT_CLK);

        CLOCK_SetClkDiv(kCLOCK_DivSctClk, 2, true);

        SCTIMER_GetDefaultConfig(&config);

        SCTIMER_Init(SCT0, &config);

        pwmParam.output = kSCTIMER_Out_5;
        pwmParam.level = kSCTIMER_HighTrue;
        pwmParam.dutyCyclePercent = 5;

        SCTIMER_SetupPwm(SCT0, &pwmParam, kSCTIMER_CenterAlignedPwm, 1000U, CLOCK_GetFreq(kCLOCK_Sct), &event);
    }

    lcd_framebuffer = rt_malloc_align(sizeof(rt_uint16_t) * RT_HW_LCD_HEIGHT * RT_HW_LCD_WIDTH, 32);
    rt_memset(lcd_framebuffer, 0, sizeof(rt_uint16_t) * RT_HW_LCD_HEIGHT * RT_HW_LCD_WIDTH);

    {
        /* Initialize the display. */
        lcdc_config_t lcdConfig;

        LCDC_GetDefaultConfig(&lcdConfig);

        lcdConfig.panelClock_Hz = LCD_PANEL_CLK;
        lcdConfig.ppl = LCD_PPL;
        lcdConfig.hsw = LCD_HSW;
        lcdConfig.hfp = LCD_HFP;
        lcdConfig.hbp = LCD_HBP;
        lcdConfig.lpp = LCD_LPP;
        lcdConfig.vsw = LCD_VSW;
        lcdConfig.vfp = LCD_VFP;
        lcdConfig.vbp = LCD_VBP;
        lcdConfig.polarityFlags = LCD_POL_FLAGS;
        lcdConfig.upperPanelAddr = (uint32_t)lcd_framebuffer;//VRAM_ADDR;
        lcdConfig.bpp = kLCDC_16BPP565;
        lcdConfig.display = kLCDC_DisplayTFT;
        lcdConfig.swapRedBlue = true;

        LCDC_Init(LCD, &lcdConfig, CLOCK_GetFreq(kCLOCK_LCD));

        /* Trigger interrupt at start of every vertical back porch. */
        LCDC_SetVerticalInterruptMode(LCD, kLCDC_StartOfBackPorch);
        LCDC_EnableInterrupts(LCD, kLCDC_VerticalCompareInterrupt);
        NVIC_EnableIRQ(LCD_IRQn);

        LCDC_Start(LCD);
        LCDC_PowerUp(LCD);
    }

    return RT_EOK;
}