MT72 RGB CLOCK设置
是这样设置的,但看MTK文档里面的设置应该是:
params->dpi.mipi_pll_clk_div1 = 32; //0..63
params->dpi.mipi_pll_clk_div2 = 4; //0..15
但如果我按下面这种方式设置,不能点亮屏,而且上面设置则可以,有人知道上面设置的具体意义么?
调屏 ,我也是这一块 不是很懂 。
你上面的这种方法,我从来没用过,一般都是下面的方法。
具体是什么原因,我也不清楚。
不懂,看上去很高深的样子,帮顶!
我查看了datasheet和代码里面的设置, OUTREGBIT(MIPITX_DSI_PLL_CON0_REG,DSI_PHY_REG->MIPITX_DSI_PLL_CON0,RG_DSI0_MPPLL_TXdiv1,lcm_params->dpi.mipi_pll_clk_div2);
OUTREGBIT(MIPITX_DSI_PLL_CON0_REG,DSI_PHY_REG->MIPITX_DSI_PLL_CON0,RG_DSI0_MPPLL_TXdiv0,lcm_params->dpi.mipi_pll_clk_div1);
感觉上面那么设置到这里没有用,因为这里只设置这个寄存器的两个bit,但实际是那样设置有用,不知道还有哪里会用到这两个值
static void lcm_get_params(LCM_PARAMS *params)
{
#if 1
memset(params, 0, sizeof(LCM_PARAMS));
#ifndef BUILD_LK
printk("\n#### lcm_get_params \n");
#endif
params->type = LCM_TYPE_DPI;
params->ctrl = LCM_CTRL_NONE;
params->width = FRAME_WIDTH;
params->height = FRAME_HEIGHT;
params->io_select_mode = 0;
/* RGB interface configurations */
params->dpi.mipi_pll_clk_ref = 0; //5; //0; //the most important parameters: set pll clk to 66Mhz and dpi clk to 33Mhz
// params->dpi.mipi_pll_clk_div1 = 32; //0..63
// params->dpi.mipi_pll_clk_div2 = 4; //0..15
params->dpi.mipi_pll_clk_div1 = 0x80000081 ;//30 ;//36; //42; //36; //31->41
params->dpi.mipi_pll_clk_div2 = 0x8009a000;//3;//7; //10; //7; //chenqi 4->8
params->dpi.dpi_clk_div = 2;
params->dpi.dpi_clk_duty = 1;
params->dpi.clk_pol = LCM_POLARITY_FALLING;
params->dpi.de_pol = LCM_POLARITY_RISING;
params->dpi.vsync_pol = LCM_POLARITY_FALLING;
params->dpi.hsync_pol = LCM_POLARITY_FALLING;
params->dpi.hsync_pulse_width = 20;
params->dpi.hsync_back_porch = 140;
params->dpi.hsync_front_porch = 100;
params->dpi.vsync_pulse_width = 3;
params->dpi.vsync_back_porch = 20;
params->dpi.vsync_front_porch = 12;
params->dpi.format = LCM_DPI_FORMAT_RGB888; // format is 24 bit
params->dpi.rgb_order = LCM_COLOR_ORDER_RGB;
params->dpi.is_serial_output = 0;
params->dpi.intermediat_buffer_num = 2;
params->dpi.io_driving_current = LCM_DRIVING_CURRENT_4MA; // LCM_DRIVING_CURRENT_2MA
#else
memset(params, 0, sizeof(LCM_PARAMS));
params->type = LCM_TYPE_DPI;
params->ctrl = LCM_CTRL_NONE;//LCM_CTRL_SERIAL_DBI;
params->width = FRAME_WIDTH;
params->height = FRAME_HEIGHT;
params->io_select_mode = 0;
/* RGB interface configurations */
params->dpi.mipi_pll_clk_ref = 0; //0..1 //the most important parameters: set pll clk to 66Mhz and dpi clk to 33Mhz
params->dpi.mipi_pll_clk_div1 = 32; //0..63
params->dpi.mipi_pll_clk_div2 = 4; //0..15
params->dpi.dpi_clk_div = 2; //:2..32
params->dpi.dpi_clk_duty = 1; //1..(dpi_clk_div - 1)
params->dpi.clk_pol = LCM_POLARITY_RISING;
params->dpi.de_pol = LCM_POLARITY_RISING;
params->dpi.vsync_pol = LCM_POLARITY_FALLING;
params->dpi.hsync_pol = LCM_POLARITY_FALLING;
params->dpi.hsync_pulse_width = 20;
params->dpi.hsync_back_porch = 140;
params->dpi.hsync_front_porch = 160;
params->dpi.vsync_pulse_width = 3;
params->dpi.vsync_back_porch = 20;
params->dpi.vsync_front_porch = 12;
/* Pixel Clock Frequency = 26MHz * mipi_pll_clk_div1
/ (mipi_pll_clk_ref + 1)
/ (2 * mipi_pll_clk_div2)
/ dpi_clk_div
*/
params->dpi.format = LCM_DPI_FORMAT_RGB888; // format is 24 bit
params->dpi.rgb_order = LCM_COLOR_ORDER_RGB;
params->dpi.is_serial_output = 0;
params->dpi.intermediat_buffer_num = 2;
params->dpi.io_driving_current = LCM_DRIVING_CURRENT_6575_8MA; // LCM_DRIVING_CURRENT_2MA
#endif
}
同样遇到这样的问题,请问小编明白了吗,求分享,谢谢!
小编,问题解决了吗?能分享一下代码吗?