Example of using the DM-TFT18-101 display
Dependencies: DmTftLibrary mbed
Fork of dm_bubbles by
main.cpp@4:e9c7ecc37061, 2014-10-01 (annotated)
- Committer:
- embeddedartists
- Date:
- Wed Oct 01 11:03:19 2014 +0000
- Revision:
- 4:e9c7ecc37061
- Parent:
- 2:43fe0d1d9259
Cleanup
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
displaymodule | 0:70db0a4adfce | 1 | /****************************************************************************** |
displaymodule | 0:70db0a4adfce | 2 | * Includes |
displaymodule | 0:70db0a4adfce | 3 | *****************************************************************************/ |
displaymodule | 0:70db0a4adfce | 4 | |
displaymodule | 0:70db0a4adfce | 5 | #include "mbed.h" |
displaymodule | 0:70db0a4adfce | 6 | |
displaymodule | 0:70db0a4adfce | 7 | #include "BubbleDemo.h" |
displaymodule | 0:70db0a4adfce | 8 | |
displaymodule | 0:70db0a4adfce | 9 | #include "DmTftHX8353C.h" |
displaymodule | 0:70db0a4adfce | 10 | |
displaymodule | 0:70db0a4adfce | 11 | /****************************************************************************** |
displaymodule | 0:70db0a4adfce | 12 | * Typedefs and defines |
displaymodule | 0:70db0a4adfce | 13 | *****************************************************************************/ |
displaymodule | 0:70db0a4adfce | 14 | |
displaymodule | 0:70db0a4adfce | 15 | /****************************************************************************** |
displaymodule | 0:70db0a4adfce | 16 | * Local variables |
displaymodule | 0:70db0a4adfce | 17 | *****************************************************************************/ |
displaymodule | 0:70db0a4adfce | 18 | |
embeddedartists | 4:e9c7ecc37061 | 19 | /* DM_TFT18_101 */ |
embeddedartists | 4:e9c7ecc37061 | 20 | DmTftHX8353C tft(p5, p7, p30, p17, p16); // mosi,clk,cs,dc,rst |
displaymodule | 0:70db0a4adfce | 21 | |
displaymodule | 0:70db0a4adfce | 22 | /****************************************************************************** |
displaymodule | 0:70db0a4adfce | 23 | * Global variables |
displaymodule | 0:70db0a4adfce | 24 | *****************************************************************************/ |
displaymodule | 0:70db0a4adfce | 25 | |
displaymodule | 0:70db0a4adfce | 26 | /****************************************************************************** |
displaymodule | 0:70db0a4adfce | 27 | * Main |
displaymodule | 0:70db0a4adfce | 28 | *****************************************************************************/ |
displaymodule | 0:70db0a4adfce | 29 | |
embeddedartists | 4:e9c7ecc37061 | 30 | /* |
embeddedartists | 4:e9c7ecc37061 | 31 | Hardware Setup: |
embeddedartists | 4:e9c7ecc37061 | 32 | |
embeddedartists | 4:e9c7ecc37061 | 33 | - Jumpers JP1..JP6 should be in position 1-2 |
embeddedartists | 4:e9c7ecc37061 | 34 | - Jumpers in J14 should NOT be inserted |
embeddedartists | 4:e9c7ecc37061 | 35 | - Jumper J7 should be inserted |
embeddedartists | 4:e9c7ecc37061 | 36 | - Display in connector J12 (display will be outside of base boards boundaries). |
embeddedartists | 4:e9c7ecc37061 | 37 | */ |
embeddedartists | 4:e9c7ecc37061 | 38 | |
embeddedartists | 4:e9c7ecc37061 | 39 | /* |
embeddedartists | 4:e9c7ecc37061 | 40 | Test Comments: |
embeddedartists | 4:e9c7ecc37061 | 41 | |
embeddedartists | 4:e9c7ecc37061 | 42 | - This example is only for the DM-TFT-101 1.8" display as it is the only |
embeddedartists | 4:e9c7ecc37061 | 43 | one with SPI interface AND 40-pin contact |
embeddedartists | 4:e9c7ecc37061 | 44 | - The display board's sd card cannot be accessed due to missing ChipSelect |
embeddedartists | 4:e9c7ecc37061 | 45 | - The display cannot be used with the MCI interface on the base board as they |
embeddedartists | 4:e9c7ecc37061 | 46 | share p30 (SDCLK and LCD_CS) so use SPI interface to use the base board's uSD |
embeddedartists | 4:e9c7ecc37061 | 47 | */ |
embeddedartists | 4:e9c7ecc37061 | 48 | |
displaymodule | 0:70db0a4adfce | 49 | int main (void) |
displaymodule | 0:70db0a4adfce | 50 | { |
displaymodule | 0:70db0a4adfce | 51 | tft.init(); |
displaymodule | 0:70db0a4adfce | 52 | |
displaymodule | 0:70db0a4adfce | 53 | BubbleDemo bubbleDemo(&tft, tft.width(), tft.height()); |
displaymodule | 0:70db0a4adfce | 54 | while (1) { |
displaymodule | 0:70db0a4adfce | 55 | bubbleDemo.run(750, 20); |
displaymodule | 0:70db0a4adfce | 56 | } |
displaymodule | 0:70db0a4adfce | 57 | } |