ch58x-hal 0.0.2

HAL for the CH583/CH582/CH581 RISC-V BLE microcotrollers from WCH
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use core::ptr;

const R8_CHIP_ID: u32 = 0x40001041;

/// 0x92 for CH592
/// 0x91 for CH591
/// 0x81 for CH581
/// 0x82 for CH582
/// 0x83 for CH583
pub fn get_chip_id() -> u8 {
    unsafe { ptr::read_volatile(R8_CHIP_ID as *const u8) }
}