Port of the LPC4088 QSB EA LCD Sphere Demo to the LPC4088 DM using the DMSupport lib. Dropping the QSB EALib

Dependencies:   DMBasicGUI DMSupport

Fork of lpc4088_displaymodule_hello_world by Embedded Artists

Just a quick hack to get something good looking on the LPC4088DM

/media/uploads/tecnosys/lpc4088dm.jpg

Files at this revision

API Documentation at this revision

Comitter:
embeddedartists
Date:
Wed Jan 28 15:16:25 2015 +0000
Child:
1:00c54e50014c
Commit message:
First version

Changed in this revision

DMBasicGUI.lib Show annotated file Show diff for this revision Revisions of this file
DMSupport.lib Show annotated file Show diff for this revision Revisions of this file
dm_board_config.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DMBasicGUI.lib	Wed Jan 28 15:16:25 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/embeddedartists/code/DMBasicGUI/#651861441108
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DMSupport.lib	Wed Jan 28 15:16:25 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/embeddedartists/code/DMSupport/#a97015441bb4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dm_board_config.h	Wed Jan 28 15:16:25 2015 +0000
@@ -0,0 +1,37 @@
+/*
+ *  Copyright 2014 Embedded Artists AB
+ *
+ *  Licensed 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.
+ */
+
+#ifndef DM_BOARD_CONFIG_H
+#define DM_BOARD_CONFIG_H
+
+// Template to use for the project-specific settings. Copy this file to your project,
+// rename it to dm_board_config.h and uncomment the wanted features below:
+
+// #define DM_BOARD_USE_USB_DEVICE
+// #define DM_BOARD_USE_USB_HOST
+// #define DM_BOARD_USE_MCI_FS
+// #define DM_BOARD_USE_QSPI_FS
+// #define DM_BOARD_USE_QSPI
+#define DM_BOARD_USE_DISPLAY
+#define DM_BOARD_USE_TOUCH
+// #define DM_BOARD_USE_ETHERNET
+#define DM_BOARD_USE_FAST_UART
+// #define DM_BOARD_DISABLE_STANDARD_PRINTF
+// #define DM_BOARD_ENABLE_MEASSURING_PINS
+// #define DM_BOARD_BIOS_DEVELOPMENT
+#define DM_BOARD_USE_REGISTRY
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 28 15:16:25 2015 +0000
@@ -0,0 +1,58 @@
+#include "mbed.h"
+#include "DMBoard.h"
+#include "lpc_swim.h"
+#include "lpc_swim_font.h"
+
+int main()
+{
+  DMBoard::BoardError err;
+  DMBoard* board = &DMBoard::instance();
+  RtosLog* log = board->logger();
+  Display* disp = board->display();
+  
+  do {
+    err = board->init();
+    if (err != DMBoard::Ok) {
+      log->printf("Failed to initialize the board, got error %d\r\n", err);
+      break;
+    }
+    
+    log->printf("\n\nHello World!\n\n");
+    
+    SWIM_WINDOW_T win;
+    void* fb = disp->allocateFramebuffer();
+    if (fb == NULL) {
+      log->printf("Failed to allocate memory for a frame buffer\r\n");
+      err = DMBoard::MemoryError;
+      break;
+    }
+    
+    // Prepare fullscreen
+    swim_window_open(&win, 
+                     disp->width(), disp->height(),         // full size
+                     (COLOR_T*)fb,
+                     0,0,disp->width()-1, disp->height()-1, // window position and size
+                     1,                                     // border
+                     WHITE, BLUE, BLACK);                   // colors: pen, backgr, forgr
+    swim_set_title(&win, "My Program", BLACK);
+  
+    // Message
+    swim_put_text_xy(&win, "Hello World!", 100, 100);
+    
+    // Start display in default mode (16-bit)
+    Display::DisplayError disperr = disp->powerUp(fb);
+    if (disperr != Display::DisplayError_Ok) {
+      log->printf("Failed to initialize the display, got error %d\r\n", disperr);
+      break;
+    }
+  } while(false);
+
+  if (err != DMBoard::Ok) {
+    log->printf("\nTERMINATING\n");
+    wait_ms(2000); // allow RtosLog to flush messages
+    mbed_die();
+  }  
+
+  while(true) {
+  }   
+}