Expand description
§SiFli HAL
中文 | English
Rust Hardware Abstraction Layer (HAL) and Embassy driver for SiFli MCUs.
[!WARNING]
This project is working-in-progress and not ready for production use.
§Let’s GO!
§Status
HAL Implementation Status (Click to expand/collapse)
- ✅: Supported & Tested
- 🌗: Partially Supported & Tested
- ❓: Written, needs example/test
- 📝: Planned & WIP
- ❌: Not supported by Hardware (N/A)
- ➕: Async Feature
| Peripheral | Feature | sf32lb52x | 56x | 58x |
|---|---|---|---|---|
| hcpu | ||||
| PAC (Peripheral Access Crate) | 🌗 | |||
| Startup & Interrupt | ✅ | |||
| Flash Table | 🌗 | |||
| embassy | GPTIM Time Driver | ✅ | ||
| ATIM Time Driver | (#5) | |||
| Embassy Peripheral Singleton | ✅ | |||
| RCC | Peripheral RCC Codegen (enable, freq...) | ✅ | ||
| Read current RCC tree | ✅ | |||
| RCC tree Configure | 🌗 | |||
| Modify frequency in same DVFS mode | ✅ | |||
| GPIO | Blinky | ✅ | ||
| PinMux Codegen & AF Config | ✅ | |||
| IO Mode & AonPE Config | 🌗 | |||
| EXTI ➕ | ✅ | |||
| USART | Blocking | ✅ | ||
| Buffered(Interrupt) ➕ | ✅ | |||
| DMA ➕ | ✅ | |||
| RingBuffered(DMA) ➕ | ❓ | |||
| DMA | Transfer(P2M, M2P) | ✅ | ||
| RingBuffer | ❓ | |||
| ExtDMA | ||||
| USB (see also:musb) |
embassy-usb ➕ | ✅ | ||
| Device: HID, CDC_ACM ... | ✅ | |||
| HOST / OTG | ||||
| GPADC | Blocking | ✅ | ||
| Interrupt ➕ | ✅ | |||
| Timer Trigger | ||||
| VBAT & External Channel | ✅ | |||
| Multi Channel & Slot | ||||
| Differential Input | ||||
| DMA ➕ | ||||
| Calibration | ||||
| PMU | DVFS Upscale | ✅ | ||
| DVFS Downscale | ||||
| Charge Modoule | ||||
| Buck & LDO | 🌗 | |||
| Audio | AudCodec/ADC, DAC | |||
| AudPrc/Channel, Mixer, Volume | ||||
| I2S/DMA, Master, Slave | ||||
| PDM | ||||
| I2C | ||||
| SPI | ||||
| Mailbox | ||||
| BT | ||||
| BLE | ||||
| LCDC/Layer, SPI, DBI | ||||
| ePicasso | ||||
§Features
-
defmt,log: Debug log output. -
sf32lb52x: Target chip selection. Currently, onlysf32lb52xis supported. -
set-msplim: Set the MSPLIM register in__pre_init. This register must be set before the main function’s stack setup (since the bootloader may have already configured it to a different value), otherwise, it will cause a HardFault SiFli-SDK #32.This feature will be removed after cortex-m-rt #580 is released.
-
time-driver-xxx: Timer configuration fortime-driver. It requires at least two capture/compare channels. For thesf32lb52x hcpu, onlyatim1(TODO: #5),gptim1, andgptim2are available. -
unchecked-overclocking: Enable this feature to disable the overclocking check. DO NOT ENABLE THIS FEATURE UNLESS YOU KNOW WHAT YOU’RE DOING.
§License
This project is under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Re-exports§
pub use config::Config;
Modules§
- adc
- ADC (Analog-to-Digital Converter)
- config
- HAL configuration for SiFli
- dma
- Direct Memory Access (DMA)
- gpio
- GPIO driver.
- interrupt
- Interrupt definitions.
- lcdc
- mode
- Operating modes for peripherals.
- peripherals
- Types for the peripheral singletons.
- pmu
- rcc
- time
- Time units
- timer
- usart
- Universal Synchronous/Asynchronous Receiver Transmitter (USART, UART, LPUART)
- usb
Macros§
- bind_
interrupts - Macro to bind interrupts to handlers.
- into_
ref - Convenience converting into reference.
Structs§
- Peripheral
Ref - An exclusive reference to a peripheral.
- Peripherals
- Struct containing all the peripheral singletons.
Traits§
- Peripheral
- Trait for any type that can be used as a peripheral of type
P.
Functions§
- blocking_
delay_ us - Performs a busy-wait delay for a specified number of microseconds.
- cortex_
m_ blocking_ delay_ us - Performs a busy-wait delay for a specified number of microseconds, using the
cortex-m::asm::delayfunction. - init
- Initialize the
sifli-halwith the provided configuration.