sx1276: Initial implementation

This driver was developed using an SX1276 based shield on the Galileo
G2.  It requires 3.3v of operation.  It does not work with Edison, due
to SPI issues.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2015-10-30 17:58:36 -06:00
committed by Mihai Tudor Panu
parent 4de9734f0a
commit 2a1af1399a
14 changed files with 4929 additions and 0 deletions

View File

@ -0,0 +1,5 @@
set (libname "sx1276")
set (libdescription "SZ1276 LoRa/FSK/OOK radio")
set (module_src ${libname}.cxx)
set (module_h ${libname}.h)
upm_module_init()

25
src/sx1276/LICENSE.txt Normal file
View File

@ -0,0 +1,25 @@
--- Revised BSD License ---
Copyright (c) 2013, SEMTECH S.A.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Semtech corporation nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL SEMTECH S.A. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,36 @@
%module(directors="1") javaupm_sx1276
%include "../upm.i"
%include "cpointer.i"
%include "typemaps.i"
%include "arrays_java.i";
%include "../java_buffer.i"
%feature("director") IsrCallback;
%ignore generic_callback_isr;
%include "../IsrCallback.h"
%apply int {mraa::Edge};
%apply float *INOUT { float *x, float *y, float *z };
%typemap(jni) float* "jfloatArray"
%typemap(jstype) float* "float[]"
%typemap(jtype) float* "float[]"
%typemap(javaout) float* {
return $jnicall;
}
%typemap(out) float *getAccelerometer {
$result = JCALL1(NewFloatArray, jenv, 3);
JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
delete [] $1;
}
%ignore getAccelerometer(float *, float *, float *);
%{
#include "sx1276.h"
%}
%include "sx1276.h"

View File

@ -0,0 +1,9 @@
%module jsupm_sx1276
%include "../upm.i"
%include "cpointer.i"
%include "sx1276.h"
%{
#include "sx1276.h"
%}

15
src/sx1276/pyupm_sx1276.i Normal file
View File

@ -0,0 +1,15 @@
%module pyupm_sx1276
%include "../upm.i"
%include "cpointer.i"
%include "stdint.i"
%feature("autodoc", "3");
%pointer_functions(float, floatp);
%include "sx1276.h"
%{
#include "sx1276.h"
%}

2160
src/sx1276/sx1276.cxx Normal file

File diff suppressed because it is too large Load Diff

2035
src/sx1276/sx1276.h Normal file

File diff suppressed because it is too large Load Diff