I need to write Java binding for GPIO library. Decided to go with JNI for the purpose. All of the references have examples with using standard C libraries with functions such as printf or, from scientific library with method such as multiply. The library for which I need to write Java binding has macros, structs, with types such as __u32 which I am unable to see mapped to Java. Until now have watched some youtube videos, looking at JNI programmers's guide which was recommended(but it is very old) and looking at an ibm documentation on JNI https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html has not been very helpful. https://github.com/java-native-access/jna/blob/master/www/Mappings.md has mappings but in the library there are types such as __u32 for which there is no corresponding Java type https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html, even the official documentation has no mappingfor __u32 or unsigned 32/64 bit
Is there any tools that can help me?
Where can I find a good reference for this?
Or am I approaching this completely wrong?
Should I go for JNA or some other option?
Java is not a language I would use for programming hardware, I recently took a class in Embedded Programming where the instructor specifically said don't use Java.
This article does talk about how to convert unsigned integers to integers for Java.
I'm not sure why the example you have is __u32, it is more appropriate in C to use stdint.h which provides
uint32_t.Unsigned integer values are used in GPIO to toggle boolean values that are packed into addresses in the hardware. An unsigned char (8 bits), unsigned short (16 bits) or unsigned int (generally 32 bits for this use) contain control values for digital hardware, to reduce the address space necessary (memory on a device) these bits grouped together by function and packed into a single unsigned data type.
You can find examples of this in device data sheets.