This is a Rust HAL framework to be bound to the MCU C SDK/BSP.
Ownership restrictions friendly, almost all types can be Copy/Clone.
- Use cortexm-rt or riscv-rt directly, referring to the implementation of ll_bind_hk32F0301mxxc
- Use the SDK/BSP startup_XXX.S, refer to the implementation of ll_bind_ch32v20x
- Can be fully implemented in C to facilitate the clear of interrupt flags
- Handle HAL or application data via rust-defined hook callback function
- EXTI: fn EXTI_IRQ_hook_rs(line: u8), refer to ll_bind_hk32F0301mxxc/csrc/interrupt.c
- ADC: fn ADC_CH{ch}_EOC_hook_rs(val:AdcDataType), refer to ll_bind_ch32v20x/csrc/adc.c
- USART: fn USART{id}_rx_hook_rs(val: u8), refer to ll_bind_ch32v20x/csrc/usart.c
- Tick(Rust): sys_tick_handler!(), reference example_hk32/src/interrupt.rs
- Tick(C): fn sys_tick_inc(), reference ll_bind_ch32v20x/csrc/ll_api.c
- print-log = []: print!,println! print logs via serial port
- tick-size-64bit = []: The tick counter uses 64 bits, default is 32 bits
- Embassy = []: Embassy timer driver and GPIO input asynchronous support
- USART-[0..7] = []: Serial port receive cache and callback ID definition
- adc-data-type-u8 = [] : Use 8-bit ADC data type, 16-bit by default
- adc-buffered-ch[0..7] = []: ADC cache and callback definitions
- exti-irq-callback = [] : exti interrupt callback, which needs to be defined by the App
- print-log-csdk = ["print-log"]: print!, println! use formatting function from CSDK to output logs, Save 2-6KB, refer to example_ch32v/examples/print.rs
- Add %S and %y lable to format strings and arrays with length parameters, refer to ll_bind_ch32v20x\csrc\print.c
- Not support padding