abt8601 / raspi-pacs Goto Github PK
View Code? Open in Web Editor NEWPeripheral access crates for the Broadcom microprocessors used in the Raspberry Pi boards
License: The Unlicense
Peripheral access crates for the Broadcom microprocessors used in the Raspberry Pi boards
License: The Unlicense
I realize this is generated code, so if this issue should be in the SVD2Rust repo I will move it there.
The bcm2837-lpa crate includes an aux
module that causes the crate to be uncompileable on Windows. This is because aux
is one of the few names that files aren't allowed to be named on Windows.
I'm trying to use the BCM2711-lpa crate to read the registers on the UART0 on a Raspberry Pi 4. I'm successfully able to "steal" the peripherals, but when trying to read the registers, I'm getting a segmentation fault. I've double checked that my Bluetooth is disabled and that UART is enabled in my config.txt, is there something else I need to set up before I can my program? Any help is appreciated.
My code:
fn main() {
let uart = unsafe {bcm2711_lpa::Peripherals::steal() }.UART0;
println!("stole peripherals");
let ifls = uart.ifls();
println!("got IFLS");
let imsc = uart.imsc();
println!("got IMSC");
let r1 = ifls.read().bits();
println!("read ifls");
let r2 = imsc.read().bits();
println!("read imsc");
let m1 = r1 & RXIFLSEL;
let m2 = r2 & RXIM;
println!("ifls read: {:#34b}, {:#18b}", r1, m1);
println!("imsc read: {:#34b}, {:#18b}", r2, m2);
}
output:
stole peripherals
got IFLS
got IMSC
Segmentation fault
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.