From a1241fb4978e493fa4bf1a1c556403454dc5d6ba Mon Sep 17 00:00:00 2001 From: Unizippro Date: Wed, 13 May 2020 11:21:48 +0200 Subject: [PATCH 1/2] Proposal for Configure baudrate trait --- src/serial.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/serial.rs b/src/serial.rs index ea36b7818..e22d14957 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -25,3 +25,13 @@ pub trait Write { /// Ensures that none of the previously written words are still buffered fn try_flush(&mut self) -> nb::Result<(), Self::Error>; } + +/// Enable changing the baudrate after initiation of serial interface +pub trait ConfigureBaud { + /// Baudrate type + type BaudRate; + /// Set baud error + type Error; + /// Change baudrate + fn set_baudrate(&mut self, baudrate: Self::BaudRate) -> Result<(), Self::Error>; +} \ No newline at end of file From 8d091c81ed6e8236fcf5505b9d64deaf96e98001 Mon Sep 17 00:00:00 2001 From: Unizippro Date: Wed, 13 May 2020 12:07:41 +0200 Subject: [PATCH 2/2] fix typo --- src/serial.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serial.rs b/src/serial.rs index e22d14957..e9c4cd157 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -32,6 +32,6 @@ pub trait ConfigureBaud { type BaudRate; /// Set baud error type Error; - /// Change baudrate - fn set_baudrate(&mut self, baudrate: Self::BaudRate) -> Result<(), Self::Error>; + /// Change baud rate + fn set_baud_rate(&mut self, baud_rate: Self::BaudRate) -> Result<(), Self::Error>; } \ No newline at end of file