A board support package for the LPC4088 Display Module.

Dependencies:   DM_HttpServer DM_USBHost

Dependents:   lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more

Fork of DMSupport by EmbeddedArtists AB

Files at this revision

API Documentation at this revision

Comitter:
alindvall
Date:
Tue Apr 28 11:47:20 2015 +0000
Parent:
38:420cdc281467
Child:
40:6df4f63aa406
Commit message:
Added display frame rate setting. Updated used libraries.

Changed in this revision

Bios/bios.h Show annotated file Show diff for this revision Revisions of this file
Display/BiosDisplay.cpp Show annotated file Show diff for this revision Revisions of this file
Display/BiosDisplay.h Show annotated file Show diff for this revision Revisions of this file
Display/Display.h Show annotated file Show diff for this revision Revisions of this file
USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
--- a/Bios/bios.h	Wed Apr 15 09:41:56 2015 +0200
+++ b/Bios/bios.h	Tue Apr 28 11:47:20 2015 +0000
@@ -5,7 +5,7 @@
 #include <stdbool.h>
 
 #define BIOS_MAGIC  0xEA0123EA
-#define BIOS_VER      0x000200  // MAJOR.MINOR.BUILD
+#define BIOS_VER      0x000500  // MAJOR.MINOR.BUILD
 #define BIOS_VER_MASK 0xffffff
 
 typedef enum {
@@ -26,6 +26,12 @@
     Res_24bit_rgb888 = 1<<2,
 } Resolution_t;
 
+typedef enum {
+    FrameRate_Low,
+    FrameRate_Normal,
+    FrameRate_High,
+} FrameRate_t;
+
 typedef struct {
     uint16_t x;
     uint16_t y;
@@ -46,7 +52,7 @@
 typedef BiosError_t (*simpleFunc)(void* data);
 typedef BiosError_t (*macFunc)(void* data, char* mac);
 
-typedef BiosError_t (*powerUpFunc)(void* data, void* framebuffer, Resolution_t wanted);
+typedef BiosError_t (*powerUpFunc)(void* data, void* framebuffer, Resolution_t res, FrameRate_t rate);
 typedef BiosError_t (*backlightFunc)(void* data, int percent);
 typedef BiosError_t (*infoFuncD)(void* data,
                                  uint16_t* width,
--- a/Display/BiosDisplay.cpp	Wed Apr 15 09:41:56 2015 +0200
+++ b/Display/BiosDisplay.cpp	Tue Apr 28 11:47:20 2015 +0000
@@ -85,14 +85,14 @@
   return err;
 }
 
-BiosDisplay::DisplayError BiosDisplay::powerUp(void* framebuffer, Display::Resolution wanted)
+BiosDisplay::DisplayError BiosDisplay::powerUp(void* framebuffer, Display::Resolution res, FrameRate_t rate)
 {
   DisplayError err = DisplayError_Ok;
   if (!_poweredOn) {
     err = init();
     if (err == DisplayError_Ok) {
       do {
-        err = (DisplayError)_bios->displayPowerUp(_biosData, framebuffer, (Resolution_t)wanted);
+        err = (DisplayError)_bios->displayPowerUp(_biosData, framebuffer, (Resolution_t)res, rate);
           
         if (err != DisplayError_Ok) {
           break;
@@ -159,7 +159,7 @@
 void* BiosDisplay::allocateFramebuffer(Display::Resolution res)
 {
   if (_initialized) {
-    return malloc(fbSize());
+    return malloc(_width*_height*bpp(res));
   }
   return NULL;
 }
@@ -167,7 +167,7 @@
 void* BiosDisplay::allocateFramebuffers(uint32_t num, Display::Resolution res)
 {
   if (_initialized && num>0) {
-    return malloc(fbSize()*num);
+    return malloc(_width*_height*bpp(res)*num);
   }
   return NULL;
 }
@@ -193,4 +193,3 @@
 {
   return (Resolution)_activeRes;
 }
-
--- a/Display/BiosDisplay.h	Wed Apr 15 09:41:56 2015 +0200
+++ b/Display/BiosDisplay.h	Tue Apr 28 11:47:20 2015 +0000
@@ -48,7 +48,7 @@
     DisplayError init();
   
     // From the Display interface
-    virtual DisplayError powerUp(void* framebuffer, Resolution wanted = Resolution_16bit_rgb565);
+    virtual DisplayError powerUp(void* framebuffer, Resolution wanted = Resolution_16bit_rgb565, FrameRate_t rate = FrameRate_Normal);
     virtual DisplayError powerDown();
     virtual DisplayError backlight(int percent);
     virtual uint16_t width();
@@ -84,6 +84,8 @@
     // hide assign operator
     BiosDisplay& operator=(const BiosDisplay&);
     ~BiosDisplay();
+
+    uint32_t bpp(Resolution res) { return ((res == Resolution_16bit_rgb565) ? 2 : 4); }
 };
 
 #endif /* BIOSDISPLAY_H */
--- a/Display/Display.h	Wed Apr 15 09:41:56 2015 +0200
+++ b/Display/Display.h	Tue Apr 28 11:47:20 2015 +0000
@@ -75,11 +75,15 @@
     
     /** Turns the display on with the specified framebuffer showing
      *
+     *  @param framebuffer  the data to show
+     *  @param res          the resolution to use
+     *  @param rate         the frame rate to use
+     *
      *  @returns
      *       Ok on success
      *       An error code on failure
      */
-    virtual DisplayError powerUp(void* framebuffer, Resolution wanted = Resolution_16bit_rgb565) = 0;
+    virtual DisplayError powerUp(void* framebuffer, Resolution res = Resolution_16bit_rgb565, FrameRate_t rate = FrameRate_Normal) = 0;
   
     /** Turns the display off
      *
@@ -91,18 +95,54 @@
   
     /** Sets the backlight level. 0% is off and 100% is fully on
      *
+     *  @param percent   backlight in %
+     *
      *  @returns
      *       Ok on success
      *       An error code on failure
      */
     virtual DisplayError backlight(int percent) = 0;
   
+    /** Returns the width (in pixels) of the display
+     *
+     *  @returns the display width
+     */
     virtual uint16_t width() = 0;
+
+    /** Returns the height (in pixels) of the display
+     *
+     *  @returns the display height
+     */
     virtual uint16_t height() = 0;
+
+    /** Returns the number of bytes used by each pixel
+     *
+     *  @returns bytes per pixel
+     */
     virtual uint16_t bytesPerPixel() = 0;
+
+    /** Returns the number of bytes used for each frame buffer
+     *
+     *  @returns width*height*bytesPerPixel
+     */
     virtual uint32_t fbSize() = 0;
+
+    /** Returns the display orientation
+     *
+     *  @returns the display orientation
+     */
     virtual bool landscape() = 0;
+
+    /** Returns true if the specified resolution can be used
+     *
+     *  @returns true if supported, false if not
+     */
     virtual bool isSupported(Resolution res) = 0;
+
+    /** Returns the current resolution
+     *
+     *  @returns the current resolution
+     */
     virtual Resolution currentResolution() = 0;
     
     /** Replaces the current framebuffer.
--- a/USBDevice.lib	Wed Apr 15 09:41:56 2015 +0200
+++ b/USBDevice.lib	Tue Apr 28 11:47:20 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/USBDevice/#0f216c4e75e5
+http://mbed.org/users/mbed_official/code/USBDevice/#deafa44182d9
--- a/mbed-rtos.lib	Wed Apr 15 09:41:56 2015 +0200
+++ b/mbed-rtos.lib	Tue Apr 28 11:47:20 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#d3d0e710b443
+http://mbed.org/users/mbed_official/code/mbed-rtos/#899aee34da6a
--- a/mbed-src.lib	Wed Apr 15 09:41:56 2015 +0200
+++ b/mbed-src.lib	Tue Apr 28 11:47:20 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-src/#f0fe52f5109e
+http://mbed.org/users/mbed_official/code/mbed-src/#aee49fe30179