|
| 1 | +// Framework Daisy keyboard, DVT1. |
| 2 | +// |
| 3 | +// The Zephyr board itself lives in the framework-daisy-zephyr module (a west |
| 4 | +// project, see zephyr-config/west.yml), so everything here is a delta on top of |
| 5 | +// it: what CircuitPython needs and the product firmware does not. |
| 6 | + |
| 7 | +// USB CDC console and data plus the HID device. Daisy's USBHS is already |
| 8 | +// enabled and labeled zephyr_udc0 by the board. |
| 9 | +#include "../../../app.overlay" |
| 10 | + |
| 11 | +// Daisy's RRAM is fully spoken for by daisy_partitions.dtsi -- 96K mcuboot, |
| 12 | +// 1828K image-0, 16K storage, exactly the 1940K there is -- so a CIRCUITPY |
| 13 | +// drive has to come out of the application slot. mcuboot's offset and the |
| 14 | +// storage partition (Bluetooth bond keys) stay exactly where the bootloader |
| 15 | +// already on the hardware expects them; only image-0 shrinks. |
| 16 | +// |
| 17 | +// If a build ever outgrows 1216K the linker says so, and the fix is to move |
| 18 | +// this boundary and the circuitpy offset below by the same amount. |
| 19 | +// |
| 20 | +// Reinstalling firmware over MCUboot's serial recovery erases image-0 as *it* |
| 21 | +// understands it, the full 1828K, so a recovery flash takes CIRCUITPY with it. |
| 22 | +&slot0_partition { |
| 23 | + reg = <0x18000 DT_SIZE_K(1216)>; |
| 24 | +}; |
| 25 | + |
| 26 | +&cpuapp_rram { |
| 27 | + partitions { |
| 28 | + circuitpy_partition: partition@148000 { |
| 29 | + label = "circuitpy"; |
| 30 | + reg = <0x148000 DT_SIZE_K(612)>; |
| 31 | + }; |
| 32 | + }; |
| 33 | +}; |
| 34 | + |
| 35 | +// Bus names. Every enabled I2C controller reaches Python as board.I2C2x |
| 36 | +// whatever we do here; these labels are what make the names say which bus is |
| 37 | +// which, and zephyr_i2c is the label that additionally designates one of the |
| 38 | +// three as plain board.I2C. |
| 39 | +// |
| 40 | +// The header is the bus a user can physically reach, so it gets board.I2C. |
| 41 | +zephyr_i2c: &i2c23 { |
| 42 | + status = "okay"; |
| 43 | +}; |
| 44 | + |
| 45 | +// Touchpad, behind the tp_power rail the board brings up at boot. |
| 46 | +tp_i2c: &i2c22 { |
| 47 | + status = "okay"; |
| 48 | +}; |
| 49 | + |
| 50 | +// The nPM1300. Exposed for reading charge state; writing to it controls the |
| 51 | +// rails the SoC itself runs on. |
| 52 | +npmc_i2c: &i2c21 { |
| 53 | + status = "okay"; |
| 54 | +}; |
| 55 | + |
| 56 | +// This port has no pwmio, and an enabled PWM instance takes its pins away from |
| 57 | +// digitalio through pinctrl. Give the four white pairing LEDs, the status RGB |
| 58 | +// and the backlight back to CircuitPython as plain GPIO -- board.WHITE_LED_1 |
| 59 | +// through _4, board.RED_LED / GREEN_LED / BLUE_LED, and board.BACKLIGHT. |
| 60 | +&pairing_leds { |
| 61 | + status = "disabled"; |
| 62 | +}; |
| 63 | + |
| 64 | +&rgb_pwmleds { |
| 65 | + status = "disabled"; |
| 66 | +}; |
| 67 | + |
| 68 | +&backlight_pwms { |
| 69 | + status = "disabled"; |
| 70 | +}; |
| 71 | + |
| 72 | +&pwm20 { |
| 73 | + status = "disabled"; |
| 74 | +}; |
| 75 | + |
| 76 | +&pwm21 { |
| 77 | + status = "disabled"; |
| 78 | +}; |
| 79 | + |
| 80 | +&pwm22 { |
| 81 | + status = "disabled"; |
| 82 | +}; |
| 83 | + |
| 84 | +/ { |
| 85 | + zephyr,user { |
| 86 | + // Pins no driver owns still deserve a name in `board`. The key |
| 87 | + // matrix is not part of the Zephyr board at all -- ZMK describes |
| 88 | + // it in its own shield -- so it is named here, giving |
| 89 | + // board.KSI0..KSI7 and board.KSO0..KSO17. Taken from |
| 90 | + // framework-daisy-zmk's daisy_kb_dvt1_nrf54lm20a_cpuapp_zmk.dts. |
| 91 | + // |
| 92 | + // The matrix is col2row and has no diodes, so three keys at the |
| 93 | + // corners of a rectangle read as a fourth. KSO1 and KSO2 are on |
| 94 | + // pins that power up as NFC; the board's UICR already releases |
| 95 | + // them. |
| 96 | + // |
| 97 | + // Only the controller and pin are read here. How a pin is driven |
| 98 | + // is up to the Python code, so the flags are written as the |
| 99 | + // board's defaults rather than as the matrix scan needs them. |
| 100 | + ksi-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, |
| 101 | + <&gpio0 1 GPIO_ACTIVE_HIGH>, |
| 102 | + <&gpio0 2 GPIO_ACTIVE_HIGH>, |
| 103 | + <&gpio0 3 GPIO_ACTIVE_HIGH>, |
| 104 | + <&gpio0 4 GPIO_ACTIVE_HIGH>, |
| 105 | + <&gpio0 5 GPIO_ACTIVE_HIGH>, |
| 106 | + <&gpio0 6 GPIO_ACTIVE_HIGH>, |
| 107 | + <&gpio0 7 GPIO_ACTIVE_HIGH>; |
| 108 | + |
| 109 | + kso-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, |
| 110 | + <&gpio1 1 GPIO_ACTIVE_HIGH>, |
| 111 | + <&gpio1 18 GPIO_ACTIVE_HIGH>, |
| 112 | + <&gpio1 19 GPIO_ACTIVE_HIGH>, |
| 113 | + <&gpio1 4 GPIO_ACTIVE_HIGH>, |
| 114 | + <&gpio1 5 GPIO_ACTIVE_HIGH>, |
| 115 | + <&gpio1 6 GPIO_ACTIVE_HIGH>, |
| 116 | + <&gpio1 7 GPIO_ACTIVE_HIGH>, |
| 117 | + <&gpio1 8 GPIO_ACTIVE_HIGH>, |
| 118 | + <&gpio1 9 GPIO_ACTIVE_HIGH>, |
| 119 | + <&gpio1 10 GPIO_ACTIVE_HIGH>, |
| 120 | + <&gpio1 11 GPIO_ACTIVE_HIGH>, |
| 121 | + <&gpio1 12 GPIO_ACTIVE_HIGH>, |
| 122 | + <&gpio1 13 GPIO_ACTIVE_HIGH>, |
| 123 | + <&gpio1 14 GPIO_ACTIVE_HIGH>, |
| 124 | + <&gpio1 15 GPIO_ACTIVE_HIGH>, |
| 125 | + <&gpio1 16 GPIO_ACTIVE_HIGH>, |
| 126 | + <&gpio1 17 GPIO_ACTIVE_HIGH>; |
| 127 | + |
| 128 | + // Keyboard backlight, freed from pwm22 above. |
| 129 | + backlight-gpios = <&gpio3 11 GPIO_ACTIVE_HIGH>; |
| 130 | + }; |
| 131 | +}; |
0 commit comments