summaryrefslogtreecommitdiff
path: root/peripheral/libupm/src/tm1637/javaupm_tm1637.i
blob: b6d283f8739deef6f4f114fccb58214320dafac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%module javaupm_tm1637
%include "../upm.i"
%include "stdint.i"
%include "typemaps.i"

%varargs(4, int digit = 0) write;

%rename("writeArray")  write(uint8_t *digits);
%rename("writeString") write(std::string digits);

%apply uint8_t *INPUT { uint8_t *digits }

%{
    #include "tm1637.hpp"
%}

%include "tm1637.hpp"


%pragma(java) jniclasscode=%{
    static {
        try {
            System.loadLibrary("javaupm_tm1637");
        } catch (UnsatisfiedLinkError e) {
            System.err.println("Native code library failed to load. \n" + e);
            System.exit(1);
        }
    }
%}