lib.rs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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] module.
  35. //!
  36. //! [examples]: examples/index.html
  37. #![no_std]
  38. extern crate cast;
  39. extern crate cortex_m;
  40. extern crate embedded_hal as hal;
  41. extern crate nb;
  42. extern crate void;
  43. pub extern crate stm32f1;
  44. #[cfg(feature = "stm32f103")]
  45. pub use stm32f1::stm32f103 as stm32;
  46. // Enable use of interrupt macro
  47. #[cfg(feature = "rt")]
  48. pub use stm32f1::interrupt;
  49. pub mod afio;
  50. pub mod bb;
  51. pub mod delay;
  52. pub mod dma;
  53. #[cfg(feature = "doc")]
  54. pub mod examples;
  55. pub mod flash;
  56. pub mod gpio;
  57. pub mod i2c;
  58. pub mod prelude;
  59. pub mod pwm;
  60. pub mod qei;
  61. pub mod rcc;
  62. pub mod serial;
  63. pub mod spi;
  64. pub mod time;
  65. pub mod timer;