Browse Source

Improve documentation for the LED examples

TheZoq2 5 years ago
parent
commit
6bbfd93c27
3 changed files with 21 additions and 1 deletions
  1. 5 0
      examples/blinky.rs
  2. 7 1
      examples/blinky_rtc.rs
  3. 9 0
      examples/led.rs

+ 5 - 0
examples/blinky.rs

@@ -1,4 +1,9 @@
 //! Blinks an LED
+//!
+//! This assumes that a LED is connected to pc13 as is the case on the blue pill board.
+//!
+//! Note: Without additional hardware, PC13 should not be used to drive an LED, see page 5.1.2 of
+//! the reference manaual for an explanation. This is not an issue on the blue pill.
 
 #![deny(unsafe_code)]
 #![deny(warnings)]

+ 7 - 1
examples/blinky_rtc.rs

@@ -1,4 +1,10 @@
-//! Blinks an LED using the real time clock to time the blinks
+//! Blinks an LED
+//!
+//! This assumes that a LED is connected to pc13 as is the case on the blue pill board.
+//!
+//! Note: Without additional hardware, PC13 should not be used to drive a LED, see
+//! section 5.1.2 of the reference manaual for an explanation.
+//! This is not an issue on the blue pill.
 
 #![deny(unsafe_code)]
 #![deny(warnings)]

+ 9 - 0
examples/led.rs

@@ -1,4 +1,13 @@
 //! Turns the user LED on
+//!
+//! If compiled for the stm32f103, this assumes that an active low LED is connected to pc13 as
+//! is the case on the blue pill board.
+//!
+//! If compiled for the stm32f100, this assumes that an active high LED is connected to pc9
+//!
+//! Note: Without additional hardware, PC13 should not be used to drive a LED, see
+//! section 5.1.2 of the reference manaual for an explanation.
+//! This is not an issue on the blue pill.
 
 #![deny(unsafe_code)]
 #![deny(warnings)]