fuck this

Dependencies:   BMP280

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDCard.h Source File

SDCard.h

00001 #ifndef __SDCard__
00002 #define __SDCard__
00003 /*
00004 *
00005 */
00006 #include "mbed.h"
00007 #include "Sampling.h"
00008 #include "SDCard.h"
00009 #include "SDBlockDevice.h"
00010 #include "FATFileSystem.h"
00011 #include "LCD.h"
00012 #include "Logging.h"
00013 
00014 //Hardware devices
00015 extern InterruptIn SD_WP;          //Pin that indicates if the card has been inserted (active low)
00016 extern InterruptIn UserButton;     //Demount request
00017 extern SDBlockDevice sd;           //SD Card device
00018 extern DigitalOut GreenLED;        //Shows its safe to demount
00019 extern DigitalOut SDCardStatusLED; //Shows if the card is inserted
00020 
00021 enum SDCardStates{INSERTED,REMOVED,DISMOUNTREQUEST};
00022 
00023 //Variables
00024 extern bool SDCardPresent;  //Is the SD card inserted?
00025 extern bool SDCardMounted;  //Is the SD card initialised?
00026 extern unsigned short SDinternalIndex;//Used for clocking out the data from the sample index
00027 extern SDCardStates SDCurrentState; //State machine state
00028 
00029 extern Thread SDCardThread;
00030 
00031 //Functions
00032 void SDCardInit(void);
00033 //Starts the thread and sets up the interrupts
00034 void SDCardRemovedISR(void);
00035 //Interrupt runs when SD card is removed
00036 void SDCardInsertedISR(void);
00037 //Interrupt runs when SD card is inserted
00038 void SDCardButtonISR(void);
00039 //Interrupt runs when user button is pressed
00040 void SDCardCode(void);
00041 //Thread code which handles writing to SD card
00042 void antiBounceISR(void);
00043 //Prevent button bounce
00044 
00045 #endif