Skip to content

Commit 14dad84

Browse files
authored
Merge pull request #304 from Sh3Rm4n/fix-spi-impls
Add missing spi impls for gpio-f303
2 parents 26a531a + e396cb5 commit 14dad84

File tree

9 files changed

+20
-25
lines changed

9 files changed

+20
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1919
- `BusClock` and `BusTimerClock` traits ([#302])
2020
- `RccBus`, `Enable`, `Reset` traits and implementations for peripherals ([#299])
2121
- Support cortex-m-rt `v0.7.0` but still allow `v0.6.13` ([#283])
22+
- Add missing SPI impls for the `gpio-f303` device groups (e.g. stm32f303vc) ([#304])
23+
- Make timer `InterruptTypes` fields public to be useful. ([#304])
2224

2325
### Fixed
2426

@@ -34,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3436
To disable that behavior, set `default-features = false`. ([#283])
3537
- The MSRV was bumped to 1.52 ([#283])
3638
- Update `stm32f3` pac to v0.14.0 ([#282])
39+
- Remove the `bxcan` re-export. ([#303])
3740

3841
## [v0.8.1] - 2021-10-27
3942

@@ -502,6 +505,7 @@ let clocks = rcc
502505
[defmt]: https://github.com/knurling-rs/defmt
503506
[filter]: https://defmt.ferrous-systems.com/filtering.html
504507

508+
[#303]: https://github.com/stm32-rs/stm32f3xx-hal/pull/303
505509
[#302]: https://github.com/stm32-rs/stm32f3xx-hal/pull/302
506510
[#299]: https://github.com/stm32-rs/stm32f3xx-hal/pull/299
507511
[#291]: https://github.com/stm32-rs/stm32f3xx-hal/pull/291

examples/can.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use hal::pac;
1313
use hal::prelude::*;
1414
use hal::watchdog::IndependentWatchDog;
1515

16-
use hal::can::bxcan::filter::Mask32;
17-
use hal::can::bxcan::{Frame, StandardId};
16+
use bxcan::filter::Mask32;
17+
use bxcan::{Frame, StandardId};
1818
use hal::can::Can;
1919
use nb::block;
2020

src/can.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::pac;
1717

1818
use crate::rcc::{Enable, Reset, APB1};
1919

20-
pub use bxcan;
2120
use bxcan::RegisterBlock;
2221

2322
use cfg_if::cfg_if;
@@ -55,12 +54,7 @@ where
5554
Tx: TxPin,
5655
Rx: RxPin,
5756
{
58-
/// Create a new CAN instance, using the specified TX and RX pins.
59-
///
60-
/// Note: this does not actually initialize the CAN bus.
61-
/// You will need to first call [`bxcan::Can::new`] and set the bus configuration and filters
62-
/// before the peripheral can be enabled.
63-
/// See the CAN example, for a more thorough example of the full setup process.
57+
/// Create a new `bxcan::CAN` instance.
6458
pub fn new(can: pac::CAN, tx: Tx, rx: Rx, apb1: &mut APB1) -> bxcan::Can<Self> {
6559
pac::CAN::enable(apb1);
6660
pac::CAN::reset(apb1);

src/rcc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ pub struct BDCR {
351351
}
352352

353353
impl BDCR {
354+
#[allow(unused)]
354355
pub(crate) fn bdcr(&mut self) -> &rcc::BDCR {
355356
// NOTE(unsafe) this proxy grants exclusive access to this register
356357
unsafe { &(*RCC::ptr()).bdcr }

src/serial.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ use cortex_m::interrupt;
4646
#[cfg_attr(feature = "enumset", derive(EnumSetType))]
4747
#[cfg_attr(not(feature = "enumset"), derive(Copy, Clone, PartialEq, Eq))]
4848
#[non_exhaustive]
49+
// TODO: Split up in transmission and reception events (RM0316 29.7)
4950
pub enum Event {
5051
/// Transmit data register empty / new data can be sent.
5152
///

src/spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ cfg_if::cfg_if! {
143143
cfg_if::cfg_if! {
144144
if #[cfg(all(
145145
not(feature = "stm32f301"),
146-
any(feature = "gpio-f302", feature = "gpio-f303e"),
146+
any(feature = "gpio-f302", feature = "gpio-f303", feature = "gpio-f303e"),
147147
))] {
148148
impl SckPin<SPI3> for gpio::PB3<AF6<PushPull>> {}
149149
impl MisoPin<SPI3> for gpio::PB4<AF6<PushPull>> {}

src/timer/interrupts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use crate::pac::Interrupt;
66
#[non_exhaustive]
77
pub struct InterruptTypes {
88
/// Break Interrupt
9-
r#break: Interrupt,
9+
pub r#break: Interrupt,
1010
/// Update Interrupt
11-
update: Interrupt,
11+
pub update: Interrupt,
1212
/// Trigger and communication Interrupt
13-
trigger: Interrupt,
13+
pub trigger: Interrupt,
1414
/// Capture and compare interupt
15-
capture_compare: Interrupt,
15+
pub capture_compare: Interrupt,
1616
}
1717

1818
// FIXME: Use conditional feature compilation to make this compialble for all chip families.

testsuite/Cargo.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,17 @@ harness = false
5050
[dependencies]
5151
cfg-if = "1.0"
5252
cortex-m = "0.7.0"
53-
cortex-m-rt = "0.7"
53+
cortex-m-rt = "0.7.1"
5454
defmt = "0.3.0"
5555
defmt-rtt = "0.3.0"
5656
defmt-test = "0.3.0"
5757
enumset = { version = "1.0.6" }
5858
# TODO: Set stm32f303xc as default, but make it overwritable
59-
stm32f3xx-hal = { path = "..", features = ["defmt-trace"]}
59+
stm32f3xx-hal = { path = "..", features = ["defmt"]}
6060
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
6161
nb = "1.0.0"
6262
num-traits = { version = "0.2.14", default-features = false }
6363

6464
[features]
6565
# enable all defmt logging levels
66-
default = ["stm32f3xx-hal/stm32f303xc", "defmt-default"]
67-
68-
# do not modify these features
69-
defmt-default = ["defmt-trace"]
70-
defmt-trace = ["stm32f3xx-hal/defmt-trace"]
71-
defmt-debug = ["stm32f3xx-hal/defmt-trace"]
72-
defmt-info = ["stm32f3xx-hal/defmt-trace"]
73-
defmt-warn = ["stm32f3xx-hal/defmt-trace"]
74-
defmt-error = ["stm32f3xx-hal/defmt-trace"]
66+
default = ["stm32f3xx-hal/stm32f303xc"]

testsuite/tests/uart.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ mod tests {
394394
unwrap!(nb::block!(serial.write(b'A')).ok());
395395
});
396396

397+
// FIXME: This test is sensitive to timing and the event might already be triggered by a
398+
// previous transmission. (More details about IDLE event RM0316 29.8.1)
399+
#[cfg(feature = "disabled")]
397400
trigger_event(Event::Idle, &mut serial, |serial| {
398401
// Note: The IDLE bit will not be set again until the RXNE bit has been set (i.e. a new
399402
// idle line occurs).

0 commit comments

Comments
 (0)