for_gamma

Dependents:   DataPool

Committer:
Komazawa_sun
Date:
Fri Aug 18 03:12:18 2017 +0000
Revision:
0:519ec302e9b8
Child:
2:dbb9a7fe426b
datapool_for_gamma

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Komazawa_sun 0:519ec302e9b8 1 #ifndef GAMMAPOOL_H
Komazawa_sun 0:519ec302e9b8 2 #define GAMMAPOOL_H
Komazawa_sun 0:519ec302e9b8 3
Komazawa_sun 0:519ec302e9b8 4 #include "I2CTransporter.h"
Komazawa_sun 0:519ec302e9b8 5
Komazawa_sun 0:519ec302e9b8 6 //#include "I2CTransporter.h"
Komazawa_sun 0:519ec302e9b8 7
Komazawa_sun 0:519ec302e9b8 8 class GammaPool{
Komazawa_sun 0:519ec302e9b8 9 public:
Komazawa_sun 0:519ec302e9b8 10 GammaPool();
Komazawa_sun 0:519ec302e9b8 11 void up_load();
Komazawa_sun 0:519ec302e9b8 12 void reset();
Komazawa_sun 0:519ec302e9b8 13
Komazawa_sun 0:519ec302e9b8 14 union i2c_jusinkun_data //from jushinkun_datas
Komazawa_sun 0:519ec302e9b8 15 {
Komazawa_sun 0:519ec302e9b8 16 char all_data[10];
Komazawa_sun 0:519ec302e9b8 17 struct
Komazawa_sun 0:519ec302e9b8 18 {
Komazawa_sun 0:519ec302e9b8 19 unsigned char start_byte:8;
Komazawa_sun 0:519ec302e9b8 20 signed int rx :8;
Komazawa_sun 0:519ec302e9b8 21 signed int ry :8;
Komazawa_sun 0:519ec302e9b8 22 signed int lx :8;
Komazawa_sun 0:519ec302e9b8 23 unsigned int r_sw1 :1;
Komazawa_sun 0:519ec302e9b8 24 unsigned int r_sw2 :1;
Komazawa_sun 0:519ec302e9b8 25 unsigned int r_sw3 :1;
Komazawa_sun 0:519ec302e9b8 26 unsigned int r_sw4 :1;
Komazawa_sun 0:519ec302e9b8 27 unsigned int r_s_sw1 :1;
Komazawa_sun 0:519ec302e9b8 28 unsigned int r_s_sw2 :1;
Komazawa_sun 0:519ec302e9b8 29 unsigned int l_sw1 :1;
Komazawa_sun 0:519ec302e9b8 30 unsigned int l_sw2 :1;
Komazawa_sun 0:519ec302e9b8 31 unsigned int l_sw3 :1;
Komazawa_sun 0:519ec302e9b8 32 unsigned int l_sw4 :1;
Komazawa_sun 0:519ec302e9b8 33 unsigned int l_s_sw1 :1;
Komazawa_sun 0:519ec302e9b8 34 unsigned int l_s_sw2 :1;
Komazawa_sun 0:519ec302e9b8 35 unsigned int mode1 :1;
Komazawa_sun 0:519ec302e9b8 36 unsigned int mode2 :1;
Komazawa_sun 0:519ec302e9b8 37 signed int r_srd :8;
Komazawa_sun 0:519ec302e9b8 38 signed int l_srd :8;
Komazawa_sun 0:519ec302e9b8 39 unsigned int no_data :2;
Komazawa_sun 0:519ec302e9b8 40 unsigned char checksum:8;
Komazawa_sun 0:519ec302e9b8 41 unsigned char stop_byte :8;
Komazawa_sun 0:519ec302e9b8 42 };
Komazawa_sun 0:519ec302e9b8 43 };
Komazawa_sun 0:519ec302e9b8 44
Komazawa_sun 0:519ec302e9b8 45 i2c_jusinkun_data ctrl;
Komazawa_sun 0:519ec302e9b8 46
Komazawa_sun 0:519ec302e9b8 47
Komazawa_sun 0:519ec302e9b8 48 union i2c_johanshin_data
Komazawa_sun 0:519ec302e9b8 49 {
Komazawa_sun 0:519ec302e9b8 50 char all_data[4];
Komazawa_sun 0:519ec302e9b8 51 struct
Komazawa_sun 0:519ec302e9b8 52 {
Komazawa_sun 0:519ec302e9b8 53 struct
Komazawa_sun 0:519ec302e9b8 54 {
Komazawa_sun 0:519ec302e9b8 55 signed int pwm :8;
Komazawa_sun 0:519ec302e9b8 56 int fire1 :1;
Komazawa_sun 0:519ec302e9b8 57 int fire2 :1;
Komazawa_sun 0:519ec302e9b8 58 }r;
Komazawa_sun 0:519ec302e9b8 59
Komazawa_sun 0:519ec302e9b8 60 struct
Komazawa_sun 0:519ec302e9b8 61 {
Komazawa_sun 0:519ec302e9b8 62 signed int pwm :8;
Komazawa_sun 0:519ec302e9b8 63 int fire1 :1;
Komazawa_sun 0:519ec302e9b8 64 int fire2 :1;
Komazawa_sun 0:519ec302e9b8 65 }l;
Komazawa_sun 0:519ec302e9b8 66
Komazawa_sun 0:519ec302e9b8 67 struct
Komazawa_sun 0:519ec302e9b8 68 {
Komazawa_sun 0:519ec302e9b8 69 signed int pwm :8;
Komazawa_sun 0:519ec302e9b8 70 int fire :1;
Komazawa_sun 0:519ec302e9b8 71 //int fire2 :1;
Komazawa_sun 0:519ec302e9b8 72 }k;
Komazawa_sun 0:519ec302e9b8 73
Komazawa_sun 0:519ec302e9b8 74 int sao_call1 :1;
Komazawa_sun 0:519ec302e9b8 75 int sao_call2 :1;
Komazawa_sun 0:519ec302e9b8 76 int no_data :1;
Komazawa_sun 0:519ec302e9b8 77 };
Komazawa_sun 0:519ec302e9b8 78 }; //apper_body
Komazawa_sun 0:519ec302e9b8 79 i2c_johanshin_data a;
Komazawa_sun 0:519ec302e9b8 80
Komazawa_sun 0:519ec302e9b8 81 union i2c_johanshin_return
Komazawa_sun 0:519ec302e9b8 82 {
Komazawa_sun 0:519ec302e9b8 83 char all_data[1];
Komazawa_sun 0:519ec302e9b8 84 struct limit
Komazawa_sun 0:519ec302e9b8 85 {
Komazawa_sun 0:519ec302e9b8 86 unsigned int max_limit :1;
Komazawa_sun 0:519ec302e9b8 87 unsigned int min_limit :1;
Komazawa_sun 0:519ec302e9b8 88 };
Komazawa_sun 0:519ec302e9b8 89 limit r;
Komazawa_sun 0:519ec302e9b8 90 limit l;
Komazawa_sun 0:519ec302e9b8 91 limit k;
Komazawa_sun 0:519ec302e9b8 92 }; //apper_body_return
Komazawa_sun 0:519ec302e9b8 93 i2c_johanshin_return ar;
Komazawa_sun 0:519ec302e9b8 94
Komazawa_sun 0:519ec302e9b8 95 int data_index[23];
Komazawa_sun 0:519ec302e9b8 96 };
Komazawa_sun 0:519ec302e9b8 97
Komazawa_sun 0:519ec302e9b8 98
Komazawa_sun 0:519ec302e9b8 99 #endif