Skip to content

Commit

Permalink
Bump e-g core (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani authored May 18, 2023
1 parent 0dc72c8 commit 7271f39
Show file tree
Hide file tree
Showing 16 changed files with 214 additions and 224 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
target_steps: &target_steps
docker:
- image: cimg/rust:1.57.0
- image: cimg/rust:1.61.0
steps:
- checkout
- restore_cache:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

### Changed

- **(breaking)** [#175](https://github.com/jamwaffles/ssd1306/pull/175) Increased MSRV to 1.57.0
- **(breaking)** [#184](https://github.com/jamwaffles/ssd1306/pull/184) Increased MSRV to 1.61.0
- **(breaking)** [#179](https://github.com/jamwaffles/ssd1306/pull/179) Changed `Ssd1306::reset` signature.
- [#181](https://github.com/jamwaffles/ssd1306/pull/181) Update embedded-graphics-core dependency to 0.4

## [0.7.1] - 2022-08-15

Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/jamwaffles/ssd1306"
version = "0.7.1"
edition = "2018"
exclude = [ "build.rs", "build.sh", "memory.x", "doc", "*.jpg", "*.png", "*.bmp" ]
rust-version = "1.57"
rust-version = "1.61"

[badges]
circle-ci = { repository = "jamwaffles/ssd1306", branch = "master" }
Expand All @@ -24,20 +24,20 @@ embedded-hal = "0.2.5"
display-interface = "0.4.1"
display-interface-i2c = "0.4.0"
display-interface-spi = "0.4.1"
embedded-graphics-core = { version = "0.3.2", optional = true }
embedded-graphics-core = { version = "0.4.0", optional = true }

[dev-dependencies]
cortex-m = "0.7.2"
cortex-m-rt = "0.6.14"
cortex-m-rtic = "0.5.6"
cortex-m-rt = "0.7.3"
cortex-m-rtic = "1.1.4"
panic-halt = "0.2.0"
cast = { version = "0.2.6", default-features = false }
# Used to load BMP images in various examples
tinybmp = "0.3.1"
embedded-graphics = "0.7.1"
tinybmp = "0.5.0"
embedded-graphics = "0.8.0"
# Used by the noise_i2c examples
rand = { version = "0.8.4", default-features = false, features = [ "small_rng" ] }
stm32f1xx-hal = { version = "0.7.0", features = [ "rt", "stm32f103" ] }
stm32f1xx-hal = { version = "0.10.0", features = [ "rt", "stm32f103" ] }

[features]
default = ["graphics"]
Expand Down
11 changes: 5 additions & 6 deletions examples/bmp_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split();

let scl = gpiob.pb8.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb9.into_alternate_open_drain(&mut gpiob.crh);
Expand All @@ -53,11 +53,10 @@ fn main() -> ! {
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.hz(),
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
&mut rcc.apb1,
1000,
10,
1000,
Expand Down Expand Up @@ -85,6 +84,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
17 changes: 8 additions & 9 deletions examples/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ use embedded_graphics::{
use panic_halt as _;
use ssd1306::{prelude::*, Ssd1306};
use stm32f1xx_hal::{
delay::Delay,
prelude::*,
spi::{Mode, Phase, Polarity, Spi},
stm32,
timer::Timer,
};

#[entry]
Expand All @@ -41,21 +41,21 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpioa = dp.GPIOA.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpioa = dp.GPIOA.split();
let mut gpiob = dp.GPIOB.split();

// SPI1
let sck = gpioa.pa5.into_alternate_push_pull(&mut gpioa.crl);
let miso = gpioa.pa6;
let mosi = gpioa.pa7.into_alternate_push_pull(&mut gpioa.crl);

let mut delay = Delay::new(cp.SYST, clocks);
let mut delay = Timer::syst(cp.SYST, &clocks).delay();

let mut rst = gpiob.pb0.into_push_pull_output(&mut gpiob.crl);
let dc = gpiob.pb1.into_push_pull_output(&mut gpiob.crl);
Expand All @@ -68,9 +68,8 @@ fn main() -> ! {
polarity: Polarity::IdleLow,
phase: Phase::CaptureOnFirstTransition,
},
8.mhz(),
8.MHz(),
clocks,
&mut rcc.apb2,
);

let interface = display_interface_spi::SPIInterfaceNoCS::new(spi, dc);
Expand Down Expand Up @@ -123,6 +122,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
11 changes: 5 additions & 6 deletions examples/graphics_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split();

let scl = gpiob.pb8.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb9.into_alternate_open_drain(&mut gpiob.crh);
Expand All @@ -52,11 +52,10 @@ fn main() -> ! {
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.hz(),
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
&mut rcc.apb1,
1000,
10,
1000,
Expand Down Expand Up @@ -111,6 +110,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
11 changes: 5 additions & 6 deletions examples/graphics_i2c_128x32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split();

let scl = gpiob.pb8.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb9.into_alternate_open_drain(&mut gpiob.crh);
Expand All @@ -52,11 +52,10 @@ fn main() -> ! {
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.hz(),
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
&mut rcc.apb1,
1000,
10,
1000,
Expand Down Expand Up @@ -111,6 +110,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
11 changes: 5 additions & 6 deletions examples/graphics_i2c_72x40.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split();

let scl = gpiob.pb8.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb9.into_alternate_open_drain(&mut gpiob.crh);
Expand All @@ -52,11 +52,10 @@ fn main() -> ! {
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.hz(),
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
&mut rcc.apb1,
1000,
10,
1000,
Expand Down Expand Up @@ -122,6 +121,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
11 changes: 5 additions & 6 deletions examples/image_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split();

let scl = gpiob.pb8.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb9.into_alternate_open_drain(&mut gpiob.crh);
Expand All @@ -58,11 +58,10 @@ fn main() -> ! {
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.hz(),
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
&mut rcc.apb1,
1000,
10,
1000,
Expand All @@ -86,6 +85,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
11 changes: 5 additions & 6 deletions examples/noise_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split();

let scl = gpiob.pb8.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb9.into_alternate_open_drain(&mut gpiob.crh);
Expand All @@ -50,11 +50,10 @@ fn main() -> ! {
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.hz(),
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
&mut rcc.apb1,
1000,
10,
1000,
Expand All @@ -77,6 +76,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
17 changes: 8 additions & 9 deletions examples/pixelsquare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ use cortex_m_rt::{entry, exception, ExceptionFrame};
use panic_halt as _;
use ssd1306::{prelude::*, Ssd1306};
use stm32f1xx_hal::{
delay::Delay,
prelude::*,
spi::{Mode, Phase, Polarity, Spi},
stm32,
timer::Timer,
};

#[entry]
Expand All @@ -37,21 +37,21 @@ fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();

let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let rcc = dp.RCC.constrain();

let clocks = rcc.cfgr.freeze(&mut flash.acr);

let mut afio = dp.AFIO.constrain(&mut rcc.apb2);
let mut afio = dp.AFIO.constrain();

let mut gpioa = dp.GPIOA.split(&mut rcc.apb2);
let mut gpiob = dp.GPIOB.split(&mut rcc.apb2);
let mut gpioa = dp.GPIOA.split();
let mut gpiob = dp.GPIOB.split();

// SPI1
let sck = gpioa.pa5.into_alternate_push_pull(&mut gpioa.crl);
let miso = gpioa.pa6;
let mosi = gpioa.pa7.into_alternate_push_pull(&mut gpioa.crl);

let mut delay = Delay::new(cp.SYST, clocks);
let mut delay = Timer::syst(cp.SYST, &clocks).delay();

let mut rst = gpiob.pb0.into_push_pull_output(&mut gpiob.crl);
let dc = gpiob.pb1.into_push_pull_output(&mut gpiob.crl);
Expand All @@ -64,9 +64,8 @@ fn main() -> ! {
polarity: Polarity::IdleLow,
phase: Phase::CaptureOnFirstTransition,
},
8.mhz(),
8.MHz(),
clocks,
&mut rcc.apb2,
);

let interface = display_interface_spi::SPIInterfaceNoCS::new(spi, dc);
Expand Down Expand Up @@ -106,6 +105,6 @@ fn main() -> ! {
}

#[exception]
fn HardFault(ef: &ExceptionFrame) -> ! {
unsafe fn HardFault(ef: &ExceptionFrame) -> ! {
panic!("{:#?}", ef);
}
Loading

0 comments on commit 7271f39

Please sign in to comment.