2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* drivers/lcd/skeleton.c
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 07:10:42 +01:00
|
|
|
* 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
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 07:10:42 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 07:10:42 +01:00
|
|
|
* 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.
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Included Files
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <nuttx/arch.h>
|
2013-07-01 16:11:54 +02:00
|
|
|
#include <nuttx/spi/spi.h>
|
2010-12-04 02:56:50 +01:00
|
|
|
#include <nuttx/lcd/lcd.h>
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
#include "up_arch.h"
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Pre-processor Definitions
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Configuration ************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Verify that all configuration requirements have been met */
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/* Debug ********************************************************************/
|
|
|
|
|
2010-05-11 04:40:10 +02:00
|
|
|
/* Define the following to enable register-level debug output */
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
#undef CONFIG_LCD_SKELDEBUG
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* Verbose debug must also be enabled */
|
|
|
|
|
2016-06-11 22:14:08 +02:00
|
|
|
#ifndef CONFIG_DEBUG_FEATURES
|
2016-06-11 19:50:18 +02:00
|
|
|
# undef CONFIG_DEBUG_INFO
|
2010-05-11 04:40:10 +02:00
|
|
|
# undef CONFIG_DEBUG_GRAPHICS
|
|
|
|
#endif
|
|
|
|
|
2016-06-11 19:50:18 +02:00
|
|
|
#ifndef CONFIG_DEBUG_INFO
|
2010-05-11 04:41:08 +02:00
|
|
|
# undef CONFIG_LCD_SKELDEBUG
|
2010-05-11 04:40:10 +02:00
|
|
|
#endif
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/* Color Properties *********************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Display Resolution */
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
#define SKEL_XRES 320
|
|
|
|
#define SKEL_YRES 240
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Color depth and format */
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
#define SKEL_BPP 16
|
|
|
|
#define SKEL_COLORFMT FB_FMT_RGB16_565
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/* Debug ********************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
#ifdef CONFIG_LCD_SKELDEBUG
|
2016-06-16 20:33:32 +02:00
|
|
|
# define skelerr(format, ...) _err(format, ##__VA_ARGS__)
|
|
|
|
# define skelwarn(format, ...) _warn(format, ##__VA_ARGS__)
|
|
|
|
# define skelinfo(format, ...) _info(format, ##__VA_ARGS__)
|
2010-05-11 04:40:10 +02:00
|
|
|
#else
|
2016-06-11 23:50:49 +02:00
|
|
|
# define skelerr(x...)
|
2016-06-12 17:26:00 +02:00
|
|
|
# define skelwarn(x...)
|
|
|
|
# define skelinfo(x...)
|
2010-05-11 04:40:10 +02:00
|
|
|
#endif
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Private Type Definition
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* This structure describes the state of this driver */
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
struct skel_dev_s
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2020-02-22 19:31:14 +01:00
|
|
|
/* Publicly visible device structure */
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
struct lcd_dev_s dev;
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Private LCD-specific information follows */
|
2010-05-11 04:40:10 +02:00
|
|
|
};
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Private Function Protototypes
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* LCD Data Transfer Methods */
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
static int skel_putrun(fb_coord_t row, fb_coord_t col,
|
|
|
|
FAR const uint8_t *buffer,
|
|
|
|
size_t npixels);
|
|
|
|
static int skel_getrun(fb_coord_t row, fb_coord_t col,
|
|
|
|
FAR uint8_t *buffer,
|
|
|
|
size_t npixels);
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* LCD Configuration */
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_getvideoinfo(FAR struct lcd_dev_s *dev,
|
2021-03-04 08:02:21 +01:00
|
|
|
FAR struct fb_videoinfo_s *vinfo);
|
|
|
|
static int skel_getplaneinfo(FAR struct lcd_dev_s *dev,
|
|
|
|
unsigned int planeno,
|
|
|
|
FAR struct lcd_planeinfo_s *pinfo);
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* LCD RGB Mapping */
|
|
|
|
|
|
|
|
#ifdef CONFIG_FB_CMAP
|
|
|
|
# error "RGB color mapping not supported by this driver"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Cursor Controls */
|
|
|
|
|
|
|
|
#ifdef CONFIG_FB_HWCURSOR
|
|
|
|
# error "Cursor control not supported by this driver"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* LCD Specific Controls */
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_getpower(struct lcd_dev_s *dev);
|
|
|
|
static int skel_setpower(struct lcd_dev_s *dev, int power);
|
|
|
|
static int skel_getcontrast(struct lcd_dev_s *dev);
|
2021-03-04 08:02:21 +01:00
|
|
|
static int skel_setcontrast(struct lcd_dev_s *dev,
|
|
|
|
unsigned int contrast);
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Private Data
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* This is working memory allocated by the LCD driver for each LCD device
|
|
|
|
* and for each color plane. This memory will hold one raster line of data.
|
2010-05-11 05:55:28 +02:00
|
|
|
* The size of the allocated run buffer must therefore be at least
|
2010-05-11 04:40:10 +02:00
|
|
|
* (bpp * xres / 8). Actual alignment of the buffer must conform to the
|
|
|
|
* bitwidth of the underlying pixel type.
|
|
|
|
*
|
|
|
|
* If there are multiple planes, they may share the same working buffer
|
|
|
|
* because different planes will not be operate on concurrently. However,
|
|
|
|
* if there are multiple LCD devices, they must each have unique run buffers.
|
|
|
|
*/
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static uint16_t g_runbuffer[SKEL_XRES];
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* This structure describes the overall LCD video controller */
|
|
|
|
|
|
|
|
static const struct fb_videoinfo_s g_videoinfo =
|
|
|
|
{
|
2010-05-11 04:41:08 +02:00
|
|
|
.fmt = SKEL_COLORFMT, /* Color format: RGB16-565: RRRR RGGG GGGB BBBB */
|
|
|
|
.xres = SKEL_XRES, /* Horizontal resolution in pixel columns */
|
|
|
|
.yres = SKEL_YRES, /* Vertical resolution in pixel rows */
|
|
|
|
.nplanes = 1, /* Number of color planes supported */
|
2010-05-11 04:40:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* This is the standard, NuttX Plane information object */
|
|
|
|
|
2014-04-13 22:32:20 +02:00
|
|
|
static const struct lcd_planeinfo_s g_planeinfo =
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2015-10-10 18:41:00 +02:00
|
|
|
.putrun = skel_putrun, /* Put a run into LCD memory */
|
|
|
|
.getrun = skel_getrun, /* Get a run from LCD memory */
|
|
|
|
.buffer = (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */
|
|
|
|
.bpp = SKEL_BPP, /* Bits-per-pixel */
|
2010-05-11 04:40:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* This is the standard, NuttX LCD driver object */
|
|
|
|
|
2014-04-13 22:32:20 +02:00
|
|
|
static struct skel_dev_s g_lcddev =
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
|
|
|
.dev =
|
|
|
|
{
|
|
|
|
/* LCD Configuration */
|
2014-04-13 22:32:20 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
.getvideoinfo = skel_getvideoinfo,
|
|
|
|
.getplaneinfo = skel_getplaneinfo,
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
/* LCD RGB Mapping -- Not supported */
|
2021-03-04 08:02:21 +01:00
|
|
|
|
2010-05-11 04:40:10 +02:00
|
|
|
/* Cursor Controls -- Not supported */
|
|
|
|
|
|
|
|
/* LCD Specific Controls */
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
.getpower = skel_getpower,
|
|
|
|
.setpower = skel_setpower,
|
|
|
|
.getcontrast = skel_getcontrast,
|
|
|
|
.setcontrast = skel_setcontrast,
|
2010-05-11 04:40:10 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Private Functions
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_putrun
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* This method can be used to write a partial raster line to the LCD:
|
|
|
|
*
|
|
|
|
* row - Starting row to write to (range: 0 <= row < yres)
|
|
|
|
* col - Starting column to write to (range: 0 <= col <= xres-npixels)
|
|
|
|
* buffer - The buffer containing the run to be written to the LCD
|
|
|
|
* npixels - The number of pixels to write to the LCD
|
|
|
|
* (range: 0 < npixels <= xres-col)
|
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
static int skel_putrun(fb_coord_t row, fb_coord_t col,
|
|
|
|
FAR const uint8_t *buffer,
|
2010-05-11 04:41:08 +02:00
|
|
|
size_t npixels)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
|
|
|
/* Buffer must be provided and aligned to a 16-bit address boundary */
|
|
|
|
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("row: %d col: %d npixels: %d\n", row, col, npixels);
|
2010-05-11 04:40:10 +02:00
|
|
|
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
|
|
|
|
|
|
|
|
/* Set up to write the run. */
|
|
|
|
|
|
|
|
/* Write the run to GRAM. */
|
2010-05-11 05:55:28 +02:00
|
|
|
#warning "Missing logic"
|
2010-05-11 04:40:10 +02:00
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_getrun
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* This method can be used to read a partial raster line from the LCD:
|
|
|
|
*
|
|
|
|
* row - Starting row to read from (range: 0 <= row < yres)
|
|
|
|
* col - Starting column to read read (range: 0 <= col <= xres-npixels)
|
|
|
|
* buffer - The buffer in which to return the run read from the LCD
|
|
|
|
* npixels - The number of pixels to read from the LCD
|
|
|
|
* (range: 0 < npixels <= xres-col)
|
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
|
|
|
size_t npixels)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
|
|
|
/* Buffer must be provided and aligned to a 16-bit address boundary */
|
|
|
|
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("row: %d col: %d npixels: %d\n", row, col, npixels);
|
2010-05-11 04:40:10 +02:00
|
|
|
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
|
|
|
|
|
2011-07-05 22:15:48 +02:00
|
|
|
#warning "Missing logic"
|
2010-05-11 05:55:28 +02:00
|
|
|
return -ENOSYS;
|
2010-05-11 04:40:10 +02:00
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_getvideoinfo
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Get information about the LCD video controller configuration.
|
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_getvideoinfo(FAR struct lcd_dev_s *dev,
|
2010-05-11 04:40:10 +02:00
|
|
|
FAR struct fb_videoinfo_s *vinfo)
|
|
|
|
{
|
|
|
|
DEBUGASSERT(dev && vinfo);
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("fmt: %d xres: %d yres: %d nplanes: %d\n",
|
2021-03-04 08:02:21 +01:00
|
|
|
g_videoinfo.fmt, g_videoinfo.xres,
|
|
|
|
g_videoinfo.yres, g_videoinfo.nplanes);
|
2010-05-11 04:40:10 +02:00
|
|
|
memcpy(vinfo, &g_videoinfo, sizeof(struct fb_videoinfo_s));
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_getplaneinfo
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Get information about the configuration of each LCD color plane.
|
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
static int skel_getplaneinfo(FAR struct lcd_dev_s *dev,
|
|
|
|
unsigned int planeno,
|
|
|
|
FAR struct lcd_planeinfo_s *pinfo)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
|
|
|
DEBUGASSERT(dev && pinfo && planeno == 0);
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp);
|
2010-05-11 04:40:10 +02:00
|
|
|
memcpy(pinfo, &g_planeinfo, sizeof(struct lcd_planeinfo_s));
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_getpower
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2021-03-04 08:02:21 +01:00
|
|
|
* Get the LCD panel power status
|
|
|
|
* (0: full off - CONFIG_LCD_MAXPOWER: full on).
|
|
|
|
* On backlit LCDs, this setting may correspond to the backlight setting.
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_getpower(struct lcd_dev_s *dev)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2010-05-11 04:41:08 +02:00
|
|
|
struct skel_dev_s *priv = (struct skel_dev_s *)dev;
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("power: %d\n", 0);
|
2011-07-05 22:15:48 +02:00
|
|
|
#warning "Missing logic"
|
2010-05-11 04:41:08 +02:00
|
|
|
return 0;
|
2010-05-11 04:40:10 +02:00
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_setpower
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2021-03-04 08:02:21 +01:00
|
|
|
* Enable/disable LCD panel power
|
|
|
|
* (0: full off - CONFIG_LCD_MAXPOWER: full on).
|
|
|
|
* On backlit LCDs, this setting may correspond to the backlight setting.
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_setpower(struct lcd_dev_s *dev, int power)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2010-05-11 04:41:08 +02:00
|
|
|
struct skel_dev_s *priv = (struct skel_dev_s *)dev;
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("power: %d\n", power);
|
2010-05-11 04:40:10 +02:00
|
|
|
DEBUGASSERT(power <= CONFIG_LCD_MAXPOWER);
|
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Set new power level */
|
2011-07-05 22:15:48 +02:00
|
|
|
#warning "Missing logic"
|
2010-05-11 04:40:10 +02:00
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:41:08 +02:00
|
|
|
* Name: skel_getcontrast
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Get the current contrast setting (0-CONFIG_LCD_MAXCONTRAST).
|
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_getcontrast(struct lcd_dev_s *dev)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("Not implemented\n");
|
2011-07-05 22:15:48 +02:00
|
|
|
#warning "Missing logic"
|
2010-05-11 04:40:10 +02:00
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-12 05:08:26 +02:00
|
|
|
* Name: skel_setcontrast
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST).
|
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
static int skel_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("contrast: %d\n", contrast);
|
2011-07-05 22:15:48 +02:00
|
|
|
#warning "Missing logic"
|
2010-05-11 04:40:10 +02:00
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 04:40:10 +02:00
|
|
|
* Public Functions
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2021-03-04 08:02:21 +01:00
|
|
|
/****************************************************************************
|
2010-05-11 05:55:28 +02:00
|
|
|
* Name: up_oledinitialize
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2021-03-04 08:02:21 +01:00
|
|
|
* Initialize the LCD video hardware.
|
|
|
|
* The initial state of the LCD is fully initialized, display memory
|
|
|
|
* cleared, and the LCD ready to use, but with the power setting at 0
|
|
|
|
* (full off).
|
2010-05-11 04:40:10 +02:00
|
|
|
*
|
2021-03-04 08:02:21 +01:00
|
|
|
****************************************************************************/
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 05:55:28 +02:00
|
|
|
FAR struct lcd_dev_s *up_oledinitialize(FAR struct spi_dev_s *spi)
|
2010-05-11 04:40:10 +02:00
|
|
|
{
|
2016-06-11 19:59:51 +02:00
|
|
|
ginfo("Initializing\n");
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Configure GPIO pins */
|
2010-05-11 05:55:28 +02:00
|
|
|
#warning "Missing logic"
|
2011-07-05 22:15:48 +02:00
|
|
|
|
|
|
|
/* Enable clocking */
|
|
|
|
#warning "Missing logic"
|
2010-05-11 04:40:10 +02:00
|
|
|
|
2010-05-11 04:41:08 +02:00
|
|
|
/* Configure and enable LCD */
|
2015-09-05 17:10:48 +02:00
|
|
|
#warning "Missing logic"
|
2011-07-05 22:15:48 +02:00
|
|
|
|
|
|
|
return &g_lcddev.dev;
|
2010-05-11 04:40:10 +02:00
|
|
|
}
|