fuck this

Dependencies:   BMP280

Committer:
mwthewsey
Date:
Tue Jan 09 20:51:19 2018 +0000
Revision:
21:6e733076f49c
Parent:
19:40c721f01ed2
Everything working. Comments checked.

Who changed what in which revision?

UserRevisionLine numberNew 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 21:6e733076f49c 12 #include "Logging.h"
mwthewsey 11:b538e73841ae 13
Swaggie 19:40c721f01ed2 14 //Hardware devices
mwthewsey 21:6e733076f49c 15 extern InterruptIn SD_WP; //Pin that indicates if the card has been inserted (active low)
mwthewsey 21:6e733076f49c 16 extern InterruptIn UserButton; //Demount request
mwthewsey 21:6e733076f49c 17 extern SDBlockDevice sd; //SD Card device
mwthewsey 21:6e733076f49c 18 extern DigitalOut GreenLED; //Shows its safe to demount
mwthewsey 21:6e733076f49c 19 extern DigitalOut SDCardStatusLED; //Shows if the card is inserted
Swaggie 19:40c721f01ed2 20
Swaggie 19:40c721f01ed2 21 enum SDCardStates{INSERTED,REMOVED,DISMOUNTREQUEST};
Swaggie 19:40c721f01ed2 22
Swaggie 19:40c721f01ed2 23 //Variables
Swaggie 19:40c721f01ed2 24 extern bool SDCardPresent; //Is the SD card inserted?
Swaggie 19:40c721f01ed2 25 extern bool SDCardMounted; //Is the SD card initialised?
Swaggie 19:40c721f01ed2 26 extern unsigned short SDinternalIndex;//Used for clocking out the data from the sample index
Swaggie 19:40c721f01ed2 27 extern SDCardStates SDCurrentState; //State machine state
mwthewsey 11:b538e73841ae 28
mwthewsey 12:03589f1d5c30 29 extern Thread SDCardThread;
mwthewsey 11:b538e73841ae 30
Swaggie 19:40c721f01ed2 31 //Functions
mwthewsey 12:03589f1d5c30 32 void SDCardInit(void);
Swaggie 19:40c721f01ed2 33 //Starts the thread and sets up the interrupts
mwthewsey 12:03589f1d5c30 34 void SDCardRemovedISR(void);
mwthewsey 21:6e733076f49c 35 //Interrupt runs when SD card is removed
mwthewsey 12:03589f1d5c30 36 void SDCardInsertedISR(void);
mwthewsey 21:6e733076f49c 37 //Interrupt runs when SD card is inserted
mwthewsey 12:03589f1d5c30 38 void SDCardButtonISR(void);
mwthewsey 21:6e733076f49c 39 //Interrupt runs when user button is pressed
mwthewsey 12:03589f1d5c30 40 void SDCardCode(void);
mwthewsey 21:6e733076f49c 41 //Thread code which handles writing to SD card
mwthewsey 21:6e733076f49c 42 void antiBounceISR(void);
mwthewsey 21:6e733076f49c 43 //Prevent button bounce
mwthewsey 11:b538e73841ae 44
mwthewsey 11:b538e73841ae 45 #endif