SPI (using helper class)
SPI access (using helper class)
uint8_t c;
if (auto&& trs = SPI.get_rwer()) { // Object creation and device communication determination
// Within this scope (wave brackets) is the validity period of trs.
trs << 0x00; // Writes 0x00 with mwx::stream interface
trs >> c; // Store the read data in c.
}
// wrt is discarded at the point where the if clause is exited, and the use of the bus is terminatedread/write
inline uint8_t _spi_single_op(uint8_t cmd, uint8_t arg) {
uint8_t d0, d1;
if (auto&& x = SPI.get_rwer()) {
d0 = x.transfer(cmd); (void)d0;
d1 = x.transfer(arg);
// (x << (cmd)) >> d0;
// (x << (arg)) >> d1;
}
return d1;
}get_rwer()
worker object
transfer() transfer16() transfer32()
<< operator
>> operator
最終更新