|
1 | 1 | /* Partition layout is owned by the mcuboot fork |
2 | 2 | * (dts/adafruit/adafruit_clue_nrf52840.dtsi) and applied to this image by |
3 | 3 | * sysbuild. This overlay only adds board/app config. */ |
| 4 | +/* No Zephyr console by default, so TX/RX are free for busio.UART. A CONSOLE=1 |
| 5 | + * build puts the console back on UART0 (console.overlay). */ |
4 | 6 | / { |
5 | 7 | chosen { |
6 | 8 | /delete-property/ zephyr,console; |
|
15 | 17 | /delete-node/ board_cdc_acm_uart; |
16 | 18 | }; |
17 | 19 |
|
18 | | -// UART0, I2C1 and SPI3 are enabled with all pins disconnected and marked |
19 | | -// zephyr,deferred-init so nothing is claimed at boot: the iobroker |
| 20 | +// UART0, I2C0, I2C1 and SPI3 are enabled with all pins disconnected and |
| 21 | +// marked zephyr,deferred-init so nothing is claimed at boot: the iobroker |
20 | 22 | // initializes and routes a device to arbitrary pins when a busio object is |
21 | | -// constructed, and de-initializes it on release. (I2C0 is the fixed sensor |
22 | | -// bus, SPI2 the fixed display bus, and QSPI the fixed external flash.) |
| 23 | +// constructed, and de-initializes it on release. (SPI2 is the fixed display |
| 24 | +// bus and QSPI the fixed external flash. The onboard sensors are on SCL/SDA |
| 25 | +// but have no devicetree nodes, so I2C0 does not need to be fixed.) |
| 26 | +// |
| 27 | +// See "nRF serial instances" in internal-modules/iobroker/README.md for how |
| 28 | +// the instances are shared and allocated. |
23 | 29 | // |
24 | 30 | // I2C1 and SPI1 are the same peripheral instance (0x40004000), so only one |
25 | 31 | // mode can be enabled: I2C is the more useful dynamic bus on the CLUE. |
|
41 | 47 | }; |
42 | 48 | }; |
43 | 49 |
|
| 50 | + i2c0_dyn_default: i2c0_dyn_default { |
| 51 | + group1 { |
| 52 | + psels = <NRF_PSEL_DISCONNECTED(TWIM_SDA)>, |
| 53 | + <NRF_PSEL_DISCONNECTED(TWIM_SCL)>; |
| 54 | + }; |
| 55 | + }; |
| 56 | + |
| 57 | + i2c0_dyn_sleep: i2c0_dyn_sleep { |
| 58 | + group1 { |
| 59 | + psels = <NRF_PSEL_DISCONNECTED(TWIM_SDA)>, |
| 60 | + <NRF_PSEL_DISCONNECTED(TWIM_SCL)>; |
| 61 | + }; |
| 62 | + }; |
| 63 | + |
44 | 64 | i2c1_dyn_default: i2c1_dyn_default { |
45 | 65 | group1 { |
46 | 66 | psels = <NRF_PSEL_DISCONNECTED(TWIM_SDA)>, |
|
144 | 164 | }; |
145 | 165 | }; |
146 | 166 |
|
| 167 | +// The upstream board uses the legacy UART driver for UART0, which can't be |
| 168 | +// de-initialized, so iobroker could not route it again once it was released. |
| 169 | +// Instead, use the UARTE driver, which can be deinited. |
147 | 170 | &uart0 { |
| 171 | + compatible = "nordic,nrf-uarte"; |
148 | 172 | status = "okay"; |
149 | 173 | zephyr,deferred-init; |
150 | 174 | current-speed = <115200>; |
|
153 | 177 | pinctrl-names = "default", "sleep"; |
154 | 178 | }; |
155 | 179 |
|
| 180 | +// The upstream board fixes I2C0 to SCL/SDA with the legacy TWI driver. Use |
| 181 | +// TWIM like I2C1 so iobroker can route it. |
| 182 | +&i2c0 { |
| 183 | + compatible = "nordic,nrf-twim"; |
| 184 | + status = "okay"; |
| 185 | + zephyr,deferred-init; |
| 186 | + pinctrl-0 = <&i2c0_dyn_default>; |
| 187 | + pinctrl-1 = <&i2c0_dyn_sleep>; |
| 188 | + pinctrl-names = "default", "sleep"; |
| 189 | +}; |
| 190 | + |
156 | 191 | &i2c1 { |
157 | 192 | status = "okay"; |
158 | 193 | zephyr,deferred-init; |
|
0 commit comments