1# Copyright (c) 2019 Nordic Semiconductor ASA 2# SPDX-License-Identifier: Apache-2.0 3 4description: | 5 Nordic nRF family TWI (TWI master). 6 7 This binding can be used for nodes which can represent TWI 8 peripherals. When a single SoC peripheral ID corresponds to multiple 9 I2C peripherals (like TWI or TWIM), the corresponding devicetree 10 nodes must be set up to select TWI before use. 11 12 To select TWI, set the node's "compatible" to "nordic,nrf-twi" and 13 its "status" to "okay", e.g. using an overlay file like this: 14 15 /* This is for TWI0 -- change to "i2c1" for TWI1. */ 16 &i2c0 { 17 compatible = "nordic,nrf-twi"; 18 status = "okay"; 19 /* other property settings can go here */ 20 }; 21 22 You can use either of these options to check TWI availability on 23 your SoC: 24 25 1. Check the peripheral Instantiation table in the Memory 26 section of your SoC's Product Specification document. 27 A "TWI0" instance in the table means "i2c0" in the devicetree 28 can be used with this binding, and similarly for "TWI1". 29 30 2. Open your SoC's .dtsi file and look for a node definition that 31 documents TWI support, like this: 32 33 i2c0: i2c@40003000 { 34 /* 35 * This i2c node can be TWI, [...]. 36 */ 37 ... 38 }; 39 40 If your SoC only has TWIM and TWIS I2C peripherals, you cannot use 41 this binding. See the "nordic,nrf-twim" binding instead. 42 43compatible: "nordic,nrf-twi" 44 45include: nordic,nrf-twi-common.yaml 46