Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure examples #552

Merged
merged 8 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --features=${{ matrix.mcu }},usb_fs,sdio-host,can,i2s,fsmc_lcd --examples
args: --features=${{ matrix.mcu }},usb_fs,sdio-host,can,i2s,fsmc_lcd,rtic --examples
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Update `bxcan`, `rtic` and other dependencies [#519]
- Bump `synopsys-usb-otg` to `0.3.1` [#535]
- Renamed and updated rtic-button example (was rtic) [#551]
- Rename adc_dma_rtic to rtic-adc-dma and move it ot defmt [#552]
- Rename spi_slave_dma_rtic to rtic-spi-slave-dma and unbroke it [#552]
- Rename i2s-rtic-audio-in-out to rtic-i2s-audio-in-out [#552]

### Removed
- `i2s-audio-out-dma.rs` example, too difficult to fix.
Expand Down Expand Up @@ -69,6 +72,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[#542]: https://github.com/stm32-rs/stm32f4xx-hal/pull/542
[#527]: https://github.com/stm32-rs/stm32f4xx-hal/pull/527
[#551]: https://github.com/stm32-rs/stm32f4xx-hal/pull/551
[#552]: https://github.com/stm32-rs/stm32f4xx-hal/pull/552

## [v0.13.2] - 2022-05-16

Expand Down
122 changes: 73 additions & 49 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ version = "0.3.0"
optional = true

[dev-dependencies]
defmt = "0.3.2"
defmt-rtt = "0.3.2"
panic-probe = { version = "0.3.0", features = [ "print-defmt" ] }
panic-semihosting = "0.6.0"
cortex-m-semihosting = "0.5.0"
heapless = "0.7.16"
Expand Down Expand Up @@ -370,25 +372,19 @@ debug = true
lto = true
opt-level = "s"

# Keep examples sorted

[[example]]
name= "display_touch"
required-features = ["fsmc_lcd", "stm32f412"] #or stm32f413
name = "analog-stopwatch-with-spi-ssd1306"
required-features = ["spi4", "tim2", "gpioe", "gpiog"] # stm32f429

[[example]]
name = "blinky-timer-irq"
required-features = ["tim2"] # stm32f411

[[example]]
name = "usb_serial_poll"
required-features = ["otg-fs", "usb_fs"] # stm32f401

[[example]]
name = "usb_serial_irq"
required-features = ["otg-fs", "usb_fs"] # stm32f407

[[example]]
name = "sd"
required-features = ["gpiod", "sdio", "sdio-host"] # stm32f405
name = "can-send"
required-features = ["can", "stm32f405"]

[[example]]
name = "delay-syst-blinky"
Expand All @@ -398,50 +394,74 @@ required-features = ["device-selected"] # stm32f411
name = "delay-timer-blinky"
required-features = ["device-selected"] # stm32f411

[[example]]
name = "display-touch"
required-features = ["fsmc_lcd", "stm32f412"] #or stm32f413

[[example]]
name = "dwt-blinky"
required-features = ["gpiog"] # "stm32f429"

[[example]]
name = "ssd1306-image"
required-features = ["device-selected"] # stm32f411
name = "dynamic-gpio"
required-features = ["device-selected"]

[[example]]
name = "stopwatch-with-ssd1306-and-interrupts"
required-features = ["tim2"] # stm32f411
name = "f413disco-lcd-ferris"
required-features = ["gpiod", "gpioe", "gpiof", "gpiog", "fsmc", "fsmc_lcd"] # stm32f413

[[example]]
name = "stopwatch-with-ssd1306-and-interrupts-and-dma-i2c"
required-features = ["tim2", "stm32f411"] # stm32f411
name = "hd44780"
required-features = ["device-selected"]

[[example]]
name = "analog-stopwatch-with-spi-ssd1306"
required-features = ["spi4", "tim2", "gpioe", "gpiog"] # stm32f429
name = "i2s-audio-out"
required-features = ["stm32f411", "i2s"]

[[example]]
name = "rng-display"
required-features = ["rng"] # stm32f407
name = "ist7920-bidi-normal-spi"
required-features = ["device-selected"]

[[example]]
name = "pwm"
required-features = ["device-selected"]

[[example]]
name = "pwm-input"
required-features = ["tim8"] # stm32f446

[[example]]
name = "pwm-sinus"
required-features = ["stm32f411"]

[[example]]
name = "qei"
required-features = ["tim2"] # stm32f411

[[example]]
name = "can-send"
required-features = ["can", "stm32f405"]
name = "rng-display"
required-features = ["rng"] # stm32f407

[[example]]
name = "i2s-audio-out"
required-features = ["stm32f411", "i2s"]
name = "rtc"
required-features = ["device-selected"]

[[example]]
name = "i2s-rtic-audio-in-out"
required-features = ["stm32f411", "i2s", "rtic"]
name = "rtic-adc-dma"
required-features = ["device-selected", "rtic"] # stm32f401

[[example]]
name = "rtic-button"
required-features = ["stm32f411", "rtic"] # stm32f411

[[example]]
name = "rtic-i2s-audio-in-out"
required-features = ["stm32f411", "i2s", "rtic"]

[[example]]
name = "rtic-spi-slave-dma"
required-features = ["stm32f411", "rtic"]

[[example]]
name = "rtic-tick"
required-features = ["tim2", "rtic"]
Expand All @@ -455,50 +475,54 @@ name = "rtic-usart-shell-ssd1306"
required-features = ["stm32f411", "rtic"] # stm32f411

[[example]]
name = "adc_dma_rtic"
required-features = ["device-selected", "rtic"] # stm32f401
name = "sd"
required-features = ["gpiod", "sdio", "sdio-host"] # stm32f405

[[example]]
name = "serial"
required-features = ["device-selected"]

[[example]]
name = "serial-9bit"
required-features = ["gpiod"] # stm32f411

[[example]]
name = "st7789-lcd"
required-features = ["fsmc", "fsmc_lcd"] # stm32f412
name = "spi-dma"
required-features = ["stm32f411"]

[[example]]
name = "f413disco_lcd_ferris"
required-features = ["gpiod", "gpioe", "gpiof", "gpiog", "fsmc", "fsmc_lcd"] # stm32f413
name = "ssd1306-image"
required-features = ["device-selected"] # stm32f411

[[example]]
name= "pwm-input"
required-features = ["tim8"] # stm32f446
name = "st7789-lcd"
required-features = ["fsmc", "fsmc_lcd"] # stm32f412

[[example]]
name= "pwm-sinus"
required-features = ["stm32f411"]
name = "stopwatch-with-ssd1306-and-interrupts"
required-features = ["tim2"] # stm32f411

[[example]]
name = "ist7920_bidi_normal_spi"
required-features = ["device-selected"]
name = "stopwatch-with-ssd1306-and-interrupts-and-dma-i2c"
required-features = ["tim2", "stm32f411"] # stm32f411

[[example]]
name = "spi_dma"
required-features = ["stm32f411"]
name = "timer-periph"
required-features = ["device-selected"]

[[example]]
name = "dynamic_gpio"
name = "timer-syst"
required-features = ["device-selected"]

[[example]]
name = "rtc"
required-features = ["device-selected"]
name = "usb-serial-irq"
required-features = ["otg-fs", "usb_fs"] # stm32f407

[[example]]
name = "hd44780"
required-features = ["device-selected"]
name = "usb-serial-poll"
required-features = ["otg-fs", "usb_fs"] # stm32f401

[[example]]
name = "spi_slave_dma_rtic"
required-features = ["stm32f411", "rtic"]
name = "ws2812-spi"
required-features = ["device-selected"]

File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions examples/adc_dma_rtic.rs → examples/rtic-adc-dma.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![no_std]
#![no_main]

use panic_semihosting as _;
use defmt_rtt as _; // global logger
use panic_probe as _;

#[rtic::app(device = stm32f4xx_hal::pac, dispatchers = [EXTI0])]
mod app {
use cortex_m_semihosting::hprintln;
use dwt_systick_monotonic::DwtSystick;

use stm32f4xx_hal::{
Expand Down Expand Up @@ -126,6 +126,6 @@ mod app {
let temperature = (110.0 - 30.0) * ((raw_temp as f32) - cal30) / (cal110 - cal30) + 30.0;
let voltage = sample_to_millivolts(raw_volt);

hprintln!("temperature: {}, voltage: {}", temperature, voltage).unwrap();
defmt::info!("temperature: {}, voltage: {}", temperature, voltage);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ impl<SPI: Instance, PINS, const BIDI: bool, W: FrameSize, OPERATION>

// Spi DMA

impl<SPI: Instance, PINS, const BIDI: bool> Spi<SPI, PINS, BIDI, u8, Master> {
impl<SPI: Instance, PINS, const BIDI: bool, OPERATION> Spi<SPI, PINS, BIDI, u8, OPERATION> {
pub fn use_dma(self) -> DmaBuilder<SPI> {
DmaBuilder { spi: self.spi }
}
Expand Down