Skip to content

Commit

Permalink
boards: twi0 -> twi1
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Jun 20, 2024
1 parent 292e86a commit 66ace22
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions boards/acd52832/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ unsafe fn start() -> (
// Create shared mux for the I2C bus
let i2c_mux = static_init!(
capsules_core::virtualizers::virtual_i2c::MuxI2C<'static, nrf52832::i2c::TWI<'static>>,
capsules_core::virtualizers::virtual_i2c::MuxI2C::new(&base_peripherals.twi0, None,)
capsules_core::virtualizers::virtual_i2c::MuxI2C::new(&base_peripherals.twi1, None,)
);
kernel::deferred_call::DeferredCallClient::register(i2c_mux);
base_peripherals.twi0.configure(
base_peripherals.twi1.configure(
nrf52832::pinmux::Pinmux::new(21),
nrf52832::pinmux::Pinmux::new(20),
);
base_peripherals.twi0.set_master_client(i2c_mux);
base_peripherals.twi1.set_master_client(i2c_mux);

// Configure the MCP23017. Device address 0x20.
let mcp_pin0 = static_init!(
Expand Down
4 changes: 2 additions & 2 deletions boards/makepython-nrf52840/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ pub unsafe fn start() -> (
// SCREEN
//--------------------------------------------------------------------------

let i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi0, None)
let i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi1, None)
.finalize(components::i2c_mux_component_static!(nrf52840::i2c::TWI));
base_peripherals.twi0.configure(
base_peripherals.twi1.configure(
nrf52840::pinmux::Pinmux::new(I2C_SCL_PIN as u32),
nrf52840::pinmux::Pinmux::new(I2C_SDA_PIN as u32),
);
Expand Down
4 changes: 2 additions & 2 deletions boards/microbit_v2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@ unsafe fn start() -> (
// SENSORS
//--------------------------------------------------------------------------

base_peripherals.twi0.configure(
base_peripherals.twi1.configure(
nrf52833::pinmux::Pinmux::new(I2C_SCL_PIN as u32),
nrf52833::pinmux::Pinmux::new(I2C_SDA_PIN as u32),
);

let sensors_i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi0, None)
let sensors_i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi1, None)
.finalize(components::i2c_mux_component_static!(
nrf52833::i2c::TWI<'static>
));
Expand Down
4 changes: 2 additions & 2 deletions boards/nano33ble/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ pub unsafe fn start() -> (
// SENSORS
//--------------------------------------------------------------------------

let sensors_i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi0, None)
let sensors_i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi1, None)
.finalize(components::i2c_mux_component_static!(nrf52840::i2c::TWI));
base_peripherals.twi0.configure(
base_peripherals.twi1.configure(
nrf52840::pinmux::Pinmux::new(I2C_SCL_PIN as u32),
nrf52840::pinmux::Pinmux::new(I2C_SDA_PIN as u32),
);
Expand Down
4 changes: 2 additions & 2 deletions boards/nano33ble_rev2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ pub unsafe fn start() -> (
// SENSORS
//--------------------------------------------------------------------------

let sensors_i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi0, None)
let sensors_i2c_bus = components::i2c::I2CMuxComponent::new(&base_peripherals.twi1, None)
.finalize(components::i2c_mux_component_static!(nrf52840::i2c::TWI));
base_peripherals.twi0.configure(
base_peripherals.twi1.configure(
nrf52840::pinmux::Pinmux::new(I2C_SCL_PIN as u32),
nrf52840::pinmux::Pinmux::new(I2C_SDA_PIN as u32),
);
Expand Down
6 changes: 3 additions & 3 deletions boards/tutorials/nrf52840dk-thread-tutorial/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ pub unsafe fn main() {
const SCREEN_I2C_SDA_PIN: Pin = Pin::P1_10;
const SCREEN_I2C_SCL_PIN: Pin = Pin::P1_11;

let i2c_bus = components::i2c::I2CMuxComponent::new(&nrf52840_peripherals.nrf52.twi0, None)
let i2c_bus = components::i2c::I2CMuxComponent::new(&nrf52840_peripherals.nrf52.twi1, None)
.finalize(components::i2c_mux_component_static!(nrf52840::i2c::TWI));
nrf52840_peripherals.nrf52.twi0.configure(
nrf52840_peripherals.nrf52.twi1.configure(
nrf52840::pinmux::Pinmux::new(SCREEN_I2C_SCL_PIN as u32),
nrf52840::pinmux::Pinmux::new(SCREEN_I2C_SDA_PIN as u32),
);
nrf52840_peripherals
.nrf52
.twi0
.twi1
.set_speed(nrf52840::i2c::Speed::K400);

// I2C address is b011110X, and on this board D/C̅ is GND.
Expand Down

0 comments on commit 66ace22

Please sign in to comment.