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:
embeddedartists
Date:
Thu Dec 11 18:23:07 2014 +0000
Parent:
8:e60eb67dfc08
Child:
10:1ac4b213f0f7
Commit message:
Updated documentation

Changed in this revision

DMBoard.cpp Show annotated file Show diff for this revision Revisions of this file
DMBoard.h Show annotated file Show diff for this revision Revisions of this file
Display/AR1021.cpp Show annotated file Show diff for this revision Revisions of this file
Display/AR1021.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
Display/TouchPanel.h Show annotated file Show diff for this revision Revisions of this file
FileSystems/MCIFileSystem.cpp Show annotated file Show diff for this revision Revisions of this file
FileSystems/MCIFileSystem.h Show annotated file Show diff for this revision Revisions of this file
FileSystems/QSPIFileSystem.cpp Show annotated file Show diff for this revision Revisions of this file
FileSystems/QSPIFileSystem.h Show annotated file Show diff for this revision Revisions of this file
FileSystems/RAMFileSystem.cpp Show annotated file Show diff for this revision Revisions of this file
FileSystems/RAMFileSystem.h Show annotated file Show diff for this revision Revisions of this file
FileSystems/USBMSD_RAMFS.cpp Show annotated file Show diff for this revision Revisions of this file
FileSystems/USBMSD_RAMFS.h Show annotated file Show diff for this revision Revisions of this file
FileSystems/gpdma.cpp Show annotated file Show diff for this revision Revisions of this file
FileSystems/gpdma.h Show annotated file Show diff for this revision Revisions of this file
Memory/InternalEEPROM.cpp Show annotated file Show diff for this revision Revisions of this file
Memory/SPIFI.cpp Show annotated file Show diff for this revision Revisions of this file
Memory/SPIFI.h Show annotated file Show diff for this revision Revisions of this file
Memory/sdram.cpp Show annotated file Show diff for this revision Revisions of this file
Memory/sdram.h Show annotated file Show diff for this revision Revisions of this file
RtosLog.h Show annotated file Show diff for this revision Revisions of this file
--- a/DMBoard.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/DMBoard.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -262,10 +262,6 @@
 #if defined(DM_BOARD_USE_TOUCH)
       //if (... configuration says AR1021...) {
         _touch = new AR1021(P2_27, P2_26, P2_22, P2_23, P2_25);
-//        if (!_touch->init(Display::instance().width(), Display::instance().height())) {
-//          err = TouchError;
-//          break;
-//        }
         int att;
         for (att = 1; att <= 3; att++) {
             if (_touch->init(Display::instance().width(), Display::instance().height())) {
@@ -324,4 +320,3 @@
 { 
   return _button.read() == 0;
 }
-
--- a/DMBoard.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/DMBoard.h	Thu Dec 11 18:23:07 2014 +0000
@@ -69,13 +69,16 @@
         TouchError    =       3,
     };
     
+    /** Get the only instance of the DMBoard
+     *
+     *  @returns The DMBoard
+     */
     static DMBoard& instance()
     {
         static DMBoard singleton;
         return singleton;
     }
   
-
     /** Initializes the wanted features
      *
      *  @returns
@@ -84,6 +87,11 @@
      */
     BoardError init();
   
+    /** Controls the four LEDs on the Display Module
+     *
+     * @param led One of Led1, Led2, Led3 or Led4
+     * @param on true to turn the LED on regardless of its polarity
+     */
     void setLED(Leds led, bool on);
     
     /** Controls the buzzer
@@ -99,16 +107,37 @@
      * @param duration_ms the number of milliseconds to play or 0 for forever
      */
     void buzzer(int frequency=0, int duration_ms=0);
+    
+    /** Test if the USER button is pressed or not
+     *
+     *  @returns
+     *       True if the button is pressed, false if not
+     */
     bool buttonPressed();
     
 #if defined(DM_BOARD_USE_TOUCH)
+    /** Returns the TouchPanel interface
+     *
+     *  @returns
+     *       The touch panel
+     */
     TouchPanel* touchPanel() { return _touch; }
 #endif
 #if defined(DM_BOARD_USE_DISPLAY)
+    /** Returns the Display interface
+     *
+     *  @returns
+     *       The display
+     */
     Display* display() { return &(Display::instance()); }
 
     friend class Display;
 #endif
+    /** Returns the logger interface
+     *
+     *  @returns
+     *       The logger
+     */
     RtosLog* logger() { return &_logger; }
 
 private:
@@ -148,4 +177,3 @@
 };
 
 #endif
-
--- a/Display/AR1021.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/Display/AR1021.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -542,4 +542,3 @@
 
     }
 }
-
--- a/Display/AR1021.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/Display/AR1021.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -30,7 +30,6 @@
 class AR1021 : public TouchPanel {
 public:
 
-
     /**
      * Constructor
      *
@@ -51,7 +50,6 @@
 
 private:
 
-
     SPI _spi;
     DigitalOut _cs;
     DigitalIn _siq;
@@ -69,12 +67,9 @@
 
     int _calibPoint;
 
-
     int cmd(char cmd, char* data, int len, char* respBuf, int* respLen, bool setCsOff=true);
     int waitForCalibResponse(uint32_t timeout);
     void readTouchIrq();
-
-
 };
 
 #endif
--- a/Display/Display.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/Display/Display.h	Thu Dec 11 18:23:07 2014 +0000
@@ -19,6 +19,39 @@
 
 #include "mbed.h"
 
+/**
+ * Display example
+ *
+ * @code
+ * #include "mbed.h"
+ * #include "DMBoard.h"
+ *
+ * int main(void) {
+ *    // initialize the display
+ *    DMBoard::instance().init();
+ *
+ *    // allocate one framebuffer
+ *    Display* disp = DMBoard::instance().display();
+ *    uint16_t* fb = (uint16_t*)disp->allocateFramebuffer();
+ *    if (fb == NULL) {
+ *      DMBoard::instance().logger()->printf("Failed to allocate memory for framebuffer\r\n");
+ *      mbed_die();
+ *    }
+ *
+ *    // draw something on the framebuffer
+ *    ...
+ *
+ *    // turn on the display
+ *    disperr = disp->powerUp(fb);
+ *    if (disperr != Display::Ok) {
+ *      DMBoard::instance().logger()->printf("Failed to initialize the display, got error %d\r\n", disperr);
+ *      mbed_die();
+ *    }
+ *
+ *    ...
+ * }
+ * @endcode
+ */
 class Display {
 public:
     enum Constants {
@@ -39,6 +72,10 @@
         Resolution_24bit_rgb888 = 24,
     };
     
+    /** Get the only instance of the Display
+     *
+     *  @returns The display
+     */
     static Display& instance()
     {
         static Display singleton;
@@ -46,7 +83,7 @@
     }
   
 
-    /** Initializes the wanted features
+    /** Initializes the display but does not turn it on
      *
      *  @returns
      *       Ok on success
@@ -54,7 +91,7 @@
      */
     DisplayError init();
   
-    /** Initializes the wanted features
+    /** Turns the display on with the specified framebuffer showing
      *
      *  @returns
      *       Ok on success
@@ -62,7 +99,7 @@
      */
     DisplayError powerUp(void* framebuffer, Resolution wanted = Resolution_16bit_rgb565);
   
-    /** Initializes the wanted features
+    /** Turns the display off
      *
      *  @returns
      *       Ok on success
@@ -84,8 +121,37 @@
     uint32_t fbSize() { return _fbSize; }
     bool landscape() { return _landscape; }
     bool isSupported(Resolution res);
+    
+    /** Replaces the current framebuffer.
+     *
+     * Note that this requires the caller or someone else to have a
+     * reference to the existing framebuffer, otherwise that memory
+     * is lost.
+     *
+     *  @param buff the new framebuffer
+     */
     void setFramebuffer(void* buff);
+    
+    /** Replaces the current framebuffer with the specified one.
+     *
+     * This function as opposed to the setFramebuffer() one does return
+     * the old framebuffer. This way the caller can save the old one and
+     * then swap it back when done.
+     *
+     *  @param buff the new framebuffer
+     *  @returns the old framebuffer
+     */
     void* swapFramebuffer(void* buff);
+    
+    /** Allocate enough memory for one framebuffer
+     *
+     * This function is a to make it easier to allocate memory for framebuffers
+     * as the number of bytes needed depends on width, height and bytes per pixel.
+     *
+     * Free the allocated memory when done using the free() function.
+     *
+     *  @returns a new framebuffer or NULL if out of memory 
+     */
     void* allocateFramebuffer(Resolution res=Resolution_16bit_rgb565);
 
 private:
@@ -121,4 +187,3 @@
 };
 
 #endif
-
--- a/Display/TouchPanel.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/Display/TouchPanel.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -17,7 +17,6 @@
 #ifndef TOUCHPANEL_H
 #define TOUCHPANEL_H
 
-
 /**
  * An abstract class that represents touch panels.
  */
@@ -52,7 +51,6 @@
      */
     virtual bool read(touchCoordinate_t &coord) = 0;
 
-
     /**
      * Start to calibrate the display
      *
@@ -86,8 +84,6 @@
      * @return true if the request was successful; otherwise false
      */
     virtual bool waitForCalibratePoint(bool* morePoints, uint32_t timeout) = 0;
-
-
 };
 
 #endif
--- a/FileSystems/MCIFileSystem.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/MCIFileSystem.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -1829,4 +1829,3 @@
   }
   return Ret;
 }
-
--- a/FileSystems/MCIFileSystem.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/MCIFileSystem.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -203,4 +203,3 @@
 };
 
 #endif
-
--- a/FileSystems/QSPIFileSystem.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/QSPIFileSystem.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
--- a/FileSystems/QSPIFileSystem.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/QSPIFileSystem.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
--- a/FileSystems/RAMFileSystem.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/RAMFileSystem.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,3 +1,19 @@
+/*
+ *  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.
+ */
+
 #include "RAMFileSystem.h"
 #include "mbed_debug.h"
 
@@ -53,4 +69,3 @@
 uint64_t RAMFileSystem::disk_size() {
     return memSize;
 }
-
--- a/FileSystems/RAMFileSystem.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/RAMFileSystem.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,3 +1,19 @@
+/*
+ *  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 RAMFILESYSTEM_H
 #define RAMFILESYSTEM_H
 
@@ -50,4 +66,3 @@
 };
 
 #endif
-
--- a/FileSystems/USBMSD_RAMFS.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/USBMSD_RAMFS.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,3 +1,19 @@
+/*
+ *  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.
+ */
+
 #include "USBMSD_RAMFS.h"
 
 USBMSD_RAMFS::USBMSD_RAMFS(RAMFileSystem* ramfs, uint16_t vendor_id, uint16_t product_id, uint16_t product_release) :
--- a/FileSystems/USBMSD_RAMFS.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/USBMSD_RAMFS.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,3 +1,19 @@
+/*
+ *  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 USBMSDRAMFS_H
 #define USBMSDRAMFS_H
 
@@ -77,4 +93,3 @@
 };
 
 #endif
-
--- a/FileSystems/gpdma.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/gpdma.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -323,5 +323,3 @@
   gpdma_transfer(&cfg, ctrl_word, 0, GPDMA_CONN_SDC, GPDMA_CONN_MEMORY);
   return true;
 }
-
-
--- a/FileSystems/gpdma.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/FileSystems/gpdma.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -102,5 +102,3 @@
                              uint32_t dst,
                              uint32_t Size);
 #endif
-
-
--- a/Memory/InternalEEPROM.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/Memory/InternalEEPROM.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
--- a/Memory/SPIFI.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/Memory/SPIFI.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -255,5 +255,3 @@
   int rc = _spifi->spifi_erase(_romData, &opers);
   return translateError(rc);
 }
-
-
--- a/Memory/SPIFI.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/Memory/SPIFI.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -225,4 +225,3 @@
 };
 
 #endif
-
--- a/Memory/sdram.cpp	Thu Dec 11 11:50:29 2014 +0000
+++ b/Memory/sdram.cpp	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -592,5 +592,3 @@
 {
   okToUseSdramForHeap = false;
 }
-
-
--- a/Memory/sdram.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/Memory/sdram.h	Thu Dec 11 18:23:07 2014 +0000
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2013 Embedded Artists AB
+ *  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.
@@ -63,5 +63,3 @@
 /****************************************************************************
 **                            End Of File
 *****************************************************************************/
-
-
--- a/RtosLog.h	Thu Dec 11 11:50:29 2014 +0000
+++ b/RtosLog.h	Thu Dec 11 18:23:07 2014 +0000
@@ -23,9 +23,25 @@
 
 /**
  * All threads can independantly call the printf function in the RtosLog class
- * without risc of getting the output tangled up.
+ * without risk of getting the output tangled up.
  *
  * The RtosLog class uses a Thread to process the messages one at a time.
+ *
+ *
+ * Example of using the RtosLog class:
+ *
+ * @code
+ * #include "mbed.h"
+ * #include "DMBoard.h"
+ *
+ * void myTask(void const*args) {
+ *    RtosLog* log = DMBoard::instance().logger();
+ *    ...
+ *    log->printf("Hello world!\n");
+ *    ...
+ * }
+ * @endcode
+ *
  */
 class RtosLog {
 public:
@@ -60,5 +76,3 @@
 };
 
 #endif
-
-