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