智也 大野 / Mbed 2 deprecated HeptaBattery_SDFilesystem_Q

Dependencies:   mbed PowerControl SDFileSystem

Fork of HeptaBattery_SDFilesystem_Q by 智也 大野

Committer:
tomoya123
Date:
Fri Dec 09 04:53:49 2016 +0000
Revision:
0:9eb94b338772
Battery and SDcard Q

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tomoya123 0:9eb94b338772 1 #include "mbed.h"
tomoya123 0:9eb94b338772 2
tomoya123 0:9eb94b338772 3 #pragma once
tomoya123 0:9eb94b338772 4
tomoya123 0:9eb94b338772 5 #define AQTK_I2C_ADDR (0x2E<<1)
tomoya123 0:9eb94b338772 6 #define AQTK_STARTUP_WAIT_MS 80
tomoya123 0:9eb94b338772 7 #define AQTK_POLL_WAIT_MS 10
tomoya123 0:9eb94b338772 8
tomoya123 0:9eb94b338772 9 /** HeptaVoice class
tomoya123 0:9eb94b338772 10 *
tomoya123 0:9eb94b338772 11 * AquesTalk pico LSI I2C interface
tomoya123 0:9eb94b338772 12 * Example:
tomoya123 0:9eb94b338772 13 * @code
tomoya123 0:9eb94b338772 14 * #include "HeptaVoice.h"
tomoya123 0:9eb94b338772 15 * HeptaVoice talk(P0_10,P0_11); // I2C sda scl
tomoya123 0:9eb94b338772 16 *
tomoya123 0:9eb94b338772 17 * int main() {
tomoya123 0:9eb94b338772 18 * talk.Synthe("konnichiwa.");
tomoya123 0:9eb94b338772 19 * for(int n = 1; ; n++) {
tomoya123 0:9eb94b338772 20 * char buf[32];
tomoya123 0:9eb94b338772 21 * snprintf(buf, sizeof(buf), "<NUMK VAL=%d>.", n);
tomoya123 0:9eb94b338772 22 * talk.Synthe(buf);
tomoya123 0:9eb94b338772 23 * }
tomoya123 0:9eb94b338772 24 * }
tomoya123 0:9eb94b338772 25 * @endcode
tomoya123 0:9eb94b338772 26 *
tomoya123 0:9eb94b338772 27 */
tomoya123 0:9eb94b338772 28 class HeptaVoice {
tomoya123 0:9eb94b338772 29 public:
tomoya123 0:9eb94b338772 30 /** Create a AquesTalk pico LSI I2C interface
tomoya123 0:9eb94b338772 31 *
tomoya123 0:9eb94b338772 32 * @param sda I2C data pin
tomoya123 0:9eb94b338772 33 * @param scl I2C clock pin
tomoya123 0:9eb94b338772 34 * @param addr I2C address
tomoya123 0:9eb94b338772 35 */
tomoya123 0:9eb94b338772 36 HeptaVoice(PinName sda, PinName scl, int addr = AQTK_I2C_ADDR);
tomoya123 0:9eb94b338772 37 bool IsActive(int timeout_ms = 500);
tomoya123 0:9eb94b338772 38 void Synthe(const char* msg);
tomoya123 0:9eb94b338772 39 void Write(const char* msg);
tomoya123 0:9eb94b338772 40 bool IsBusy();
tomoya123 0:9eb94b338772 41 private:
tomoya123 0:9eb94b338772 42 int _addr;
tomoya123 0:9eb94b338772 43 I2C _i2c;
tomoya123 0:9eb94b338772 44 Timer _poll_wait;
tomoya123 0:9eb94b338772 45 };