![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Signal Generator
Dependencies: IniManager RA8875 Watchdog mbed-rtos mbed
Fork of speaker_demo_Analog by
main.cpp@6:1f48212fbaf9, 2017-05-20 (annotated)
- Committer:
- WiredHome
- Date:
- Sat May 20 19:52:23 2017 +0000
- Revision:
- 6:1f48212fbaf9
- Parent:
- 5:49dd0c647a40
Signal Generator - a work in process as the need arises.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 1:dd07e1deec6c | 1 | |
4180_1 | 0:1c8118ee4106 | 2 | #include "mbed.h" |
WiredHome | 1:dd07e1deec6c | 3 | #include "RA8875.h" |
WiredHome | 1:dd07e1deec6c | 4 | #include "Watchdog.h" // ver 2 |
WiredHome | 3:d22f3e52d06a | 5 | //#include "IniManager.h" // v19 |
WiredHome | 1:dd07e1deec6c | 6 | |
WiredHome | 2:8f71b71fce1b | 7 | #include "SignalGenDisplay.h" |
WiredHome | 2:8f71b71fce1b | 8 | #include "SignalGenDAC.h" |
WiredHome | 2:8f71b71fce1b | 9 | |
WiredHome | 1:dd07e1deec6c | 10 | RA8875 lcd(p5,p6,p7,p12, NC, "tft"); // SPI:{MOSI,MISO,SCK,/ChipSelect,/reset}, name |
WiredHome | 3:d22f3e52d06a | 11 | //INI ini; |
WiredHome | 1:dd07e1deec6c | 12 | |
WiredHome | 1:dd07e1deec6c | 13 | RawSerial pc(USBTX, USBRX); |
WiredHome | 1:dd07e1deec6c | 14 | LocalFileSystem local("local"); |
WiredHome | 5:49dd0c647a40 | 15 | SignalGenDAC g_signal; // defaults to LPC1768 mbed module (p18 and 3.3v) |
WiredHome | 3:d22f3e52d06a | 16 | SignalGenDisplay ui(&lcd, &g_signal); |
WiredHome | 3:d22f3e52d06a | 17 | |
WiredHome | 1:dd07e1deec6c | 18 | Watchdog wd; |
WiredHome | 1:dd07e1deec6c | 19 | |
WiredHome | 1:dd07e1deec6c | 20 | int main() { |
WiredHome | 1:dd07e1deec6c | 21 | pc.baud(460800); |
WiredHome | 1:dd07e1deec6c | 22 | |
WiredHome | 1:dd07e1deec6c | 23 | if (wd.WatchdogCausedReset()) { |
WiredHome | 1:dd07e1deec6c | 24 | pc.printf("**** Watchdog Event caused reset ****\r\n"); |
WiredHome | 1:dd07e1deec6c | 25 | } |
WiredHome | 3:d22f3e52d06a | 26 | wd.Configure(30.0); |
WiredHome | 3:d22f3e52d06a | 27 | //ini.SetFile("/local/SigGen.ini", 2); |
WiredHome | 1:dd07e1deec6c | 28 | |
WiredHome | 1:dd07e1deec6c | 29 | lcd.init(480,272,16, true, true, true); |
WiredHome | 3:d22f3e52d06a | 30 | while (true) |
WiredHome | 1:dd07e1deec6c | 31 | { |
WiredHome | 3:d22f3e52d06a | 32 | wd.Service(); |
WiredHome | 1:dd07e1deec6c | 33 | if (pc.readable()) { |
WiredHome | 1:dd07e1deec6c | 34 | int c = pc.getc(); |
WiredHome | 1:dd07e1deec6c | 35 | ui.Poll(c); |
WiredHome | 1:dd07e1deec6c | 36 | } else { |
WiredHome | 1:dd07e1deec6c | 37 | ui.Poll(); |
WiredHome | 1:dd07e1deec6c | 38 | } |
WiredHome | 1:dd07e1deec6c | 39 | } // End of 'while' statement |
WiredHome | 1:dd07e1deec6c | 40 | } // End of main program |
WiredHome | 1:dd07e1deec6c | 41 | |
WiredHome | 2:8f71b71fce1b | 42 |