mirror of
https://github.com/apache/nuttx.git
synced 2026-05-13 02:18:38 +08:00
Support for Sharp Memory LCD. From Librae
This commit is contained in:
+51
-1
@@ -21,7 +21,7 @@ config LCD_NOGETRUN
|
||||
|
||||
config LCD_MAXCONTRAST
|
||||
int "LCD maximum contrast"
|
||||
default 63 if NOKIA6100_S1D15G10
|
||||
default 63 if NOKIA6100_S1D15G10 || LCD_SHARP_MEMLCD
|
||||
default 127 if NOKIA6100_PCF8833
|
||||
default 255 if LCD_P14201 || LCD_LCD1602
|
||||
default 63
|
||||
@@ -433,6 +433,56 @@ config SSD1289_PROFILE3
|
||||
endchoice
|
||||
endif
|
||||
|
||||
config LCD_SHARP_MEMLCD
|
||||
bool "Sharp Memory LCD Suite"
|
||||
default n
|
||||
---help---
|
||||
memlcd.c. Driver for Sharp Memory LCD Suite.
|
||||
|
||||
if LCD_SHARP_MEMLCD
|
||||
|
||||
choice MEMLCD_MODEL
|
||||
prompt "Choose Model"
|
||||
default MEMLCD_LS013B7DH03
|
||||
|
||||
config MEMLCD_LS013B7DH01
|
||||
bool "LS013B7DH01"
|
||||
---help---
|
||||
Selects the LS013B7DH01 model
|
||||
|
||||
config MEMLCD_LS013B7DH03
|
||||
bool "LS013B7DH03"
|
||||
---help---
|
||||
Selects the LS013B7DH03 model
|
||||
|
||||
endchoice
|
||||
|
||||
config MEMLCD_NINTERFACES
|
||||
int "Number of physical Memory LCD devices"
|
||||
default 1
|
||||
range 1 1
|
||||
---help---
|
||||
Specifies the number of physical Memory LCD devices that will
|
||||
be supported.
|
||||
|
||||
config MEMLCD_EXTCOMIN_MODE_HW
|
||||
bool "Use hardware mode for EXTCOMIN"
|
||||
default n
|
||||
---help---
|
||||
If use hardware mode to toggle VCOM, we need to send specific
|
||||
command at a constant frequency to trigger the LCD intenal
|
||||
hardware logic. While use software mode, we set up a timer to
|
||||
toggle EXTCOMIN connected IO, basically, it is a hardware
|
||||
timer to ensure a constant frequency.
|
||||
|
||||
config MEMLCD_SPI_FREQUENCY
|
||||
int "SPI frequency"
|
||||
default 3500000
|
||||
---help---
|
||||
Define to use a different bus frequency, FIXME DEFAULT VALUE OK?
|
||||
|
||||
endif
|
||||
|
||||
choice
|
||||
prompt "LCD Orientation"
|
||||
default LCD_LANDSCAPE
|
||||
|
||||
@@ -71,6 +71,10 @@ ifeq ($(CONFIG_LCD_ST7567),y)
|
||||
CSRCS += st7567.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SHARP_MEMLCD),y)
|
||||
CSRCS += memlcd.c
|
||||
endif
|
||||
|
||||
# Include LCD driver build support
|
||||
|
||||
DEPPATH += --dep-path lcd
|
||||
|
||||
@@ -108,6 +108,12 @@ Re-usable LCD drivers reside in the drivers/lcd directory:
|
||||
st7567.c. LCD Display Module, ST7567, Univision Technology Inc. Used
|
||||
with the LPCXpresso and Embedded Artists base board.
|
||||
|
||||
memlcd.c. Sharp Memory LCD Suite, LS013B7DH01, LS013B7DH03, etc.
|
||||
There are some more different models, they are basically controlled
|
||||
by similar logics, thus this driver can be extended. Example usage:
|
||||
|
||||
configs/maple
|
||||
|
||||
OLEDs:
|
||||
-----
|
||||
p14201.c. Driver for RiT P14201 series display with SD1329 IC
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* include/nuttx/lcd/memlcd.h
|
||||
* Common definitions for the Sharp Memory LCD driver
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_MEMLCD_H
|
||||
#define __INCLUDE_NUTTX_MEMLCD_H
|
||||
|
||||
/*******************************************************************************
|
||||
* Included Files
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
# define EXTERN extern
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* Pre-processor Definitions
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Public Types
|
||||
******************************************************************************/
|
||||
|
||||
/* A reference to a structure of this type must be passed to the initialization
|
||||
* method. It provides some board-specific hooks used by driver to manage the
|
||||
* timer and gpio (IRQ and DISP).
|
||||
*
|
||||
* Memory for this structure is provided by the caller. It is not copied
|
||||
* by the driver and is presumed to persist while the driver is active.
|
||||
*/
|
||||
|
||||
struct memlcd_priv_s
|
||||
{
|
||||
/* IRQ/GPIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the Memory LCD driver from differences in GPIO
|
||||
* interrupt handling by varying boards and MCUs.
|
||||
*
|
||||
* irqattach - Attach the driver interrupt handler to the GPIO interrupt
|
||||
* If isr is NULL, detach and disable it.
|
||||
* dispcontrol - Enable or disable the DISP pin and EXTCOMIN interrupt.
|
||||
* setpolarity - Board specified method to set EXTCOMIN.
|
||||
* Needed only when CONFIG_MEMLCD_EXTCOMIN_MODE_HW is not set.
|
||||
* setvcomfreq - Set timer frequency for EXTCOMIN.
|
||||
*/
|
||||
|
||||
int (*attachirq) (xcpt_t isr);
|
||||
void (*dispcontrol) (bool on);
|
||||
#ifndef CONFIG_MEMLCD_EXTCOMIN_MODE_HW
|
||||
void (*setpolarity) (bool pol);
|
||||
#endif
|
||||
void (*setvcomfreq) (unsigned int freq);
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
* Public Data
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Public Function Prototypes
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Name: memlcd_initialize
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Input Parameters:
|
||||
*
|
||||
* spi - A reference to the SPI driver instance.
|
||||
* devno - A value in the range of 0 throuh CONFIG_MEMLCD_NINTERFACES-1.
|
||||
* This allows support for multiple devices.
|
||||
* memlcd_priv_s - Board specific structure
|
||||
*
|
||||
* Returned Value:
|
||||
*
|
||||
* On success, this function returns a reference to the LCD object for the
|
||||
* specified LCD. NULL is returned on any failure.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct lcd_dev_s; /* see nuttx/lcd.h */
|
||||
struct spi_dev_s; /* see nuttx/spi/spi.h */
|
||||
FAR struct lcd_dev_s *memlcd_initialize(FAR struct spi_dev_s *spi,
|
||||
FAR struct memlcd_priv_s *priv,
|
||||
unsigned int devno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_MEMLCD_H */
|
||||
Reference in New Issue
Block a user