zfm20: Use mraa::Uart instead of tty

Updated the ZFM20 class to use UART functionality provided through the
mraa::Uart class instead of using the UART directly.

    * Switch to mraa::Uart
    * Added raw uart string constructor, closes #621
    * Updated examples
    * Added a common.i to minimize interface duplication
    * Removed pointers from C++ functions where references are
      preferable
    * Removed dependency on termios
    * Added typedefs to handle pass-by-reference
    * Removed flushes
    * Removed code after throws

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2017-08-07 16:15:41 -07:00
parent 74b5ec00dc
commit 680649ba6f
8 changed files with 76 additions and 240 deletions

11
src/zfm20/common.i Normal file
View File

@@ -0,0 +1,11 @@
%include "../upm.i"
/* Make it easy to use the methods which take a uint& id and score */
%include "typemaps.i"
%apply uint16_t &OUTPUT {uint16_t &id};
%apply uint16_t &OUTPUT {uint16_t &score};
%{
#include "zfm20.hpp"
%}
%include "zfm20.hpp"