I messed up the merge, so pushing it over to another repo so I don't lose it. Will tidy up and remove later

Dependencies:   BufferedSerial FatFileSystemCpp mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FIZReader.h Source File

FIZReader.h

00001 #ifndef __FIZReader_H__
00002 #define __FIZReader_H__
00003 #include "BufferedSerial.h"
00004 #include <vector>
00005 
00006 class FIZReader {
00007 
00008 public:
00009   FIZReader(const PinName Tx, const PinName Rx);
00010   virtual void requestCurrent() = 0;
00011 
00012     /// true if the values have been updated since the last update.
00013     // focus and zoom are in mm, iris is in 100ths of a stop
00014   bool getMostRecent(uint32_t *focus, uint16_t *iris, uint16_t *zoom);
00015 
00016 protected:
00017   int hexValue(char ascii);
00018   unsigned int getAbsoluteValue(unsigned int encoder_pos, vector<unsigned int> &encoder_range, vector<unsigned int> &absolute_range);
00019   uint32_t getAbsoluteFocus(uint32_t encoder_pos);
00020   uint16_t getAbsoluteIris(uint16_t encoder_pos);
00021   uint16_t getAbsoluteZoom(uint16_t encoder_pos);
00022   RawSerial _port;
00023    
00024     uint32_t _focus; // in mm
00025     uint16_t _iris; // in 100ths of F stop
00026     uint16_t _zoom; // in mm
00027     bool newData;
00028         
00029 };
00030 
00031 #endif