Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,36 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: ⚡ Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo
- name: Set permissions
run: chmod +x d
- name: Load sources
run: ./d download-all
- name: Run build
run: cargo run --release --bin stm32-bindings-gen
- name: Run package build
run: cd build/stm32-bindings && cargo build --target=thumbv8m.main-none-eabihf
- uses: actions/checkout@v4
- name: ⚡ Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo
- name: Install ARM GCC toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi
- name: Set permissions
run: chmod +x d
- name: Load sources
run: ./d download-all
- name: Run build
run: cargo run --release --bin stm32-bindings-gen
- name: Run package build
run: cd build/stm32-bindings && cargo build --target=thumbv8m.main-none-eabihf
44 changes: 44 additions & 0 deletions stm32-bindings-gen/inc/app_conf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Stub configuration header used during bindings generation. */

#ifndef STM32_BINDINGS_GEN_APP_CONF_H
#define STM32_BINDINGS_GEN_APP_CONF_H

#ifdef __cplusplus
extern "C" {
#endif

/* Provide minimal definitions so that ST middleware headers compile under bindgen. */

#ifndef LOG_LEVEL_INFO
#define LOG_LEVEL_INFO (0)
#endif

#ifndef LOG_INFO_APP
#define LOG_INFO_APP(...)
#endif

#ifndef CFG_LOG_SUPPORTED
#define CFG_LOG_SUPPORTED (0U)
#endif

#ifndef PWR_LDO_SUPPLY
#define PWR_LDO_SUPPLY (0U)
#endif

#ifndef RADIO_INTR_NUM
#define RADIO_INTR_NUM (0U)
#endif

#ifndef RADIO_INTR_PRIO_HIGH
#define RADIO_INTR_PRIO_HIGH (0U)
#endif

#ifndef RADIO_INTR_PRIO_LOW
#define RADIO_INTR_PRIO_LOW (0U)
#endif

#ifdef __cplusplus
}
#endif

#endif /* STM32_BINDINGS_GEN_APP_CONF_H */
91 changes: 91 additions & 0 deletions stm32-bindings-gen/inc/ble-wba.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#ifndef BLE_WBA_BINDINGS_H_
#define BLE_WBA_BINDINGS_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "cmsis_compiler.h"

/* Toolchain abstraction utilities */


/* Link Layer command interface */
#include "bsp.h"
#include "common_types.h"
#include "dtm.h"
#include "event_manager.h"
#include "evnt_schdlr_gnrc_if.h"
#include "hci.h"
#include "ll_error.h"
#include "ll_intf.h"
#include "ll_intf_cmn.h"
#include "mac_host_intf.h"
#include "mem_intf.h"
#include "os_wrapper.h"
#include "platform.h"
#include "power_table.h"
#include "pta.h"
#include "ral.h"
#include "rfd_dev_config.h"


/* Core BLE stack */
#include "blestack.h"
#include "ble_bufsize.h"
#include "ble_codec.h"
#include "ble_const.h"
#include "ble_core.h"
#include "ble_defs.h"
#include "ble_legacy.h"
#include "ble_std.h"
#include "bleplat.h"

/* Auto-generated ACI command definitions */
#include "auto/ble_events.h"
#include "auto/ble_gap_aci.h"
#include "auto/ble_gatt_aci.h"
#include "auto/ble_hal_aci.h"
#include "auto/ble_hci_le.h"
#include "auto/ble_l2cap_aci.h"
#include "auto/ble_raw_api.h"
#include "auto/ble_types.h"
#include "auto/ble_vs_codes.h"

/* BLE Audio stack */
#include "ble_audio_stack.h"
#include "ble_audio_plat.h"
#include "audio_types.h"
#include "bap_bufsize.h"
#include "bap_types.h"
#include "cap.h"
#include "cap_types.h"
#include "ccp.h"
#include "ccp_types.h"
#include "csip.h"
#include "csip_types.h"
#include "ltv_utils.h"
#include "mcp.h"
#include "mcp_types.h"
#include "micp.h"
#include "micp_types.h"
#include "vcp.h"
#include "vcp_types.h"

/* Codec manager interfaces */
#include "codec_if.h"
#include "codec_mngr.h"

/* LC3 codec interfaces */
#include "LC3.h"
#include "LC3_decoder.h"
#include "LC3_encoder.h"

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* BLE_WBA_BINDINGS_H_ */
28 changes: 28 additions & 0 deletions stm32-bindings-gen/inc/string.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef STM32_BINDINGS_GEN_STUB_STRING_H
#define STM32_BINDINGS_GEN_STUB_STRING_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>

void *memcpy(void *dest, const void *src, size_t n);
void *memmove(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n);
int memcmp(const void *s1, const void *s2, size_t n);

size_t strlen(const char *s);
size_t strnlen(const char *s, size_t maxlen);
char *strcpy(char *dest, const char *src);
char *strncpy(char *dest, const char *src, size_t n);
char *strcat(char *dest, const char *src);
char *strncat(char *dest, const char *src, size_t n);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);

#ifdef __cplusplus
}
#endif

#endif /* STM32_BINDINGS_GEN_STUB_STRING_H */
16 changes: 15 additions & 1 deletion stm32-bindings-gen/inc/wba_wpan_mac.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
#include "st_mac_802_15_4_sap.h"
#include "st_mac_802_15_4_types.h"
#include "st_mac_802_15_4_core.h"
#include "st_mac_802_15_4_sys.h"
#include "st_mac_802_15_4_config.h"
#include "st_mac_802_15_4_core_config.h"
#include "st_mac_802_15_4_sys_svc.h"
#include "st_mac_802_15_4_svc.h"
#include "st_mac_802_15_4_ext_svc.h"
#include "st_mac_802_15_4_raw_svc.h"
#include "st_mac_802_15_4_dbg_svc.h"
#include "st_mac_buffer_management.h"
#include "st_mac_queue.h"
#include "stm_queue.h"
#include "utilities_common.h"

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef APP_CONF_H
Expand Down Expand Up @@ -459,4 +473,4 @@ extern "C"
} /* extern "C" */
#endif

#endif /* APP_CERTIFICATION_MAC_802_15_4_PROCESS_H */
#endif /* APP_CERTIFICATION_MAC_802_15_4_PROCESS_H */
13 changes: 12 additions & 1 deletion stm32-bindings-gen/res/src/bindings/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
#[cfg(feature = "wba_wpan_mac")]
mod wba_wpan_mac;
pub mod wba_wpan_mac;
#[cfg(feature = "wba_wpan_mac")]
pub use self::wba_wpan_mac as mac_802_15_4;
#[cfg(feature = "wba_wpan_mac")]
pub use self::wba_wpan_mac as wpan_wba;

#[cfg(feature = "wba_wpan_ble")]
pub mod ble_stack;
#[cfg(feature = "wba_wpan_ble")]
pub use self::ble_stack as ble;
#[cfg(feature = "wba_wpan_ble")]
pub use self::ble_stack as ble_wba;
3 changes: 2 additions & 1 deletion stm32-bindings-gen/res/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
#![allow(non_camel_case_types)]
#![doc(html_no_source)]

mod bindings;
pub mod bindings;
pub use bindings::*;
Loading