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.
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.
Diff: MARMEX_OB_oled.h
- Revision:
- 5:ac4f0c5d1c6f
- Parent:
- 1:dbe2dc31542d
- Child:
- 7:125538c50c22
--- 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] );