1 %module pyupm_lsm303 2 %include "../upm.i" 3 %include "../carrays_int16_t.i" 4 5 %feature("autodoc", "3"); 6 7 // Adding this typemap because SWIG is converting int16 into a short by default 8 // This forces SWIG to convert it correctly 9 %typemap(out) int16_t* { 10 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 ); 11 } 12 13 %include "lsm303.h" 14 %{ 15 #include "lsm303.h" 16 %} 17