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 Final351CW_FINAL by
Components/components.hpp@10:098c2fa0a1a6, 2018-01-09 (annotated)
- Committer:
- liam_grazier
- Date:
- Tue Jan 09 11:33:14 2018 +0000
- Revision:
- 10:098c2fa0a1a6
- Parent:
- 8:582ac4c5a524
fin commented
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
liam_grazier | 10:098c2fa0a1a6 | 1 | /* ELEC351 COURSEWORK 2018 |
liam_grazier | 10:098c2fa0a1a6 | 2 | DESIGNED USING MBED ONLINE COMPILER IMPORTED TO KEIL |
liam_grazier | 10:098c2fa0a1a6 | 3 | LIAM GRAZIER // DOUG TILLEY // ALEX BARON |
liam_grazier | 10:098c2fa0a1a6 | 4 | */ |
liam_grazier | 10:098c2fa0a1a6 | 5 | #ifndef __components__ |
liam_grazier | 10:098c2fa0a1a6 | 6 | #define __components__ |
liam_grazier | 10:098c2fa0a1a6 | 7 | //defines for signals for threads |
liam_grazier | 8:582ac4c5a524 | 8 | #define SIG_READY 1 |
liam_grazier | 8:582ac4c5a524 | 9 | #define SIG_READY2 1 |
liam_grazier | 8:582ac4c5a524 | 10 | #define SIG_REMOVE 1 |
liam_grazier | 8:582ac4c5a524 | 11 | #define SIG_NET 1 |
liam_grazier | 8:582ac4c5a524 | 12 | //#define BME |
liam_grazier | 8:582ac4c5a524 | 13 | #ifdef BME |
liam_grazier | 8:582ac4c5a524 | 14 | #include "BME280.h" |
liam_grazier | 8:582ac4c5a524 | 15 | #else |
liam_grazier | 8:582ac4c5a524 | 16 | #include "BMP280.h" |
liam_grazier | 8:582ac4c5a524 | 17 | #endif |
liam_grazier | 10:098c2fa0a1a6 | 18 | //sdcard includes |
liam_grazier | 8:582ac4c5a524 | 19 | #include "SDBlockDevice.h" |
liam_grazier | 8:582ac4c5a524 | 20 | #include "FATFileSystem.h" |
liam_grazier | 10:098c2fa0a1a6 | 21 | //task voids |
liam_grazier | 10:098c2fa0a1a6 | 22 | void DispTime(void);//print time to terminak |
liam_grazier | 10:098c2fa0a1a6 | 23 | void setuptime(void); //task for init the background for time over serial |
liam_grazier | 10:098c2fa0a1a6 | 24 | void runtime(void); //set time over serial |
liam_grazier | 10:098c2fa0a1a6 | 25 | void rundate(void); //set date over serial |
liam_grazier | 10:098c2fa0a1a6 | 26 | void runanalysis(void); //lcd printing/sensor store and refresh |
liam_grazier | 10:098c2fa0a1a6 | 27 | void sdrun(void); //setup sd |
liam_grazier | 10:098c2fa0a1a6 | 28 | void sdcheck(void); //check sd still init. |
liam_grazier | 10:098c2fa0a1a6 | 29 | void lcdstart(void); //start the lcd/routine for start |
liam_grazier | 10:098c2fa0a1a6 | 30 | void sdwrite(void); //write data to SD |
liam_grazier | 10:098c2fa0a1a6 | 31 | void sdwipe(void); //wipe data from SD |
liam_grazier | 10:098c2fa0a1a6 | 32 | void sdremove(void); //remove the SD card safely |
liam_grazier | 8:582ac4c5a524 | 33 | enum ELEC350_ERROR_CODE {OK, FATAL}; |
liam_grazier | 10:098c2fa0a1a6 | 34 | //setup i/o |
liam_grazier | 8:582ac4c5a524 | 35 | extern DigitalOut onBoardLED; |
liam_grazier | 8:582ac4c5a524 | 36 | extern DigitalOut redLED; |
liam_grazier | 8:582ac4c5a524 | 37 | extern DigitalOut yellowLED; |
liam_grazier | 8:582ac4c5a524 | 38 | extern DigitalOut greenLED; |
liam_grazier | 8:582ac4c5a524 | 39 | extern DigitalIn onBoardSwitch; |
liam_grazier | 8:582ac4c5a524 | 40 | extern DigitalIn SW1; |
liam_grazier | 8:582ac4c5a524 | 41 | extern DigitalIn SW2; |
liam_grazier | 8:582ac4c5a524 | 42 | extern AnalogIn adcIn; |
liam_grazier | 8:582ac4c5a524 | 43 | #ifdef BME |
liam_grazier | 8:582ac4c5a524 | 44 | extern BME280 sensor; |
liam_grazier | 8:582ac4c5a524 | 45 | #else |
liam_grazier | 8:582ac4c5a524 | 46 | extern BMP280 sensor; |
liam_grazier | 8:582ac4c5a524 | 47 | #endif |
liam_grazier | 8:582ac4c5a524 | 48 | extern void errorCode(ELEC350_ERROR_CODE err); |
liam_grazier | 8:582ac4c5a524 | 49 | #endif |