drivers/lcd: ssd1306: cleanup to comments, README, nxstyle issues

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
This commit is contained in:
Juha Niskanen
2020-10-28 19:28:30 -07:00
committed by Xiang Xiao
parent bdb398fa8c
commit d53abbc4ac
4 changed files with 294 additions and 236 deletions
-8
View File
@@ -356,14 +356,6 @@ config SSD1306_FREQUENCY
---help---
Selects the SPI bus frequency used with the SSD1306 device
#config SSD1306_NINTERFACES
# int "Number of SSD1306 Devices"
# default 1
# ---help---
# Specifies the number of physical SSD1306 devices that will be
# supported. NOTE: At present, this must be undefined or defined to
# be 1.
endif # LCD_SSD1306_SPI
if LCD_SSD1306_I2C
+10 -8
View File
@@ -35,7 +35,7 @@ LCD Header files
int (*getvideoinfo)(FAR struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo);
int (*getplaneinfo)(FAR struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo);
FAR struct lcd_planeinfo_s *pinfo);
- The following are provided only if the video hardware supports RGB
color mapping:
@@ -103,14 +103,14 @@ Re-usable LCD drivers reside in the drivers/lcd directory:
ssd12989.c. Generic LCD driver for LCDs based on the Solomon Systech
SSD1289 LCD controller. Think of this as a template for an LCD driver
that you will probably have to customize for any particular LCD
hardware. (see also boards/arm/stm32/hymini-stm32v/src/ssd1289.c below).
hardware. (See also boards/arm/stm32/hymini-stm32v/src/ssd1289.c below).
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:
by similar logics, thus this driver can be extended.
ra8875.c. RAiO Technologies RA8875 LCD controller. Contributed by
Marten Svanfeldt.
@@ -120,7 +120,7 @@ Re-usable LCD drivers reside in the drivers/lcd directory:
p14201.c. Driver for RiT P14201 series display with SD1329 IC
controller. Based on the SD1329 controller. This OLED is used with
older versions of the TI/Luminary LM3S8962 Evaluation Kit. Example
usage
usage:
boards/arm/tiva/lm3s6965-ek/src
boards/arm/tiva/lm3s8962-ek/src
@@ -138,9 +138,11 @@ Re-usable LCD drivers reside in the drivers/lcd directory:
boards/arm/lpc71xx_40xx/lpcxpresso-lpc1768
ssd1306.c. OLED Display Modules based on the SSD1306 controllers.
This includes the UG-2864HSWEG01 and UG2832HSWEG04, Both from Univision
This includes the UG-2864HSWEG01 and UG2832HSWEG04, both from Univision
Technology Inc. The latter is used with the OLED1 module that comes
with the Atmel SAM4l Xplained Pro board. Example usage:
with the Atmel SAM4l Xplained Pro board. This driver also supports
Densitron Technologies DD-12864WO-4A which is based on SSD1309 LCD
controller. Example usage:
boards/arm/stm32/stm32f4discovery
boards/arm/sam34/sam4l-xplained
@@ -220,7 +222,7 @@ interface) that makes then less re-usable:
boards/arm/stm32/stm32f4discovery/src/stm32_ug2864ambag01.c
boards/arm/stm32/stm32f4discovery/src/stm32_ug2864hsweg01.c
boards/arm/sam34/sam4l-xplained/src/sa,_ug2832hsweg04.c
boards/arm/sam34/sam4l-xplained/src/sam_ug2832hsweg04.c
boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c
LCD controllers built-into the MCU:
@@ -231,7 +233,7 @@ interface) that makes then less re-usable:
boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c. 1x6 segment LCD with
bars using the segment LCD controller built-into the STM32L15X.
Alphnumeric/segment LCD Displays:
Alphanumeric/segment LCD Displays:
boards/renesas/m16c/skp16c26/src/m16c_lcd.c. Untested alphanumeric
LCD driver.
+32 -35
View File
@@ -1,4 +1,4 @@
/**************************************************************************************
/****************************************************************************
* drivers/lcd/ssd1306.h
*
* Copyright (C) 2015 Alan Carvalho de Assis
@@ -31,14 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************************/
****************************************************************************/
#ifndef __DRIVERS_LCD_SSD1306_H
#define __DRIVERS_LCD_SSD1306_H
/**************************************************************************************
/****************************************************************************
* Included Files
**************************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -48,24 +48,18 @@
#include <nuttx/lcd/lcd.h>
#include <nuttx/lcd/ssd1306.h>
/**************************************************************************************
/****************************************************************************
* Pre-processor Definitions
**************************************************************************************/
/* Configuration **********************************************************************/
****************************************************************************/
/* Configuration ************************************************************/
/* Limitations of the current configuration that I hope to fix someday */
#ifndef CONFIG_SSD1306_NINTERFACES
# define CONFIG_SSD1306_NINTERFACES 1
#endif
#if CONFIG_SSD1306_NINTERFACES != 1
# warning "This implementation supports only a single SSD1306 device"
# undef CONFIG_SSD1306_NINTERFACES
# define CONFIG_SSD1306_NINTERFACES 1
#endif
#if !defined(CONFIG_LCD_SH1106_OLED_132) && !defined(CONFIG_LCD_UG2864HSWEG01) && \
!defined(CONFIG_LCD_UG2832HSWEG04) && !defined(CONFIG_LCD_DD12864WO4A) && \
#if !defined(CONFIG_LCD_SH1106_OLED_132) && \
!defined(CONFIG_LCD_UG2864HSWEG01) && \
!defined(CONFIG_LCD_UG2832HSWEG04) && \
!defined(CONFIG_LCD_DD12864WO4A) && \
!defined(CONFIG_LCD_HILETGO)
# error "Unknown and unsupported SSD1306 LCD"
#endif
@@ -79,15 +73,15 @@
# undef CONFIG_LCD_RPORTRAIT
#endif
/**************************************************************************************
/****************************************************************************
* Pre-processor Definitions
**************************************************************************************/
****************************************************************************/
#ifndef CONFIG_NX_BGCOLOR
# define CONFIG_NX_BGCOLOR SSD1306_Y1_BLACK
#endif
/* SSD1306 Commands *******************************************************************/
/* SSD1306 Commands *********************************************************/
#define SSD1306_SETCOLL(ad) (0x00 | ((ad) & 0x0f)) /* Set Lower Column Address: (00h - 0fh) */
#define SSD1306_SETCOLH(ad) (0x10 | ((ad) & 0x0f)) /* Set Higher Column Address: (10h - 1fh) */
@@ -144,11 +138,13 @@
#define SSD1309_SETMEMORY (0x20)
# define SSD1309_MEMADDR(ma) ((ma) & 0x03)
/* Color Properties *******************************************************************/
/* Color Properties *********************************************************/
/* Display Resolution
*
* The SSD1306 display controller can handle a resolution of 132x64. The UG-2864HSWEG01
* on the base board is 128x64; the UG-2832HSWEG04 is 128x32.
* The SSD1306 display controller can handle a resolution of 132x64.
* The UG-2864HSWEG01 on the base board is 128x64; the UG-2832HSWEG04
* is 128x32.
*/
#if defined(CONFIG_LCD_UG2864HSWEG01)
@@ -268,9 +264,9 @@
#define LS_BIT (1 << 0)
#define MS_BIT (1 << 7)
/**************************************************************************************
/****************************************************************************
* Public Type Definition
**************************************************************************************/
****************************************************************************/
/* This structure describes the state of the SSD1306 driver */
@@ -292,26 +288,27 @@ struct ssd1306_dev_s
FAR const struct ssd1306_priv_s *board_priv; /* Board specific structure */
/* The SSD1306 does not support reading from the display memory in SPI mode.
* Since there is 1 BPP and access is byte-by-byte, it is necessary to keep
* a shadow copy of the framebuffer memory. At 128x64, this amounts to 1KB.
*/
/* The SSD1306 does not support reading from the display memory in SPI
* mode. Since there is 1 BPP and access is byte-by-byte, it is necessary
* to keep a shadow copy of the framebuffer memory. At 128x64, this
* amounts to 1 KB.
*/
uint8_t fb[SSD1306_DEV_FBSIZE];
};
/**************************************************************************************
/****************************************************************************
* Public Function Prototypes
**************************************************************************************/
****************************************************************************/
int ssd1306_sendbyte(FAR struct ssd1306_dev_s *priv, uint8_t regval);
int ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len);
int ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data,
uint8_t len);
#ifdef CONFIG_LCD_SSD1306_SPI
void ssd1306_select(FAR struct ssd1306_dev_s *priv, bool cs);
void ssd1306_cmddata(FAR struct ssd1306_dev_s *priv, bool cmd);
void ssd1306_configspi(FAR struct spi_dev_s *spi);
#else
# define ssd1306_select(priv, cs)
# define ssd1306_cmddata(priv, cmd)
+252 -185
View File
File diff suppressed because it is too large Load Diff