1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-02 02:56:26 +02:00

Initialise I2C bus.

This commit is contained in:
Andrew Walbran 2023-02-14 23:28:34 +00:00
parent 026cdca2b7
commit fb2a81186b

View File

@ -18,11 +18,13 @@
extern crate panic_halt as _;
use cortex_m_rt::entry;
use microbit::Board;
use microbit::{hal::twim::Twim, pac::twim0::frequency::FREQUENCY_A, Board};
#[entry]
fn main() -> ! {
let board = Board::take().unwrap();
let i2c = Twim::new(board.TWIM0, board.i2c_internal.into(), FREQUENCY_A::K100);
loop {}
}