py32-bind-hal

Crates.iopy32-bind-hal
lib.rspy32-bind-hal
version0.5.0
sourcesrc
created_at2024-09-10 11:23:07.748333
updated_at2024-09-12 03:17:42.496029
descriptionMCU HALs using binding, currently supports PY32
homepagehttps://github.com/decaday/py32-bind-hal
repositoryhttps://github.com/decaday/py32-bind-hal
max_upload_size
id1370283
size79,863
Decaday (decaday)

documentation

README

py32-bind-hal

Crates.io

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 N/C
Power ✔(only sleep/stop) N/C
DMA N/C
RTC N/C
WDG N/C
PWM/TIMER ✔(only PWM now) N/C
Peripherals/Functions Bindings Easy-to-use func embedded-hal/io embedded-hal/io-async Polling DMA IT
EXTI N/C N/C
I2C
ADC N/C N/C
UART
SPI

N/C: mcu hardware or embedded-hal not support

✖: no plan or hard to impl

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.

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.

Old Verisons

You can see old versions at bind-hal - crates.io and decaday/bind-hal (github.com) .

Commit count: 0

cargo fmt