ジャイロ追加前

Dependencies:   mbed FreeRTOS

Committer:
MasashiNomura
Date:
Wed Dec 12 23:52:22 2018 +0000
Revision:
25:f3a6e7eec9c3
Parent:
24:c5945aaae777
Child:
27:ff63c23bc689
2018/12/11

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takeru0x1103 0:ecd925601fc6 1 #ifndef _TYPEDEF_H_
takeru0x1103 0:ecd925601fc6 2 #define _TYPEDEF_H_
takeru0x1103 0:ecd925601fc6 3 /////////////////////////////////////////////////////////////////////
takeru0x1103 18:5aa48aec9cae 4 #include "debug.h"
MasashiNomura 25:f3a6e7eec9c3 5 #include <bitset>
takeru0x1103 0:ecd925601fc6 6
takeru0x1103 17:f9610f3cfa1b 7 //Asciiコード
takeru0x1103 17:f9610f3cfa1b 8 #define BS 0x08
takeru0x1103 17:f9610f3cfa1b 9 #define HT 0x09
takeru0x1103 17:f9610f3cfa1b 10 #define TAB 0x09
takeru0x1103 17:f9610f3cfa1b 11 #define LF 0x0A
takeru0x1103 17:f9610f3cfa1b 12 #define CR 0x0D
takeru0x1103 17:f9610f3cfa1b 13 #define SPC 0x20
takeru0x1103 17:f9610f3cfa1b 14 #define ESC 0x1B
takeru0x1103 17:f9610f3cfa1b 15
takeru0x1103 0:ecd925601fc6 16 /*
takeru0x1103 0:ecd925601fc6 17 * 共通で使用する型の定義
takeru0x1103 0:ecd925601fc6 18 *
takeru0x1103 0:ecd925601fc6 19 */
takeru0x1103 0:ecd925601fc6 20
takeru0x1103 18:5aa48aec9cae 21 typedef unsigned char UCHAR;
takeru0x1103 18:5aa48aec9cae 22 typedef unsigned short UINT16;
takeru0x1103 18:5aa48aec9cae 23 typedef short INT16;
takeru0x1103 18:5aa48aec9cae 24 typedef unsigned int UINT32;
takeru0x1103 0:ecd925601fc6 25
MasashiNomura 22:24c9c2dedca9 26 //ユーザースイッチ(ハンドル)のレジスタ読み値のビットフィールド
MasashiNomura 22:24c9c2dedca9 27 typedef union{
MasashiNomura 22:24c9c2dedca9 28 UINT16 w;
MasashiNomura 22:24c9c2dedca9 29 struct{
MasashiNomura 22:24c9c2dedca9 30 UCHAR axl_r : 1;
MasashiNomura 22:24c9c2dedca9 31 UCHAR axl_l : 1;
MasashiNomura 23:79e20be4bc5b 32 UCHAR stop : 1;
MasashiNomura 23:79e20be4bc5b 33 UCHAR y_ctrl : 1;
MasashiNomura 23:79e20be4bc5b 34 UCHAR eng_stop : 1;
MasashiNomura 22:24c9c2dedca9 35 }bf;
MasashiNomura 22:24c9c2dedca9 36 }typUserSw;
MasashiNomura 22:24c9c2dedca9 37
MasashiNomura 24:c5945aaae777 38 //姿勢制御用PIDパラメータ構造体
MasashiNomura 24:c5945aaae777 39 typedef struct{
MasashiNomura 24:c5945aaae777 40 float PP;
MasashiNomura 24:c5945aaae777 41 float P;
MasashiNomura 24:c5945aaae777 42 float I;
MasashiNomura 24:c5945aaae777 43 float D;
MasashiNomura 24:c5945aaae777 44 float IMax;
MasashiNomura 24:c5945aaae777 45 float IMin;
MasashiNomura 24:c5945aaae777 46 }typPidPara;
MasashiNomura 24:c5945aaae777 47
MasashiNomura 25:f3a6e7eec9c3 48 //モーターのパラメータ構造体
MasashiNomura 25:f3a6e7eec9c3 49 typedef struct{
MasashiNomura 25:f3a6e7eec9c3 50 //UCHAR num;
MasashiNomura 25:f3a6e7eec9c3 51 //INT16 offset;
MasashiNomura 25:f3a6e7eec9c3 52 INT16 limit_hi;
MasashiNomura 25:f3a6e7eec9c3 53 INT16 limit_low;
MasashiNomura 25:f3a6e7eec9c3 54 }typMotPara;
MasashiNomura 24:c5945aaae777 55
MasashiNomura 25:f3a6e7eec9c3 56 typedef std::bitset<4> typFlg4Mot;
takeru0x1103 0:ecd925601fc6 57 /////////////////////////////////////////////////////////////////////
takeru0x1103 0:ecd925601fc6 58 #endif