Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Get_IMD/IMD.h

Committer:
martydd3
Date:
2014-10-21
Revision:
12:e0adb697fcdb
Parent:
8:ecf68db484af

File content as of revision 12:e0adb697fcdb:

// copied idea from http://developer.mbed.org/forum/mbed/topic/466/?page=1#comment-2457

#ifndef _FILE_IMD_H
#define _FILE_IMD_H  

#include "mbed.h"
#include "CANBuffer.h"
#include "rtos.h"

const int TX_IMD_ID = ((0x4 << 8) | 0x20);

class IMD{
    public:
        IMD(CANBuffer *can);
        void start_update();
        float frequency();
        float pulse_width();
        float duty();
        
    private:
        InterruptIn _p;
        Timer _t;
        float _pulsewidth, _period;
        void rise();
        void fall();      
};

#endif