add 'lib' side code for sending the API call to cramium_hal_service

this is the code that exists on the caller's side. It creates
a message with the correct opcode and decodes the result.
This commit is contained in:
bunnie 2025-06-07 02:48:10 +08:00
parent 2c99b32e5a
commit f3e7eec6cf

View file

@ -86,4 +86,20 @@ impl UdmaGlobalConfig for UdmaGlobal {
}
fn reset(&self, peripheral: PeriphId) { self.reset(peripheral); }
fn irq_status_bits(&self, bank: IrqBank) -> u32 {
match xous::send_message(
self.conn,
xous::Message::new_blocking_scalar(
HalOpcode::UdmaIrqStatusBits.to_usize().unwrap(),
bank as u32 as usize,
0,
0,
0,
),
) {
Ok(xous::Result::Scalar5(_, value, _, _, _)) => value as u32,
_ => panic!("Unhandled response on irq_status_bits"),
}
}
}