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
hepta_sat/HeptaVoice.h
- Committer:
- tomoya123
- Date:
- 2016-12-09
- Revision:
- 0:9eb94b338772
File content as of revision 0:9eb94b338772:
#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;
};
