diff --git a/configs/README.txt b/configs/README.txt index 6eae21fcffe..8a1b1a020da 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -359,10 +359,11 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_P14201_FRAMEBUFFER - If defined, accesses will be performed using an in-memory copy of the OLEDs GDDRAM. This cost of this buffer is 128 * 96 / 2 = 6Kb. If this is defined, then the driver - will be fully functioned. If not, then it will have the following + will be fully functional. If not, then it will have the following limitations: - Reading graphics memory cannot be supported, and - All pixel writes must be aligned to byte boundaries. + The latter limitation effectively reduces the 128x96 disply to 64x96. ENC28J60 Ethernet Driver Configuration Settings: CONFIG_NET_ENC28J60 - Enabled ENC28J60 support diff --git a/configs/lm3s6965-ek/nx/defconfig b/configs/lm3s6965-ek/nx/defconfig index 14e7338c839..2b425b4e239 100755 --- a/configs/lm3s6965-ek/nx/defconfig +++ b/configs/lm3s6965-ek/nx/defconfig @@ -576,6 +576,27 @@ CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 +# RiT P14201 OLED Driver Configuration +# +# CONFIG_LCD_P14201 - Enable P14201 support +# CONFIG_P14201_SPIMODE - Controls the SPI mode +# CONFIG_P14201_FREQUENCY - Define to use a different bus frequency +# CONFIG_P14201_NINTERFACES - Specifies the number of physical P14201 devices that +# will be supported. +# CONFIG_P14201_FRAMEBUFFER - If defined, accesses will be performed using an in-memory +# copy of the OLEDs GDDRAM. This cost of this buffer is 128 * 96 / 2 = 6Kb. If this +# is defined, then the driver will be fully functional. If not, then it will have the +# following limitations: +# - Reading graphics memory cannot be supported, and +# - All pixel writes must be aligned to byte boundaries. +# +# The latter limitation effectively reduces the 128x96 disply to 64x96. +CONFIG_LCD_P14201=y +CONFIG_P14201_SPIMODE=0 +CONFIG_P14201_FREQUENCY=20000000 +CONFIG_P14201_NINTERFACES=1 +CONFIG_P14201_FRAMEBUFFER=y + # # Settings for examples/uip # @@ -708,6 +729,7 @@ CONFIG_EXAMPLES_NX_STACKSIZE=2048 CONFIG_EXAMPLES_NX_CLIENTPRIO=80 CONFIG_EXAMPLES_NX_SERVERPRIO=120 CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 +CONFIG_EXAMPLES_NX_EXTERNINIT=y # # Stack and heap information diff --git a/configs/lm3s6965-ek/src/lm3s6965ek_internal.h b/configs/lm3s6965-ek/src/lm3s6965ek_internal.h index 17a791ea4a3..2b7514c21ea 100755 --- a/configs/lm3s6965-ek/src/lm3s6965ek_internal.h +++ b/configs/lm3s6965-ek/src/lm3s6965ek_internal.h @@ -126,18 +126,6 @@ extern void weak_function lm3s_ssiinitialize(void); -/************************************************************************************ - * Name: lm3s_oledinitialize - * - * Description: - * Called to configure OLED. - * - ************************************************************************************/ - -#ifdef CONFIG_NX_LCDDRIVER -extern void lm3s_oledinitialize(void); -#endif - #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_LM3S6965_EK_SRC_LM3S6965EK_INTERNAL_H */ diff --git a/configs/lm3s6965-ek/src/up_boot.c b/configs/lm3s6965-ek/src/up_boot.c index d4ab263d587..2a3d5938983 100755 --- a/configs/lm3s6965-ek/src/up_boot.c +++ b/configs/lm3s6965-ek/src/up_boot.c @@ -81,12 +81,6 @@ void lm3s_boardinitialize(void) { lm3s_ssiinitialize(); } - - /* Configure the OLED for use */ - -#ifdef CONFIG_NX_LCDDRIVER - lm3s_oledinitialize(); -#endif #endif /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/lm3s6965-ek/src/up_oled.c b/configs/lm3s6965-ek/src/up_oled.c index e79b08b3479..17b9c223285 100755 --- a/configs/lm3s6965-ek/src/up_oled.c +++ b/configs/lm3s6965-ek/src/up_oled.c @@ -59,17 +59,17 @@ ****************************************************************************/ /************************************************************************************ - * Name: lm3s_oledinitialize + * Name: up_nxdrvinit * * Description: - * Called to configure OLED. + * Called NX initialization logic to configure the OLED. * ************************************************************************************/ -void lm3s_oledinitialize(void) +FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno) { FAR struct spi_dev_s *spi; - int ret; + FAR struct lcd_dev_s *dev; /* Configure the OLED D/Cn GPIO */ @@ -86,16 +86,18 @@ void lm3s_oledinitialize(void) { /* Bind the SPI port to the OLED */ - ret = rit_initialize(spi, 0); - if (ret < 0) + dev = rit_initialize(spi, devno); + if (!dev) { - glldbg("Failed to bind SPI port 0 to OLED: %d\n", ret); + glldbg("Failed to bind SPI port 0 to OLED %d: %d\n", ret, devno); } else { - gllvdbg("Bound SPI port 0 to OLED\n"); + gllvdbg("Bound SPI port 0 to OLED %d\n", devno); + return dev; } } + return NULL; } /**************************************************************************************