Skip to content

Commit

Permalink
add ssd1351 video display to somax_ui
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkcass committed Oct 16, 2018
1 parent 519e5cb commit 08242a8
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 4 deletions.
3 changes: 3 additions & 0 deletions somax_ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ OBJECT_FILES = somaxui_main.o \
inputmixer.o \
inputsource.o \
inputevent.o \
gpio_interface.o \
spi_interface.o \
color_oled.o \


SRC_DIR = src
Expand Down
9 changes: 7 additions & 2 deletions somax_ui/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ at boot.
#
**Status**

* October 15, 2018 - started to add the video display for the ssd1351. realized this
is a good opportunity to abstract the SPI and GPIO interfaces. the framework for
GPIO is done as is the implementation. The SPI interface has a framework and the
implementation is about half way done.
* October 14, 2018 - created framework for input mixer and supporting classes. created video
composer and supporting classes framework. created the first ui class ui_menu.
* October 12, 2018 - created project and copied in old 3d joystick functionality.
Created and installed systemd service to start application at boot. currently,
only joy3d-control-gimbal and joy3d-thermal-view are enabled. joy3d-gimbal-control
is ready for use. joy3d-thermal-view is in development and should be ready by
10/15/2018.
* October 14, 2018 - created framework for input mixer and supporting classes. created video
composer and supporting classes framework. created the first ui class ui_menu.



11 changes: 9 additions & 2 deletions somax_ui/src/videodisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//------------------------------------------------------------------------------
#include "somax.h"
#include "videodisplay.h"
#include "videodisplay_ssd1351.h"
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//CONSTANTS
Expand All @@ -24,6 +25,12 @@
//DATA STRUCTURES
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
struct SSD1351_DRIVER
{
ssd1351_context ssd351;

};

struct VIDDISP_CONTEXT
{
int context_slot;
Expand Down Expand Up @@ -57,8 +64,8 @@ static struct VIDDISP_PROPS display_properties[VIDDISP_NUM_DISPLAYS+1] =
{
"FRAME-PRIMARY",
VIDDISP_DEVICEID_OLED1500RGB565,
128,
128,
SSD1351_WIDTH,
SSD1351_HEIGHT,
PIXBUF_FORMATID_RGB565,
},
{
Expand Down
Empty file.
36 changes: 36 additions & 0 deletions somax_ui/src/videodisplay_ssd1351.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef __videodisplay_ssd1351_h__
#define __videodisplay_ssd1351_h__
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// author: mark cass
// project: somax personal AI
// project url: https://mechanizedai.com
// license: open source and free for all uses without encumbrance.
//
// FILE: color_oled.h
// DESCRIPTION: driver for color oled display
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#include "somax.h"

#define SSD1351_NUM_DISPLAYID 1
#define SSD1351_DISPLAYID_OLED15 1

#define SSD1351_CONTEXT_NULL 0

#define SSD1351_WIDTH 128
#define SSD1351_HEIGHT 128
#define SSD1351_BYTES_PER_PIXEL 2
#define SSD1351_FRAMEBUFFER_SIZE_BYTES 32768

typedef int ssd1351_displayid;
struct SSD1351_CONTEXT;
typedef struct SSD1351_CONTEXT* ssd1351_context;

typedef smx_byte ssd1351_frame_buffer[SSD1351_FRAMEBUFFER_SIZE_BYTES];

ssd1351_context ssd1351_open(ssd1351_displayid id);
void ssd1351_close(ssd1351_context camt);
void ssd1351_display_buffer(ssd1351_context display, ssd1351_frame_buffer buffer);

#endif

0 comments on commit 08242a8

Please sign in to comment.