فهرست منبع

Updated for stm32f1 v0.5.0 and dressed up for first 0.1.0 release

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
Daniel Egger 5 سال پیش
والد
کامیت
43f2475d5e
11فایلهای تغییر یافته به همراه32 افزوده شده و 39 حذف شده
  1. 8 11
      Cargo.toml
  2. 2 2
      examples/blinky.rs
  3. 2 2
      examples/delay.rs
  4. 2 2
      examples/led.rs
  5. 2 2
      examples/mfrc522.rs
  6. 2 2
      examples/nojtag.rs
  7. 2 2
      examples/pwm.rs
  8. 2 2
      examples/qei.rs
  9. 2 2
      examples/serial.rs
  10. 0 4
      src/lib.rs
  11. 8 8
      src/pwm.rs

+ 8 - 11
Cargo.toml

@@ -1,18 +1,19 @@
 [package]
-authors = ["Jorge Aparicio <jorge@japaric.io>"]
+authors = ["Jorge Aparicio <jorge@japaric.io>", "Daniel Egger <daniel@eggers-club.de>"]
 categories = ["embedded", "hardware-support", "no-std"]
 description = "HAL for the STM32F100xx family of microcontrollers"
 keywords = ["arm", "cortex-m", "stm32", "hal"]
 license = "MIT OR Apache-2.0"
 name = "stm32f1xx-hal"
 repository = "https://github.com/stm32-rs/stm32f1xx-hal"
-version = "0.0.0"
+documentation = "https://docs.rs/crate/stm32f1xx-hal"
+version = "0.1.0"
 
 [dependencies]
 cortex-m = "0.5.8"
 nb = "0.1.1"
-cortex-m-rt = "0.6.6"
-stm32f1 = "0.4.0"
+cortex-m-rt = "0.6.7"
+stm32f1 = "0.5.0"
 
 [dependencies.void]
 default-features = false
@@ -32,10 +33,10 @@ panic-itm = "0.4.0"
 # cortex-m-rtfm = "0.3.1"
 cortex-m-semihosting = "0.3.2"
 enc28j60 = "0.2.0"
-heapless = "0.4.0"
+heapless = "0.4.1"
 m = "0.1.1"
 mfrc522 = "0.2.0"
-serde_derive = "1.0.81"
+serde_derive = "1.0.82"
 
 [dev-dependencies.byteorder]
 default-features = false
@@ -67,16 +68,12 @@ version = "1.5.0"
 
 [dev-dependencies.serde]
 default-features = false
-version = "1.0.81"
+version = "1.0.82"
 
 #[dev-dependencies.serde-json-core]
 #git = "https://github.com/japaric/serde-json-core"
 #rev = "6f12b77c1ffeae167989fe06e0d8b15978bd6d18"
 
-[dev-dependencies.stm32f103xx]
-features = ["rt"]
-version = "0.11.0"
-
 [features]
 doc = []
 rt = ["stm32f1/rt"]

+ 2 - 2
examples/blinky.rs

@@ -13,14 +13,14 @@ extern crate stm32f1xx_hal as hal;
 extern crate nb;
 
 use hal::prelude::*;
-use hal::stm32f103xx;
+use hal::stm32;
 use hal::timer::Timer;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
     let cp = cortex_m::Peripherals::take().unwrap();
-    let dp = stm32f103xx::Peripherals::take().unwrap();
+    let dp = stm32::Peripherals::take().unwrap();
 
     let mut flash = dp.FLASH.constrain();
     let mut rcc = dp.RCC.constrain();

+ 2 - 2
examples/delay.rs

@@ -12,12 +12,12 @@ extern crate stm32f1xx_hal as hal;
 
 use hal::delay::Delay;
 use hal::prelude::*;
-use hal::stm32f103xx;
+use hal::stm32;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
-    let dp = stm32f103xx::Peripherals::take().unwrap();
+    let dp = stm32::Peripherals::take().unwrap();
     let cp = cortex_m::Peripherals::take().unwrap();
 
     let mut flash = dp.FLASH.constrain();

+ 2 - 2
examples/led.rs

@@ -10,12 +10,12 @@ extern crate panic_semihosting;
 extern crate stm32f1xx_hal as hal;
 
 use hal::prelude::*;
-use hal::stm32f103xx;
+use hal::stm32;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
-    let p = stm32f103xx::Peripherals::take().unwrap();
+    let p = stm32::Peripherals::take().unwrap();
 
     let mut rcc = p.RCC.constrain();
     let mut gpioc = p.GPIOC.split(&mut rcc.apb2);

+ 2 - 2
examples/mfrc522.rs

@@ -12,14 +12,14 @@ extern crate stm32f1xx_hal as hal;
 
 use hal::prelude::*;
 use hal::spi::Spi;
-use hal::stm32f103xx;
+use hal::stm32;
 use mfrc522::Mfrc522;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
     let mut cp = cortex_m::Peripherals::take().unwrap();
-    let dp = stm32f103xx::Peripherals::take().unwrap();
+    let dp = stm32::Peripherals::take().unwrap();
 
     let _stim = &mut cp.ITM.stim[0];
     let mut rcc = dp.RCC.constrain();

+ 2 - 2
examples/nojtag.rs

@@ -10,12 +10,12 @@ extern crate panic_semihosting;
 extern crate stm32f1xx_hal as hal;
 
 use hal::prelude::*;
-use hal::stm32f103xx;
+use hal::stm32;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
-    let p = stm32f103xx::Peripherals::take().unwrap();
+    let p = stm32::Peripherals::take().unwrap();
 
     let mut rcc = p.RCC.constrain();
     let mut gpiob = p.GPIOB.split(&mut rcc.apb2);

+ 2 - 2
examples/pwm.rs

@@ -12,12 +12,12 @@ extern crate stm32f1xx_hal as hal;
 
 use cortex_m::asm;
 use hal::prelude::*;
-use hal::stm32f103xx;
+use hal::stm32;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
-    let p = stm32f103xx::Peripherals::take().unwrap();
+    let p = stm32::Peripherals::take().unwrap();
 
     let mut flash = p.FLASH.constrain();
     let mut rcc = p.RCC.constrain();

+ 2 - 2
examples/qei.rs

@@ -16,13 +16,13 @@ use core::fmt::Write;
 use hal::delay::Delay;
 use hal::prelude::*;
 use hal::qei::Qei;
-use hal::stm32f103xx;
+use hal::stm32;
 use rt::{entry, exception, ExceptionFrame};
 use semihosting::hio;
 
 #[entry]
 fn main() -> ! {
-    let dp = stm32f103xx::Peripherals::take().unwrap();
+    let dp = stm32::Peripherals::take().unwrap();
     let cp = cortex_m::Peripherals::take().unwrap();
 
     let mut flash = dp.FLASH.constrain();

+ 2 - 2
examples/serial.rs

@@ -17,12 +17,12 @@ extern crate stm32f1xx_hal as hal;
 use cortex_m::asm;
 use hal::prelude::*;
 use hal::serial::Serial;
-use hal::stm32f103xx;
+use hal::stm32;
 use rt::{entry, exception, ExceptionFrame};
 
 #[entry]
 fn main() -> ! {
-    let p = stm32f103xx::Peripherals::take().unwrap();
+    let p = stm32::Peripherals::take().unwrap();
 
     let mut flash = p.FLASH.constrain();
     let mut rcc = p.RCC.constrain();

+ 0 - 4
src/lib.rs

@@ -48,10 +48,6 @@ pub extern crate stm32f1;
 #[cfg(feature = "stm32f103")]
 pub use stm32f1::stm32f103 as stm32;
 
-// Enable use of interrupt macro
-#[cfg(feature = "rt")]
-pub use stm32f1::interrupt;
-
 pub mod afio;
 pub mod bb;
 pub mod delay;

+ 8 - 8
src/pwm.rs

@@ -243,7 +243,7 @@ macro_rules! hal {
                 }
 
                 fn get_duty(&self) -> u16 {
-                    unsafe { (*$TIMX::ptr()).ccr1.read().ccr1().bits() }
+                    unsafe { (*$TIMX::ptr()).ccr1.read().ccr().bits() }
                 }
 
                 fn get_max_duty(&self) -> u16 {
@@ -251,7 +251,7 @@ macro_rules! hal {
                 }
 
                 fn set_duty(&mut self, duty: u16) {
-                    unsafe { (*$TIMX::ptr()).ccr1.write(|w| w.ccr1().bits(duty)) }
+                    unsafe { (*$TIMX::ptr()).ccr1.write(|w| w.ccr().bits(duty)) }
                 }
             }
 
@@ -267,7 +267,7 @@ macro_rules! hal {
                 }
 
                 fn get_duty(&self) -> u16 {
-                    unsafe { (*$TIMX::ptr()).ccr2.read().ccr2().bits() }
+                    unsafe { (*$TIMX::ptr()).ccr2.read().ccr().bits() }
                 }
 
                 fn get_max_duty(&self) -> u16 {
@@ -275,7 +275,7 @@ macro_rules! hal {
                 }
 
                 fn set_duty(&mut self, duty: u16) {
-                    unsafe { (*$TIMX::ptr()).ccr2.write(|w| w.ccr2().bits(duty)) }
+                    unsafe { (*$TIMX::ptr()).ccr2.write(|w| w.ccr().bits(duty)) }
                 }
             }
 
@@ -291,7 +291,7 @@ macro_rules! hal {
                 }
 
                 fn get_duty(&self) -> u16 {
-                    unsafe { (*$TIMX::ptr()).ccr3.read().ccr3().bits() }
+                    unsafe { (*$TIMX::ptr()).ccr3.read().ccr().bits() }
                 }
 
                 fn get_max_duty(&self) -> u16 {
@@ -299,7 +299,7 @@ macro_rules! hal {
                 }
 
                 fn set_duty(&mut self, duty: u16) {
-                    unsafe { (*$TIMX::ptr()).ccr3.write(|w| w.ccr3().bits(duty)) }
+                    unsafe { (*$TIMX::ptr()).ccr3.write(|w| w.ccr().bits(duty)) }
                 }
             }
 
@@ -315,7 +315,7 @@ macro_rules! hal {
                 }
 
                 fn get_duty(&self) -> u16 {
-                    unsafe { (*$TIMX::ptr()).ccr4.read().ccr4().bits() }
+                    unsafe { (*$TIMX::ptr()).ccr4.read().ccr().bits() }
                 }
 
                 fn get_max_duty(&self) -> u16 {
@@ -323,7 +323,7 @@ macro_rules! hal {
                 }
 
                 fn set_duty(&mut self, duty: u16) {
-                    unsafe { (*$TIMX::ptr()).ccr4.write(|w| w.ccr4().bits(duty)) }
+                    unsafe { (*$TIMX::ptr()).ccr4.write(|w| w.ccr().bits(duty)) }
                 }
             }
         )+