aboutsummaryrefslogtreecommitdiff
path: root/libraries/Firmata/Firmata.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/Firmata/Firmata.h')
-rw-r--r--libraries/Firmata/Firmata.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/libraries/Firmata/Firmata.h b/libraries/Firmata/Firmata.h
index 86535d9..74f1ccc 100644
--- a/libraries/Firmata/Firmata.h
+++ b/libraries/Firmata/Firmata.h
@@ -13,16 +13,15 @@
#ifndef Firmata_h
#define Firmata_h
-#include <Arduino.h>
-#include <inttypes.h>
-
+#include "Boards.h" /* Hardware Abstraction Layer + Wiring/Arduino */
/* Version numbers for the protocol. The protocol is still changing, so these
* version numbers are important. This number can be queried so that host
* software can test whether it will be compatible with the currently
* installed firmware. */
#define FIRMATA_MAJOR_VERSION 2 // for non-compatible changes
-#define FIRMATA_MINOR_VERSION 2 // for backwards compatible changes
+#define FIRMATA_MINOR_VERSION 3 // for backwards compatible changes
+#define FIRMATA_BUGFIX_VERSION 1 // for bugfix releases
#define MAX_DATA_BYTES 32 // max number of data bytes in non-Sysex messages
@@ -66,8 +65,8 @@
#define SYSEX_SAMPLING_INTERVAL 0x7A // same as SAMPLING_INTERVAL
// pin modes
-//#define INPUT 0x00 // defined in Arduino.h
-//#define OUTPUT 0x01 // defined in Arduino.h
+//#define INPUT 0x00 // defined in wiring.h
+//#define OUTPUT 0x01 // defined in wiring.h
#define ANALOG 0x02 // analog pin in analogInput mode
#define PWM 0x03 // digital pin in PWM output mode
#define SERVO 0x04 // digital pin in Servo output mode
@@ -88,10 +87,11 @@ extern "C" {
class FirmataClass
{
public:
- FirmataClass();
+ FirmataClass(Stream &s);
/* Arduino constructors */
void begin();
void begin(long);
+ void begin(Stream &s);
/* querying functions */
void printVersion(void);
void blinkVersion(void);
@@ -116,6 +116,7 @@ public:
void detach(byte command);
private:
+ Stream &FirmataSerial;
/* firmware name and version */
byte firmwareVersionCount;
byte *firmwareVersionVector;
@@ -141,6 +142,9 @@ private:
void processSysexMessage(void);
void systemReset(void);
void pin13strobe(int count, int onInterval, int offInterval);
+ void sendValueAsTwo7bitBytes(int value);
+ void startSysex(void);
+ void endSysex(void);
};
extern FirmataClass Firmata;
@@ -155,8 +159,5 @@ extern FirmataClass Firmata;
*/
#define setFirmwareVersion(x, y) setFirmwareNameAndVersion(__FILE__, x, y)
-/* Hardware Abstraction Layer */
-#include "Boards.h"
-
#endif /* Firmata_h */