sentral tester

Dependencies:   mbed

Committer:
awmiller
Date:
Fri May 20 17:23:07 2016 +0000
Revision:
1:29e57acc058b
Parent:
0:6834f1402927
sentral tester

Who changed what in which revision?

UserRevisionLine numberNew contents of line
awmiller 0:6834f1402927 1 #ifndef __SENTRAL_H
awmiller 0:6834f1402927 2 #define __SENTRAL_H
awmiller 0:6834f1402927 3
awmiller 0:6834f1402927 4 #define SENTRAL_DI02
awmiller 0:6834f1402927 5
awmiller 0:6834f1402927 6 typedef struct {
awmiller 0:6834f1402927 7 unsigned long AXIS_X;
awmiller 0:6834f1402927 8 unsigned long AXIS_Y;
awmiller 0:6834f1402927 9 unsigned long AXIS_Z;
awmiller 0:6834f1402927 10 unsigned long AXIS_W;
awmiller 0:6834f1402927 11 } QuaternionData;
awmiller 0:6834f1402927 12
awmiller 0:6834f1402927 13 #define SENTRAL_EEPROM_ADDRESS 0xa0
awmiller 0:6834f1402927 14 #define SENTRAL_ADDRESS 0x50
awmiller 0:6834f1402927 15 #define SENTRAL_ACC_ADDRESS 0x1a
awmiller 0:6834f1402927 16 #define SENTRAL_Q_ADDRESS 0x00
awmiller 0:6834f1402927 17
awmiller 0:6834f1402927 18 void Setup_Sentral_EEPROM();
awmiller 0:6834f1402927 19 int SentralGetQData(QuaternionData* buff);
awmiller 0:6834f1402927 20
awmiller 0:6834f1402927 21 #define SentralAddress 0x50
awmiller 0:6834f1402927 22
awmiller 0:6834f1402927 23 #ifdef SENTRAL_DI02
awmiller 0:6834f1402927 24 #define RETURN_SUCCESS 1
awmiller 0:6834f1402927 25 #define RETURN_FAILURE 0
awmiller 0:6834f1402927 26 #define ENABLE_EVENTS_REG 0x33
awmiller 0:6834f1402927 27 #define MAG_RATE_REG 0x55
awmiller 0:6834f1402927 28 #define ACCEL_RATE_REG 0x56
awmiller 0:6834f1402927 29 #define GYRO_RATE_REG 0x57
awmiller 0:6834f1402927 30 #define HOST_CONTROL_REG 0x34
awmiller 0:6834f1402927 31 #define SENTRAL_STATUS_REG 0x37
awmiller 0:6834f1402927 32 #define PASSTHROUGH_CONFIG_REG 0xa0
awmiller 0:6834f1402927 33 #define RESET_REQ_REG 0x9b
awmiller 0:6834f1402927 34 #define REVISION_ID_REG 0x91
awmiller 0:6834f1402927 35 #define HOST_STATUS_REG 0x92
awmiller 0:6834f1402927 36 #define ALGORITHM_CONTROL 0x54
awmiller 0:6834f1402927 37
awmiller 0:6834f1402927 38 #define DEFAULT_I2C_SPEED_KHZ 100
awmiller 0:6834f1402927 39
awmiller 0:6834f1402927 40 //M_BED PORTS
awmiller 0:6834f1402927 41 //int ResetSentral(UInt8 NewByte);
awmiller 0:6834f1402927 42 //int Setup_Sentral(void);
awmiller 0:6834f1402927 43 unsigned int SentralSetup(Serial &pc,I2C &master);
awmiller 0:6834f1402927 44
awmiller 0:6834f1402927 45 //M_BED ROUTINES
awmiller 0:6834f1402927 46 int Sentral_Power(int val =1);
awmiller 0:6834f1402927 47 int Set_SA0(int val =0);
awmiller 0:6834f1402927 48 void Sentral_Reset();
awmiller 0:6834f1402927 49
awmiller 0:6834f1402927 50
awmiller 0:6834f1402927 51 #endif
awmiller 0:6834f1402927 52
awmiller 0:6834f1402927 53 #endif