teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Committer:
MasashiNomura
Date:
Sat Jan 19 12:35:23 2019 +0000
Revision:
39:1b76f7df8804
Parent:
38:24ee50452755
Child:
40:debe99e228d3
20190119 Modify for 45inc; Checking User SW and sequence

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takeru0x1103 16:05b9e44889f1 1 #ifndef __HBMANAGER_H__
takeru0x1103 16:05b9e44889f1 2 #define __HBMANAGER_H__
takeru0x1103 0:ecd925601fc6 3 /////////////////////////////////////////////////////////////////////
takeru0x1103 17:f9610f3cfa1b 4 #include "typedef.h"
takeru0x1103 17:f9610f3cfa1b 5 #include "HbEngine.h"
takeru0x1103 18:5aa48aec9cae 6 #include "HbAttitude.h"
takeru0x1103 18:5aa48aec9cae 7 #include "HbMotor.h"
takeru0x1103 18:5aa48aec9cae 8 #include "Imu.h"
MasashiNomura 22:24c9c2dedca9 9 #include "HbUserOpe.h"
takeru0x1103 17:f9610f3cfa1b 10
takeru0x1103 0:ecd925601fc6 11
takeru0x1103 19:4b0fe9a5ec38 12
takeru0x1103 19:4b0fe9a5ec38 13
takeru0x1103 17:f9610f3cfa1b 14 /////////////////////////////////////////////////
takeru0x1103 17:f9610f3cfa1b 15 class HbManager{
takeru0x1103 17:f9610f3cfa1b 16 private:
MasashiNomura 36:2cc739c7e4cb 17 //INT16 motorVal[4] ;//
takeru0x1103 18:5aa48aec9cae 18 UINT16 accelVal[2] ;//
MasashiNomura 36:2cc739c7e4cb 19 float nowTrgtAng; //目標ヨー角
takeru0x1103 19:4b0fe9a5ec38 20 float nowAngle ;//現在ヨー角
takeru0x1103 19:4b0fe9a5ec38 21 float nowRate ;//現在加速度
MasashiNomura 22:24c9c2dedca9 22 typUserSw usrSW ;//ユーザー操作SW
takeru0x1103 19:4b0fe9a5ec38 23 //メンバクラス
takeru0x1103 18:5aa48aec9cae 24 HbEngine *eng[2] ;//エンジン制御クラス
takeru0x1103 18:5aa48aec9cae 25 HbAttitude *att ;//姿勢制御クラス
MasashiNomura 28:fdb3b144e342 26 //HbMotor *mot[4] ;//モーター制御クラス
MasashiNomura 28:fdb3b144e342 27 HbSubProp *subProp[4] ;//モーター制御クラス
takeru0x1103 18:5aa48aec9cae 28 Imu *imu ;//慣性計測装置
MasashiNomura 22:24c9c2dedca9 29
MasashiNomura 22:24c9c2dedca9 30 HbUserOpe *ope ;//ユーザー操作
MasashiNomura 22:24c9c2dedca9 31
MasashiNomura 24:c5945aaae777 32 //INT16 motVal; // モーターチェック用モーター値
MasashiNomura 24:c5945aaae777 33 //short motNum; // モーターチェック用モーター番号
MasashiNomura 24:c5945aaae777 34
takeru0x1103 17:f9610f3cfa1b 35 public:
takeru0x1103 17:f9610f3cfa1b 36 HbManager();
MasashiNomura 39:1b76f7df8804 37 // TestSPIRead Task生存証明用アクセスProof of survival
MasashiNomura 39:1b76f7df8804 38 UINT16 proofOfSurvival();
MasashiNomura 38:24ee50452755 39 // Attitude
takeru0x1103 18:5aa48aec9cae 40 void getAttitude();
MasashiNomura 25:f3a6e7eec9c3 41 void calAtt();
takeru0x1103 18:5aa48aec9cae 42 void controlAttitude();
MasashiNomura 24:c5945aaae777 43 void controlAttitude(float cmdAngle);
MasashiNomura 24:c5945aaae777 44 void setAttPara(typPidPara para);
MasashiNomura 38:24ee50452755 45 // Motor
takeru0x1103 18:5aa48aec9cae 46 void controlMotor();
MasashiNomura 29:eb3d72dd94aa 47 void addMotVal(eMotPos pos, INT16 add);
MasashiNomura 29:eb3d72dd94aa 48 void subMotVal(eMotPos pos, INT16 add);
MasashiNomura 30:13ada1a24c59 49 INT16 getCurMotVal(eMotPos pos);
MasashiNomura 30:13ada1a24c59 50 void setMotVal(eMotPos pos, INT16 val);
MasashiNomura 27:ff63c23bc689 51
MasashiNomura 36:2cc739c7e4cb 52 //void setMotFPGA(UCHAR num, INT16 val);
MasashiNomura 27:ff63c23bc689 53
MasashiNomura 38:24ee50452755 54 // Engine
MasashiNomura 39:1b76f7df8804 55 void getEngine();
takeru0x1103 17:f9610f3cfa1b 56 void controlEngine();
MasashiNomura 36:2cc739c7e4cb 57 void clearHvAxl();
MasashiNomura 36:2cc739c7e4cb 58 bool chkSetHvAxl(eEgPos pos);
MasashiNomura 36:2cc739c7e4cb 59 void setHvAxl(eEgPos pos, INT16 val);
MasashiNomura 38:24ee50452755 60 INT16 getHvAxl(eEgPos pos);
MasashiNomura 36:2cc739c7e4cb 61 void setAccelVal(eEgPos pos, INT16 val);
MasashiNomura 39:1b76f7df8804 62 INT16 getAccelVal(eEgPos pos);
MasashiNomura 36:2cc739c7e4cb 63
takeru0x1103 17:f9610f3cfa1b 64 void getUserCommand();
MasashiNomura 33:eb260dbfc22a 65 INT16 getUserMotAxl();
MasashiNomura 36:2cc739c7e4cb 66 INT16 getUserEngTrottle();
MasashiNomura 38:24ee50452755 67 float getUserMotAxlRaw();
MasashiNomura 38:24ee50452755 68 float getUserEngTrottleRaw();
MasashiNomura 33:eb260dbfc22a 69
MasashiNomura 23:79e20be4bc5b 70 bool chkOverIDLE();
MasashiNomura 23:79e20be4bc5b 71 bool chkInRangeIDLE();
MasashiNomura 31:56c554c560c1 72 void chkSW(enmHbState stat);
MasashiNomura 23:79e20be4bc5b 73 bool chkSWUserOpe(HbUserOpe::SW_TYPE stype);
MasashiNomura 30:13ada1a24c59 74 bool chkSWUserOpeRE(HbUserOpe::SW_TYPE stype);//立ち上がり検出
MasashiNomura 23:79e20be4bc5b 75 bool chkSWUserOpeAny();
MasashiNomura 36:2cc739c7e4cb 76 bool chkSWUserOpeBoth(HbUserOpe::SW_TYPE stype1, HbUserOpe::SW_TYPE stype2);
MasashiNomura 36:2cc739c7e4cb 77
MasashiNomura 23:79e20be4bc5b 78 typUserSw getUserSw();
takeru0x1103 17:f9610f3cfa1b 79 };
takeru0x1103 0:ecd925601fc6 80
takeru0x1103 0:ecd925601fc6 81 /////////////////////////////////////////////////////////////////////
takeru0x1103 16:05b9e44889f1 82 #endif