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.
Dependents: HEPTA_assembly template HEPTA_GS
Diff: HeptaSerial.h
- Revision:
- 3:12659e671bad
- Parent:
- 2:686c7043f5f4
- Child:
- 4:57c7f33a3621
--- a/HeptaSerial.h Wed Jul 19 09:20:37 2017 +0000
+++ b/HeptaSerial.h Fri Jul 21 10:35:56 2017 +0000
@@ -1,31 +1,12 @@
-/**
- * C1098-SS device driver class (Version 1.0)
- * Reference documents: C1098-SS User Manual v1.0 2012.5.6
- *
- * CameraC328Library
- * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
- * http://shinta.main.jp/
- *
- * CameraC1098-SS Library
- * Copyright (C) 2012 Tadao Iida
- */
-
#include "mbed.h"
#include "SerialBuffered.h"
#ifndef HEPTA_SERIAL_H
#define HEPTA_SERIAL_H
-/*
- * Class: HeptaSerial
- */
-
class HeptaSerial {
public:
- /**
- * @enum JPEG resolution.
- */
enum JpegResolution {
JpegResolution80x64 = 0x01, // unofficial
JpegResolution160x128 = 0x03, // unofficial
@@ -33,9 +14,6 @@
JpegResolution640x480 = 0x07 // VGA
};
- /**
- * @enum Error number.
- */
enum ErrorNumber {
NoError = 0x00,
UnexpectedReply = 0x04,
@@ -46,9 +24,6 @@
SetTransferPackageSizeWrong = 0x11
};
- /**
- * @enum Baud rate.
- */
enum Baud {
Baud460800 = 0x02,
Baud230400 = 0x03,
@@ -58,67 +33,35 @@
Baud14400 = 0x07 // Default.
};
- /**
- * @enum Reset type.
- */
enum ResetType {
Nomal = 0x00,
High = 0xff
};
- /** Constructor.
- *
- * @param tx A pin for transmit.
- * @param rx A pin for receive.
- * @param baud Baud rate. (Default is 14400.)
- */
HeptaSerial(PinName tx, PinName rx, int baud = 14400);
- /** Destructor.
- *
- */
~HeptaSerial();
- /** sync
- * Make a sync. for baud rate.
- */
ErrorNumber sync();
-
- /** Initialize.
- *
- *
- * @param baud Camera Interface Speed.
- * @param jr JPEG resolution.
- */
ErrorNumber init(Baud baud, JpegResolution jr);
-
- /** getJpegSnapshotPicture
- * Get JPEG snapshot picture.
- *
- * @param func A pointer to a callback function.
- * You can block this function until saving the image datas.
- * @return Status of the error.
- */
ErrorNumber getJpegSnapshotPicture();
ErrorNumber getJpegSnapshotPicture_data();
-
- /** setmbedBaud
- * mbed Interface Speed.
- *
- * @param baud mbed Interface Speed.
- */
void setmbedBaud(Baud baud);
void Sync(void);
void initialize(Baud baud,JpegResolution jr);
- void test_jpeg_snapshot_picture(void);
- void test_jpeg_snapshot_data(void);
+ void test_jpeg_snapshot_picture(int CAPTURE_FRAMES);
+ void test_jpeg_snapshot_data(int CAPTURE_FRAMES);
void jpeg_callback(char *buf, size_t siz);
+
+
+
+
private:
SerialBuffered serial;
static const int COMMAND_LENGTH = 6;
static const int SYNCMAX = 60;
static const int packageSize = 256;
- static const int CAPTURE_FRAMES = 3;
+ //static const int CAPTURE_FRAMES = 3;
ErrorNumber sendInitial(Baud band, JpegResolution jr);
ErrorNumber sendGetPicture(void);