Exemplo n.º 1
0
/**
 *  初始化 touch panel 消息传输通道
 */
__s32 msg_srv_init_tp_channel(__memit_ctr_t *emit)
{		
	 /* 创建 desktop_msg_queue */		
	emit->sys_msg_counter = 0;	
	emit->psys_msg_queue  = esKRNL_QCreate(SYS_MSGQ_SIZE);	
	if(!emit->psys_msg_queue)
	{
		__err(" create sys_msg_queue error \n");
		return EPDK_FAIL;
	}
		
	/* 创建 p_array_sem */	
	emit->p_array_sem = esKRNL_SemCreate(1);	
	if( !emit->p_array_sem )
	{
		__err(" create p_array_sem error \n");
		return EPDK_FAIL;
	}
	emit->p_hook_sem = esKRNL_SemCreate(1);
	if( !emit->p_hook_sem )
	{
		__err(" create p_hook_sem error \n");
		return EPDK_FAIL;
	}
	/* 装载 touchpanel 驱动 */
		
	/*  注册回调函数 tp_msg_cb */
	/*{
		ES_FILE *p_tpfile;
		p_tpfile = eLIBs_fopen("b:\\HID\\TP", "r+");
		if( !p_tpfile )
		{
			__err(" open touchpanel driver error \n");
			return EPDK_FAIL;
		}
		
		eLIBs_fioctrl(p_tpfile, DRV_TP_CMD_REG, 0, (void *)tp_msg_cb);	
		eLIBs_fclose(p_tpfile);
	}*/
	{	
	    /* grab logical keyboard, binding event callback to input_subsystem */
	    emit_ctr.h_tpGraber = esINPUT_LdevGrab(INPUT_LTS_DEV_NAME, (__pCBK_t)tp_msg_cb, 0, 0);
	    if (emit_ctr.h_tpGraber == NULL)
	    {
	        __msg("grab logical touchpannel failed\n");
	        return EPDK_FAIL;
	    }
	}
		
	return EPDK_OK;
}
Exemplo n.º 2
0
void ve_init_clock(void)
{
    u8 err;

    //* create semaphore for VE interrupt.
    sem_intr = esKRNL_SemCreate(0);
    if(sem_intr == NULL)
    	return;

    //* create semaphore to sync adjust clock operation
    sem_ve_clk_adjust = esKRNL_SemCreate(1);
    if(sem_ve_clk_adjust == NULL)
    {
    	esKRNL_SemDel(sem_intr, OS_DEL_ALWAYS, &err);
    	sem_intr = NULL;
        return;
    }

    //* request handle of VE module clock
    h_ve_clock = esCLK_OpenMclk(CSP_CCM_MOD_CLK_VE);
    esCLK_MclkRegCb(CSP_CCM_MOD_CLK_VE, cb_ve_clock_change);

    //* request handle of AHB to VE clock gate.
    h_ve_ahb_gate = esCLK_OpenMclk(CSP_CCM_MOD_CLK_AHB_VE);

    //* request handle of DRAM to VE clock gate.
    h_ve_dram_gate = esCLK_OpenMclk(CSP_CCM_MOD_CLK_SDRAM_VE);

    //* set MACC clock source to video PLL.
    esCLK_SetMclkSrc(h_ve_clock, CSP_CCM_SYS_CLK_VE_PLL);
    esCLK_SetMclkDiv(h_ve_clock, 1);

    //* switch SRAM to MACC.
    h_ve_sram = esMEM_SramReqBlk(CSP_SRAM_ZONE_C1, SRAM_REQ_MODE_WAIT);
    esMEM_SramSwitchBlk(h_ve_sram, CSP_SRAM_MODULE_VE);

    //* enable MACC module clock
    esCLK_MclkOnOff(h_ve_clock, CLK_ON);
    esCLK_MclkOnOff(h_ve_ahb_gate, CLK_ON);
    esCLK_MclkOnOff(h_ve_dram_gate, CLK_ON);

	esINT_InsISR(INTC_IRQNO_MACC, (__pISR_t)ve_interrupt_service, 0);

    return;
}
Exemplo n.º 3
0
__s32 DRV_DISP_MInit(void)
{
    __disp_bsp_init_para para;
    __hdle hReg;
    __u32 i = 0;
     user_gpio_set_t  gpio_set[1];
	__s32            ret;
   
    para.base_image0    = 0xf1e60000;
    para.base_scaler0   = 0xf1e00000;
    para.base_lcdc0     = 0xf1c0c000;
    para.base_tvec      = 0xf1c0a000;
    para.base_ccmu      = 0xf1c20000;
    para.base_sdram     = 0xf1c01000;
    para.base_pioc      = 0xf1c20800;
    para.base_timer		= 0xf1c21000;	/*	PWM module register base	*/

    para.power_on       = DRV_lcd_power_on;
    para.power_off      = DRV_lcd_power_off;
    para.scaler_begin   		= DRV_scaler_begin;
    para.scaler_finish  		= DRV_scaler_finish;
    para.tve_interrup   		= DRV_tve_interrup;
	para.hdmi_set_mode  		= DRV_hdmi_set_mode;
	para.Hdmi_open  			= DRV_Hdmi_open;
	para.Hdmi_close  			= DRV_Hdmi_close;
	para.hdmi_mode_support		= DRV_hdmi_mode_support;
	para.hdmi_get_HPD_status	= DRV_hdmi_get_HPD_status;
	para.disp_int_process       = disp_int_process;

	eLIBs_memset(&g_disp_drv, 0, sizeof(__disp_drv_t));
    g_disp_drv.scaler_finished_sem[0] = esKRNL_SemCreate(0);
    if(!g_disp_drv.scaler_finished_sem[0])
    {
        __wrn("create scaler_finished_sem[0] fail!\n");
        return EPDK_FAIL;
    }  
    g_disp_drv.scaler_finished_sem[1] = esKRNL_SemCreate(0);
    if(!g_disp_drv.scaler_finished_sem[1])
    {
        __wrn("create scaler_finished_sem[1] fail!\n");
        return EPDK_FAIL;
    }    

    for(i = 0; i<MAX_EVENT_SEM; i++)
    {
    	g_disp_drv.event_sem[0][i] = NULL;
     	g_disp_drv.event_sem[1][i] = NULL;
    }

    BSP_disp_init(&para);
    BSP_disp_open();

	g_disp_drv.reg_operate_vaild = 1;
	
   	hReg = esDEV_DevReg("DISP", "DISPLAY", &dispdev_ops, 0);
    if(!hReg)
    {
        __inf("esDEV_DevReg() fail!\n");
    	return EPDK_FAIL;
    }

	#if DRV_VCOM_TIMER

	//Soft Vcom Control;

	ret = esCFG_GetKeyValue("softvcom_para", "soft_vcom_en", &vcom_en, 1);
	if (!ret)
	{
		eLIBs_printf(" -- %s, %d, vcom_en = %d -- \n", __FILE__, __LINE__, vcom_en);
	
		if(vcom_en)
		{
			ret = esCFG_GetKeyValue("softvcom_para", "vcom_io", (int *)gpio_set, sizeof(user_gpio_set_t)/4);
			if (!ret)
			{
				vcom_io = esPINS_PinGrpReq(gpio_set, 1);
				if (!vcom_io)
				{
					__wrn("request output_col pin failed\n");
					return EPDK_FAIL;
				}
			}
			else
			{
				__wrn("fetch para from script failed\n");
				return EPDK_FAIL;
			}
		}
	}
	else
	{
		__wrn("fetch para from script failed\n");
		return EPDK_FAIL;
	}

	ret = esPINS_SetPinPull(vcom_io, PIN_PULL_DOWN, NULL);
	if (ret)
	{
		__wrn("pull output_col failed\n");
		return EPDK_FAIL;
	}

    //申请定时器
	vcom_timer_init();

    //让定时器开始跑
	vcom_timer_start();
#endif	

    return EPDK_OK;        
}
Exemplo n.º 4
0
Handle semaphore_create(u32 cnt)
{
	return (Handle)esKRNL_SemCreate(cnt);
}