pub struct Grayskull {
pub chip_if: Arc<dyn ChipInterface + Send + Sync>,
pub arc_if: Arc<dyn ChipComms + Send + Sync>,
pub arc_addrs: ArcMsgAddr,
/* private fields */
}
Fields§
§chip_if: Arc<dyn ChipInterface + Send + Sync>
§arc_if: Arc<dyn ChipComms + Send + Sync>
§arc_addrs: ArcMsgAddr
Implementations§
Source§impl Grayskull
impl Grayskull
pub fn create( chip_if: Arc<dyn ChipInterface + Send + Sync>, arc_if: Arc<dyn ChipComms + Send + Sync>, arc_addrs: ArcMsgAddr, ) -> Self
pub fn get_if<T: ChipInterface>(&self) -> Option<&T>
pub fn spi_write(&self, addr: u32, value: &[u8]) -> Result<(), Box<dyn Error>>
pub fn spi_read( &self, addr: u32, value: &mut [u8], ) -> Result<(), Box<dyn Error>>
Trait Implementations§
Source§impl ChipImpl for Grayskull
impl ChipImpl for Grayskull
Source§fn update_init_state(
&mut self,
status: &mut InitStatus,
) -> Result<ChipInitResult, PlatformError>
fn update_init_state( &mut self, status: &mut InitStatus, ) -> Result<ChipInitResult, PlatformError>
Update the initialization state of the chip.
The primary purpose of this function is to tell the caller when it is safe to starting interacting with the chip. Read more
Source§fn get_arch(&self) -> Arch
fn get_arch(&self) -> Arch
Returns the current arch of the chip, can be used to avoid
needing to ducktype when downcasting.
Source§fn arc_msg(&self, msg: ArcMsgOptions) -> Result<ArcMsgOk, PlatformError>
fn arc_msg(&self, msg: ArcMsgOptions) -> Result<ArcMsgOk, PlatformError>
Send an arc_msg to the underlying chip.
Source§fn get_neighbouring_chips(&self) -> Result<Vec<NeighbouringChip>, PlatformError>
fn get_neighbouring_chips(&self) -> Result<Vec<NeighbouringChip>, PlatformError>
Get a list of neighbouring chips.
Will return an empty list for gs and up to four chips for wh.
Source§fn get_telemetry(&self) -> Result<Telemetry, PlatformError>
fn get_telemetry(&self) -> Result<Telemetry, PlatformError>
Get telemetry information from the chip.
The information is not cached, so should not be called repeatedly.
Source§fn get_device_info(&self) -> Result<Option<DeviceInfo>, PlatformError>
fn get_device_info(&self) -> Result<Option<DeviceInfo>, PlatformError>
Get information about the underlying chip transport.
This is a hack to get the physical id of the chip.
Source§impl HlComms for &Grayskull
impl HlComms for &Grayskull
fn comms_obj(&self) -> (&dyn ChipComms, &dyn ChipInterface)
fn noc_read( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>
fn noc_write( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
fn noc_broadcast( &self, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
fn noc_read32( &self, noc_id: u8, x: u8, y: u8, addr: u64, ) -> Result<u32, Box<dyn Error>>
fn noc_write32( &self, noc_id: u8, x: u8, y: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>
fn noc_broadcast32( &self, noc_id: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>
fn axi_read(&self, addr: u64, data: &mut [u8]) -> Result<(), Box<dyn Error>>
fn axi_write(&self, addr: u64, data: &[u8]) -> Result<(), Box<dyn Error>>
fn axi_read32(&self, addr: u64) -> Result<u32, Box<dyn Error>>
fn axi_write32(&self, addr: u64, value: u32) -> Result<(), Box<dyn Error>>
Source§impl HlComms for Grayskull
impl HlComms for Grayskull
fn comms_obj(&self) -> (&dyn ChipComms, &dyn ChipInterface)
fn noc_read( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &mut [u8], ) -> Result<(), Box<dyn Error>>
fn noc_write( &self, noc_id: u8, x: u8, y: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
fn noc_broadcast( &self, noc_id: u8, addr: u64, data: &[u8], ) -> Result<(), Box<dyn Error>>
fn noc_read32( &self, noc_id: u8, x: u8, y: u8, addr: u64, ) -> Result<u32, Box<dyn Error>>
fn noc_write32( &self, noc_id: u8, x: u8, y: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>
fn noc_broadcast32( &self, noc_id: u8, addr: u64, value: u32, ) -> Result<(), Box<dyn Error>>
fn axi_read(&self, addr: u64, data: &mut [u8]) -> Result<(), Box<dyn Error>>
fn axi_write(&self, addr: u64, data: &[u8]) -> Result<(), Box<dyn Error>>
fn axi_read32(&self, addr: u64) -> Result<u32, Box<dyn Error>>
fn axi_write32(&self, addr: u64, value: u32) -> Result<(), Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for Grayskull
impl !RefUnwindSafe for Grayskull
impl Send for Grayskull
impl Sync for Grayskull
impl Unpin for Grayskull
impl !UnwindSafe for Grayskull
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more