SDFileSystem

Dependencies:   mbed PowerControl SDFileSystem

Fork of SDFilesystem by 智也 大野

Committer:
tomoya123
Date:
Fri Dec 09 05:02:42 2016 +0000
Revision:
0:8d235efb1150
SDcard

Who changed what in which revision?

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