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:
- 7:125538c50c22
- Parent:
- 5:ac4f0c5d1c6f
- Child:
- 8:86aae677a68b
diff -r b61b876d50a8 -r 125538c50c22 MARMEX_OB_oled.h --- a/MARMEX_OB_oled.h Wed Jun 18 06:44:44 2014 +0000 +++ b/MARMEX_OB_oled.h Thu Jun 19 12:21:50 2014 +0000 @@ -2,8 +2,8 @@ * * @class MARMEX_OB_oled * @author tedd - * @version 0.53 (optimized for "line data transfer") - * @date 16-Jun-2014 + * @version 0.54 (optimized for "line data transfer") + * @date 19-Jun-2014 * * Released under the MIT License: http://mbed.org/license/mit * @@ -352,7 +352,7 @@ _spi.write( 0x100 | (*colour >> 8) ); _spi.write( 0x100 | *colour++ ); } - + _cs = 0; #else @@ -361,9 +361,64 @@ } #endif - _window( 0, 0, WIDTH, HEIGHT ); _cs = 1; + _window( 0, 0, WIDTH, HEIGHT ); } + + + + + void blit565_SPI_FIFO_WRITE( int x, int y, int width, int height, short* colour ) { + _window( x, y, width, height ); + +#define FIFO_DEPTH 4 + +#ifdef TARGET_MBED_LPC1768 +#define SPI_PORT_SELECTOR LPC_SSP1 +#endif + +#ifdef TARGET_LPC11U35_501 +#define SPI_PORT_SELECTOR LPC_SSP0 +#endif + +#ifdef TARGET_LPC11U24_401 +#define SPI_PORT_SELECTOR LPC_SSP0 +#endif + + char dummy; + int n; + int length; + + length = width * height; + + _cs = 0; + + for(n = (FIFO_DEPTH >> 1); n > 0; n--) { + SPI_PORT_SELECTOR->DR = (*colour >> 8) | 0x100; + SPI_PORT_SELECTOR->DR = ((*colour++) & 0xFF) | 0x100; + } + + do { + while (!(SPI_PORT_SELECTOR->SR & 0x4)); + dummy = SPI_PORT_SELECTOR->DR; + + if (n < length - (FIFO_DEPTH >> 1)) + SPI_PORT_SELECTOR->DR = (*colour >> 8) | 0x100; + + while (!(SPI_PORT_SELECTOR->SR & 0x4)); + dummy = SPI_PORT_SELECTOR->DR; + + if (n++ < length - (FIFO_DEPTH >> 1)) + SPI_PORT_SELECTOR->DR = ((*colour++) & 0xFF) | 0x100; + + + } while(n < length); + + _cs = 1; + _window( 0, 0, WIDTH, HEIGHT ); + } + + void bitblit( int x, int y, int width, int height, const char* bitstream ) { _cs = 0; _window( x, y, width, height );