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.
Fork of dm_bubbles by
main.cpp@2:43fe0d1d9259, 2014-07-08 (annotated)
- Committer:
- displaymodule
- Date:
- Tue Jul 08 06:23:17 2014 +0000
- Revision:
- 2:43fe0d1d9259
- Parent:
- 1:e286034c8f6a
Updated library dependencies.
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 | #include "DmTftS6D0164.h" |
| displaymodule | 0:70db0a4adfce | 11 | #include "DmTftIli9325.h" |
| displaymodule | 0:70db0a4adfce | 12 | #include "DmTftIli9341.h" |
| displaymodule | 0:70db0a4adfce | 13 | #include "DmTftSsd2119.h" |
| displaymodule | 0:70db0a4adfce | 14 | |
| displaymodule | 0:70db0a4adfce | 15 | /****************************************************************************** |
| displaymodule | 0:70db0a4adfce | 16 | * Typedefs and defines |
| displaymodule | 0:70db0a4adfce | 17 | *****************************************************************************/ |
| displaymodule | 0:70db0a4adfce | 18 | |
| displaymodule | 0:70db0a4adfce | 19 | #define RESET_FLAG \ |
| displaymodule | 0:70db0a4adfce | 20 | do { \ |
| displaymodule | 0:70db0a4adfce | 21 | if (abortTest) { \ |
| displaymodule | 0:70db0a4adfce | 22 | abortTest = false; \ |
| displaymodule | 0:70db0a4adfce | 23 | wait(0.04); \ |
| displaymodule | 0:70db0a4adfce | 24 | } \ |
| displaymodule | 0:70db0a4adfce | 25 | } while(false) |
| displaymodule | 0:70db0a4adfce | 26 | |
| displaymodule | 0:70db0a4adfce | 27 | |
| displaymodule | 2:43fe0d1d9259 | 28 | #if 0 |
| displaymodule | 1:e286034c8f6a | 29 | /* Displays without adapter */ |
| displaymodule | 1:e286034c8f6a | 30 | #define DM_PIN_SPI_MOSI D11 |
| displaymodule | 1:e286034c8f6a | 31 | #define DM_PIN_SPI_MISO D12 |
| displaymodule | 1:e286034c8f6a | 32 | #define DM_PIN_SPI_SCLK D13 |
| displaymodule | 1:e286034c8f6a | 33 | #define DM_PIN_CS_TOUCH D4 |
| displaymodule | 1:e286034c8f6a | 34 | #define DM_PIN_CS_TFT D10 |
| displaymodule | 1:e286034c8f6a | 35 | #define DM_PIN_CS_SDCARD D8 |
| displaymodule | 1:e286034c8f6a | 36 | #define DM_PIN_CS_FLASH D6 |
| displaymodule | 1:e286034c8f6a | 37 | #else |
| displaymodule | 1:e286034c8f6a | 38 | /* Displays with adapter */ |
| displaymodule | 1:e286034c8f6a | 39 | #define DM_PIN_SPI_MOSI A0 |
| displaymodule | 1:e286034c8f6a | 40 | #define DM_PIN_SPI_MISO D9 |
| displaymodule | 1:e286034c8f6a | 41 | #define DM_PIN_SPI_SCLK A1 |
| displaymodule | 1:e286034c8f6a | 42 | #define DM_PIN_CS_TOUCH D8 |
| displaymodule | 1:e286034c8f6a | 43 | #define DM_PIN_CS_TFT A3 |
| displaymodule | 1:e286034c8f6a | 44 | #define DM_PIN_CS_SDCARD D10 |
| displaymodule | 0:70db0a4adfce | 45 | #endif |
| displaymodule | 0:70db0a4adfce | 46 | |
| displaymodule | 0:70db0a4adfce | 47 | /****************************************************************************** |
| displaymodule | 0:70db0a4adfce | 48 | * Local variables |
| displaymodule | 0:70db0a4adfce | 49 | *****************************************************************************/ |
| displaymodule | 0:70db0a4adfce | 50 | |
| displaymodule | 0:70db0a4adfce | 51 | static InterruptIn buttonInterrupt(P2_10); |
| displaymodule | 0:70db0a4adfce | 52 | static DigitalOut led(LED1); |
| displaymodule | 0:70db0a4adfce | 53 | |
| displaymodule | 0:70db0a4adfce | 54 | //DmTftHX8353C tft; /* DM_TFT18_101 */ |
| displaymodule | 0:70db0a4adfce | 55 | //DmTftS6D0164 tft; /* DM_TFT22_102 */ |
| displaymodule | 2:43fe0d1d9259 | 56 | DmTftIli9325 tft; /* DM_TFT28_103 and DM_TFT24_104 */ |
| displaymodule | 1:e286034c8f6a | 57 | //DmTftIli9341 tft; /* DM_TFT28_105 */ |
| displaymodule | 2:43fe0d1d9259 | 58 | //DmTftSsd2119 tft; /* DM_TFT35_107 */ |
| displaymodule | 0:70db0a4adfce | 59 | |
| displaymodule | 0:70db0a4adfce | 60 | DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1); |
| displaymodule | 0:70db0a4adfce | 61 | DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1); |
| displaymodule | 0:70db0a4adfce | 62 | DigitalInOut csSDCard(DM_PIN_CS_SDCARD, PIN_OUTPUT, PullUp, 1); |
| displaymodule | 0:70db0a4adfce | 63 | #ifdef DM_PIN_CS_FLASH |
| displaymodule | 0:70db0a4adfce | 64 | DigitalInOut csFlash(DM_PIN_CS_FLASH, PIN_OUTPUT, PullUp, 1); |
| displaymodule | 1:e286034c8f6a | 65 | #endif |
| displaymodule | 0:70db0a4adfce | 66 | |
| displaymodule | 0:70db0a4adfce | 67 | /****************************************************************************** |
| displaymodule | 0:70db0a4adfce | 68 | * Global variables |
| displaymodule | 0:70db0a4adfce | 69 | *****************************************************************************/ |
| displaymodule | 0:70db0a4adfce | 70 | |
| displaymodule | 0:70db0a4adfce | 71 | /****************************************************************************** |
| displaymodule | 0:70db0a4adfce | 72 | * Main |
| displaymodule | 0:70db0a4adfce | 73 | *****************************************************************************/ |
| displaymodule | 0:70db0a4adfce | 74 | |
| displaymodule | 0:70db0a4adfce | 75 | int main (void) |
| displaymodule | 0:70db0a4adfce | 76 | { |
| displaymodule | 0:70db0a4adfce | 77 | tft.init(); |
| displaymodule | 0:70db0a4adfce | 78 | |
| displaymodule | 0:70db0a4adfce | 79 | BubbleDemo bubbleDemo(&tft, tft.width(), tft.height()); |
| displaymodule | 0:70db0a4adfce | 80 | while (1) { |
| displaymodule | 0:70db0a4adfce | 81 | bubbleDemo.run(750, 20); |
| displaymodule | 0:70db0a4adfce | 82 | } |
| displaymodule | 0:70db0a4adfce | 83 | } |
