Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MARMEX_VB NokiaLCD mbed
Revision 5:ac4f0c5d1c6f, committed 2014-06-16
- 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