-
Camera.h@0:9719776f6e46, 2014-07-04 (annotated)
- Committer:
- Deurklink
- Date:
- Fri Jul 04 09:48:47 2014 +0000
- Revision:
- 0:9719776f6e46
-
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Deurklink | 0:9719776f6e46 | 1 | #include "mbed.h" |
Deurklink | 0:9719776f6e46 | 2 | #include <string> |
Deurklink | 0:9719776f6e46 | 3 | #include "GPS.h" |
Deurklink | 0:9719776f6e46 | 4 | #include "EthernetPowerControl.h" |
Deurklink | 0:9719776f6e46 | 5 | #include "MODSERIAL.h" |
Deurklink | 0:9719776f6e46 | 6 | |
Deurklink | 0:9719776f6e46 | 7 | #define XBEETIMEOUT 5 |
Deurklink | 0:9719776f6e46 | 8 | |
Deurklink | 0:9719776f6e46 | 9 | class Camera |
Deurklink | 0:9719776f6e46 | 10 | { |
Deurklink | 0:9719776f6e46 | 11 | public: |
Deurklink | 0:9719776f6e46 | 12 | Camera(PinName gpsTx, PinName gpsRx, PinName xbTx, PinName xbRx, int freq, int len, int cdelay); |
Deurklink | 0:9719776f6e46 | 13 | GPS gps; |
Deurklink | 0:9719776f6e46 | 14 | bool init(); |
Deurklink | 0:9719776f6e46 | 15 | void parseXbee(); |
Deurklink | 0:9719776f6e46 | 16 | void parseGpsData(); |
Deurklink | 0:9719776f6e46 | 17 | bool gpsReadable(); |
Deurklink | 0:9719776f6e46 | 18 | bool xbeeReadable(); |
Deurklink | 0:9719776f6e46 | 19 | |
Deurklink | 0:9719776f6e46 | 20 | DigitalOut L1; |
Deurklink | 0:9719776f6e46 | 21 | DigitalOut L2; |
Deurklink | 0:9719776f6e46 | 22 | DigitalOut L3; |
Deurklink | 0:9719776f6e46 | 23 | DigitalOut L4; |
Deurklink | 0:9719776f6e46 | 24 | |
Deurklink | 0:9719776f6e46 | 25 | private: |
Deurklink | 0:9719776f6e46 | 26 | MODSERIAL XBee; |
Deurklink | 0:9719776f6e46 | 27 | InterruptIn PPS; |
Deurklink | 0:9719776f6e46 | 28 | char RxBuffer[256]; |
Deurklink | 0:9719776f6e46 | 29 | |
Deurklink | 0:9719776f6e46 | 30 | bool PWMon; |
Deurklink | 0:9719776f6e46 | 31 | bool RxTO; |
Deurklink | 0:9719776f6e46 | 32 | |
Deurklink | 0:9719776f6e46 | 33 | int TimingOffset; |
Deurklink | 0:9719776f6e46 | 34 | int BeaconNumber; |
Deurklink | 0:9719776f6e46 | 35 | |
Deurklink | 0:9719776f6e46 | 36 | void ppsSync(); |
Deurklink | 0:9719776f6e46 | 37 | void readDipSwitch(); |
Deurklink | 0:9719776f6e46 | 38 | void initDipSwitch(); |
Deurklink | 0:9719776f6e46 | 39 | |
Deurklink | 0:9719776f6e46 | 40 | // Pins are all bound to a mbed pin in the constructor |
Deurklink | 0:9719776f6e46 | 41 | // Digital pins for setting the Timing offset |
Deurklink | 0:9719776f6e46 | 42 | DigitalIn T1; |
Deurklink | 0:9719776f6e46 | 43 | DigitalIn T2; |
Deurklink | 0:9719776f6e46 | 44 | DigitalIn T3; |
Deurklink | 0:9719776f6e46 | 45 | DigitalIn T4; |
Deurklink | 0:9719776f6e46 | 46 | DigitalIn T5; |
Deurklink | 0:9719776f6e46 | 47 | DigitalIn T6; |
Deurklink | 0:9719776f6e46 | 48 | DigitalIn T7; |
Deurklink | 0:9719776f6e46 | 49 | DigitalIn T8; |
Deurklink | 0:9719776f6e46 | 50 | |
Deurklink | 0:9719776f6e46 | 51 | // Digital pins for setting the beacon number |
Deurklink | 0:9719776f6e46 | 52 | DigitalIn B1; |
Deurklink | 0:9719776f6e46 | 53 | DigitalIn B2; |
Deurklink | 0:9719776f6e46 | 54 | DigitalIn B3; |
Deurklink | 0:9719776f6e46 | 55 | DigitalIn B4; |
Deurklink | 0:9719776f6e46 | 56 | |
Deurklink | 0:9719776f6e46 | 57 | int PulseFrequency; //Hz |
Deurklink | 0:9719776f6e46 | 58 | int Pulselength; //usec |
Deurklink | 0:9719776f6e46 | 59 | int PWMclock; |
Deurklink | 0:9719776f6e46 | 60 | int Period; |
Deurklink | 0:9719776f6e46 | 61 | int CameraDelay_us; //usec |
Deurklink | 0:9719776f6e46 | 62 | |
Deurklink | 0:9719776f6e46 | 63 | Timeout _CameraDelay; |
Deurklink | 0:9719776f6e46 | 64 | void cameraDelay(); |
Deurklink | 0:9719776f6e46 | 65 | |
Deurklink | 0:9719776f6e46 | 66 | Timeout _RxTimeOut; |
Deurklink | 0:9719776f6e46 | 67 | void rxTimeOut(); |
Deurklink | 0:9719776f6e46 | 68 | |
Deurklink | 0:9719776f6e46 | 69 | void startPWM(); |
Deurklink | 0:9719776f6e46 | 70 | void stopPWM(); |
Deurklink | 0:9719776f6e46 | 71 | void resetPWM(int _PulseFrequency, int _Pulselength); |
Deurklink | 0:9719776f6e46 | 72 | void printStatus(); |
Deurklink | 0:9719776f6e46 | 73 | void getXbeeData(); |
Deurklink | 0:9719776f6e46 | 74 | }; |