Implement first basic interrupt handler

This commit is contained in:
2025-05-29 18:21:42 +02:00
parent 18233ec722
commit 20808a7992
16 changed files with 283 additions and 32 deletions

View File

@@ -27,7 +27,7 @@ pub fn print(s: &str) {
unsafe { while (core::ptr::read_volatile(UART0_FR as *const u32) >> 3) & 0b1 != 0 {} }
}
pub fn configure_uart() {
pub fn uart_init() {
let baud_div_times_64 = (UART_CLK * 4) / BAUD;
let ibrd = baud_div_times_64 / 64;
@@ -45,6 +45,7 @@ pub fn configure_uart() {
// Enable transmit and uart
let mut cr = core::ptr::read_volatile(UART0_CR as *mut u32);
cr |= UART0_CR_UARTEN | UART0_CR_TXE;
core::ptr::write_volatile(UART0_CR as *mut u32, cr);
}
}