Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DRIVER.hpp
00001 #ifndef _DRIVER__HPP_ 00002 #define _DRIVER__HPP_ 00003 #include "mbed.h" 00004 00005 00006 //static Serial pc2(USBTX, USBRX); //Define serial namespace so the serial comms can be printed to 00007 class DRIVER 00008 { 00009 public: 00010 00011 DRIVER(PinName N1, PinName N2, PinName N3, PinName N4); 00012 ~DRIVER(); 00013 00014 //Core Functions 00015 00016 void Test(); 00017 void Sine_Lookup_Table_Generator(); 00018 void Output_Sine_Wave(); 00019 //Setter Functions 00020 //void Set_Pwm_Output(float Period, float Duty_Cycle); 00021 void Set_Control_Pin(bool Control_Pin); 00022 //Getter Functions 00023 float Get_Hall_Effect_Sensor_Value(); 00024 float Get_Coil_Feedback_Value(); 00025 00026 00027 private://Private member variables to prevent them being accessed externally 00028 00029 PwmOut _Pwm_Output; 00030 DigitalOut _Control_Pin; 00031 AnalogIn _Hall_Effect_Sensor; 00032 AnalogIn _Coil_Feedback; 00033 00034 //Values of inputs 00035 00036 float _Hall_Effect_Sensor_Value; 00037 float _Coil_Feedback_Value; 00038 //Mutex Locks 00039 }; 00040 00041 #endif//_DRIVER_HPP_ 00042 /* 00043 //Output Connections 00044 PwmOut Pwm_Output(PB_0);// PWM output pin D3 on the board 00045 DigitalOut Control_Pin(D5);//Control Pin for the board 00046 //Input Connections 00047 AnalogIn Hall_Effect_Sensor(PA_0);//Hall Effect Sensor A0 on board 00048 AnalogIn Coil_Feedback(PA_1);//Coil feedback ADC pin connection A1 on board 00049 */
Generated on Fri Jul 22 2022 04:09:08 by
 1.7.2
 1.7.2