Kobayashi Akihiro / ActiveCaster

Dependents:   ActiveCaster_ ActiveCaster_2

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AMT22.h Source File

AMT22.h

00001 #ifndef _AMT22_H
00002 #define _AMT22_H
00003 
00004 #include "mbed.h"
00005 #include "define.h"
00006 //#include <SPI.h>
00007 
00008 class AMT203V{
00009   public:
00010   AMT203V(SPI*, PinName);
00011 
00012   int spi_write(int msg);
00013   int init();
00014   int getEncount();
00015   void updateCount();
00016   int setZeroPos();
00017   int getRawEncount();
00018 
00019   private:
00020   bool init_done;
00021   //unsigned char CSBpin;
00022   const int res = 0x3FFF;//4096;
00023   unsigned int ABSposition;  // rawdata
00024   unsigned int preABSposition;
00025   int rotation = 0;
00026   int encount;        // 渡す値
00027   int temp[2];
00028 
00029   SPI *pSPI;
00030   DigitalOut *CSBpin;
00031 
00032 };
00033 
00034 #endif