Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Commit d014035

Browse files
committed
Updated documentation
1 parent cedabc5 commit d014035

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/serial.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
//! UART peripheral control
22
//!
3-
//! Controls the 3 uart peripherals (UART0, UART1, UART2)
3+
//! Controls the 3 uart peripherals (UART0, UART1, UART2).
44
//!
5-
//! **It currently depends on GPIO pins and clock to be configured with default settings.**
6-
//! (Tested for UART 0)
5+
//! # Example
6+
//!
7+
//! Creation of the serial peripheral and writing formatted info.
8+
//! ```
9+
//! let serial: Serial<_, _, _> = Serial::new(
10+
//! dp.UART0,
11+
//! esp32_hal::serial::Pins {
12+
//! tx: gpios.gpio1,
13+
//! rx: gpios.gpio3,
14+
//! cts: None,
15+
//! rts: None,
16+
//! },
17+
//! config,
18+
//! clkcntrl_config,
19+
//! &mut dport,
20+
//! )
21+
//! .unwrap();
22+
//!
23+
//! writeln!(serial, "Serial output").unwrap();
24+
//! ```
725
//!
826
//! # TODO
9-
//! - Automatic GPIO configuration
1027
//! - Add all extra features esp32 supports (eg rs485, etc. etc.)
1128
//! - Free APB lock when TX is idle (and no RX used)
1229

0 commit comments

Comments
 (0)