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.
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaBattery_SDFilesystem_Q by
Diff: hepta_sat/HeptaVoice.h
- Revision:
- 0:9eb94b338772
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hepta_sat/HeptaVoice.h Fri Dec 09 04:53:49 2016 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+
+#pragma once
+
+#define AQTK_I2C_ADDR (0x2E<<1)
+#define AQTK_STARTUP_WAIT_MS 80
+#define AQTK_POLL_WAIT_MS 10
+
+/** HeptaVoice class
+ *
+ * AquesTalk pico LSI I2C interface
+ * Example:
+ * @code
+ * #include "HeptaVoice.h"
+ * HeptaVoice talk(P0_10,P0_11); // I2C sda scl
+ *
+ * int main() {
+ * talk.Synthe("konnichiwa.");
+ * for(int n = 1; ; n++) {
+ * char buf[32];
+ * snprintf(buf, sizeof(buf), "<NUMK VAL=%d>.", n);
+ * talk.Synthe(buf);
+ * }
+ * }
+ * @endcode
+ *
+ */
+class HeptaVoice {
+public:
+ /** Create a AquesTalk pico LSI I2C interface
+ *
+ * @param sda I2C data pin
+ * @param scl I2C clock pin
+ * @param addr I2C address
+ */
+ HeptaVoice(PinName sda, PinName scl, int addr = AQTK_I2C_ADDR);
+ bool IsActive(int timeout_ms = 500);
+ void Synthe(const char* msg);
+ void Write(const char* msg);
+ bool IsBusy();
+private:
+ int _addr;
+ I2C _i2c;
+ Timer _poll_wait;
+};
