mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-02 11:03:18 +02:00
Initialise I2C bus.
This commit is contained in:
parent
026cdca2b7
commit
fb2a81186b
@ -18,11 +18,13 @@
|
|||||||
extern crate panic_halt as _;
|
extern crate panic_halt as _;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use microbit::Board;
|
use microbit::{hal::twim::Twim, pac::twim0::frequency::FREQUENCY_A, Board};
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
let board = Board::take().unwrap();
|
let board = Board::take().unwrap();
|
||||||
|
|
||||||
|
let i2c = Twim::new(board.TWIM0, board.i2c_internal.into(), FREQUENCY_A::K100);
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user