hattori&ide

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MITSUBA_CAN.h Source File

MITSUBA_CAN.h

00001 /**
00002 * define LogFrame Address.
00003 */
00004 #define FRAME0  0x01
00005 #define FRAME1  0x02
00006 
00007 #include "mbed.h"
00008 
00009 /**
00010 * MITSUBA class
00011 */
00012 class MITSUBA {
00013 public:
00014   /**
00015   * variables parsed from CAN data
00016   */
00017   double batteryVoltage;    // 0.5V / LSB
00018   double batteryCurrent;    // 1A / LSB
00019   double motorCurrentPeak;  // 1A / LSB
00020   double FETtemp;           // 5deg / LSB
00021   double rpmMotor;          // 1rpm / LSB
00022   double duty;              // 0.5% / LSB
00023   double angle;             // 0.5deg / LSB
00024   double accelPosition;     // 0.5% / LSB
00025   double regenePosition;    // 0.5% / LSB
00026   double OUTtarget;          // 0.5A/LSB
00027 
00028   /**
00029   * MITSUBA constructor.
00030   @param _can instance of CAN
00031   @param freq CAN frequency
00032   */
00033   MITSUBA(CAN &_can, int freq);
00034   /**
00035   * Fetch and Parse data sent by the MITSUBA Inverter.
00036   @param val LogFrame Address
00037   */
00038   void GetCanData(unsigned char val);
00039 
00040 private:
00041   CAN &can;
00042   int canfreq;
00043   void ParseFrame0(unsigned char *data);
00044   void ParseFrame1(unsigned char *data);
00045 };