bind-hal

Crates.iobind-hal
lib.rsbind-hal
version0.3.3
sourcesrc
created_at2024-07-19 12:39:21.108877
updated_at2024-09-10 11:16:14.874786
descriptionMCU HALs using binding, currently supports PY32
homepagehttps://github.com/decaday/bind-hal
repositoryhttps://github.com/decaday/bind-hal
max_upload_size
id1308581
size94,188
Decaday (decaday)

documentation

README

bind-hal

Crates.io

This crate has been separated and moved to py32-bind-hal

This crate is no longer updated, please see py32-bind-hal



This project aims to provide a more complete HAL (Hardware Abstraction Layer).

The project uses the vendor-provided C SDK and operates peripherals through bindings, then wraps these C APIs for easy use in Rust.

Users can also directly use FFI to perform complex operations without manipulating registers.

Supported MCU:

---PY32F0xx Series---

Puya PY32F002A, PY32F003, PY32F030

Xinlinggo XL32F003*, XL32F002A*

Luat AIR001

Peripherals/Functions Bindings Easy-to-use func Embedded-Hal
GPIO
RCC
Power ✔(only sleep/stop)
PWM/TIMER
RTC
WDG
Peripherals/Functions Bindings Easy-to-use func Embedded-Hal Embedded-Async Polling DMA IT
EXTI
I2C
ADC ✔(only polling)
USART WIP
SPI
LED

✖: mcu or embedded-hal not support

WIP: work in progress

Others:

Interrupt(cortex-m-rt) Embassy Time-Driver HAL-Ticks

Why use bindings?

Taking STM32 as an example, there are many excellent HALs available: embassy stm32-rs

This crate’s performance, ROM, and RAM usage are far inferior to these HALs.

However, most Rust HALs are maintained by the community or enthusiasts and do not receive vendor support. Especially for microcontrollers with fewer users, there are not enough people to maintain the HAL, or in the end, only basic functions can be used.

This crate requires little maintenance and does not require dealing with registers. Even if there are unwrapped functions, others can easily supplement or directly call FFI.

In the near future, this crate will primarily update SDKs for microcontrollers similar to STM32 HAL CSDK aiming to reuse code on similar SDKs.

py32csdk-hal-sys

The CSDK and bindings for py32 are maintained here: py32csdk-hal-sys, and this package already includes precompiled static library file and bindings.rs for quick use. However, if you want to recompile and generate bindings, it will be troublesome, please check its Docs. You need to enable the recompile feature.

Commit count: 0

cargo fmt