mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
feat: add mipidsi support
add mipi dsi subsystem support. reference links: https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_mipi_dsi.c https://github.com/torvalds/linux/blob/master/include/video/mipi_display.h Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
This commit is contained in:
@@ -322,5 +322,6 @@ config OV2640_REGDEBUG
|
||||
endif
|
||||
|
||||
source "drivers/video/vnc/Kconfig"
|
||||
source "drivers/video/mipidsi/Kconfig"
|
||||
|
||||
endif # DRIVERS_VIDEO
|
||||
|
||||
@@ -59,6 +59,7 @@ endif
|
||||
endif
|
||||
|
||||
include video/vnc/Make.defs
|
||||
include video/mipidsi/Make.defs
|
||||
|
||||
# Include video driver build support
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
menuconfig MIPI_DSI
|
||||
bool "Dsi Driver Support"
|
||||
default n
|
||||
---help---
|
||||
Enables building of a dsi generic driver.
|
||||
|
||||
if MIPI_DSI
|
||||
|
||||
config MIPI_DSI_DRIVER
|
||||
bool "MIPI DSI Character Driver"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
############################################################################
|
||||
# drivers/video/mipidsi/Make.defs
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Don't build anything if there is no mipi dsi support
|
||||
|
||||
ifeq ($(CONFIG_MIPI_DSI),y)
|
||||
|
||||
CSRCS += mipi_dsi_device.c mipi_dsi_host.c mipi_dsi_packet.c
|
||||
|
||||
ifeq ($(CONFIG_MIPI_DSI_DRIVER),y)
|
||||
CSRCS += mipi_dsi_device_driver.c mipi_dsi_host_driver.c
|
||||
endif
|
||||
|
||||
DEPPATH += --dep-path video/mipidsi
|
||||
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)video$(DELIM)mipidsi
|
||||
VPATH += :video/mipidsi
|
||||
|
||||
endif # CONFIG_MIPI_DSI
|
||||
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* drivers/video/mipidsi/mipi_dsi.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __DRIVERS_VIDEO_MIPIDSI_MIPI_DSI_H
|
||||
#define __DRIVERS_VIDEO_MIPIDSI_MIPI_DSI_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/video/mipi_dsi.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_host_driver_register
|
||||
*
|
||||
* Description:
|
||||
* Create and register the dsi host character driver.
|
||||
*
|
||||
* The dsi host character driver is a simple character driver that
|
||||
* supports dsi transfer.
|
||||
*
|
||||
* Input Parameters:
|
||||
* host - An instance of the struct mipi_dsi_host
|
||||
*
|
||||
* Returned Value:
|
||||
* OK if the driver was successfully register; A negated errno value is
|
||||
* returned on any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_host_driver_register(FAR struct mipi_dsi_host *host);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_device_driver_register
|
||||
*
|
||||
* Description:
|
||||
* Create and register the dsi device character driver.
|
||||
*
|
||||
* The dsi device character driver is a simple character driver that
|
||||
* supports get dsi device params.
|
||||
*
|
||||
* Input Parameters:
|
||||
* device - An instance of the struct mipi_dsi_device
|
||||
*
|
||||
* Returned Value:
|
||||
* OK if the driver was successfully register; A negated errno value is
|
||||
* returned on any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_device_driver_register(FAR struct mipi_dsi_device *device);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __DRIVERS_VIDEO_MIPIDSI_MIPI_DSI_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,234 @@
|
||||
/****************************************************************************
|
||||
* drivers/video/mipidsi/mipi_dsi_device_driver.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "mipi_dsi.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Device naming ************************************************************/
|
||||
|
||||
#define MIPI_DSI_DEVNAME_FMT "/dev/dsi%d/dev.%d.%s"
|
||||
#define MIPI_DSI_DEVNAME_LEN 128
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct mipi_dsi_device_driver_s
|
||||
{
|
||||
FAR struct mipi_dsi_device *dsi_dev;
|
||||
mutex_t lock; /* Mutual exclusion */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t dsi_dev_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t dsi_dev_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
static int dsi_dev_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static const struct file_operations dsi_dev_fops =
|
||||
{
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
dsi_dev_read, /* read */
|
||||
dsi_dev_write, /* write */
|
||||
NULL, /* seek */
|
||||
dsi_dev_ioctl, /* ioctl */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dsi_dev_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t dsi_dev_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
return 0; /* Return EOF */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dsi_dev_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t dsi_dev_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
return buflen; /* Say that everything was written */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dsi_dev_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int dsi_dev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct mipi_dsi_device_driver_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct mipi_dsi_device_driver_s *)inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Get exclusive access to the DSI device driver state structure */
|
||||
|
||||
ret = nxmutex_lock(&priv->lock);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Process the IOCTL command */
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case MIPIDSI_GETDEVLANES:
|
||||
{
|
||||
FAR uint16_t *planes = (FAR uint16_t *)((uintptr_t)arg);
|
||||
DEBUGASSERT(planes != NULL);
|
||||
|
||||
*planes = priv->dsi_dev->lanes;
|
||||
}
|
||||
break;
|
||||
case MIPIDSI_GETDEVFMT:
|
||||
{
|
||||
FAR uint32_t *fmt = (FAR uint32_t *)((uintptr_t)arg);
|
||||
DEBUGASSERT(fmt != NULL);
|
||||
|
||||
*fmt = priv->dsi_dev->format;
|
||||
}
|
||||
break;
|
||||
case MIPIDSI_GETDEVMODE:
|
||||
{
|
||||
FAR uint32_t *mode = (FAR uint32_t *)((uintptr_t)arg);
|
||||
DEBUGASSERT(mode != NULL);
|
||||
|
||||
*mode = priv->dsi_dev->mode_flags;
|
||||
}
|
||||
break;
|
||||
case MIPIDSI_GETDEVHSRATE:
|
||||
{
|
||||
FAR uint32_t *hsrate = (FAR uint32_t *)((uintptr_t)arg);
|
||||
DEBUGASSERT(hsrate != NULL);
|
||||
|
||||
*hsrate = priv->dsi_dev->hs_rate;
|
||||
}
|
||||
break;
|
||||
case MIPIDSI_GETDEVLPRATE:
|
||||
{
|
||||
FAR uint32_t *lprate = (FAR uint32_t *)((uintptr_t)arg);
|
||||
DEBUGASSERT(lprate != NULL);
|
||||
|
||||
*lprate = priv->dsi_dev->lp_rate;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
nxmutex_unlock(&priv->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_device_driver_register
|
||||
*
|
||||
* Description:
|
||||
* Create and register the dsi device character driver.
|
||||
*
|
||||
* The dsi device character driver is a simple character driver that
|
||||
* supports get dsi device params.
|
||||
*
|
||||
* Input Parameters:
|
||||
* device - An instance of the struct mipi_dsi_device
|
||||
*
|
||||
* Returned Value:
|
||||
* OK if the driver was successfully register; A negated errno value is
|
||||
* returned on any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_device_driver_register(FAR struct mipi_dsi_device *device)
|
||||
{
|
||||
FAR struct mipi_dsi_device_driver_s *priv;
|
||||
FAR struct mipi_dsi_host *host;
|
||||
char devpath[MIPI_DSI_DEVNAME_LEN];
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(device != NULL && device->host != NULL);
|
||||
|
||||
priv = kmm_zalloc(sizeof(struct mipi_dsi_device_driver_s));
|
||||
if (priv == NULL)
|
||||
{
|
||||
verr("mipi dsi device driver register failed, no memory.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
priv->dsi_dev = device;
|
||||
nxmutex_init(&priv->lock);
|
||||
|
||||
host = device->host;
|
||||
snprintf(devpath, sizeof(devpath), MIPI_DSI_DEVNAME_FMT, host->bus,
|
||||
device->channel, device->name);
|
||||
|
||||
ret = register_driver(devpath, &dsi_dev_fops, 0666, priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
nxmutex_destroy(&priv->lock);
|
||||
kmm_free(priv);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
/****************************************************************************
|
||||
* drivers/video/mipidsi/mipi_dsi_host.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "mipi_dsi.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct mipi_dsi_hosts_s
|
||||
{
|
||||
int count;
|
||||
struct mipi_dsi_host *hosts[0];
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct mipi_dsi_hosts_s *g_hosts;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_host_exist
|
||||
****************************************************************************/
|
||||
|
||||
static bool mipi_dsi_host_exist(int bus)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (g_hosts != NULL && i < g_hosts->count)
|
||||
{
|
||||
if (g_hosts->hosts[i]->bus == bus)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_host_register
|
||||
*
|
||||
* Description:
|
||||
* Register mipi dsi host, if defined CONFIG_MIPI_DSI_DRIVER, will create
|
||||
* character device at /dev.
|
||||
*
|
||||
* Input Parameters:
|
||||
* host - An instance of the dsi host
|
||||
*
|
||||
* Returned Value:
|
||||
* OK if the driver was successfully register; A negated errno value is
|
||||
* returned on any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_host_register(FAR struct mipi_dsi_host *host)
|
||||
{
|
||||
DEBUGASSERT(host != NULL && host->ops != NULL);
|
||||
|
||||
if (mipi_dsi_host_exist(host->bus))
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (g_hosts == NULL)
|
||||
{
|
||||
g_hosts = kmm_zalloc(sizeof(struct mipi_dsi_hosts_s) +
|
||||
sizeof(FAR struct mipi_dsi_host *));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_hosts = kmm_realloc(g_hosts, sizeof(struct mipi_dsi_hosts_s) +
|
||||
sizeof(FAR struct mipi_dsi_host *) *
|
||||
(g_hosts->count + 1));
|
||||
}
|
||||
|
||||
if (g_hosts == NULL)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
g_hosts->hosts[g_hosts->count] = host;
|
||||
g_hosts->count++;
|
||||
|
||||
#ifdef CONFIG_MIPI_DSI_DRIVER
|
||||
return mipi_dsi_host_driver_register(host);
|
||||
#else
|
||||
return OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_host_get
|
||||
*
|
||||
* Description:
|
||||
* Find host in list by bus number. Lcd driver can get host by this
|
||||
* interface to register dsi device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* bus - The dsi host bus number.
|
||||
*
|
||||
* Returned Value:
|
||||
* struct mipi_dsi_host pointer if the host was successfully registered;
|
||||
* NULL pointer is returned on any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct mipi_dsi_host *mipi_dsi_host_get(int bus)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (g_hosts != NULL && i < g_hosts->count)
|
||||
{
|
||||
if (g_hosts->hosts[i]->bus == bus)
|
||||
{
|
||||
return g_hosts->hosts[i];
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
/****************************************************************************
|
||||
* drivers/video/mipidsi/mipi_dsi_host_driver.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "mipi_dsi.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Device naming ************************************************************/
|
||||
|
||||
#define MIPI_DSI_HOSTNAME_FMT "/dev/dsi%d/host"
|
||||
#define MIPI_DSI_HOSTNAME_LEN 128
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/* Driver state structure */
|
||||
|
||||
struct mipi_dsi_host_driver_s
|
||||
{
|
||||
FAR struct mipi_dsi_host *host;
|
||||
mutex_t lock; /* Mutual exclusion */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t dsi_host_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len);
|
||||
static ssize_t dsi_host_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len);
|
||||
static int dsi_host_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static const struct file_operations dsi_host_fops =
|
||||
{
|
||||
NULL, /* open */
|
||||
NULL, /* close */
|
||||
dsi_host_read, /* read */
|
||||
dsi_host_write, /* write */
|
||||
NULL, /* seek */
|
||||
dsi_host_ioctl, /* ioctl */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dsi_host_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t dsi_host_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
return 0; /* Return EOF */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: DSI hostdrvr_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t dsi_host_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
return len; /* Say that everything was written */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dsi_host_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int dsi_host_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct mipi_dsi_host_driver_s *priv;
|
||||
FAR struct inode *inode;
|
||||
FAR struct mipi_dsi_msg *msg;
|
||||
FAR struct mipi_dsi_host *host;
|
||||
int ret;
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Get exclusive access to the dsi host driver state structure */
|
||||
|
||||
ret = nxmutex_lock(&priv->lock);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Process the IOCTL command */
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case MIPIDSI_TRANSFER:
|
||||
{
|
||||
/* Get the reference to the mipi_dsi_msg structure */
|
||||
|
||||
msg = (FAR struct mipi_dsi_msg *)((uintptr_t)arg);
|
||||
|
||||
/* Get the reference to the mipi_dsi_host structure */
|
||||
|
||||
host = priv->host;
|
||||
DEBUGASSERT(host != NULL && msg != NULL);
|
||||
|
||||
ret = host->ops->transfer(host, msg);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
nxmutex_unlock(&priv->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_host_driver_register
|
||||
*
|
||||
* Description:
|
||||
* Create and register the dsi host character driver.
|
||||
*
|
||||
* The dsi host character driver is a simple character driver that
|
||||
* supports dsi transfer.
|
||||
*
|
||||
* Input Parameters:
|
||||
* host - An instance of the struct mipi_dsi_host
|
||||
*
|
||||
* Returned Value:
|
||||
* OK if the driver was successfully register; A negated errno value is
|
||||
* returned on any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_host_driver_register(FAR struct mipi_dsi_host *host)
|
||||
{
|
||||
FAR struct mipi_dsi_host_driver_s *priv;
|
||||
char name[MIPI_DSI_HOSTNAME_LEN];
|
||||
int ret = -ENOMEM;
|
||||
|
||||
DEBUGASSERT(host != NULL);
|
||||
|
||||
priv = kmm_zalloc(sizeof(struct mipi_dsi_host_driver_s));
|
||||
if (priv != NULL)
|
||||
{
|
||||
priv->host = host;
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
nxmutex_init(&priv->lock);
|
||||
#endif
|
||||
|
||||
snprintf(name, sizeof(name), MIPI_DSI_HOSTNAME_FMT, host->bus);
|
||||
ret = register_driver(name, &dsi_host_fops, 0666, priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
nxmutex_destroy(&priv->lock);
|
||||
#endif
|
||||
kmm_free(priv);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
/****************************************************************************
|
||||
* drivers/video/mipidsi/mipi_dsi_packet.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <nuttx/video/mipi_dsi.h>
|
||||
#include <nuttx/video/mipi_display.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_pixel_format_to_bpp
|
||||
*
|
||||
* Description:
|
||||
* Obtain the number of bits per pixel for any given pixel format defined
|
||||
* by the MIPI DSI specification
|
||||
*
|
||||
* Input Parameters:
|
||||
* fmt - MIPI DSI pixel format
|
||||
*
|
||||
* Returned Value:
|
||||
* The number of bits per pixel of the given pixel format.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_pixel_format_to_bpp(uint8_t fmt)
|
||||
{
|
||||
switch (fmt)
|
||||
{
|
||||
case MIPI_DSI_FMT_RGB888:
|
||||
case MIPI_DSI_FMT_RGB666:
|
||||
return 24;
|
||||
case MIPI_DSI_FMT_RGB666_PACKED:
|
||||
return 18;
|
||||
case MIPI_DSI_FMT_RGB565:
|
||||
return 16;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_packet_format_is_short
|
||||
*
|
||||
* Description:
|
||||
* Check if a packet is of the short format
|
||||
*
|
||||
* Input Parameters:
|
||||
* type - MIPI DSI data type of the packet
|
||||
*
|
||||
* Returned Value:
|
||||
* True if the packet for the given data type is a short packet, false
|
||||
* otherwise.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool mipi_dsi_packet_format_is_short(uint8_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MIPI_DSI_VSYNC_START:
|
||||
case MIPI_DSI_VSYNC_END:
|
||||
case MIPI_DSI_HSYNC_START:
|
||||
case MIPI_DSI_HSYNC_END:
|
||||
case MIPI_DSI_COMPRESSION_MODE:
|
||||
case MIPI_DSI_END_OF_TRANSMISSION:
|
||||
case MIPI_DSI_COLOR_MODE_OFF:
|
||||
case MIPI_DSI_COLOR_MODE_ON:
|
||||
case MIPI_DSI_SHUTDOWN_PERIPHERAL:
|
||||
case MIPI_DSI_TURN_ON_PERIPHERAL:
|
||||
case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM:
|
||||
case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM:
|
||||
case MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM:
|
||||
case MIPI_DSI_GENERIC_READ_0_PARAM:
|
||||
case MIPI_DSI_GENERIC_READ_1_PARAM:
|
||||
case MIPI_DSI_GENERIC_READ_2_PARAM:
|
||||
case MIPI_DSI_DCS_SHORT_WRITE_0_PARAM:
|
||||
case MIPI_DSI_DCS_SHORT_WRITE_1_PARAM:
|
||||
case MIPI_DSI_DCS_READ_0_PARAM:
|
||||
case MIPI_DSI_EXECUTE_QUEUE:
|
||||
case MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_packet_format_is_long
|
||||
*
|
||||
* Description:
|
||||
* Check if a packet is of the long format
|
||||
*
|
||||
* Input Parameters:
|
||||
* type - MIPI DSI data type of the packet
|
||||
*
|
||||
* Returned Value:
|
||||
* True if the packet for the given data type is a long packet, false
|
||||
* otherwise.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool mipi_dsi_packet_format_is_long(uint8_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MIPI_DSI_NULL_PACKET:
|
||||
case MIPI_DSI_BLANKING_PACKET:
|
||||
case MIPI_DSI_LONG_GENERIC_WRITE:
|
||||
case MIPI_DSI_DCS_LONG_WRITE:
|
||||
case MIPI_DSI_PICTURE_PARAMETER_SET:
|
||||
case MIPI_DSI_COMPRESSED_PIXEL_STREAM:
|
||||
case MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_RGB30:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_RGB36:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_RGB16:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_RGB18:
|
||||
case MIPI_DSI_PIXEL_STREAM_3BYTE_RGB18:
|
||||
case MIPI_DSI_PACKED_PIXEL_STREAM_RGB24:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: mipi_dsi_create_packet
|
||||
*
|
||||
* Description:
|
||||
* Create a packet from a message according to the DSI protocol
|
||||
*
|
||||
* Input Parameters:
|
||||
* packet - Pointer to a DSI packet structure
|
||||
* msg - Message to translate into a packet
|
||||
*
|
||||
* Returned Value:
|
||||
* Return: 0 on success or a negative error code on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mipi_dsi_create_packet(FAR struct mipi_dsi_packet *packet,
|
||||
FAR const struct mipi_dsi_msg *msg)
|
||||
{
|
||||
DEBUGASSERT(packet != NULL);
|
||||
DEBUGASSERT(msg != NULL);
|
||||
|
||||
/* do some minimum sanity checking */
|
||||
|
||||
if (!mipi_dsi_packet_format_is_short(msg->type) &&
|
||||
!mipi_dsi_packet_format_is_long(msg->type))
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (msg->channel > 3)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(packet, 0, sizeof(*packet));
|
||||
packet->header[0] = (msg->channel << 6) | (msg->type & 0x3f);
|
||||
|
||||
/* TODO: compute ECC if hardware support is not available */
|
||||
|
||||
/* Long write packets contain the word count in header bytes 1 and 2.
|
||||
* The payload follows the header and is word count bytes long.
|
||||
*
|
||||
* Short write packets encode up to two parameters in header bytes 1
|
||||
* and 2.
|
||||
*/
|
||||
|
||||
if (mipi_dsi_packet_format_is_long(msg->type))
|
||||
{
|
||||
packet->header[1] = (msg->tx_len >> 0) & 0xff;
|
||||
packet->header[2] = (msg->tx_len >> 8) & 0xff;
|
||||
|
||||
packet->payload_length = msg->tx_len;
|
||||
packet->payload = msg->tx_buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
FAR const uint8_t *tx = msg->tx_buf;
|
||||
|
||||
packet->header[1] = (msg->tx_len > 0) ? tx[0] : 0;
|
||||
packet->header[2] = (msg->tx_len > 1) ? tx[1] : 0;
|
||||
}
|
||||
|
||||
packet->size = sizeof(packet->header) + packet->payload_length;
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -94,6 +94,7 @@
|
||||
#define _LTEBASE (0x3600) /* LTE device ioctl commands */
|
||||
#define _VIDIOCBASE (0x3700) /* Video device ioctl commands */
|
||||
#define _CELLIOCBASE (0x3800) /* Cellular device ioctl commands */
|
||||
#define _MIPIDSIBASE (0x3900) /* Mipidsi device ioctl commands */
|
||||
#define _WLIOCBASE (0x8b00) /* Wireless modules ioctl network commands */
|
||||
|
||||
/* boardctl() commands share the same number space */
|
||||
@@ -621,6 +622,11 @@
|
||||
#define _CELLIOCVALID(c) (_IOC_TYPE(c)==_CELLIOCBASE)
|
||||
#define _CELLIOC(nr) _IOC(_CELLIOCBASE,nr)
|
||||
|
||||
/* mipidsi driver ioctl definitions *****************************************/
|
||||
|
||||
#define _MIPIDSIIOCVALID(c) (_IOC_TYPE(c)==_MIPIDSIBASE)
|
||||
#define _MIPIDSIIOC(nr) _IOC(_MIPIDSIBASE,nr)
|
||||
|
||||
/* Wireless driver network ioctl definitions ********************************/
|
||||
|
||||
/* (see nuttx/include/wireless/wireless.h */
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/video/mipi_display.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_MIPI_DISPLAY_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_MIPI_DISPLAY_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* DSI Processor-to-Peripheral transaction types */
|
||||
|
||||
#define MIPI_DSI_VSYNC_START 0x01
|
||||
#define MIPI_DSI_VSYNC_END 0x11
|
||||
#define MIPI_DSI_HSYNC_START 0x21
|
||||
#define MIPI_DSI_HSYNC_END 0x31
|
||||
#define MIPI_DSI_COMPRESSION_MODE 0x07
|
||||
#define MIPI_DSI_END_OF_TRANSMISSION 0x08
|
||||
#define MIPI_DSI_COLOR_MODE_OFF 0x02
|
||||
#define MIPI_DSI_COLOR_MODE_ON 0x12
|
||||
#define MIPI_DSI_SHUTDOWN_PERIPHERAL 0x22
|
||||
#define MIPI_DSI_TURN_ON_PERIPHERAL 0x32
|
||||
#define MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM 0x03
|
||||
#define MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM 0x13
|
||||
#define MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM 0x23
|
||||
#define MIPI_DSI_GENERIC_READ_0_PARAM 0x04
|
||||
#define MIPI_DSI_GENERIC_READ_1_PARAM 0x14
|
||||
#define MIPI_DSI_GENERIC_READ_2_PARAM 0x24
|
||||
#define MIPI_DSI_DCS_SHORT_WRITE_0_PARAM 0x05
|
||||
#define MIPI_DSI_DCS_SHORT_WRITE_1_PARAM 0x15
|
||||
#define MIPI_DSI_DCS_READ_0_PARAM 0x06
|
||||
#define MIPI_DSI_EXECUTE_QUEUE 0x16
|
||||
#define MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE 0x37
|
||||
#define MIPI_DSI_NULL_PACKET 0x09
|
||||
#define MIPI_DSI_BLANKING_PACKET 0x19
|
||||
#define MIPI_DSI_LONG_GENERIC_WRITE 0x29
|
||||
#define MIPI_DSI_DCS_LONG_WRITE 0x39
|
||||
#define MIPI_DSI_PICTURE_PARAMETER_SET 0x0a
|
||||
#define MIPI_DSI_COMPRESSED_PIXEL_STREAM 0x0b
|
||||
#define MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 0x0c
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24 0x1c
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16 0x2c
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB30 0x0d
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB36 0x1d
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12 0x3d
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB16 0x0e
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB18 0x1e
|
||||
#define MIPI_DSI_PIXEL_STREAM_3BYTE_RGB18 0x2e
|
||||
#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB24 0x3e
|
||||
|
||||
/* DSI Peripheral-to-Processor transaction data type */
|
||||
|
||||
#define MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT 0x02
|
||||
#define MIPI_DSI_RX_END_OF_TRANSMISSION 0x08
|
||||
#define MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE 0x11
|
||||
#define MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE 0x12
|
||||
#define MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE 0x1a
|
||||
#define MIPI_DSI_RX_DCS_LONG_READ_RESPONSE 0x1c
|
||||
#define MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE 0x21
|
||||
#define MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE 0x22
|
||||
|
||||
/* DCS commands */
|
||||
|
||||
#define MIPI_DCS_NOP 0x00
|
||||
#define MIPI_DCS_SOFT_RESET 0x01
|
||||
#define MIPI_DCS_GET_COMPRESSION_MODE 0x03
|
||||
#define MIPI_DCS_GET_DISPLAY_ID 0x04
|
||||
#define MIPI_DCS_GET_ERROR_COUNT_ON_DSI 0x05
|
||||
#define MIPI_DCS_GET_RED_CHANNEL 0x06
|
||||
#define MIPI_DCS_GET_GREEN_CHANNEL 0x07
|
||||
#define MIPI_DCS_GET_BLUE_CHANNEL 0x08
|
||||
#define MIPI_DCS_GET_DISPLAY_STATUS 0x09
|
||||
#define MIPI_DCS_GET_POWER_MODE 0x0a
|
||||
#define MIPI_DCS_GET_ADDRESS_MODE 0x0b
|
||||
#define MIPI_DCS_GET_PIXEL_FORMAT 0x0c
|
||||
#define MIPI_DCS_GET_DISPLAY_MODE 0x0d
|
||||
#define MIPI_DCS_GET_SIGNAL_MODE 0x0e
|
||||
#define MIPI_DCS_GET_DIAGNOSTIC_RESULT 0x0f
|
||||
#define MIPI_DCS_ENTER_SLEEP_MODE 0x10
|
||||
#define MIPI_DCS_EXIT_SLEEP_MODE 0x11
|
||||
#define MIPI_DCS_ENTER_PARTIAL_MODE 0x12
|
||||
#define MIPI_DCS_ENTER_NORMAL_MODE 0x13
|
||||
#define MIPI_DCS_GET_IMAGE_CHECKSUM_RGB 0x14
|
||||
#define MIPI_DCS_GET_IMAGE_CHECKSUM_CT 0x15
|
||||
#define MIPI_DCS_EXIT_INVERT_MODE 0x20
|
||||
#define MIPI_DCS_ENTER_INVERT_MODE 0x21
|
||||
#define MIPI_DCS_SET_GAMMA_CURVE 0x26
|
||||
#define MIPI_DCS_SET_DISPLAY_OFF 0x28
|
||||
#define MIPI_DCS_SET_DISPLAY_ON 0x29
|
||||
#define MIPI_DCS_SET_COLUMN_ADDRESS 0x2a
|
||||
#define MIPI_DCS_SET_PAGE_ADDRESS 0x2b
|
||||
#define MIPI_DCS_WRITE_MEMORY_START 0x2c
|
||||
#define MIPI_DCS_WRITE_LUT 0x2d
|
||||
#define MIPI_DCS_READ_MEMORY_START 0x2e
|
||||
#define MIPI_DCS_SET_PARTIAL_ROWS 0x30 /* MIPI DCS 1.02 -
|
||||
* MIPI_DCS_SET_PARTIAL_AREA
|
||||
* before that */
|
||||
#define MIPI_DCS_SET_PARTIAL_COLUMNS 0x31
|
||||
#define MIPI_DCS_SET_SCROLL_AREA 0x33
|
||||
#define MIPI_DCS_SET_TEAR_OFF 0x34
|
||||
#define MIPI_DCS_SET_TEAR_ON 0x35
|
||||
#define MIPI_DCS_SET_ADDRESS_MODE 0x36
|
||||
#define MIPI_DCS_SET_SCROLL_START 0x37
|
||||
#define MIPI_DCS_EXIT_IDLE_MODE 0x38
|
||||
#define MIPI_DCS_ENTER_IDLE_MODE 0x39
|
||||
#define MIPI_DCS_SET_PIXEL_FORMAT 0x3a
|
||||
#define MIPI_DCS_WRITE_MEMORY_CONTINUE 0x3c
|
||||
#define MIPI_DCS_SET_3D_CONTROL 0x3d
|
||||
#define MIPI_DCS_READ_MEMORY_CONTINUE 0x3e
|
||||
#define MIPI_DCS_GET_3D_CONTROL 0x3f
|
||||
#define MIPI_DCS_SET_VSYNC_TIMING 0x40
|
||||
#define MIPI_DCS_SET_TEAR_SCANLINE 0x44
|
||||
#define MIPI_DCS_GET_SCANLINE 0x45
|
||||
#define MIPI_DCS_SET_DISPLAY_BRIGHTNESS 0x51 /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_GET_DISPLAY_BRIGHTNESS 0x52 /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_WRITE_CONTROL_DISPLAY 0x53 /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_GET_CONTROL_DISPLAY 0x54 /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_WRITE_POWER_SAVE 0x55 /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_GET_POWER_SAVE 0x56 /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_SET_CABC_MIN_BRIGHTNESS 0x5e /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_GET_CABC_MIN_BRIGHTNESS 0x5f /* MIPI DCS 1.3 */
|
||||
#define MIPI_DCS_READ_DDB_START 0xa1
|
||||
#define MIPI_DCS_READ_PPS_START 0xa2
|
||||
#define MIPI_DCS_READ_DDB_CONTINUE 0xa8
|
||||
#define MIPI_DCS_READ_PPS_CONTINUE 0xa9
|
||||
|
||||
/* DCS pixel formats */
|
||||
|
||||
#define MIPI_DCS_PIXEL_FMT_24BIT 7
|
||||
#define MIPI_DCS_PIXEL_FMT_18BIT 6
|
||||
#define MIPI_DCS_PIXEL_FMT_16BIT 5
|
||||
#define MIPI_DCS_PIXEL_FMT_12BIT 3
|
||||
#define MIPI_DCS_PIXEL_FMT_8BIT 2
|
||||
#define MIPI_DCS_PIXEL_FMT_3BIT 1
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_MIPI_DISPLAY_H */
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user