Skip to content

Commit accd109

Browse files
committed
Rename serial raw_read to read_data_register
1 parent 421b01a commit accd109

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4545
the dependencies where using the MIT / Apache 2.0 dual licensing already,
4646
which resulted into the situtation, that BSD 0-clause was not affectivly
4747
0-clause as MIT conditions had to be met anyways. (🧂 IANAL). ([#309])
48+
- Renamed `Serial::raw_read` to `Serial::read_data_register`. ([#281])
4849
- Move ADC from a macro to a generic implementation, meaning that
4950
it is possible to obtain an ADC instance via `Adc::new` instead of
5051
`Adc::adc1`. ([#281])

src/serial.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,13 @@ where
576576
/// the triggered events via [`Serial::triggered_events`].
577577
///
578578
/// Returns `None` if the hardware is busy.
579+
///
580+
/// ## Embedded HAL
581+
///
582+
/// To have a more managed way to read from the serial use the [`embedded_hal::serial::Read`]
583+
/// trait implementation.
579584
#[doc(alias = "RDR")]
580-
pub fn raw_read(&self) -> Option<u8> {
585+
pub fn read_data_register(&self) -> Option<u8> {
581586
if self.usart.isr.read().busy().bit_is_set() {
582587
return None;
583588
}
@@ -907,7 +912,7 @@ where
907912
/// up to the interrupt handler.
908913
///
909914
/// To read out the content of the read register without internal error handling, use
910-
/// [`Serial::raw_read()`].
915+
/// [`Serial::read_data_register()`].
911916
/// ...
912917
// -> According to this API it should be skipped.
913918
fn read(&mut self) -> nb::Result<u8, Error> {

0 commit comments

Comments
 (0)