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.
Dependents: dm_bubbles dm_calc dm_paint dm_sdcard_with_adapter ... more
Diff: dm_platform.h
- Revision:
- 3:02c19cbc707c
- Parent:
- 2:59be7fca4581
- Child:
- 4:92d019216e28
--- a/dm_platform.h Tue May 20 12:21:43 2014 +0200
+++ b/dm_platform.h Wed May 21 14:43:08 2014 +0000
@@ -60,11 +60,27 @@
// Clear bit, Set bit, High pulse, Low pulse, Boundary limits and Delay macros
#define sbi(reg, _bitmask) (*(reg) = 1)
#define cbi(reg, _bitmask) (*(reg) = 0)
- #define pulse_high(reg, _bitmask) do { *(reg) = 1; *(reg) = 0; } while(0)
- #define pulse_low(reg, _bitmask) do { *(reg) = 0; *(reg) = 1; } while(0)
#define constrain(amt,low,high) ((amt)<=(low)?(low):((amt)>(high)?(high):(amt)))
#define delay(ms) wait_ms(ms)
+ // On Arduino no extra delay is needed, but on faster platforms the simulated
+ // SPI bus may get a too high frequency so a delay here will lower it. This
+ // delay should ideally be configurable per platform but for now it will have
+ // to be ok to lower the frequency to 500KHz
+ #define pulse_delay() wait_us(1)
+ #define pulse_high(reg, _bitmask) do {\
+ *(reg) = 1; \
+ pulse_delay(); \
+ *(reg) = 0; \
+ pulse_delay(); \
+ } while(0)
+ #define pulse_low(reg, _bitmask) do {\
+ *(reg) = 0; \
+ pulse_delay(); \
+ *(reg) = 1; \
+ pulse_delay(); \
+ } while(0)
+
// Map of mandatory pin names, from Arduino names to D* and A*
#if defined(__LPC407x_8x_177x_8x_H__)
#define D0 p10
DisplayModule 1.8" TFT with SPI Interface
DisplayModule 2.2" TFT with 8-bit interface
DisplayModule 2.8" 240x320 Touch TFT with 8-bit Interface
DisplayModule 2.4" 240x320 Touch TFT with 8-bit Interface
DisplayModule 2.8" 240x320 TFT LCD With Resistive Touch - SPI, 4MB Flash
DisplayModule 3.5" 320x240 TFT LCD With Resistive Touch - SPI, 4MB Flash
DisplayModule 4.3" 480x272 Arduino TFT Shield With Touch And SPI Interface
DisplayModule 5.0" 800x480 Arduino TFT Shield With Touch And SPI Interface
DisplayModule 2.8" 240x320 TFT With Capacitive Touch