2017_hongo_Bteam

Dependents:   DataPool

BetaPool.h

Committer:
Komazawa_sun
Date:
2017-08-30
Revision:
2:503337abcb4a
Parent:
0:31116bc8d4a7

File content as of revision 2:503337abcb4a:

#ifndef BETAPOOL_H
#define BETAPOOL_H

#include "I2CTransporter.h"

class BetaPool{
    public:
        BetaPool();
        void up_load();
        void reset();
        
        union i2c_jusinkun_data //from jushinkun_datas
        {
            char all_data[10];
            struct 
            {
                unsigned char start_byte:8;
                signed int rx :8;
                signed int ry :8;
                signed int lx :8;
                unsigned int r_sw1 :1;
                unsigned int r_sw2 :1;
                unsigned int r_sw3 :1;
                unsigned int r_sw4 :1;
                unsigned int r_s_sw1 :1;
                unsigned int r_s_sw2 :1;
                unsigned int l_sw1 :1;
                unsigned int l_sw2 :1;
                unsigned int l_sw3 :1;
                unsigned int l_sw4 :1;
                unsigned int l_s_sw1 :1;
                unsigned int l_s_sw2 :1;
                unsigned int mode1 :1;
                unsigned int mode2 :1;
                signed int r_srd :8;
                signed int l_srd :8;
                unsigned int no_data :2;
                //unsigned int no_data :4;
                unsigned char checksum:8;
                unsigned char stop_byte :8;
            };
        };
        
        i2c_jusinkun_data ctrl;
        
        
        /*union i2c_johanshin_data
        {
            char all_data[4];
            struct
            {
                struct
                {
                    signed int pwm :8;
                    int fire1 :1;
                    int fire2 :1;
                }r;
                
                struct
                {
                    signed int pwm :8;
                    int fire1 :1;
                    int fire2 :1;
                }l;

                struct
                {
                    signed int pwm :8;
                    int fire :1;
                    //int fire2 :1;
                }k;
                
                int sao_call1 :1;
                int sao_call2 :1;
                int no_data :1;        
            };
        }; //apper_body
        i2c_johanshin_data a;
        
        union i2c_johanshin_return
        {
            char all_data[1];
            struct limit
            {
                unsigned int max_limit :1;
                unsigned int min_limit :1;
            };
            limit r;
            limit l;  
            limit k;  
        }; //apper_body_return
        i2c_johanshin_return ar;*/

        int data_index[23];
};


#endif