add api to determine current speed

This commit is contained in:
bunnie 2025-11-14 16:16:30 +08:00
parent c5fb3f282d
commit c79a891553

View file

@ -1630,6 +1630,8 @@ impl CorigineUsb {
}
}
pub fn get_speed(&self) -> PortSpeed { PortSpeed::from_portsc(self.csr.r(PORTSC)) }
pub fn update_ep0_maxpacketsize(&mut self, size: usize) {
let cmd_param = self.csr.ms(CMDPARA0_CMD1_UPDATE_EP0_MPS, size as u32);
self.issue_command(CmdType::UpdateEp0, cmd_param, 0).expect("couldn't issue command");