forked from apache/nuttx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to transparent OLED SSD1309
This patch adds support to transparent OLED powered by SSD1309. SSD1309 uses the driver from SSD1306. Signed-off-by: Alan C. Assis <[email protected]>
- Loading branch information
1 parent
1cacc70
commit 8d7d687
Showing
8 changed files
with
447 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
boards/arm/stm32/stm32f401rc-rs485/configs/ssd1309/defconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# | ||
# This file is autogenerated: PLEASE DO NOT EDIT IT. | ||
# | ||
# You can use "make menuconfig" to make any modifications to the installed .config file. | ||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your | ||
# modifications. | ||
# | ||
# CONFIG_ARCH_FPU is not set | ||
# CONFIG_NSH_ARGCAT is not set | ||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set | ||
CONFIG_ARCH="arm" | ||
CONFIG_ARCH_BOARD="stm32f401rc-rs485" | ||
CONFIG_ARCH_BOARD_COMMON=y | ||
CONFIG_ARCH_BOARD_STM32F401RC_RS485=y | ||
CONFIG_ARCH_BUTTONS=y | ||
CONFIG_ARCH_CHIP="stm32" | ||
CONFIG_ARCH_CHIP_STM32=y | ||
CONFIG_ARCH_CHIP_STM32F401RC=y | ||
CONFIG_ARCH_INTERRUPTSTACK=2048 | ||
CONFIG_ARCH_IRQBUTTONS=y | ||
CONFIG_ARCH_STACKDUMP=y | ||
CONFIG_BOARDCTL_USBDEVCTRL=y | ||
CONFIG_BOARD_LATE_INITIALIZE=y | ||
CONFIG_BOARD_LOOPSPERMSEC=8499 | ||
CONFIG_BUILTIN=y | ||
CONFIG_CDCACM=y | ||
CONFIG_CDCACM_CONSOLE=y | ||
CONFIG_DRIVERS_VIDEO=y | ||
CONFIG_EXAMPLES_BUTTONS=y | ||
CONFIG_EXAMPLES_BUTTONS_NAME0="SW3" | ||
CONFIG_EXAMPLES_BUTTONS_NAME1="SW4" | ||
CONFIG_EXAMPLES_BUTTONS_NAME2="SW5" | ||
CONFIG_EXAMPLES_BUTTONS_NAMES=y | ||
CONFIG_EXAMPLES_BUTTONS_QTD=3 | ||
CONFIG_EXAMPLES_FB=y | ||
CONFIG_FS_PROCFS=y | ||
CONFIG_HAVE_CXX=y | ||
CONFIG_HAVE_CXXINITIALIZE=y | ||
CONFIG_INIT_ENTRYPOINT="nsh_main" | ||
CONFIG_INPUT=y | ||
CONFIG_INPUT_BUTTONS=y | ||
CONFIG_INPUT_BUTTONS_LOWER=y | ||
CONFIG_INTELHEX_BINARY=y | ||
CONFIG_LCD=y | ||
CONFIG_LCD_DD12864WO4A=y | ||
CONFIG_LCD_FRAMEBUFFER=y | ||
CONFIG_LCD_NOGETRUN=y | ||
CONFIG_NSH_ARCHINIT=y | ||
CONFIG_NSH_BUILTIN_APPS=y | ||
CONFIG_NSH_DISABLE_IFUPDOWN=y | ||
CONFIG_NSH_FILEIOSIZE=512 | ||
CONFIG_NSH_LINELEN=64 | ||
CONFIG_NSH_READLINE=y | ||
CONFIG_PREALLOC_TIMERS=4 | ||
CONFIG_RAM_SIZE=98304 | ||
CONFIG_RAM_START=0x20000000 | ||
CONFIG_RAW_BINARY=y | ||
CONFIG_RR_INTERVAL=200 | ||
CONFIG_SCHED_WAITPID=y | ||
CONFIG_START_DAY=5 | ||
CONFIG_START_MONTH=5 | ||
CONFIG_START_YEAR=2014 | ||
CONFIG_STM32_JTAG_SW_ENABLE=y | ||
CONFIG_STM32_OTGFS=y | ||
CONFIG_STM32_PWR=y | ||
CONFIG_STM32_SPI1=y | ||
CONFIG_STM32_USART6=y | ||
CONFIG_SYSTEM_NSH=y | ||
CONFIG_TASK_NAME_SIZE=0 | ||
CONFIG_USBDEV=y | ||
CONFIG_VIDEO_FB=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
boards/arm/stm32/stm32f401rc-rs485/src/stm32_lcd_ssd1306.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/**************************************************************************** | ||
* boards/arm/stm32/stm32f401rc-rs485/src/stm32_lcd_ssd1306.c | ||
* | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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. | ||
* | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
#include <stdio.h> | ||
#include <stdbool.h> | ||
#include <debug.h> | ||
#include <errno.h> | ||
|
||
#include <nuttx/arch.h> | ||
#include <nuttx/board.h> | ||
#include <nuttx/spi/spi.h> | ||
#include <nuttx/lcd/lcd.h> | ||
#include <nuttx/lcd/ssd1306.h> | ||
|
||
#include "stm32.h" | ||
#include "stm32f401rc-rs485.h" | ||
|
||
#include "stm32_ssd1306.h" | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
#define OLED_SPI_PORT 1 /* OLED display connected to SPI1 */ | ||
|
||
/**************************************************************************** | ||
* Private Data | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Public Functions | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Name: board_lcd_initialize | ||
****************************************************************************/ | ||
|
||
int board_lcd_initialize(void) | ||
{ | ||
int ret; | ||
|
||
/* Initialize the RESET and DC pins */ | ||
|
||
stm32_configgpio(GPIO_OLED_RESET); | ||
stm32_configgpio(GPIO_OLED_DC); | ||
|
||
/* Reset the OLED display */ | ||
|
||
stm32_gpiowrite(GPIO_OLED_RESET, 0); | ||
up_mdelay(1); | ||
stm32_gpiowrite(GPIO_OLED_RESET, 1); | ||
up_mdelay(120); | ||
|
||
ret = board_ssd1306_initialize(OLED_SPI_PORT); | ||
if (ret < 0) | ||
{ | ||
lcderr("ERROR: Failed to initialize SSD1306\n"); | ||
return ret; | ||
} | ||
|
||
return OK; | ||
} | ||
|
||
/**************************************************************************** | ||
* Name: board_lcd_getdev | ||
****************************************************************************/ | ||
|
||
struct lcd_dev_s *board_lcd_getdev(int devno) | ||
{ | ||
return board_ssd1306_getdev(); | ||
} | ||
|
||
/**************************************************************************** | ||
* Name: board_lcd_uninitialize | ||
****************************************************************************/ | ||
|
||
void board_lcd_uninitialize(void) | ||
{ | ||
/* TO-FIX */ | ||
} |
Oops, something went wrong.