MARMEX_VB test application program. This application works on "mbed NXP LPC1768" only. This application expects to have the MARMEX_VB module on a "MAPLE mini type-B (MARM03-BASE)" baseboard (slot2) with MARMEX_OB module (on slot1)

Dependencies:   MARMEX_VB NokiaLCD mbed

This is the library test program.
The program can test features of the library (refer to MARMEX-VB's API document) and can save captured data into BMP file.

Warning!

This test program can run on "mbed NXP LPC1768" only.

/media/uploads/nxpfan/dsc_0506_-1-.jpg
Picture : sample of test program operation
The modules of MARMEX-VB and MARMEX-OB are set on the "MAPLE mini type-B (MARM03-BASE)" baseboard.
The image data from camera is mirrored and alpha graphics added by software.

Files at this revision

API Documentation at this revision

Comitter:
nxpfan
Date:
Mon Jun 16 14:03:10 2014 +0000
Parent:
4:1d15e17d14f9
Child:
6:b61b876d50a8
Commit message:
optimization done for SPI operation: ChipSelect signal kept asserted during line data transfer.

Changed in this revision

MARMEX_OB_oled.h Show annotated file Show diff for this revision Revisions of this file
MARMEX_VB.lib Show annotated file Show diff for this revision Revisions of this file
--- a/MARMEX_OB_oled.h	Sun Jun 15 11:15:03 2014 +0000
+++ b/MARMEX_OB_oled.h	Mon Jun 16 14:03:10 2014 +0000
@@ -2,8 +2,8 @@
  *
  *  @class   MARMEX_OB_oled
  *  @author  tedd
- *  @version 0.52 (optimized for "mbed NXP LPC1768")
- *  @date    06-Jun-2014
+ *  @version 0.53 (optimized for "line data transfer")
+ *  @date    16-Jun-2014
  *
  *  Released under the MIT License: http://mbed.org/license/mit
  *
@@ -320,78 +320,41 @@
     }
 
     void blit565( int x, int y, int width, int height, short* colour ) {
-        _cs = 0;
         _window( x, y, width, height );
 
-#define OPTIMIZE_BY_GPIO_REGISTER_ACCESS
-#if defined( TARGET_MBED_LPC1768 ) && defined (OPTIMIZE_BY_GPIO_REGISTER_ACCESS )
-        LPC_GPIO1->FIOMASK   = ~0x80000000;
-        
-        for (int i = 0; i < width * height; i += 8 ) {
-            LPC_GPIO1->FIOCLR   = 0x80000000;
-            _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
+#define OPTIMIZE_KEEP_ASSERTING_CS_DURING_LINE_DATA_TRANSFER
+#ifdef  OPTIMIZE_KEEP_ASSERTING_CS_DURING_LINE_DATA_TRANSFER
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
-            _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
-
-            LPC_GPIO1->FIOCLR   = 0x80000000;
-            _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
+        _cs = 0;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
+        for (int i = 0; i < width * height; i += 8 ) {
+            _spi.write( 0x100 | (*colour >> 8) );
             _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
-
-            LPC_GPIO1->FIOCLR   = 0x80000000;
-            _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
+            _spi.write( 0x100 | (*colour >> 8) );
             _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
+            _spi.write( 0x100 | *colour++ );
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
+            _spi.write( 0x100 | (*colour >> 8) );
             _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
-
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
-
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
-
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
             _spi.write( 0x100 | (*colour >> 8) );
-            LPC_GPIO1->FIOSET   = 0x80000000;
+            _spi.write( 0x100 | *colour++ );
+        }
+        
+        _cs = 0;
 
-            LPC_GPIO1->FIOCLR   = 0x80000000;
-            _spi.write( 0x100 | *colour++ );
-            LPC_GPIO1->FIOSET   = 0x80000000;
-        }
 #else
         for (int i = 0; i < width * height; i++ ) {
             _putp565( colour[i] );
--- a/MARMEX_VB.lib	Sun Jun 15 11:15:03 2014 +0000
+++ b/MARMEX_VB.lib	Mon Jun 16 14:03:10 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/CQ-Publishing/code/MARMEX_VB/#88213c3ca312
+http://mbed.org/teams/CQ-Publishing/code/MARMEX_VB/#7f26004cfbce