Skip to main content

Crate ch57x_pac

Crate ch57x_pac 

Source
Expand description

§ch57x-pac

Crates.io docs.rs License: MIT OR Apache-2.0 CI

Peripheral Access Crate (PAC) for WCH CH57x RISC-V BLE microcontrollers.

This crate is generated using svd2rust and provides register-level access to CH57x peripherals.

§Scope

  • no_std PAC for CH57x-family register blocks
  • Interrupt definitions and vector table support via rt feature
  • Optional critical-section integration for embedded Rust ecosystem crates

§Cargo

[dependencies]
ch57x-pac = "0.1.3"

§Features

  • rt (default): exports interrupt symbols/vector table glue expected by runtime crates
  • critical-section: enables critical-section support

§Minimal Usage

let p = ch57x_pac::Peripherals::take().unwrap();
p.sys.r8_clk_sys_cfg().modify(|_, w| unsafe { w.bits(0) });

§docs.rs Notes

docs.rs builds with:

  • target: riscv32imac-unknown-none-elf
  • features: rt, critical-section

§CI/CD

  • CI runs cargo check and cargo doc on every push and pull request.
  • Publish workflow is configured to publish from version tags (or manual dispatch). The publish job requires repository secret CRATES_IO_TOKEN.

§License

Licensed under either:

  • Apache License, Version 2.0
  • MIT license

Generated Register API Peripheral access API for WCH CH57x microcontrollers (generated with svd2rust).

You can find an overview of the generated API here.

Modules§

generic
Common register and bit access and modify traits
pfic
Program Fast Interrupt Controller
pwmx
PWMx register
spi0
SPI0 register
sys
System Control Register
systick
Systick register
tmr0
Timer0 register
tmr1
Timer1 register
tmr2
Timer2 register
tmr3
Timer3 register
uart0
UART0 register
uart1
UART1 register
uart2
UART2 register
uart3
UART3 register
usb
USB register

Structs§

Peripherals
All the peripherals.

Enums§

Interrupt
Enumeration of all the interrupts.

Constants§

NVIC_PRIO_BITS
Number available in the NVIC for configuring priority

Type Aliases§

Pfic
Program Fast Interrupt Controller
Pwmx
PWMx register
Spi0
SPI0 register
Sys
System Control Register
Systick
Systick register
Tmr0
Timer0 register
Tmr1
Timer1 register
Tmr2
Timer2 register
Tmr3
Timer3 register
Uart0
UART0 register
Uart1
UART1 register
Uart2
UART2 register
Uart3
UART3 register
Usb
USB register