add rust bindings
This commit is contained in:
parent
2737938bff
commit
c276778a1c
@ -111,3 +111,16 @@ ${BUILD_DIR}/%.o : %.c Makefile
|
||||
clean:
|
||||
-rm -rf build
|
||||
|
||||
${BUILD_DIR}/bindgen.i : bindgen.h
|
||||
$(CC) -E bindgen.h -o $(BUILD_DIR)/bindgen.i $(CFLAGS) $(CPPFLAGS)
|
||||
|
||||
|
||||
${BUILD_DIR}/bindgen.rs : ${BUILD_DIR}/bindgen.i
|
||||
bindgen --allowlist-type "List_t|TaskHandle_t|TaskStatus_t|TCB_t" ${BUILD_DIR}/bindgen.i -o ${BUILD_DIR}/bindings.rs
|
||||
sed -i -f transform.sed build/bindings.rs
|
||||
cat typeheader.rs build/bindings.rs > build/bindings_2.rs
|
||||
# --ctypes-prefix compat_types
|
||||
# bindgen --new-type-alias void --default-alias-style new_type --allowlist-type "List_t|TaskHandle_t|TaskStatus_t|TCB_t" ${BUILD_DIR}/bindgen.i -o ${BUILD_DIR}/bindings.rs
|
||||
|
||||
binder:
|
||||
bindgen --ignore-methods --no-include-path-detection --allowlist-type "List_t|TaskHandle_t|TaskStatus_t|TCB_t" bindgen.h -o ${BUILD_DIR}/bindings.rs -- $(CC) $(CFLAGS) $(CPPFLAGS) -I/nix/store/2f638ck7i6161b9vhgbdw7fp1r4k643v-gcc-arm-embedded-10.3.1/lib/gcc/arm-none-eabi/10.3.1/include -I/nix/store/2f638ck7i6161b9vhgbdw7fp1r4k643v-gcc-arm-embedded-10.3.1/arm-none-eabi/include/ -MMD
|
||||
|
6
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/bindgen.h
Normal file
6
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/bindgen.h
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <FreeRTOSConfig.h>
|
||||
#include <task.h>
|
||||
#include <list.h>
|
||||
#include "../../Source/tasks.c"
|
4
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/transform.sed
Normal file
4
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/transform.sed
Normal file
@ -0,0 +1,4 @@
|
||||
s@::c_ulong@::c_uint@
|
||||
s@*mut ::std::os::raw::c_void@void_ptr@
|
||||
s@*const ::std::os::raw::c_char@char_ptr@
|
||||
s@*mut \([A-Z,_,a-z]*\),@\1_ptr,@
|
8
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/typeheader.rs
Normal file
8
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/typeheader.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// Manual Types
|
||||
pub type xLIST_ITEM_ptr = ::std::os::raw::c_uint;
|
||||
pub type xLIST_ptr = ::std::os::raw::c_uint;
|
||||
pub type ListItem_t_ptr = ::std::os::raw::c_uint;
|
||||
pub type StackType_t_ptr = ::std::os::raw::c_uint;
|
||||
pub type char_ptr = ::std::os::raw::c_uint;
|
||||
pub type void_ptr = ::std::os::raw::c_uint;
|
||||
|
Loading…
x
Reference in New Issue
Block a user