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-10
Revision:
8:ecf68db484af
Child:
12:e0adb697fcdb

File content as of revision 8:ecf68db484af:

// 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 = ((4 << 8) | 7);

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