Skip to content

Commit

Permalink
make DataPacket fields public
Browse files Browse the repository at this point in the history
  • Loading branch information
hacknus committed Sep 11, 2023
1 parent 310d2f8 commit e9de69b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ pub enum Error<E> {

/// Data Exchange packet
pub struct DataPacket {
status: SpiStatus,
data: u32,
/// Status returned from last communication
pub status: SpiStatus,
/// Data received from TMC5160
pub data: u32,
}

impl fmt::Display for DataPacket {
Expand Down Expand Up @@ -347,7 +349,7 @@ impl<SPI, CS, EN, E> Tmc5160<SPI, CS, EN>
pub fn read_gstat(&mut self) -> Result<DataPacket, Error<E>> {
self.read_register(Registers::GSTAT)
}

/// set the position to 0 / home
pub fn set_home(&mut self) -> Result<DataPacket, Error<E>> {
let mut val = 0_u32.to_be_bytes();
Expand Down

0 comments on commit e9de69b

Please sign in to comment.