Ivan Stoev / HeptaCamera_GPS

Dependents:   3daf572bcae1 Team Team01_HEPTA_Trainig

Fork of HeptaCamera_GPS by HEPTA-Sat Training 2017~2018

Files at this revision

API Documentation at this revision

Comitter:
umeume
Date:
Sat Aug 05 14:20:51 2017 +0000
Parent:
6:c11f48bbb567
Child:
8:6d9c33df4c09
Commit message:
test;

Changed in this revision

HeptaSerial.cpp Show annotated file Show diff for this revision Revisions of this file
HeptaSerial.h Show annotated file Show diff for this revision Revisions of this file
--- a/HeptaSerial.cpp	Sat Aug 05 13:36:04 2017 +0000
+++ b/HeptaSerial.cpp	Sat Aug 05 14:20:51 2017 +0000
@@ -12,7 +12,7 @@
  * @param rx A pin for receive.
  * @param baud Baud rate. (Default is Baud14400.)
  */
-HeptaSerial::HeptaSerial(PinName tx, PinName rx) : serial(tx, rx)
+HeptaSerial::HeptaSerial(PinName tx, PinName rx, PinName CAM, PinName GPS) : serial(tx, rx), CAM_SW(CAM), GPS_SW(GPS)
 {
     //serial.baud(baud);
 }
@@ -610,11 +610,17 @@
     return true;
 }
 
+void HeptaSerial::camera_setting(void)
+{
+    CAM_SW = 1;
+    GPS_SW = 0;
+    serial.setTimeout(1);
+}
+
 void HeptaSerial::Sync(void)
 {
-    serial.setTimeout(1);
+    camera_setting();
     HeptaSerial::ErrorNumber err = HeptaSerial::NoError;
-
     err = sync();
     int count=0;
     while(err) {
@@ -696,6 +702,8 @@
 //*********************serial*********************//
 void HeptaSerial::gps_setting(void)
 {
+    CAM_SW = 0;
+    GPS_SW = 1;
     serial._baud(9600);
     serial.setTimeout(9999);
 }
--- a/HeptaSerial.h	Sat Aug 05 13:36:04 2017 +0000
+++ b/HeptaSerial.h	Sat Aug 05 14:20:51 2017 +0000
@@ -39,7 +39,7 @@
         High  = 0xff
     };
 
-    HeptaSerial(PinName tx, PinName rx);
+    HeptaSerial(PinName tx, PinName rx, PinName CAM, PinName GPS);
 
     ~HeptaSerial();
 
@@ -48,6 +48,7 @@
     ErrorNumber getJpegSnapshotPicture();
     ErrorNumber getJpegSnapshotPicture_data();
     void setmbedBaud(Baud baud);
+    void camera_setting(void);
     void Sync(void);
     void initialize(Baud baud,JpegResolution jr);
     void test_jpeg_snapshot_picture(int CAPTURE_FRAMES);
@@ -62,6 +63,8 @@
 
 private:
     SerialBuffered serial;
+    DigitalOut CAM_SW;
+    DigitalOut GPS_SW;
     static const int COMMAND_LENGTH = 6;
     static const int SYNCMAX = 60;
     static const int packageSize = 256;