SSD1351 driver: add 8-bit parallel interface

This commit is contained in:
Paul A. Patience
2015-09-06 12:08:38 -04:00
parent 7d33e858dd
commit c080146748
3 changed files with 236 additions and 255 deletions
+9
View File
@@ -378,6 +378,11 @@ choice
prompt "Interface"
default SSD1351_SPI4WIRE
config SSD1351_PARALLEL8BIT
bool "8-bit Parallel Interface"
---help---
Enables support for the 8-bit parallel interface.
config SSD1351_SPI3WIRE
bool "3-wire SPI Interface"
select SPI
@@ -393,6 +398,8 @@ config SSD1351_SPI4WIRE
endchoice
if SSD1351_SPI3WIRE || SSD1351_SPI4WIRE
config SSD1351_SPIMODE
int "SPI Mode"
default 0
@@ -406,6 +413,8 @@ config SSD1351_SPIFREQ
---help---
Specifies the SPI frequency.
endif
config SSD1351_NINTERFACES
int "Number of SSD1351 Devices"
default 1
+209 -255
View File
File diff suppressed because it is too large Load Diff
+18
View File
@@ -51,6 +51,7 @@
/* Configuration ************************************************************/
/* SSD1351 configuration settings:
* CONFIG_SSD1351_PARALLEL8BIT - 8-bit parallel interface
* CONFIG_SSD1351_SPI3WIRE - 3-wire SPI interface
* CONFIG_SSD1351_SPI4WIRE - 4-wire SPI interface
* CONFIG_SSD1351_SPIMODE - SPI mode
@@ -98,7 +99,18 @@
* Public Types
****************************************************************************/
#ifdef CONFIG_SSD1351_PARALLEL8BIT
struct ssd1351_lcd_s
{
void (*cmd)(FAR struct ssd1351_lcd_s *lcd, uint8_t cmd);
#ifndef CONFIG_LCD_NOGETRUN
uint8_t (*read)(FAR struct ssd1351_lcd_s *lcd);
#endif
void (*write)(FAR struct ssd1351_lcd_s *lcd, uint8_t data);
};
#elif defined(CONFIG_SSD1351_SPI3WIRE) || defined(CONFIG_SSD1351_SPI4WIRE)
struct spi_dev_s;
#endif
/****************************************************************************
* Public Function Prototypes
@@ -118,6 +130,7 @@ extern "C"
* but with the power setting at 0 (full off == sleep mode).
*
* Input Parameters:
* lcd - A reference to the platform-specific interface.
* spi - A reference to the SPI driver instance.
* devno - A value in the range of 0 through CONFIG_SSD1351_NINTERFACES-1.
* This allows support for multiple devices.
@@ -128,8 +141,13 @@ extern "C"
*
****************************************************************************/
#ifdef CONFIG_SSD1351_PARALLEL8BIT
FAR struct lcd_dev_s *ssd1351_initialize(FAR struct ssd1351_lcd_s *lcd,
unsigned int devno);
#elif defined(CONFIG_SSD1351_SPI3WIRE) || defined(CONFIG_SSD1351_SPI4WIRE)
FAR struct lcd_dev_s *ssd1351_initialize(FAR struct spi_dev_s *spi,
unsigned int devno);
#endif
#ifdef __cplusplus
}