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:
- 1:dbe2dc31542d
- Parent:
- 0:343c01965543
- Child:
- 5:ac4f0c5d1c6f
diff -r 343c01965543 -r dbe2dc31542d MARMEX_OB_oled.h --- a/MARMEX_OB_oled.h Fri Jun 06 03:37:02 2014 +0000 +++ b/MARMEX_OB_oled.h Mon Jun 09 19:42:34 2014 +0000 @@ -2,8 +2,8 @@ * * @class MARMEX_OB_oled * @author tedd - * @version 0.51 - * @date 08-Apr-2011 + * @version 0.52 (optimized for "mbed NXP LPC1768") + * @date 06-Jun-2014 * * Released under the MIT License: http://mbed.org/license/mit * @@ -30,7 +30,7 @@ * * If disabled (just coment out the "#define MARMEX_OB_SPI_8BIT_MODE"), SPI access willbe done by 9 bit format. */ -#define MARMEX_OB_SPI_8BIT_MODE +//#define MARMEX_OB_SPI_8BIT_MODE /** MARMEX_OB_oled OLED screen drawing class * @@ -71,7 +71,8 @@ * @endcode */ -class MARMEX_OB_oled : public NokiaLCD { +class MARMEX_OB_oled : public NokiaLCD +{ public: @@ -318,13 +319,85 @@ _cs = 1; } - void blit565( int x, int y, int width, int height, const short* colour ) { + 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; + + 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; + + 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; + + 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; + } +#else for (int i = 0; i < width * height; i++ ) { _putp565( colour[i] ); } +#endif + _window( 0, 0, WIDTH, HEIGHT ); _cs = 1; } @@ -493,4 +566,3 @@ -