Neptune_170620

Dependencies:   mbed

Committer:
Picmon
Date:
Wed Jun 17 10:11:19 2020 +0000
Revision:
0:20b4b057fa7f
Neptune;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Picmon 0:20b4b057fa7f 1 #ifndef CONTROLS_H
Picmon 0:20b4b057fa7f 2 #define CONTROLS_H
Picmon 0:20b4b057fa7f 3
Picmon 0:20b4b057fa7f 4 #include "mbed.h"
Picmon 0:20b4b057fa7f 5 #include "FastPWM.h"
Picmon 0:20b4b057fa7f 6
Picmon 0:20b4b057fa7f 7 //DVR8603 BLDC Motor Controller
Picmon 0:20b4b057fa7f 8 extern DigitalOut motEnable;
Picmon 0:20b4b057fa7f 9 extern DigitalOut motDir;
Picmon 0:20b4b057fa7f 10 extern DigitalOut nBrake;
Picmon 0:20b4b057fa7f 11 extern DigitalIn nFault;
Picmon 0:20b4b057fa7f 12
Picmon 0:20b4b057fa7f 13 //ADC/DAC
Picmon 0:20b4b057fa7f 14 extern AnalogIn ain;
Picmon 0:20b4b057fa7f 15 extern AnalogOut aout;
Picmon 0:20b4b057fa7f 16
Picmon 0:20b4b057fa7f 17 //Nucleo Debug LEDs
Picmon 0:20b4b057fa7f 18 extern DigitalOut led1;
Picmon 0:20b4b057fa7f 19 extern DigitalOut led2;
Picmon 0:20b4b057fa7f 20 extern DigitalOut led3;
Picmon 0:20b4b057fa7f 21
Picmon 0:20b4b057fa7f 22 //Button Membrane
Picmon 0:20b4b057fa7f 23 extern DigitalOut startLED;
Picmon 0:20b4b057fa7f 24 extern DigitalOut stopLED;
Picmon 0:20b4b057fa7f 25 extern DigitalIn startButton;
Picmon 0:20b4b057fa7f 26 extern DigitalIn stopButton;
Picmon 0:20b4b057fa7f 27
Picmon 0:20b4b057fa7f 28 //4-20mA Control Inputs
Picmon 0:20b4b057fa7f 29 extern DigitalIn rmtRunStop;// Run / Stop Input
Picmon 0:20b4b057fa7f 30 extern DigitalIn rmtExtCont;//External Contact Input
Picmon 0:20b4b057fa7f 31 extern DigitalIn rmtFldRec;//Remote Fluid Recovery Inputs
Picmon 0:20b4b057fa7f 32
Picmon 0:20b4b057fa7f 33 //Leak detection
Picmon 0:20b4b057fa7f 34 extern DigitalIn leakIn;
Picmon 0:20b4b057fa7f 35
Picmon 0:20b4b057fa7f 36 //4-20mA Control Outputs
Picmon 0:20b4b057fa7f 37 extern DigitalOut alarmOut1;
Picmon 0:20b4b057fa7f 38 extern DigitalOut alarmOut2;
Picmon 0:20b4b057fa7f 39
Picmon 0:20b4b057fa7f 40 //Netxion Power Control
Picmon 0:20b4b057fa7f 41 extern DigitalOut nexPwrCont;
Picmon 0:20b4b057fa7f 42
Picmon 0:20b4b057fa7f 43 //extern PwmOut pwm;
Picmon 0:20b4b057fa7f 44 extern FastPWM pwm;
Picmon 0:20b4b057fa7f 45
Picmon 0:20b4b057fa7f 46 extern float motorSpeed;
Picmon 0:20b4b057fa7f 47 extern float flowPercent;
Picmon 0:20b4b057fa7f 48 extern float lastMaxScale;
Picmon 0:20b4b057fa7f 49
Picmon 0:20b4b057fa7f 50
Picmon 0:20b4b057fa7f 51
Picmon 0:20b4b057fa7f 52 bool startBtn(bool byPassPress);
Picmon 0:20b4b057fa7f 53 bool stopBtn(bool byPassPress);
Picmon 0:20b4b057fa7f 54
Picmon 0:20b4b057fa7f 55 void confPWM(void);
Picmon 0:20b4b057fa7f 56 void confMotor(void);
Picmon 0:20b4b057fa7f 57 void confBtn(void);
Picmon 0:20b4b057fa7f 58 uint8_t anaIn(void);
Picmon 0:20b4b057fa7f 59 uint8_t manual(void);
Picmon 0:20b4b057fa7f 60 uint8_t contactMode(void);
Picmon 0:20b4b057fa7f 61 uint8_t flowCalMode(void);
Picmon 0:20b4b057fa7f 62 uint8_t fluidRecMode(void);
Picmon 0:20b4b057fa7f 63 void reset(void);
Picmon 0:20b4b057fa7f 64 void anaOut_mA(float mA);
Picmon 0:20b4b057fa7f 65 void anaOutScale(float mA_FullScale, float mA_MatchScale);
Picmon 0:20b4b057fa7f 66 float anaIn_mA(void);
Picmon 0:20b4b057fa7f 67 void ledClr(void);
Picmon 0:20b4b057fa7f 68 uint8_t motor(float rpmSetPoint, bool dir, bool brake, bool enable, float rampTime);
Picmon 0:20b4b057fa7f 69 void ConfInputSw(void);
Picmon 0:20b4b057fa7f 70 uint8_t startUpMode(uint8_t runMode);
Picmon 0:20b4b057fa7f 71 bool runStopSignal(bool runStopSig, struct settingsNVM *nvm);
Picmon 0:20b4b057fa7f 72 void outPuts(bool leakDetection, struct settingsNVM *nvm);
Picmon 0:20b4b057fa7f 73 bool leakDetect(bool leakInput);
Picmon 0:20b4b057fa7f 74
Picmon 0:20b4b057fa7f 75 #endif