|
145 | 145 | //! // omitted: other error variants |
146 | 146 | //! } |
147 | 147 | //! |
148 | | -//! impl hal::serial::Read<u8> for Serial<USART1> { |
| 148 | +//! impl hal::nb::serial::Read<u8> for Serial<USART1> { |
149 | 149 | //! type Error = Error; |
150 | 150 | //! |
151 | 151 | //! fn read(&mut self) -> nb::Result<u8, Error> { |
|
167 | 167 | //! } |
168 | 168 | //! } |
169 | 169 | //! |
170 | | -//! impl hal::serial::Write<u8> for Serial<USART1> { |
| 170 | +//! impl hal::nb::serial::Write<u8> for Serial<USART1> { |
171 | 171 | //! type Error = Error; |
172 | 172 | //! |
173 | 173 | //! fn write(&mut self, byte: u8) -> nb::Result<(), Error> { |
|
198 | 198 | //! |
199 | 199 | //! ``` |
200 | 200 | //! use crate::stm32f1xx_hal::Serial1; |
201 | | -//! use embedded_hal::serial::Write; |
| 201 | +//! use embedded_hal::nb::serial::Write; |
202 | 202 | //! use nb::block; |
203 | 203 | //! |
204 | 204 | //! # fn main() { |
|
248 | 248 | //! |
249 | 249 | //! fn write_all<S>(serial: &mut S, buffer: &[u8]) -> Result<(), S::Error> |
250 | 250 | //! where |
251 | | -//! S: hal::serial::Write<u8> |
| 251 | +//! S: hal::nb::serial::Write<u8> |
252 | 252 | //! { |
253 | 253 | //! for &byte in buffer { |
254 | 254 | //! block!(serial.write(byte))?; |
|
281 | 281 | //! timeout: T::Time, |
282 | 282 | //! ) -> Result<u8, Error<S::Error, T::Error>> |
283 | 283 | //! where |
284 | | -//! T: hal::timer::CountDown<Error = ()>, |
285 | | -//! S: hal::serial::Read<u8>, |
| 284 | +//! T: hal::nb::timer::CountDown<Error = ()>, |
| 285 | +//! S: hal::nb::serial::Read<u8>, |
286 | 286 | //! { |
287 | 287 | //! timer.start(timeout).map_err(Error::TimedOut)?; |
288 | 288 | //! |
|
325 | 325 | //! |
326 | 326 | //! fn flush<S>(serial: &mut S, cb: &mut CircularBuffer) |
327 | 327 | //! where |
328 | | -//! S: hal::serial::Write<u8, Error = Infallible>, |
| 328 | +//! S: hal::nb::serial::Write<u8, Error = Infallible>, |
329 | 329 | //! { |
330 | 330 | //! loop { |
331 | 331 | //! if let Some(byte) = cb.peek() { |
|
389 | 389 | //! # fn deref_mut(&mut self) -> &mut T { self.0 } |
390 | 390 | //! # } |
391 | 391 | //! # struct Serial1; |
392 | | -//! # impl hal::serial::Write<u8> for Serial1 { |
| 392 | +//! # impl hal::nb::serial::Write<u8> for Serial1 { |
393 | 393 | //! # type Error = Infallible; |
394 | 394 | //! # fn write(&mut self, _: u8) -> nb::Result<(), Infallible> { Err(::nb::Error::WouldBlock) } |
395 | 395 | //! # fn flush(&mut self) -> nb::Result<(), Infallible> { Err(::nb::Error::WouldBlock) } |
|
408 | 408 | #![deny(missing_docs)] |
409 | 409 | #![no_std] |
410 | 410 |
|
411 | | -pub mod adc; |
412 | 411 | pub mod blocking; |
413 | | -pub mod capture; |
414 | | -pub mod digital; |
415 | 412 | pub mod fmt; |
| 413 | +pub mod nb; |
416 | 414 | pub mod prelude; |
417 | | -pub mod pwm; |
418 | | -pub mod qei; |
419 | | -pub mod rng; |
420 | | -pub mod serial; |
421 | | -pub mod spi; |
422 | | -pub mod timer; |
423 | | -pub mod watchdog; |
424 | 415 |
|
425 | 416 | mod private { |
426 | 417 | use crate::blocking::i2c::{SevenBitAddress, TenBitAddress}; |
|
0 commit comments