1 %module jsupm_tm1637 2 %include "../upm.i" 3 %include "../carrays_uint8_t.i" 4 5 %varargs(4, int digit = 0) write; 6 7 %rename("writeArray") write(uint8_t *digits); 8 %rename("writeString") write(std::string digits); 9 10 %typemap(in) uint8_t * { 11 void *argp = 0 ; 12 int res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_uint8Array, 0 | 0); 13 $1 = (uint8_t *)(argp); 14 } 15 16 %{ 17 #include "tm1637.h" 18 %} 19 20 %include "tm1637.h" 21 22