Tezzeret  1
Tezzeret
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
Geometrics::GmMfam Class Reference

The MFAM magnetometer sensor. More...

#include <GmMFAMSensor.hpp>

Inheritance diagram for Geometrics::GmMfam:
Inheritance graph
[legend]
Collaboration diagram for Geometrics::GmMfam:
Collaboration graph
[legend]

Public Types

enum  MfamTestStates {
  MFAM_PASSED_STARTUP = 0 , MFAM_FAILED_TO_INITIALIZE , MFAM_SYSTEM_DID_NOT_TRY_TO_START , MFAM_NO_RECORDS ,
  MFAM_SPI_CHANNEL_FAILED , MFAM_COMPASS_FAILED
}
 
enum  BufferState { Normal = 0 , Locked , Shrinking }
 

Public Member Functions

 GmMfam (UInt8 iSubjectId, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 
int Initialize (int iSpiId, int enablePinIndex, ti_sysbios_knl_Swi_Handle iSwiId, Bool waitForQuietSpi)
 
virtual void Halt ()
 
virtual int CheckCalibrate (Bool bForceCalibrate)
 
int CalibrateSpiBufferError ()
 
int ReadDataForTest ()
 
void ReadDataInternal ()
 
- Public Member Functions inherited from Geometrics::GmMfamDataSource
 GmMfamDataSource (UInt8 iSubjectId, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 
int Start ()
 
int SetSimpleSubsampleRate (int iNewRate)
 
int ResetBuffers (Bool bForceCalibrate)
 
virtual UInt16 SystemStatus ()
 
virtual int WriteToStorage (UInt32 ui32Topic, char *pData, UInt32 iSize, GmStorage *psStorage, UInt32 ui32FormatId)
 
Bool IsSuperMag ()
 
Bool MagOneDataValid ()
 
Bool MagTwoDataValid ()
 
Bool PpsLocked ()
 
Bool PpsAvailable ()
 
int MagOneStartupStatusString (char *strBuffer, int iBufferLength)
 
int MagTwoStartupStatusString (char *strBuffer, int iBufferLength)
 
int MagOneOperatingStatusString (char *strBuffer, int iBufferLength)
 
int MagTwoOperatingStatusString (char *strBuffer, int iBufferLength)
 
int LastMagOneDataValue (float *pfDataValue)
 
int LastMagTwoDataValue (float *pfDataValue)
 
UInt16 MagMainMode ()
 
UInt16 CompassStatus ()
 
bool IsInStartup ()
 
Bool SystemHasStartedUp ()
 
Bool SystemFailed ()
 
void SaveMonitorPacket (IndexedMfamFilteredPacketWithHeader *pMonitorPacket, Bool bFilter)
 
- Public Member Functions inherited from Geometrics::GmBufferedSensor
 GmBufferedSensor (UInt8 iSubjectId, int iRingCount, int iDataSize, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 Constructor for derived classes, when it's OK to allocate a local buffer dynamically. More...
 
 GmBufferedSensor (UInt8 iSubjectId, int iRingCount, int iDataSize, UInt8 *puiBuffer, UInt32 uiBufferSize, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 Constructor used by most derived classes on memory-constrained systems. In this case the derived class provides a buffer, usually static, so that the buffer doesn't need to be allocated dynamically. More...
 
int Start ()
 
int ResetBuffers ()
 
Bool HasData ()
 
int ReadRecord (char *pcDestination, int iSize)
 The main interface for consumers of a sensors data to get that data. It simply copies the data in the sensor's buffer into the caller's buffer. It is up to the caller to know what to do with that data, and how to free any local memory. (This function should have been name ReadNextRecord)
 
virtual int DeleteNextRecord ()
 DeleteNextRecord allows a caller to discard the next record without retrieving it. The subclasses that implement DeleteNextRecord must be able to deal with any memory that needs to be freed, or other such concerns.
 
- Public Member Functions inherited from Geometrics::GmEventSource
void SetSensorId (int iSensorId)
 
int GetSensorId ()
 

Static Public Member Functions

static Void GmGetMFAMSpiData (SPI_Handle handle, SPI_Transaction *transaction)
 
- Static Public Member Functions inherited from Geometrics::GmMfamDataSource
static int DecodeMagStartupStatus (UInt16 iMagStatus, char *strBuffer, int iBufferLength)
 
static int DecodeMagOperatingStatus (UInt16 iMagStatus, char *strBuffer, int iBufferLength)
 

Public Attributes

enum BufferState mBufferState
 
- Public Attributes inherited from Geometrics::GmMfamDataSource
uint32_t mQueueFillTopThreshold
 
uint32_t mQueueFillRestartThreshold
 
- Public Attributes inherited from Geometrics::GmBufferedSensor
CChildRingBufferm_rbBuffer
 The local buffer into which the sensor or event source stores each of its events or measurements. When an item is committed to this buffer, it also adds an event (consisting of the sensor's subject ID) into the application main event queue. The full event or measurement remains here, until the application reads the subject ID out of the main queue and then asks this sensor object for the full information by calling ReadRecord.
 
UInt8 m_iSubjectId
 

Static Public Attributes

static Bool sMfamIsInStartupTest
 
static MfamTestStates sMfamPassedTest = MFAM_SYSTEM_DID_NOT_TRY_TO_START
 
static SPI_Handle m_static_GmSpiHandle
 
static SPI_Params m_static_GmSpiParams
 
static SPI_Transaction m_static_RxTxnPing
 
static SPI_Transaction m_static_RxTxnPong
 
static Bool m_static_BPing
 
static int sCompassRetries = 0
 
static GmMfamm_static_msTheOneSensor = NULL
 
- Static Public Attributes inherited from Geometrics::GmMfamDataSource
static UInt16 m_static_iSystemStatus
 

Static Protected Member Functions

static void SetupSpiBuffers (bool isNull)
 
static void SetupSpiParameters (SPI_TransferMode tMode, Bool IsNull)
 

Static Protected Attributes

static Bool m_static_pps_rx
 
- Static Protected Attributes inherited from Geometrics::GmMfamDataSource
static bool m_static_boolInitialized
 
static int m_static_iSubsampleCount = 0
 

Additional Inherited Members

- Protected Member Functions inherited from Geometrics::GmMfamDataSource
int RecordStatus (MfamSpiPacket *pmspRecord)
 
- Protected Attributes inherited from Geometrics::GmMfamDataSource
IndexedMfamFilteredPacketWithHeader m_mspStatusPacket
 
int m_iSimpleSubsampleRate
 
IndexedMfamFilteredPacketWithHeader m_amspStatusRecords [MAG_SPI_TOTAL_RECORDS]
 
- Protected Attributes inherited from Geometrics::GmEventSource
int m_iSensorId
 

Detailed Description

The MFAM magnetometer sensor.

Data from this sensor can be used in individual records, blocks, decimated, etc.

See notes in Geometrics::GmMfamEmulator for information about when to use the emulator (debugging, mostly).


The documentation for this class was generated from the following files: