lib.rs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //! # HAL for the STM32F1 family of microcontrollers
  2. //!
  3. //! This is an implementation of the [`embedded-hal`] traits for the STM32F1 family of
  4. //! microcontrollers.
  5. //!
  6. //! [`embedded-hal`]: https://crates.io/crates/embedded-hal
  7. //!
  8. //! # Usage
  9. //!
  10. //! - Trying out the examples
  11. //!
  12. //! ``` text
  13. //! $ git clone https://github.com/stm32-rs/stm32f1xx-hal
  14. //!
  15. //! # on another terminal
  16. //! $ openocd -f interface/$INTERFACE.cfg -f target/stm32f1x.cfg
  17. //!
  18. //! # flash and debug the "Hello, world" example
  19. //! # NOTE examples assume 64KB of Flash and 20KB of RAM; you can tweak layout in memory.x
  20. //! $ cd stm32f1xx-hal
  21. //! $ rustup target add thumbv7m-none-eabi
  22. //! $ cargo run --example hello
  23. //! ```
  24. //!
  25. //! - Building an application (binary crate)
  26. //!
  27. //! Follow the [cortex-m-quickstart] instructions and add this crate as a dependency
  28. //! and make sure you enable the "rt" Cargo feature of this crate.
  29. //!
  30. //! [cortex-m-quickstart]: https://docs.rs/cortex-m-quickstart/~0.2.3
  31. //!
  32. //! # Examples
  33. //!
  34. //! See the [examples] folder.
  35. //!
  36. //! [examples]: https://github.com/stm32-rs/stm32f1xx-hal/tree/master/examples
  37. #![no_std]
  38. use embedded_hal as hal;
  39. #[cfg(feature = "stm32f100")]
  40. pub use stm32f1::stm32f100 as pac;
  41. #[cfg(feature = "stm32f103")]
  42. pub use stm32f1::stm32f103 as pac;
  43. pub use crate::pac as device;
  44. pub use crate::pac as stm32;
  45. pub mod afio;
  46. pub mod bb;
  47. pub mod delay;
  48. pub mod dma;
  49. pub mod flash;
  50. pub mod gpio;
  51. pub mod i2c;
  52. pub mod prelude;
  53. #[cfg(not(feature = "stm32f100"))]
  54. pub mod pwm;
  55. pub mod qei;
  56. pub mod rcc;
  57. pub mod serial;
  58. pub mod spi;
  59. pub mod time;
  60. pub mod timer;
  61. pub mod rtc;
  62. pub mod backup_domain;