Compare commits
13 Commits
cd386ed41a
...
e30d6d3f22
Author | SHA1 | Date | |
---|---|---|---|
e30d6d3f22
|
|||
7603185156
|
|||
2b6c013241
|
|||
ee8a481c4f
|
|||
ea35221d41
|
|||
a1a5156caf
|
|||
0f3614465f
|
|||
52f5d42358
|
|||
1f4d6f601d
|
|||
f7ff74940a
|
|||
60305ef393
|
|||
ce7a8665a3
|
|||
784a6d7146
|
@ -125,7 +125,6 @@ fn main() -> ! {
|
|||||||
Some(spi_clk_cfg),
|
Some(spi_clk_cfg),
|
||||||
Some(SPI_MODE),
|
Some(SPI_MODE),
|
||||||
BLOCKMODE,
|
BLOCKMODE,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
spi.cfg_transfer(&transfer_cfg);
|
spi.cfg_transfer(&transfer_cfg);
|
||||||
@ -139,7 +138,6 @@ fn main() -> ! {
|
|||||||
Some(SPI_MODE),
|
Some(SPI_MODE),
|
||||||
Some(hw_cs_pin),
|
Some(hw_cs_pin),
|
||||||
BLOCKMODE,
|
BLOCKMODE,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
spi.cfg_transfer(&transfer_cfg);
|
spi.cfg_transfer(&transfer_cfg);
|
||||||
|
@ -301,9 +301,6 @@ pub struct TransferConfig {
|
|||||||
/// the BMSTOP bit is set on a dataword. A frame is defined as CSn being active for the
|
/// the BMSTOP bit is set on a dataword. A frame is defined as CSn being active for the
|
||||||
/// duration of multiple data words
|
/// duration of multiple data words
|
||||||
pub blockmode: bool,
|
pub blockmode: bool,
|
||||||
/// Only used when blockmode is used. The SCK will be stalled until an explicit stop bit
|
|
||||||
/// is set on a written word.
|
|
||||||
pub bmstall: bool,
|
|
||||||
pub hw_cs: HwChipSelectId,
|
pub hw_cs: HwChipSelectId,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +309,6 @@ impl TransferConfigWithHwcs<NoneT> {
|
|||||||
clk_cfg: Option<SpiClkConfig>,
|
clk_cfg: Option<SpiClkConfig>,
|
||||||
mode: Option<Mode>,
|
mode: Option<Mode>,
|
||||||
blockmode: bool,
|
blockmode: bool,
|
||||||
bmstall: bool,
|
|
||||||
sod: bool,
|
sod: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
TransferConfigWithHwcs {
|
TransferConfigWithHwcs {
|
||||||
@ -322,7 +318,6 @@ impl TransferConfigWithHwcs<NoneT> {
|
|||||||
mode,
|
mode,
|
||||||
sod,
|
sod,
|
||||||
blockmode,
|
blockmode,
|
||||||
bmstall,
|
|
||||||
hw_cs: HwChipSelectId::Invalid,
|
hw_cs: HwChipSelectId::Invalid,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -335,7 +330,6 @@ impl<HwCs: HwCsProvider> TransferConfigWithHwcs<HwCs> {
|
|||||||
mode: Option<Mode>,
|
mode: Option<Mode>,
|
||||||
hw_cs: Option<HwCs>,
|
hw_cs: Option<HwCs>,
|
||||||
blockmode: bool,
|
blockmode: bool,
|
||||||
bmstall: bool,
|
|
||||||
sod: bool,
|
sod: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
TransferConfigWithHwcs {
|
TransferConfigWithHwcs {
|
||||||
@ -345,7 +339,6 @@ impl<HwCs: HwCsProvider> TransferConfigWithHwcs<HwCs> {
|
|||||||
mode,
|
mode,
|
||||||
sod,
|
sod,
|
||||||
blockmode,
|
blockmode,
|
||||||
bmstall,
|
|
||||||
hw_cs: HwCs::CS_ID,
|
hw_cs: HwCs::CS_ID,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -428,11 +421,6 @@ impl SpiConfig {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn bmstall(mut self, enable: bool) -> Self {
|
|
||||||
self.bmstall = enable;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn mode(mut self, mode: Mode) -> Self {
|
pub fn mode(mut self, mode: Mode) -> Self {
|
||||||
self.init_mode = mode;
|
self.init_mode = mode;
|
||||||
self
|
self
|
||||||
@ -756,8 +744,12 @@ where
|
|||||||
} else {
|
} else {
|
||||||
w.sod().clear_bit();
|
w.sod().clear_bit();
|
||||||
}
|
}
|
||||||
w.blockmode().bit(transfer_cfg.cfg.blockmode);
|
if transfer_cfg.cfg.blockmode {
|
||||||
w.bmstall().bit(transfer_cfg.cfg.bmstall)
|
w.blockmode().set_bit();
|
||||||
|
} else {
|
||||||
|
w.blockmode().clear_bit();
|
||||||
|
}
|
||||||
|
w
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user