From f3e7eec6cfb3dc930cdaa89505927ad88ba430cd Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 7 Jun 2025 02:48:10 +0800 Subject: [PATCH] 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. --- services/cram-hal-service/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/services/cram-hal-service/src/lib.rs b/services/cram-hal-service/src/lib.rs index 37082e724..2cda32d56 100644 --- a/services/cram-hal-service/src/lib.rs +++ b/services/cram-hal-service/src/lib.rs @@ -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"), + } + } }