Tezzeret  1
Tezzeret
GmUsbStorage.hpp
1 #ifndef GM_USB_STORAGE_HPP_
2 #define GM_USB_STORAGE_HPP_
3 
4 #include <stdio.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include <stdbool.h>
8 #include <GmFatFs/ff.h>
9 
10 #if (GEO_FATFS_TI == GEO_TRUE)
11 #include <driverlib/gpio.h>
12 #include <driverlib/ssi.h>
13 #include <driverlib/sysctl.h>
14 #include <ti/sysbios/family/arm/m3/Hwi.h>
15 /* Status of Disk Functions */
16 typedef BYTE DSTATUS;
17 #define DRIVE_NOT_MOUNTED ~0
18 #endif
19 
20 
21 #include "GeoFatFsStorage.hpp"
22 #include "GmFatFs/USBMSCHFatFsTiva.h"
23 #if (GEO_FATFS_TI == GEO_TRUE)
24 #include <ti/drivers/sdspi/SDSPITiva.h>
25 #endif
26 
27 namespace Geometrics
28 {
30  {
31  public:
32  GmUsbStorage ();
33  ~GmUsbStorage ();
34 
35  static int Setup (unsigned int uiIndex);
36  int Shutdown ();
37  virtual const char *GetDrive ();
38 
39  protected:
40  virtual int GetFatFsBlockSize () { return GEO_USB_FATFS_BLOCK_SIZE; };
41 
42  public:
43  /********************************************************************/
44  /* Factory setup. This class needs to able to instantiate objects */
45  /* in contexts where the caller doesn't know this derived class. */
46  /* Look for instances of IFatFsStorageFactory in the code to */
47  /* understand the use. */
48  /********************************************************************/
50  {
51  GeoFatFsStorage *MakeNewStorage ();
52  };
53 
54  private:
55  static USBMSCHFatFs_Handle s_usbmschfatfsHandle;
56  static USBMSCHFatFs_Params s_usbmschfatfsParams;
57 
58 
59 
60  static UsbFatFsStorageFactory s_usbFatFsStorageFactory;
61 
62  public:
63  static void SetAsFatFsFactory (const char whichStorage);
64 
65  };
66 }
67 
68 
69 #endif
Definition: GeoFatFsStorage.hpp:89
Definition: GeoFatFsStorage.hpp:38
Definition: GmUsbStorage.hpp:30
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47