Skip to content

Commit 3f2e7d1

Browse files
bors[bot]burrbull
andauthored
Merge #411
411: update deps, release 0.9.0 r=therealprof a=burrbull Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents f30cb81 + a80dc6e commit 3f2e7d1

File tree

7 files changed

+40
-36
lines changed

7 files changed

+40
-36
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.9.0] - 2022-03-02
11+
1012
### Added
1113

1214
- Reexport gpio pins to `gpio` mod
1315
- Added the ability to specify the word size (8 or 9 bits) for `Serial` (USART). When using parity, the parity bit is included in the number of bits of the word.
1416
- `blocking::serial::Write` for `Tx` and `Serial`. `core::fmt::Write` for `Serial`
1517
- `Instance` for Timer's, rtic-monotonic fugit impl
16-
- Serial can now be reconfigured, allowing to change e.g. the baud rate after initialisation.
18+
- Serial can now be reconfigured, allowing to change e.g. the baud rate after initialization.
1719

1820
### Changed
1921

22+
- Use `embedded-dma` 0.2.0
2023
- Connectivity line devices configuration supports ADC2
2124
- replace `GetBusFreq` with `BusClock` and `BusTimerClock`
2225

@@ -302,7 +305,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
302305

303306
- First tagged version
304307

305-
[Unreleased]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.8.0...HEAD
308+
[Unreleased]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.9.0...HEAD
309+
[v0.9.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.8.0...v0.9.0
306310
[v0.8.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.7.0...v0.8.0
307311
[v0.7.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.6.1...v0.7.0
308312
[v0.6.1]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.6.0...v0.6.1

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ repository = "https://github.com/stm32-rs/stm32f1xx-hal"
99
documentation = "https://docs.rs/stm32f1xx-hal"
1010
readme = "README.md"
1111
edition = "2018"
12-
version = "0.8.0"
12+
version = "0.9.0"
1313

1414
[package.metadata.docs.rs]
1515
features = ["stm32f103", "rt"]
1616
default-target = "x86_64-unknown-linux-gnu"
1717

1818
[dependencies]
1919
cortex-m = "0.7.4"
20-
cortex-m-rt = "0.7"
20+
cortex-m-rt = "0.7.1"
2121
nb = "1"
2222
stm32f1 = "0.14.0"
23-
embedded-dma = "0.1.2"
23+
embedded-dma = "0.2.0"
2424
bxcan = "0.6"
2525
void = { default-features = false, version = "1.0.2" }
26-
embedded-hal = { features = ["unproven"], version = "0.2.6" }
26+
embedded-hal = { features = ["unproven"], version = "0.2.7" }
2727
fugit = "0.3.5"
2828
fugit-timer = "0.1.3"
2929
rtic-monotonic = { version = "1.0", optional = true }
@@ -39,7 +39,7 @@ panic-semihosting = "0.5.6"
3939
panic-itm = "0.4.1"
4040
cortex-m-rtic = "1.0.0"
4141
cortex-m-semihosting = "0.3.7"
42-
heapless = "0.7.9"
42+
heapless = "0.7.10"
4343
mfrc522 = "0.2.0"
4444
usb-device = "0.2.8"
4545
usbd-serial = "0.1.1"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ be specified as part of the `Cargo.toml` definition.
186186

187187
```toml
188188
[dependencies.stm32f1xx-hal]
189-
version = "0.6.1"
189+
version = "0.9.0"
190190
features = ["stm32f100", "rt"]
191191
```
192192

src/adc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::rcc::{Clocks, Enable, Reset};
1111
use crate::time::kHz;
1212
use core::sync::atomic::{self, Ordering};
1313
use cortex_m::asm::delay;
14-
use embedded_dma::StaticWriteBuffer;
14+
use embedded_dma::WriteBuffer;
1515

1616
use crate::pac::{self, RCC};
1717

@@ -735,13 +735,13 @@ macro_rules! adcdma {
735735
impl<B, PINS, MODE> crate::dma::CircReadDma<B, u16> for AdcDma<$ADCX, PINS, MODE, $dmarxch>
736736
where
737737
Self: TransferPayload,
738-
&'static mut [B; 2]: StaticWriteBuffer<Word = u16>,
738+
&'static mut [B; 2]: WriteBuffer<Word = u16>,
739739
B: 'static,
740740
{
741741
fn circ_read(mut self, mut buffer: &'static mut [B; 2]) -> CircBuffer<B, Self> {
742742
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
743743
// until the end of the transfer.
744-
let (ptr, len) = unsafe { buffer.static_write_buffer() };
744+
let (ptr, len) = unsafe { buffer.write_buffer() };
745745
self.channel.set_peripheral_address(
746746
unsafe { &(*<$ADCX>::ptr()).dr as *const _ as u32 },
747747
false,
@@ -775,12 +775,12 @@ macro_rules! adcdma {
775775
impl<B, PINS, MODE> crate::dma::ReadDma<B, u16> for AdcDma<$ADCX, PINS, MODE, $dmarxch>
776776
where
777777
Self: TransferPayload,
778-
B: StaticWriteBuffer<Word = u16>,
778+
B: WriteBuffer<Word = u16>,
779779
{
780780
fn read(mut self, mut buffer: B) -> Transfer<W, B, Self> {
781781
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
782782
// until the end of the transfer.
783-
let (ptr, len) = unsafe { buffer.static_write_buffer() };
783+
let (ptr, len) = unsafe { buffer.write_buffer() };
784784
self.channel.set_peripheral_address(
785785
unsafe { &(*<$ADCX>::ptr()).dr as *const _ as u32 },
786786
false,

src/dma.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::{
55
marker::PhantomData,
66
sync::atomic::{compiler_fence, Ordering},
77
};
8-
use embedded_dma::{StaticReadBuffer, StaticWriteBuffer};
8+
use embedded_dma::{ReadBuffer, WriteBuffer};
99

1010
#[derive(Debug)]
1111
#[non_exhaustive]
@@ -35,7 +35,7 @@ where
3535

3636
impl<BUFFER, PAYLOAD> CircBuffer<BUFFER, PAYLOAD>
3737
where
38-
&'static mut [BUFFER; 2]: StaticWriteBuffer,
38+
&'static mut [BUFFER; 2]: WriteBuffer,
3939
BUFFER: 'static,
4040
{
4141
pub(crate) fn new(buf: &'static mut [BUFFER; 2], payload: PAYLOAD) -> Self {
@@ -563,7 +563,7 @@ pub trait Transmit {
563563
/// Trait for circular DMA readings from peripheral to memory.
564564
pub trait CircReadDma<B, RS>: Receive
565565
where
566-
&'static mut [B; 2]: StaticWriteBuffer<Word = RS>,
566+
&'static mut [B; 2]: WriteBuffer<Word = RS>,
567567
B: 'static,
568568
Self: core::marker::Sized,
569569
{
@@ -573,7 +573,7 @@ where
573573
/// Trait for DMA readings from peripheral to memory.
574574
pub trait ReadDma<B, RS>: Receive
575575
where
576-
B: StaticWriteBuffer<Word = RS>,
576+
B: WriteBuffer<Word = RS>,
577577
Self: core::marker::Sized + TransferPayload,
578578
{
579579
fn read(self, buffer: B) -> Transfer<W, B, Self>;
@@ -582,7 +582,7 @@ where
582582
/// Trait for DMA writing from memory to peripheral.
583583
pub trait WriteDma<B, TS>: Transmit
584584
where
585-
B: StaticReadBuffer<Word = TS>,
585+
B: ReadBuffer<Word = TS>,
586586
Self: core::marker::Sized + TransferPayload,
587587
{
588588
fn write(self, buffer: B) -> Transfer<R, B, Self>;
@@ -591,8 +591,8 @@ where
591591
/// Trait for DMA simultaneously reading and writing within one synchronous operation. Panics if both buffers are not of equal length.
592592
pub trait ReadWriteDma<RXB, TXB, TS>: Transmit
593593
where
594-
RXB: StaticWriteBuffer<Word = TS>,
595-
TXB: StaticReadBuffer<Word = TS>,
594+
RXB: WriteBuffer<Word = TS>,
595+
TXB: ReadBuffer<Word = TS>,
596596
Self: core::marker::Sized + TransferPayload,
597597
{
598598
fn read_write(self, rx_buffer: RXB, tx_buffer: TXB) -> Transfer<W, (RXB, TXB), Self>;

src/serial.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ use core::convert::Infallible;
8383
use core::marker::PhantomData;
8484
use core::ops::Deref;
8585
use core::sync::atomic::{self, Ordering};
86-
use embedded_dma::{StaticReadBuffer, StaticWriteBuffer};
86+
use embedded_dma::{ReadBuffer, WriteBuffer};
8787
use embedded_hal::serial::Write;
8888

8989
use crate::afio::MAPR;
@@ -968,13 +968,13 @@ macro_rules! serialdma {
968968

969969
impl<B> crate::dma::CircReadDma<B, u8> for $rxdma
970970
where
971-
&'static mut [B; 2]: StaticWriteBuffer<Word = u8>,
971+
&'static mut [B; 2]: WriteBuffer<Word = u8>,
972972
B: 'static,
973973
{
974974
fn circ_read(mut self, mut buffer: &'static mut [B; 2]) -> CircBuffer<B, Self> {
975975
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
976976
// until the end of the transfer.
977-
let (ptr, len) = unsafe { buffer.static_write_buffer() };
977+
let (ptr, len) = unsafe { buffer.write_buffer() };
978978
self.channel.set_peripheral_address(unsafe{ &(*$USARTX::ptr()).dr as *const _ as u32 }, false);
979979
self.channel.set_memory_address(ptr as u32, true);
980980
self.channel.set_transfer_length(len);
@@ -998,12 +998,12 @@ macro_rules! serialdma {
998998

999999
impl<B> crate::dma::ReadDma<B, u8> for $rxdma
10001000
where
1001-
B: StaticWriteBuffer<Word = u8>,
1001+
B: WriteBuffer<Word = u8>,
10021002
{
10031003
fn read(mut self, mut buffer: B) -> Transfer<W, B, Self> {
10041004
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
10051005
// until the end of the transfer.
1006-
let (ptr, len) = unsafe { buffer.static_write_buffer() };
1006+
let (ptr, len) = unsafe { buffer.write_buffer() };
10071007
self.channel.set_peripheral_address(unsafe{ &(*$USARTX::ptr()).dr as *const _ as u32 }, false);
10081008
self.channel.set_memory_address(ptr as u32, true);
10091009
self.channel.set_transfer_length(len);
@@ -1025,12 +1025,12 @@ macro_rules! serialdma {
10251025

10261026
impl<B> crate::dma::WriteDma<B, u8> for $txdma
10271027
where
1028-
B: StaticReadBuffer<Word = u8>,
1028+
B: ReadBuffer<Word = u8>,
10291029
{
10301030
fn write(mut self, buffer: B) -> Transfer<R, B, Self> {
10311031
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
10321032
// until the end of the transfer.
1033-
let (ptr, len) = unsafe { buffer.static_read_buffer() };
1033+
let (ptr, len) = unsafe { buffer.read_buffer() };
10341034

10351035
self.channel.set_peripheral_address(unsafe{ &(*$USARTX::ptr()).dr as *const _ as u32 }, false);
10361036

src/spi.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use crate::rcc::{BusClock, Clocks, Enable, Reset};
4949
use crate::time::Hertz;
5050

5151
use core::sync::atomic::{self, Ordering};
52-
use embedded_dma::{StaticReadBuffer, StaticWriteBuffer};
52+
use embedded_dma::{ReadBuffer, WriteBuffer};
5353

5454
/// SPI error
5555
#[derive(Debug)]
@@ -625,12 +625,12 @@ macro_rules! spi_dma {
625625

626626
impl<B, REMAP, PIN> crate::dma::ReadDma<B, u8> for SpiRxDma<$SPIi, REMAP, PIN, $RCi>
627627
where
628-
B: StaticWriteBuffer<Word = u8>,
628+
B: WriteBuffer<Word = u8>,
629629
{
630630
fn read(mut self, mut buffer: B) -> Transfer<W, B, Self> {
631631
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
632632
// until the end of the transfer.
633-
let (ptr, len) = unsafe { buffer.static_write_buffer() };
633+
let (ptr, len) = unsafe { buffer.write_buffer() };
634634
self.channel.set_peripheral_address(
635635
unsafe { &(*<$SPIi>::ptr()).dr as *const _ as u32 },
636636
false,
@@ -668,12 +668,12 @@ macro_rules! spi_dma {
668668

669669
impl<B, REMAP, PIN> crate::dma::WriteDma<B, u8> for SpiTxDma<$SPIi, REMAP, PIN, $TCi>
670670
where
671-
B: StaticReadBuffer<Word = u8>,
671+
B: ReadBuffer<Word = u8>,
672672
{
673673
fn write(mut self, buffer: B) -> Transfer<R, B, Self> {
674674
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
675675
// until the end of the transfer.
676-
let (ptr, len) = unsafe { buffer.static_read_buffer() };
676+
let (ptr, len) = unsafe { buffer.read_buffer() };
677677
self.channel.set_peripheral_address(
678678
unsafe { &(*<$SPIi>::ptr()).dr as *const _ as u32 },
679679
false,
@@ -712,8 +712,8 @@ macro_rules! spi_dma {
712712
impl<RXB, TXB, REMAP, PIN> crate::dma::ReadWriteDma<RXB, TXB, u8>
713713
for SpiRxTxDma<$SPIi, REMAP, PIN, $RCi, $TCi>
714714
where
715-
RXB: StaticWriteBuffer<Word = u8>,
716-
TXB: StaticReadBuffer<Word = u8>,
715+
RXB: WriteBuffer<Word = u8>,
716+
TXB: ReadBuffer<Word = u8>,
717717
{
718718
fn read_write(
719719
mut self,
@@ -722,8 +722,8 @@ macro_rules! spi_dma {
722722
) -> Transfer<W, (RXB, TXB), Self> {
723723
// NOTE(unsafe) We own the buffer now and we won't call other `&mut` on it
724724
// until the end of the transfer.
725-
let (rxptr, rxlen) = unsafe { rxbuffer.static_write_buffer() };
726-
let (txptr, txlen) = unsafe { txbuffer.static_read_buffer() };
725+
let (rxptr, rxlen) = unsafe { rxbuffer.write_buffer() };
726+
let (txptr, txlen) = unsafe { txbuffer.read_buffer() };
727727

728728
if rxlen != txlen {
729729
panic!("receive and send buffer lengths do not match!");

0 commit comments

Comments
 (0)