コード例 #1
0
/*
 *
 *   Function Name:   DSI_ExecCmndList
 *
 *   Description:
 *
 */
static void DSI_ExecCmndList(DispDrv_PANEL_t *pPanel, char *buff)
{
	CSL_DSI_CMND_t msg;
	int res = 0;

	msg.vc = pPanel->cmnd_mode->vc;
	msg.isLP = pPanel->disp_info->cmnd_LP;
	msg.endWithBta = FALSE;
	msg.reply = NULL;

	while (*buff) {
		uint8_t len = *buff++;
		if (len == (uint8_t)~0) {
			msleep(*buff++);
		} else {
			switch (len) {
			case 0:
				res = -1;
				break;
			case 1:
				msg.dsiCmnd = DSI_DT_SH_DCS_WR_P0;
				break;
			case 2:
				msg.dsiCmnd = DSI_DT_SH_DCS_WR_P1;
				break;
			default:
				if (len <= CSL_DSI_GetMaxTxMsgSize())
					msg.dsiCmnd = DSI_DT_LG_DCS_WR;
				else
					res = -1;
				break;
			}
			if (res) {
				DSI_ERR("Packet size err %d\n", res);
				goto err_size;
			}
			msg.isLong = len > 2;
			msg.msg = buff;
			msg.msgLen = len;
			res = CSL_DSI_SendPacket(pPanel->clientH, &msg, FALSE);
			buff += len;
		}
		if (res)
			DSI_ERR("Error while sending packet %d\n", res);
	}
err_size:
	return;
}
コード例 #2
0
//*****************************************************************************
//
// Function Name:  DISPDRV_WrSendCmnd
// Parameters:     msg_buff   = TX byte buffer
//                 msg_size   = size of message to be sent [bytes]
//
// Description:    Send commands with variable no of parms
//                 Assumption: DISPLAY's Controller Accepts DT Used
//
//*****************************************************************************
static int DISPDRV_WrSendCmnd( 
    DISPDRV_HANDLE_T    drvH, 
    UInt8 *             msg_buff, 
    UInt32              msg_size,
    UInt8 packet_type
    )
{
    DISPDRV_PANEL_T *pPanel = (DISPDRV_PANEL_T *)drvH;
    CSL_DSI_CMND_t      msg;

    int                 res = 0;



	if(packet_type == GEN_TYPE)
	{
	    switch(msg_size)
	    {
/*		case 0:
		    res = -1;
		    break; */
	    case 0:
		    msg.dsiCmnd = DSI_DT_SH_GEN_WR_P0;
		    break;
	    case 1:
		    msg.dsiCmnd = DSI_DT_SH_GEN_WR_P1;
		    break;
	    case 2:
		    msg.dsiCmnd = DSI_DT_SH_GEN_WR_P2;
		    break;
		default:		    
	    	if( msg_size <= CSL_DSI_GetMaxTxMsgSize() ) 
	    	{
			    msg.dsiCmnd = DSI_DT_LG_GEN_WR;
		    }
		    else
			    res = -1;
			break;
		}
	
	}
	else // DCS TYPE
	{
	    switch(msg_size)
	    {
		case 0:
		    res = -1;
		    break;
	    case 1:
		    msg.dsiCmnd = DSI_DT_SH_DCS_WR_P0;
		    break;
	    case 2:
		    msg.dsiCmnd = DSI_DT_SH_DCS_WR_P1;
		    break;
		default:		    
	    	if( msg_size <= CSL_DSI_GetMaxTxMsgSize() ) 
	    	{
			    msg.dsiCmnd = DSI_DT_LG_DCS_WR;
		    }
		    else
			    res = -1;
			break;
		}
	}
	

	if( res == 0 ){
    	msg.msg        = msg_buff;
    	msg.msgLen     = msg_size;
    	msg.vc         = DISPDRV_VC;
    	msg.isLP       = DISPDRV_CMND_IS_LP;
    	msg.isLong     = msg_size > 2;
    	msg.endWithBta = FALSE;
    
    	CSL_DSI_SendPacket (pPanel->clientH, &msg, FALSE);   
	}    
    

	return(res);
}