updated docs
This commit is contained in:
parent
6d56a07fd4
commit
ba20217b63
@ -4,6 +4,10 @@
|
||||
[](https://crates.io/crates/si5351)
|
||||
[](https://travis-ci.org/ilya-epifanov/si5351)
|
||||
|
||||
## Documentation
|
||||
|
||||
On [docs.rs](https://docs.rs/si5351)
|
||||
|
||||
## License
|
||||
|
||||
Licensed under either of
|
||||
|
||||
16
src/lib.rs
16
src/lib.rs
@ -46,11 +46,24 @@ use si5351;
|
||||
use si5351::{Si5351, Si5351Device};
|
||||
|
||||
# fn main() {
|
||||
let mut clock = Si5351Device<'static, I2C>::new(i2c, false, 25_000_000);
|
||||
let mut clock = Si5351Device<I2C>::new(&mut i2c, false, 25_000_000);
|
||||
clock.init(si5351::CrystalLoad::_10)?;
|
||||
# }
|
||||
```
|
||||
|
||||
Or, if you have an [Adafruit module], you can use shortcut functions to initializate it:
|
||||
```no_run
|
||||
# extern crate stm32f103xx_hal as hal;
|
||||
# extern crate si5351;
|
||||
use si5351;
|
||||
use si5351::{Si5351, Si5351Device};
|
||||
|
||||
# fn main() {
|
||||
let mut clock = Si5351Device<I2C>::new_adafruit_module(&mut i2c);
|
||||
clock.init_adafruit_module()?;
|
||||
# }
|
||||
```
|
||||
|
||||
And set frequency on one of the outputs:
|
||||
|
||||
```no_run
|
||||
@ -61,6 +74,7 @@ clock.set_frequency(si5351::PLL::A, si5351::ClockOutput::Clk0, 14_175_000)?;
|
||||
|
||||
[Si5351]: https://www.silabs.com/documents/public/data-sheets/Si5351-B.pdf
|
||||
[`embedded-hal`]: https://github.com/japaric/embedded-hal
|
||||
[Adafruit module]: https://www.adafruit.com/product/2045
|
||||
*/
|
||||
//#![deny(missing_docs)]
|
||||
#![deny(warnings)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user