This library is a Snootlab's library's translation to use Akene on mbed boards instead of Arduino ones. The functions Akene.begin() and Akene.send() work perfectly, but no real checkup has been made for the other functions. Feel free to implement what you want to make your device work on mbed.
Akene.h@0:48c5b5c0395e, 2015-11-27 (annotated)
- Committer:
- Remitte
- Date:
- Fri Nov 27 15:42:18 2015 +0000
- Revision:
- 0:48c5b5c0395e
This is a Snootlab's library's translation to use Akene on mbed boards instead of Arduino ones.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Remitte | 0:48c5b5c0395e | 1 | /* |
Remitte | 0:48c5b5c0395e | 2 | This file is a Snootlab's header file's translation to use Akene on mbed boards instead of Arduino ones. |
Remitte | 0:48c5b5c0395e | 3 | The functions Akene.begin() and Akene.send() work perfectly, but no real checkup has been made for the other functions. |
Remitte | 0:48c5b5c0395e | 4 | Feel free to implement what you want to make your device work on mbed. |
Remitte | 0:48c5b5c0395e | 5 | |
Remitte | 0:48c5b5c0395e | 6 | This translation is due to a Polytech Paris UPMC project led by Rémi Jourdain with the help of Clément Maciejewski. |
Remitte | 0:48c5b5c0395e | 7 | |
Remitte | 0:48c5b5c0395e | 8 | Visit <http://snootlab.com> |
Remitte | 0:48c5b5c0395e | 9 | Copyright (C) 2013-2015 Snootlab. All rights reserved. |
Remitte | 0:48c5b5c0395e | 10 | |
Remitte | 0:48c5b5c0395e | 11 | Akene is free software: you can redistribute it and/or modify |
Remitte | 0:48c5b5c0395e | 12 | it under the terms of the GNU General Public License as published by |
Remitte | 0:48c5b5c0395e | 13 | the Free Software Foundation, either version 3 of the License, or |
Remitte | 0:48c5b5c0395e | 14 | (at your option) any later version. |
Remitte | 0:48c5b5c0395e | 15 | |
Remitte | 0:48c5b5c0395e | 16 | Akene is distributed in the hope that it will be useful, |
Remitte | 0:48c5b5c0395e | 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
Remitte | 0:48c5b5c0395e | 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Remitte | 0:48c5b5c0395e | 19 | GNU General Public License for more details. |
Remitte | 0:48c5b5c0395e | 20 | |
Remitte | 0:48c5b5c0395e | 21 | You should have received a copy of the GNU General Public License |
Remitte | 0:48c5b5c0395e | 22 | along with Akene. If not, see <http://www.gnu.org/licenses/>. |
Remitte | 0:48c5b5c0395e | 23 | */ |
Remitte | 0:48c5b5c0395e | 24 | |
Remitte | 0:48c5b5c0395e | 25 | #ifndef AKENE_H |
Remitte | 0:48c5b5c0395e | 26 | #define AKENE_H |
Remitte | 0:48c5b5c0395e | 27 | |
Remitte | 0:48c5b5c0395e | 28 | #include "mbed.h" |
Remitte | 0:48c5b5c0395e | 29 | |
Remitte | 0:48c5b5c0395e | 30 | class Akene_ { |
Remitte | 0:48c5b5c0395e | 31 | public: |
Remitte | 0:48c5b5c0395e | 32 | Akene_(); |
Remitte | 0:48c5b5c0395e | 33 | ~Akene_(); |
Remitte | 0:48c5b5c0395e | 34 | void begin(); |
Remitte | 0:48c5b5c0395e | 35 | bool isReady(); |
Remitte | 0:48c5b5c0395e | 36 | bool send(const void* data, uint8_t len); |
Remitte | 0:48c5b5c0395e | 37 | uint8_t getRev(); |
Remitte | 0:48c5b5c0395e | 38 | unsigned long getID(); |
Remitte | 0:48c5b5c0395e | 39 | bool setPower(uint8_t power); |
Remitte | 0:48c5b5c0395e | 40 | |
Remitte | 0:48c5b5c0395e | 41 | enum RETURN_CODE { |
Remitte | 0:48c5b5c0395e | 42 | OK = 'O', |
Remitte | 0:48c5b5c0395e | 43 | KO = 'K', |
Remitte | 0:48c5b5c0395e | 44 | SENT = 'S' |
Remitte | 0:48c5b5c0395e | 45 | }; |
Remitte | 0:48c5b5c0395e | 46 | |
Remitte | 0:48c5b5c0395e | 47 | private: |
Remitte | 0:48c5b5c0395e | 48 | Serial _serial; |
Remitte | 0:48c5b5c0395e | 49 | unsigned long _lastSend; |
Remitte | 0:48c5b5c0395e | 50 | Timer _T; |
Remitte | 0:48c5b5c0395e | 51 | uint8_t _nextReturn(); |
Remitte | 0:48c5b5c0395e | 52 | }; |
Remitte | 0:48c5b5c0395e | 53 | |
Remitte | 0:48c5b5c0395e | 54 | extern Akene_ Akene; |
Remitte | 0:48c5b5c0395e | 55 | |
Remitte | 0:48c5b5c0395e | 56 | #endif |