fuck this
Dependencies: BMP280
SDCard.h@19:40c721f01ed2, 2018-01-09 (annotated)
- Committer:
- Swaggie
- Date:
- Tue Jan 09 11:39:59 2018 +0000
- Revision:
- 19:40c721f01ed2
- Parent:
- 12:03589f1d5c30
- Child:
- 21:6e733076f49c
Moved SD card HW to main file. Started detail commenting. SDCard commenting needs completing.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mwthewsey | 12:03589f1d5c30 | 1 | #ifndef __SDCard__ |
mwthewsey | 12:03589f1d5c30 | 2 | #define __SDCard__ |
Swaggie | 19:40c721f01ed2 | 3 | /* |
Swaggie | 19:40c721f01ed2 | 4 | * |
Swaggie | 19:40c721f01ed2 | 5 | */ |
Swaggie | 19:40c721f01ed2 | 6 | #include "mbed.h" |
Swaggie | 19:40c721f01ed2 | 7 | #include "Sampling.h" |
Swaggie | 19:40c721f01ed2 | 8 | #include "SDCard.h" |
Swaggie | 19:40c721f01ed2 | 9 | #include "SDBlockDevice.h" |
Swaggie | 19:40c721f01ed2 | 10 | #include "FATFileSystem.h" |
Swaggie | 19:40c721f01ed2 | 11 | #include "LCD.h" |
mwthewsey | 11:b538e73841ae | 12 | |
Swaggie | 19:40c721f01ed2 | 13 | //Hardware devices |
Swaggie | 19:40c721f01ed2 | 14 | extern InterruptIn SD_WP; //Pin that indicates if the card has been inserted (active low) |
Swaggie | 19:40c721f01ed2 | 15 | extern InterruptIn UserButton;//Demount request |
Swaggie | 19:40c721f01ed2 | 16 | extern SDBlockDevice sd; //SD Card device |
Swaggie | 19:40c721f01ed2 | 17 | extern DigitalOut GreenLED; //Shows its safe to demount |
Swaggie | 19:40c721f01ed2 | 18 | extern DigitalOut SDCardStatusLED;//Shows if the card is inserted |
Swaggie | 19:40c721f01ed2 | 19 | |
Swaggie | 19:40c721f01ed2 | 20 | enum SDCardStates{INSERTED,REMOVED,DISMOUNTREQUEST}; |
Swaggie | 19:40c721f01ed2 | 21 | |
Swaggie | 19:40c721f01ed2 | 22 | //Variables |
Swaggie | 19:40c721f01ed2 | 23 | extern bool SDCardPresent; //Is the SD card inserted? |
Swaggie | 19:40c721f01ed2 | 24 | extern bool SDCardMounted; //Is the SD card initialised? |
Swaggie | 19:40c721f01ed2 | 25 | extern unsigned short SDinternalIndex;//Used for clocking out the data from the sample index |
Swaggie | 19:40c721f01ed2 | 26 | extern SDCardStates SDCurrentState; //State machine state |
mwthewsey | 11:b538e73841ae | 27 | |
mwthewsey | 12:03589f1d5c30 | 28 | extern Thread SDCardThread; |
mwthewsey | 11:b538e73841ae | 29 | |
Swaggie | 19:40c721f01ed2 | 30 | //Functions |
mwthewsey | 12:03589f1d5c30 | 31 | void SDCardInit(void); |
Swaggie | 19:40c721f01ed2 | 32 | //Starts the thread and sets up the interrupts |
mwthewsey | 12:03589f1d5c30 | 33 | void SDCardRemovedISR(void); |
Swaggie | 19:40c721f01ed2 | 34 | // |
mwthewsey | 12:03589f1d5c30 | 35 | void SDCardInsertedISR(void); |
mwthewsey | 12:03589f1d5c30 | 36 | void SDCardButtonISR(void); |
mwthewsey | 12:03589f1d5c30 | 37 | void SDCardCode(void); |
mwthewsey | 11:b538e73841ae | 38 | |
mwthewsey | 11:b538e73841ae | 39 | #endif |