MARMEX-VB : "Mary Camera module" library

Dependents:   MARMEX_VB_test MARMEX_VB_Hello

MARMEX-VB (MARY-VB) camera module library for mbed. (This module may be available in Japan only.)

Kown problem / 既知の問題

The read data may have contouring. In this case, it may require reset or changing order of data reading. The order change API is available as "read_order_change()" function.
カメラから読み出したデータに擬似輪郭が発生することがあります.この問題にはシステム全体のリセットを行うか,または読み出し順の変更を行うことで対処して下さい.読み出し順の変更はAPIの"read_order_change()"関数を使うことができます.

Revision:
3:7f26004cfbce
Parent:
2:88213c3ca312
Child:
4:8ef31b67c0ab
diff -r 88213c3ca312 -r 7f26004cfbce MARMEX_VB.cpp
--- a/MARMEX_VB.cpp	Mon Jun 09 20:00:39 2014 +0000
+++ b/MARMEX_VB.cpp	Mon Jun 16 14:02:58 2014 +0000
@@ -1,8 +1,8 @@
 /** MARMEX_VB Camera control library
  *
  *  @class   MARMEX_VB
- *  @version 0.21
- *  @date    10-Jun-2014
+ *  @version 0.3
+ *  @date    16-Jun-2014
  *
  *  Released under the Apache License, Version 2.0 : http://mbed.org/handbook/Apache-Licence
  *
@@ -274,81 +274,41 @@
 
     } else {
 
-#define OPTIMIZE_BY_GPIO_REGISTER_ACCESS
-#if defined( TARGET_MBED_LPC1768 ) && defined (OPTIMIZE_BY_GPIO_REGISTER_ACCESS )
+#define OPTIMIZE_KEEP_ASSERTING_CS_DURING_LINE_DATA_TRANSFER
+#ifdef  OPTIMIZE_KEEP_ASSERTING_CS_DURING_LINE_DATA_TRANSFER 
         //  optimized by IO register access and loop unroll
-        LPC_GPIO2->FIOMASK  = ~0x10;
+        _cs = 0;
 
         char    reg = COMMAND_READ | CAMERA_DATA_REGISTER | COMMAND_ADDR_INCREMENT;
 
         for( int x = 0; x < n_of_pixels; x += 8 ) {
             //  perform 2 bytes read. a pixel data is in RGB565 format (16bits)
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
 
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p  = _spi.write( reg );
-            LPC_GPIO2->FIOSET   = 0x10;
-
-            LPC_GPIO2->FIOCLR   = 0x10;
             *p++  |= _spi.write( reg ) << 8;
-            LPC_GPIO2->FIOSET   = 0x10;
         }
-
+        _cs = 1;
 #else
         for( int x = 0; x < n_of_pixels; x++ ) {
             //  perform 2 bytes read. a pixel data is in RGB565 format (16bits)