Steven Kay / MC33926
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MC33926.h Source File

MC33926.h

00001 /********************************************************************************************
00002 
00003    Filename: MC33926.h
00004    
00005    Original Author: Steven Kay
00006 
00007    Development Group: Steve!!
00008 
00009    Original Creation Date: April 2017
00010 
00011    Description: <Desc>
00012 
00013    Revision History: Version 1.0 - Initial Release
00014 
00015  *********************************************************************************************/
00016 
00017 #ifndef MC33926_H
00018 #define MC33926_H
00019 
00020 
00021 #include "mbed.h"
00022 
00023 
00024 #define DRIVER_PWM_PERIOD       2
00025 
00026 
00027 #define RESET                   2
00028 #define FORWARD                 1
00029 #define REVERSE                 0
00030 
00031 
00032 class MC33926
00033 {
00034     
00035     public:
00036     
00037     MC33926(PinName pinIN1, PinName pinIN2, PinName pinFB, PinName pinSF);
00038         
00039     
00040     void SetPWMPulsewidth(int direction, float PWM_Pulsewidth);
00041     
00042     float ReadCurrentFeedback();
00043     
00044     // Implemented on v2.0
00045 //    void StatusFlagWatch(bool latchPol);
00046 //    bool GetStatus();
00047 //    void ResetStatus();
00048         
00049     protected:
00050     
00051         PwmOut *_pinIN1;
00052         PwmOut *_pinIN2;
00053         AnalogIn *_pinFB;
00054         InterruptIn *_pinSF;
00055         
00056         volatile bool statusFlag;
00057     
00058     
00059     void StatusFlagISR();
00060 
00061     
00062 };
00063 
00064 #endif